/* ============ Luca Cazzaniga — Fotografia Immobiliare in Numeri ============ */

:root {
  --bg: #0b0a08;
  --bg-soft: #12100d;
  --ink: #f3ecdd;
  --ink-dim: #9d937e;
  --gold: #c9a861;
  --gold-soft: #8a743f;
  --line: rgba(243, 236, 221, 0.12);
  --serif: "Fraunces", Georgia, serif;
  --grotesk: "Space Grotesk", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--grotesk);
  font-weight: 300;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--gold); color: var(--bg); }

em { font-style: italic; color: var(--gold); }
strong { font-weight: 500; color: var(--ink); }

/* grain overlay */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none;
  z-index: 50;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  animation: grain 9s steps(10) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); }
  40% { transform: translate(2%,-3%); } 60% { transform: translate(-2%,-2%); }
  80% { transform: translate(3%,3%); }
}

/* topbar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.4rem 4vw;
  z-index: 40;
  mix-blend-mode: difference;
}
.topbar__name { font-family: var(--serif); font-weight: 560; font-size: 1.05rem; letter-spacing: 0.02em; }
.topbar__tag  { font-size: 0.72rem; letter-spacing: 0.32em; text-transform: uppercase; color: var(--ink-dim); }

/* ============ shared section styles ============ */
.sec { position: relative; padding: 22vh 4vw; }
.sec__inner { max-width: 1080px; margin: 0 auto; }
.sec__inner--center { text-align: center; }

.sec__eyebrow {
  font-size: 0.74rem; letter-spacing: 0.38em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 2.2rem;
}
.sec__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.2rem, 5.4vw, 4.4rem);
  line-height: 1.08; letter-spacing: -0.01em;
  margin-bottom: 3.5rem;
}
.sec__title--center { text-align: center; }
.sec__note {
  max-width: 46ch; color: var(--ink-dim);
  font-size: 1.02rem; margin-top: 3.2rem;
}
.sec__note--center { margin-left: auto; margin-right: auto; text-align: center; }

/* line reveal (JS slides the inner span up) */
.reveal-line { display: block; overflow: hidden; }
.reveal-line > span { display: inline-block; will-change: transform; }

/* ============ 1 · HERO ============ */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 0 4vw;
}
.hero__layer { position: absolute; inset: -12%; pointer-events: none; }
.hero__layer--lines svg { width: 100%; height: 100%; }
.blueprint rect, .blueprint line, .blueprint circle {
  fill: none; stroke: var(--ink); stroke-width: 1; opacity: 0.07;
}
.hero__layer--frame::before {
  content: ""; position: absolute;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(74vw, 980px); height: min(72vh, 680px);
  border: 1px solid var(--line);
}
.hero__content { position: relative; z-index: 2; }
.hero__eyebrow {
  font-size: 0.74rem; letter-spacing: 0.38em; text-transform: uppercase;
  color: var(--ink-dim); margin-bottom: 2.6rem;
}
.hero__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.8rem, 8vw, 6.8rem);
  line-height: 1.04; letter-spacing: -0.015em;
}
.hero__counter { margin: 4.2rem 0 2.8rem; }
.hero__number {
  display: block;
  font-family: var(--grotesk); font-weight: 700;
  font-size: clamp(3.4rem, 11vw, 9.5rem);
  line-height: 1; letter-spacing: -0.03em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.hero__label {
  display: block; margin-top: 1rem;
  font-size: 0.78rem; letter-spacing: 0.42em; text-transform: uppercase;
  color: var(--ink-dim);
}
.hero__sub { color: var(--ink-dim); font-size: 1.05rem; }
.hero__scrollhint {
  position: absolute; bottom: 3.2vh; left: 50%; transform: translateX(-50%);
  font-size: 0.66rem; letter-spacing: 0.4em; text-transform: uppercase;
  color: var(--ink-dim);
  display: flex; flex-direction: column; align-items: center; gap: 0.8rem;
}
.hero__scrollhint span {
  width: 1px; height: 46px;
  background: linear-gradient(to bottom, transparent, var(--gold));
  animation: scrollhint 2.2s ease-in-out infinite;
}
@keyframes scrollhint { 0% { transform: scaleY(0); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: top; }
  56% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ============ 2 · LAVORAZIONI ============ */
.sec--lavorazioni { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 3rem; margin-top: 1rem;
}
.stat { border-top: 1px solid var(--line); padding-top: 2rem; }
.stat__num {
  display: block;
  font-weight: 700; font-size: clamp(2.4rem, 5.6vw, 4.6rem);
  line-height: 1.05; letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat__num--small { color: var(--gold); }
.stat__label { display: block; margin-top: 1rem; color: var(--ink-dim); font-size: 0.92rem; max-width: 24ch; }

/* ============ 3 · HDR ============ */
.sec--hdr { padding: 0; }
.hdr-stage {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  padding: 18vh 4vw;
}
.hdr-frames { position: relative; width: min(560px, 80vw); height: min(340px, 48vw); margin-bottom: 4.5rem; }
.hdr-frame {
  position: absolute; inset: 0;
  border-radius: 6px;
  display: flex; align-items: flex-end; justify-content: flex-start;
  padding: 1rem 1.2rem;
  font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase;
  border: 1px solid var(--line);
  will-change: transform, opacity;
}
.hdr-copy { text-align: center; position: relative; z-index: 2; }
.hdr-copy__num {
  display: block;
  font-weight: 700; font-size: clamp(3.2rem, 10vw, 8rem);
  line-height: 1; color: var(--gold); letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.6rem;
}

/* ============ 4 · OTTICA ============ */
.sec--ottica { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lensbar { margin: 1rem 0 4.5rem; }
.lensbar__track {
  width: 100%; height: 64px;
  border: 1px solid var(--line); border-radius: 3px;
  overflow: hidden; position: relative;
}
.lensbar__fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold-soft), var(--gold));
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 1.2rem;
  will-change: width;
}
.lensbar__pct { font-weight: 700; font-size: 1.4rem; color: var(--bg); }
.lensbar__caption { margin-top: 1.4rem; color: var(--ink-dim); }
.lensbar__count { font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.lenslist { list-style: none; counter-reset: lens; }
.lenslist__item {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 1.3rem 0;
  border-top: 1px solid var(--line);
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  counter-increment: lens;
}
.lenslist__item::before {
  content: "0" counter(lens);
  font-size: 0.72rem; color: var(--gold); margin-right: 1.6rem;
  letter-spacing: 0.2em;
}
.lenslist__item > span:first-of-type { flex: 1; }
.lenslist__n { font-variant-numeric: tabular-nums; color: var(--ink-dim); font-weight: 500; }

/* ============ 5 · 16MM / F8 ============ */
.sec--f8 { padding: 0; }
.f8-stage {
  min-height: 100vh;
  display: grid; grid-template-columns: 1fr 1fr;
  align-items: center; gap: 4vw;
  max-width: 1180px; margin: 0 auto;
  padding: 16vh 4vw;
}
.f8-aperture { position: relative; width: min(420px, 84vw); margin: 0 auto; }
.f8-aperture svg { width: 100%; height: auto; display: block; }
.f8-ring { fill: none; stroke: var(--line); stroke-width: 1.5; }
.f8-blades polygon { fill: #060504; stroke: rgba(201,168,97,0.35); stroke-width: 1; }
.f8-iris { fill: none; stroke: var(--gold); stroke-width: 2; }
.f8-fnum {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-weight: 700; font-size: clamp(1.6rem, 4vw, 2.6rem);
  color: var(--gold); letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.f8-copy__focal {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(4.5rem, 12vw, 10rem); line-height: 1;
  letter-spacing: -0.02em;
}
.f8-copy__focal small { font-size: 0.32em; color: var(--gold); font-family: var(--grotesk); font-weight: 300; }
.f8-copy__focaltxt { color: var(--ink-dim); margin: 1.6rem 0 3.4rem; max-width: 40ch; }
.f8-copy__f {
  font-family: var(--serif); font-weight: 400; font-style: italic;
  font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1; color: var(--gold);
}
.f8-copy__ftxt { color: var(--ink-dim); margin-top: 1.6rem; max-width: 40ch; }

/* ============ 6 · TEMPI & ISO ============ */
.sec--tempi { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.speclist { list-style: none; max-width: 880px; }
.speclist__item {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(1.3rem, 3.2vw, 2.2rem); line-height: 1.3;
  padding: 1.6rem 0; border-bottom: 1px solid var(--line);
}
.speclist__item strong { font-family: var(--grotesk); font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }

/* ============ 7 · ESPERIENZA ============ */
.stats-row--exp { grid-template-columns: repeat(2, 1fr); row-gap: 4rem; }
.sec--exp .sec__note { margin-top: 4.2rem; }

/* ============ 8 · OUTRO ============ */
.sec--outro { min-height: 88vh; display: flex; align-items: center; justify-content: center; }
.outro__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 5.8rem); line-height: 1.06;
  margin-bottom: 2.6rem;
}
.outro__sub { color: var(--ink-dim); margin-bottom: 5rem; }
.outro__sign {
  font-family: var(--serif); font-style: italic; font-weight: 340;
  font-size: clamp(1.8rem, 4vw, 2.8rem); color: var(--gold);
}
.outro__contact {
  margin-top: 1.2rem;
  font-size: 0.72rem; letter-spacing: 0.38em; text-transform: uppercase;
  color: var(--ink-dim);
}

/* ============ responsive ============ */
@media (max-width: 860px) {
  .stats-row { grid-template-columns: 1fr; gap: 2.2rem; }
  .f8-stage { grid-template-columns: 1fr; gap: 4rem; text-align: center; }
  .f8-copy__focaltxt, .f8-copy__ftxt { margin-left: auto; margin-right: auto; }
  .br-desk { display: none; }
  .bar:nth-child(odd) .bar__year { display: none; }
}

/* ============ reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  .grain, .hero__scrollhint span { animation: none; }
}
