/* =============================================================
   Tommaso Borroni — Fotografo · Milano
   Stack vanilla CSS, mobile-first, OKLCH palette
   ============================================================= */

/* --- Reset minimale ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; }
img, picture, svg { display: block; max-width: 100%; height: auto; }
button { background: none; border: none; cursor: pointer; font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* --- Tokens ------------------------------------------------- */
:root {
  /* Palette — black stage with cobalt blue spotlight */
  --bg-base:        oklch(0.10 0.012 250);
  --bg-elevated:    oklch(0.14 0.018 250);
  --bg-deep:        oklch(0.07 0.010 250);
  --fg-base:        oklch(0.96 0.005 250);
  --fg-muted:       oklch(0.74 0.012 250);
  --fg-faint:       oklch(0.55 0.014 250);
  --accent-stage:   oklch(0.50 0.19 258);
  --accent-bright:  oklch(0.62 0.20 252);
  --highlight-spot: oklch(0.66 0.22 340);
  --border-faint:   oklch(0.22 0.020 250);
  --border-strong:  oklch(0.32 0.025 250);

  /* Typography */
  --font-display: "Bebas Neue", Impact, "Helvetica Neue", sans-serif;
  --font-body:    "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Sizing */
  --container:    72rem;
  --container-narrow: 46rem;
  --pad-x: clamp(1.25rem, 5vw, 2.5rem);
  --section-y: clamp(4.5rem, 9vw, 8rem);

  /* Type scale */
  --fs-hero:    clamp(3rem, 11vw, 7.5rem);
  --fs-h2:      clamp(2.25rem, 6vw, 4.25rem);
  --fs-h3:      clamp(1.4rem, 2.4vw, 1.75rem);
  --fs-body:    1.0625rem;
  --fs-small:   0.875rem;
  --fs-kicker:  0.8125rem;
}

/* --- Base typography ---------------------------------------- */
body {
  background: var(--bg-base);
  color: var(--fg-base);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  font-weight: 400;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}

p { color: var(--fg-muted); }

::selection { background: var(--accent-stage); color: var(--fg-base); }

:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--accent-stage);
  color: var(--fg-base);
  padding: 0.75rem 1rem;
  z-index: 200;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 1rem; }

/* --- Layout helpers ----------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}
.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.section { padding-block: var(--section-y); }

.section-head { margin-bottom: clamp(2rem, 4vw, 3.5rem); }

.section-title {
  font-size: var(--fs-h2);
  color: var(--fg-base);
  margin-bottom: 0;
}

.section-intro {
  margin-top: 1.25rem;
  font-size: 1.0625rem;
  max-width: 38rem;
  color: var(--fg-muted);
}

.kicker {
  font-family: var(--font-body);
  font-size: var(--fs-kicker);
  font-weight: 500;
  color: var(--accent-bright);
  margin-bottom: 1.25rem;
  letter-spacing: 0.04em;
}

/* --- Header / Nav ------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: oklch(0.08 0.010 250 / 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border-faint);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--pad-x);
  gap: 1rem;
  max-width: var(--container);
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  color: var(--fg-base);
  text-transform: uppercase;
  min-height: 44px;
}

.brand-mark {
  width: 14px;
  height: 14px;
  background: var(--accent-stage);
  display: inline-block;
  border-radius: 1px;
  box-shadow: 0 0 14px var(--accent-stage);
}

.brand-dot { color: var(--accent-bright); }

.nav-desktop {
  display: none;
  gap: 0.4rem;
  align-items: center;
}
.nav-desktop a {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--fg-muted);
  padding: 0.6rem 0.85rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s ease;
}
.nav-desktop a:hover { color: var(--fg-base); }
.nav-desktop a.nav-cta {
  margin-left: 0.5rem;
  background: var(--accent-stage);
  color: var(--fg-base);
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.nav-desktop a.nav-cta:hover {
  background: var(--accent-bright);
  color: var(--bg-deep);
}

/* Hamburger */
.hamburger {
  width: 44px;
  height: 44px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  padding: 0;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--fg-base);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile drawer */
.nav-mobile {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  height: calc(100vh - 64px);
  height: calc(100svh - 64px);
  background: var(--bg-deep);
  border-top: 1px solid var(--border-faint);
  padding: 2rem var(--pad-x);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform 0.28s cubic-bezier(0.5, 0, 0.2, 1),
              visibility 0s linear 0.28s;
  z-index: 99;
  overflow-y: auto;
}
.nav-mobile.is-open {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.28s cubic-bezier(0.5, 0, 0.2, 1),
              visibility 0s linear 0s;
}
.nav-mobile a {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--fg-base);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-faint);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.nav-mobile a.nav-cta { color: var(--accent-bright); }

/* --- Hero --------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(5rem, 10vw, 7rem) var(--pad-x) clamp(4rem, 8vw, 6rem);
  overflow: hidden;
  isolation: isolate;
  text-align: center;
}

.hero-photo {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: contrast(1.05) saturate(1.1);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg,
      oklch(0.08 0.010 250 / 0.85) 0%,
      oklch(0.08 0.010 250 / 0.45) 35%,
      oklch(0.08 0.010 250 / 0.50) 60%,
      oklch(0.07 0.012 250 / 0.95) 100%
    );
}

.hero-content {
  max-width: 56rem;
  position: relative;
  width: 100%;
  margin-inline: auto;
}

.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent-bright);
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}
.hero-eyebrow::before,
.hero-eyebrow::after {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent-bright);
  display: inline-block;
}

.hero-title {
  font-size: var(--fs-hero);
  color: var(--fg-base);
  margin-bottom: 1.5rem;
}

.hero-sub {
  font-size: 1.125rem;
  max-width: 34rem;
  color: var(--fg-base);
  margin: 0 auto 2.25rem;
  font-weight: 300;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.95rem 1.6rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent-stage);
  color: var(--fg-base);
  box-shadow: 0 0 0 1px var(--accent-stage), 0 8px 30px -10px var(--accent-stage);
}
.btn-primary:hover {
  background: var(--accent-bright);
  color: var(--bg-deep);
}
.btn-ghost {
  border-color: var(--border-strong);
  color: var(--fg-base);
  background: transparent;
}
.btn-ghost:hover {
  border-color: var(--accent-bright);
  color: var(--accent-bright);
}

.hero-scroll {
  position: absolute;
  right: var(--pad-x);
  bottom: 2rem;
  width: 28px;
  height: 50px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
  z-index: 1;
}
.hero-scroll span {
  width: 3px;
  height: 8px;
  background: var(--accent-bright);
  display: block;
  border-radius: 2px;
  animation: scrollDot 1.6s ease-in-out infinite;
}
@keyframes scrollDot {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(14px); opacity: 1; }
}

/* --- Manifesto --------------------------------------------- */
.section-manifesto {
  background:
    radial-gradient(ellipse at 30% 0%, oklch(0.18 0.05 258 / 0.45), transparent 55%),
    var(--bg-base);
  border-top: 1px solid var(--border-faint);
}
.manifesto-body {
  margin-top: 2rem;
}
.manifesto-body p {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--fg-base);
  font-weight: 300;
  margin-bottom: 1.25rem;
  max-width: 38rem;
}
.manifesto-signature {
  font-family: var(--font-display);
  font-size: 1.5rem !important;
  color: var(--accent-bright) !important;
  margin-top: 2rem !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* --- Servizi ----------------------------------------------- */
.section-servizi { background: var(--bg-deep); }

.servizi-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

.servizio {
  background: var(--bg-elevated);
  padding: 2rem 1.75rem 2.25rem;
  border: 1px solid var(--border-faint);
  position: relative;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.servizio:hover {
  border-color: var(--accent-stage);
  transform: translateY(-3px);
}
.servizio-featured {
  background:
    linear-gradient(180deg,
      oklch(0.20 0.07 258 / 0.55) 0%,
      var(--bg-elevated) 100%);
  border-color: var(--accent-stage);
}

.servizio-title {
  font-size: var(--fs-h3);
  color: var(--fg-base);
  margin-bottom: 1rem;
  line-height: 1.05;
}
.servizio-body {
  font-size: 1rem;
  color: var(--fg-muted);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}
.servizio-tag {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--accent-bright);
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* --- Portfolio --------------------------------------------- */
.section-portfolio {
  background:
    radial-gradient(ellipse at 70% 20%, oklch(0.18 0.06 258 / 0.40), transparent 60%),
    var(--bg-base);
}

.portfolio-frame {
  margin-top: 2rem;
  display: grid;
  gap: 1.5rem;
}

.portfolio-photo {
  position: relative;
  background: var(--bg-deep);
  overflow: hidden;
}
.portfolio-photo img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
}
.portfolio-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 80px oklch(0.05 0.01 250 / 0.5);
}

.portfolio-caption {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-block: 0.5rem;
  border-top: 1px solid var(--border-faint);
  padding-top: 1.25rem;
}
.caption-label {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  color: var(--accent-bright);
  text-transform: uppercase;
}
.caption-text {
  font-size: 1rem;
  color: var(--fg-muted);
  line-height: 1.55;
  max-width: 36rem;
}

/* --- Chi sono ---------------------------------------------- */
.section-chi-sono {
  background: var(--bg-deep);
  border-top: 1px solid var(--border-faint);
}
.chi-sono-body {
  margin-top: 2rem;
}
.chi-sono-body p {
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--fg-base);
  font-weight: 300;
  margin-bottom: 1.25rem;
  max-width: 36rem;
}

/* --- Contatti ---------------------------------------------- */
.section-contatti {
  background:
    radial-gradient(ellipse at 50% 80%, oklch(0.20 0.08 258 / 0.55), transparent 60%),
    var(--bg-base);
}
.contatti-intro {
  margin-top: 1.5rem;
  font-size: 1.125rem;
  color: var(--fg-base);
  font-weight: 300;
  max-width: 36rem;
}
.contatti-list {
  margin-top: 2.5rem;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border-faint);
}
.contatto {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-faint);
  align-items: baseline;
}
.contatto-label {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--accent-bright);
  letter-spacing: 0.04em;
}
.contatto-value {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  letter-spacing: 0.02em;
  color: var(--fg-base);
  text-transform: uppercase;
  line-height: 1.05;
  user-select: all;
  word-break: break-word;
}
.contatti-note {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--fg-faint);
  font-style: normal;
}

/* --- Footer ------------------------------------------------ */
.site-footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--border-faint);
  padding-block: 3rem;
}
.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
.footer-brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 0.85rem;
}
.footer-mark {
  width: 10px;
  height: 10px;
  background: var(--accent-stage);
  display: inline-block;
}
.footer-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--fg-base);
  text-transform: uppercase;
}
.footer-tag {
  font-size: 0.85rem;
  color: var(--fg-faint);
}
.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-copy {
  font-size: 0.8rem;
  color: var(--fg-faint);
  line-height: 1.5;
}
.footer-credit {
  font-size: 0.8rem;
  color: var(--fg-faint);
}
.footer-credit a {
  color: var(--accent-bright);
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.footer-credit a:hover { border-bottom-color: var(--accent-bright); }

/* --- Breakpoints ------------------------------------------- */
@media (min-width: 600px) {
  .servizi-grid { grid-template-columns: repeat(2, 1fr); }
  .servizio:last-child { grid-column: 1 / -1; }
  .portfolio-frame {
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: end;
  }
  .portfolio-caption {
    border-top: none;
    padding-top: 0;
    border-left: none;
  }
}

@media (min-width: 768px) {
  .nav-desktop { display: inline-flex; }
  .hamburger { display: none; }
  .nav-mobile { display: none; }
  .hero-scroll { display: inline-flex; }
  .servizi-grid { grid-template-columns: repeat(3, 1fr); }
  .servizio:last-child { grid-column: auto; }
  .footer-grid {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
  .footer-meta { text-align: right; }
}

@media (min-width: 1024px) {
  .hero { padding-bottom: clamp(4rem, 7vw, 6rem); }
  .hero-content { max-width: 60rem; }
  .contatto { grid-template-columns: 10rem 1fr; }
}

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