/* ==========================================================================
   STUDIO FOTOGRAFICO TAGLIATI — style.css
   Concept: "tagliare" = scegliere cosa entra nel fotogramma e cosa resta
   fuori. Il taglio diagonale netto è l'elemento firma della pagina;
   le etichette in monospace richiamano le annotazioni su un foglio
   contatti (numero fotogramma, categoria).
   ========================================================================== */

/* ---- Design tokens ---- */
:root {
  /* Colore */
  --ink-950: #100f0d;      /* sfondo principale */
  --ink-900: #17150f;
  --ink-850: #1c1a16;      /* pannelli leggermente sollevati */
  --ink-800: #211f1b;      /* card */
  --line: #33302a;         /* hairline su fondo scuro */
  --ivory: #f2ecdf;        /* testo primario */
  --stone: #948c7c;        /* testo secondario */
  --stone-dim: #6b6558;    /* testo terziario / meta */
  --brass: #c6a15b;        /* accento — il "taglio" */
  --brass-bright: #dab876;
  --brass-dim: #8a6f3e;

  /* Tipografia */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Work Sans", -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;

  /* Layout */
  --container: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 2px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Reset essenziale ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink-950);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

/* ---- Grana fotografica ambientale ---- */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  mix-blend-mode: overlay;
}

/* ---- Utility ---- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--brass);
  display: inline-block;
}

.section {
  padding: clamp(4rem, 9vw, 7.5rem) 0;
  position: relative;
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  margin-top: 0.9rem;
  color: var(--ivory);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.9rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  border-radius: var(--radius);
  transition: all 0.35s var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--brass);
  color: var(--ink-950);
}
.btn-primary:hover { background: var(--brass-bright); transform: translateY(-1px); }
.btn-ghost {
  border-color: var(--line);
  color: var(--ivory);
}
.btn-ghost:hover { border-color: var(--brass); color: var(--brass); }

/* elemento firma: piccolo taglio diagonale usato come separatore/bullet */
.cut-mark {
  display: inline-block;
  width: 22px;
  height: 2px;
  background: var(--brass);
  transform: rotate(-18deg);
}

/* ---- Reveal on scroll ---- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem var(--gutter);
  background: linear-gradient(to bottom, rgba(16,15,13,0.85), transparent);
  transition: background 0.4s var(--ease), padding 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(16,15,13,0.92);
  backdrop-filter: blur(8px);
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-color: var(--line);
}
.logo {
  display: flex;
  align-items: center;
}
.logo-img {
  height: 48px;
  width: auto;
  display: block;
}
.main-nav ul {
  display: flex;
  gap: 2.2rem;
}
.main-nav a {
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  color: var(--stone);
  transition: color 0.25s var(--ease);
  position: relative;
}
.main-nav a:hover { color: var(--ivory); }
.main-nav a.cta {
  color: var(--brass);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.4rem;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  width: 24px;
  height: 1.5px;
  background: var(--ivory);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ==========================================================================
   HERO — il taglio diagonale
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: stretch;
}
.hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(6rem, 10vw, 9rem) var(--gutter) 4rem;
  clip-path: polygon(0 0, 100% 0, 88% 100%, 0% 100%);
  background: var(--ink-950);
  position: relative;
  z-index: 2;
}
.hero-text .eyebrow { margin-bottom: 1.6rem; }
.hero-text h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 5.2vw, 4.2rem);
  line-height: 1.05;
  max-width: 12ch;
  color: var(--ivory);
}
.hero-text h1 em {
  font-style: italic;
  color: var(--brass);
}
.hero-text .sub {
  margin-top: 1.6rem;
  max-width: 34ch;
  color: var(--stone);
  font-size: 1.05rem;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2.6rem;
  flex-wrap: wrap;
}
.hero-image {
  position: relative;
  overflow: hidden;
}
.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.hero-cut-line {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  width: 100%;
  height: 100%;
}
.hero-cut-line path {
  fill: none;
  stroke: var(--brass);
  stroke-width: 2;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: draw-cut 1.6s var(--ease) 0.4s forwards;
}
@keyframes draw-cut {
  to { stroke-dashoffset: 0; }
}
.scroll-cue {
  position: absolute;
  bottom: 2.2rem;
  left: var(--gutter);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--stone);
  text-transform: uppercase;
}
.scroll-cue .line {
  width: 1px;
  height: 26px;
  background: var(--stone-dim);
  position: relative;
  overflow: hidden;
}
.scroll-cue .line::after {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--brass);
  animation: scroll-drip 1.8s ease-in-out infinite;
}
@keyframes scroll-drip {
  0% { top: -100%; }
  60% { top: 100%; }
  100% { top: 100%; }
}

/* ==========================================================================
   FILOSOFIA
   ========================================================================== */
.philosophy {
  background: var(--ink-850);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.philosophy .container {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.philosophy-media {
  position: relative;
  aspect-ratio: 4/5;
  clip-path: polygon(0 0, 100% 8%, 100% 100%, 0% 92%);
}
.philosophy-media img { width: 100%; height: 100%; object-fit: cover; }
.philosophy-body blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1.35;
  color: var(--ivory);
  margin: 1.6rem 0 1.8rem;
  border-left: 2px solid var(--brass);
  padding-left: 1.4rem;
}
.philosophy-body p {
  color: var(--stone);
  max-width: 52ch;
  margin-bottom: 1rem;
}
.philosophy-body h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-top: 0.8rem;
}

/* ==========================================================================
   SERVIZI
   ========================================================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.service-card {
  background: var(--ink-950);
  padding: 2.4rem 1.8rem;
  transition: background 0.35s var(--ease);
  position: relative;
}
.service-card:hover { background: var(--ink-850); }
.service-mono {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--brass);
  letter-spacing: 0.1em;
}
.service-card h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 1.1rem;
  margin-bottom: 0.7rem;
}
.service-card p {
  color: var(--stone);
  font-size: 0.92rem;
}
.service-card .cut-mark { margin-top: 1.4rem; }

/* ==========================================================================
   PORTFOLIO
   ========================================================================== */
.portfolio-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.portfolio-head .section-head { margin-bottom: 0; }
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
.portfolio-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/5;
  background: var(--ink-800);
}
.portfolio-item:nth-child(2), .portfolio-item:nth-child(5) { margin-top: 2.5rem; }
.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.7s var(--ease);
}
.portfolio-item:hover img { transform: scale(1.06); }
.portfolio-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.2rem;
  background: linear-gradient(to top, rgba(16,15,13,0.92), transparent);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  transform: translateY(8px);
  opacity: 0.92;
}
.portfolio-caption .frame-no {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--brass);
  letter-spacing: 0.08em;
}
.portfolio-caption .cat {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--stone);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.portfolio-item::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--brass);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}
.portfolio-item:hover::after { transform: scaleX(1); }

/* ==========================================================================
   CONTATTI
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2.5rem, 6vw, 5rem);
}
.field {
  margin-bottom: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.field label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone);
}
.field input, .field select, .field textarea {
  background: var(--ink-850);
  border: 1px solid var(--line);
  color: var(--ivory);
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  transition: border-color 0.25s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brass);
  outline: none;
}
.field textarea { resize: vertical; min-height: 110px; }
.form-note {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--stone-dim);
  min-height: 1.2em;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
}
.info-block .eyebrow { margin-bottom: 0.7rem; }
.info-block p, .info-block a { color: var(--ivory); font-size: 1.02rem; }
.info-block .muted { color: var(--stone); font-size: 0.92rem; margin-top: 0.2rem; }
.social-links {
  display: flex;
  gap: 1.2rem;
  margin-top: 0.4rem;
}
.social-links a {
  color: var(--stone);
  font-size: 0.88rem;
  border-bottom: 1px solid transparent;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.social-links a:hover { color: var(--brass); border-color: var(--brass); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  padding: 2.4rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  border-top: 1px solid var(--line);
}
.site-footer .logo-img { height: 36px; }
.footer-links { display: flex; gap: 1.6rem; }
.footer-links a { font-size: 0.85rem; color: var(--stone); }
.footer-links a:hover { color: var(--brass); }
.back-to-top {
  color: var(--stone);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.back-to-top:hover { color: var(--brass); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 980px) {
  .logo-img { height: 38px; }

  .main-nav { display: none; }
  .nav-toggle { display: flex; }

  .hero { grid-template-columns: 1fr; }
  .hero-text {
    clip-path: none;
    padding-top: 7.5rem;
    order: 2;
  }
  .hero-image { min-height: 55vh; order: 1; }
  .hero-cut-line { display: none; }

  .philosophy .container { grid-template-columns: 1fr; }
  .philosophy-media { order: -1; clip-path: polygon(0 0, 100% 0, 100% 94%, 0 100%); }

  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
  .portfolio-item:nth-child(2), .portfolio-item:nth-child(5) { margin-top: 0; }

  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .services-grid { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .hero-text h1 { max-width: none; }

  .main-nav.mobile-open {
    display: block;
    position: fixed;
    inset: 0 0 0 30%;
    background: var(--ink-950);
    border-left: 1px solid var(--line);
    padding: 6rem 2rem 2rem;
    z-index: 90;
  }
  .main-nav.mobile-open ul { flex-direction: column; gap: 1.6rem; }
  .main-nav.mobile-open a { font-size: 1.05rem; }
}
