/* ==========================================================================
   Martin Dehn — Moderator Portfolio
   Visual language modeled on Apple's marketing pages: white / #f5f5f7 bands,
   near-black type, a single blue accent, and size-specific tracking.
   ========================================================================== */

:root {
  /* Apple's actual surface pair: pure white against their signature light grey */
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --surface: #ffffff;
  --border: rgba(0, 0, 0, 0.1);

  /* Apple's type colors — near-black, never pure #000 */
  --text: #1d1d1f;
  --text-dim: #6e6e73;
  --text-faint: #86868b;

  /* One accent, used for actions and links only */
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --link: #0066cc;

  /* Critically damped, no overshoot — Apple's default UI feel */
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0.28, 0.11, 0.32, 1);
  /* Sampled from a critically damped spring (damping 1.0, response 0.4):
     x(t) = 1 − (1 + ωt)·e^(−ωt). Settles without overshoot, unlike a bezier. */
  --spring: linear(
    0, 0.186, 0.465, 0.682, 0.821, 0.903,
    0.949, 0.973, 0.986, 0.993, 0.997, 0.999, 1
  );

  --container: 1080px;
  --gutter: clamp(1.375rem, 5vw, 2.5rem);
  --radius-lg: 18px;
  --radius-md: 12px;
}

* { box-sizing: border-box; }

html {
  /* System font first: it ships optical sizing and tracking tables already */
  font: 400 100%/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
        "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 1.0625rem; /* Apple's 17px body */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3 { margin: 0; font-weight: 600; }

p { margin: 0; }

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

.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 100;
  transition: width 80ms linear;
}

/* ==========================================================================
   Layout — full-bleed alternating bands
   ========================================================================== */

.section {
  position: relative;
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(4.5rem, 10vw, 8rem) var(--gutter);
}

/* Paint the grey band edge-to-edge without wrapping every section in markup */
.section--alt::before {
  content: "";
  position: absolute;
  inset: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: var(--bg-alt);
  z-index: -1;
}

.section-head {
  max-width: 42rem;
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.eyebrow {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em; /* small text wants slightly positive tracking */
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.section-title {
  font-size: clamp(2rem, 4.2vw, 3rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.022em; /* tightens as it grows */
}

.section-sub {
  margin-top: 1rem;
  font-size: clamp(1.0625rem, 1.5vw, 1.3125rem);
  line-height: 1.42;
  letter-spacing: 0.004em;
  color: var(--text-dim);
}

/* ---- Reveal on scroll ----
   Uses the independent `translate` property rather than `transform`, so a
   component's own hover transform composes with it instead of clobbering it.
   Scoped to .js so that without JavaScript nothing is ever hidden. */
.js .reveal {
  opacity: 0;
  translate: 0 22px;
  /* `transform` rides along here so revealed components (cards, platform
     tiles) keep a hover transition without redeclaring one — a second
     `transition` on those classes would override this whole list. */
  transition: opacity 600ms var(--spring),
              translate 600ms var(--spring),
              transform 400ms var(--ease-out);
  will-change: opacity, translate;
}
.js .reveal.is-visible { opacity: 1; translate: none; }
/* Dropped once the element has landed — a permanent hint costs memory */
.js .reveal.is-settled { will-change: auto; }

/* Images materialize: they scale up as they fade, rather than just appearing */
.js .hero-portrait.reveal,
.js .about-media.reveal,
.js .gallery-item.reveal {
  scale: 0.97;
  transition: opacity 600ms var(--spring),
              translate 600ms var(--spring),
              scale 600ms var(--spring),
              transform 400ms var(--ease-out);
}
.js .hero-portrait.reveal.is-visible,
.js .about-media.reveal.is-visible,
.js .gallery-item.reveal.is-visible { scale: 1; }

@media (prefers-reduced-motion: reduce) {
  /* Gentler equivalent, not no feedback: a short cross-fade, no travel.
     Keeps the .js prefix — a media query adds no specificity, so an
     unprefixed .reveal here would lose to .js .reveal above. */
  .js .reveal,
  .js .hero-portrait.reveal,
  .js .about-media.reveal,
  .js .gallery-item.reveal {
    translate: none;
    scale: 1;
    transition: opacity 200ms ease;
    transition-delay: 0ms !important;
  }
}

/* ==========================================================================
   Buttons — Apple's pill actions
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.375rem;
  border-radius: 980px; /* Apple's pill radius */
  font-size: 1.0625rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  transition: background-color 200ms var(--ease), color 200ms var(--ease),
              transform 120ms var(--ease-out);
}
/* Feedback on press, not on release */
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  border: 1px solid var(--text);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover { background: var(--text); color: #fff; }

/* ==========================================================================
   Nav — translucent chrome, content scrolls underneath
   ========================================================================== */

.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 3rem;
  padding: 0 var(--gutter);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 300ms var(--ease), background-color 300ms var(--ease);
}
.site-nav.is-scrolled {
  background: rgba(255, 255, 255, 0.86);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.nav-logo { display: flex; align-items: center; gap: 0.5rem; }
.logo-mark { width: 22px; height: 22px; color: var(--text); flex-shrink: 0; }
.nav-logo-text {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2rem);
}

.nav-link {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.005em;
  color: var(--text);
  opacity: 0.86;
  transition: opacity 150ms var(--ease);
  padding: 0.25rem 0;
}
.nav-link:hover { opacity: 1; }

.nav-cta {
  color: var(--link);
  opacity: 1;
  font-weight: 500;
}
.nav-cta:hover { text-decoration: underline; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle span {
  width: 17px;
  height: 1px;
  background: var(--text);
  transition: transform 300ms var(--ease-out), opacity 200ms var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(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(-5px) rotate(-45deg); }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(6rem, 13vw, 8.5rem) var(--gutter) 0;
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero-title {
  font-size: clamp(2.5rem, 5.4vw, 3.875rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em; /* strongest negative tracking on the largest text */
}

.hero-title-accent { color: var(--accent); }

.hero-sub {
  margin-top: 1.25rem;
  max-width: 26rem;
  font-size: clamp(1.1875rem, 1.9vw, 1.5rem);
  line-height: 1.32;
  letter-spacing: 0.004em;
  color: var(--text-dim);
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-portrait { position: relative; }

.portrait-frame {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  background-color: var(--bg-alt);
  background-size: cover;
  background-position: center;
}

.portrait-frame--tall { aspect-ratio: 3 / 4; }

/* ---- Spec strip — Apple's tech-specs rhythm, used for a bio ---- */
.spec-strip {
  margin-top: clamp(3.5rem, 8vw, 5.5rem);
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--border);
  padding-top: clamp(1.75rem, 4vw, 2.5rem);
}

.spec {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
  padding: 0 0.75rem;
  border-left: 1px solid var(--border);
}
.spec:first-child { border-left: none; }

.spec-value {
  font-size: clamp(1.625rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.022em;
  font-variant-numeric: tabular-nums;
}
.spec-unit { font-size: 0.5em; font-weight: 400; color: var(--text-dim); margin-left: 0.15em; }

.spec-label {
  font-size: 0.8125rem;
  line-height: 1.3;
  letter-spacing: 0.008em;
  color: var(--text-faint);
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.card {
  padding: clamp(1.75rem, 3vw, 2.25rem);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
/* On the grey band the card reads as white; on white it reads as grey */
.section--alt .card { background: #fff; }
.section:not(.section--alt) .card { background: var(--bg-alt); }
.card:hover { transform: translateY(-4px); }

.card-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 1.125rem;
  color: var(--accent);
}
.card-icon svg { width: 100%; height: 100%; display: block; }

.card-title {
  font-size: 1.3125rem;
  font-weight: 600;
  line-height: 1.19;
  letter-spacing: -0.014em;
  margin-bottom: 0.5rem;
}

.card-text {
  font-size: 1rem;
  line-height: 1.47;
  letter-spacing: -0.002em;
  color: var(--text-dim);
}

/* ==========================================================================
   About
   ========================================================================== */

.about-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.about-copy .section-title { margin-bottom: 1.5rem; }

.about-text {
  font-size: 1.0625rem;
  line-height: 1.6;
  letter-spacing: -0.002em;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
  max-width: 62ch;
}
.about-text:last-child { margin-bottom: 0; }

/* ==========================================================================
   Reach / platforms
   ========================================================================== */

.platform-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

.platform {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.75rem 1rem;
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--text);
}
.platform svg { width: 24px; height: 24px; }
.platform:hover { transform: translateY(-4px); }
/* Press feedback has to land on pointer-down, not ease in over the hover
   duration — the shorter duration wins while :active holds */
.platform:active { transform: scale(0.97); transition-duration: 100ms; }

.platform-name {
  font-size: 0.8125rem;
  letter-spacing: 0.008em;
  color: var(--text-dim);
}

.reach-benefits { margin-top: 1.25rem; }

.reach-link { margin-top: 2rem; }
.reach-link a { color: var(--link); white-space: nowrap; }
.reach-link a:hover { text-decoration: underline; }

/* ==========================================================================
   Gallery — columns masonry, photos keep their own ratio
   ========================================================================== */

.gallery-grid {
  column-count: 3;
  column-gap: 1rem;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  background-color: var(--bg-alt);
  overflow: hidden;
}

/* The frame holds still and the photo scales inside it — the frame moving
   would break the grid's alignment with its neighbours. */
.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: scale 500ms var(--ease-out);
}
.gallery-item:hover img { scale: 1.04; }

@media (prefers-reduced-motion: reduce) {
  .gallery-item img { transition: none; }
  .gallery-item:hover img { scale: 1; }
  /* Hold position on hover too — colour/opacity still signal the state */
  .card:hover,
  .platform:hover,
  .logo-row--brand img:hover { transform: none; }
}

/* ==========================================================================
   Logos
   ========================================================================== */

.section-logos { text-align: center; }
.section-logos .section-head { margin-left: auto; margin-right: auto; text-align: center; }

.logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Capped so the 8 logos wrap 4 + 4 instead of stranding one on its own row */
.logo-row--brand {
  max-width: 33rem;
  margin-inline: auto;
}

.logo-row--brand img {
  height: 76px;
  width: 112px;
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius-md);
  padding: 12px;
  transition: transform 300ms var(--ease-out);
}
.logo-row--brand img:hover { transform: translateY(-4px); }

.logo-row--tv { gap: clamp(2rem, 6vw, 4rem); }
.logo-row--tv img {
  height: 24px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  filter: grayscale(1) opacity(0.45);
  transition: filter 300ms var(--ease);
}
.logo-row--tv img:hover { filter: grayscale(0) opacity(1); }

.logo-fallback {
  height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 1rem;
  border-radius: 980px;
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  letter-spacing: 0.008em;
  color: var(--text-faint);
}

.logo-row-label {
  margin-top: 3.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.8125rem;
  letter-spacing: 0.008em;
  color: var(--text-faint);
}

/* ==========================================================================
   Booking
   ========================================================================== */

.section-booking { text-align: center; }
.booking-inner { max-width: 36rem; margin: 0 auto; }
.section-booking .section-sub { margin-left: auto; margin-right: auto; }

.booking-actions {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.booking-contact-line {
  margin-top: 1.5rem;
  font-size: 0.9375rem;
  color: var(--text-faint);
}
.booking-contact-line a { color: var(--link); }
.booking-contact-line a:hover { text-decoration: underline; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--bg-alt);
  padding: 2.5rem var(--gutter);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-faint);
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-inner .nav-logo-text { font-size: 0.8125rem; }
.footer-inner .logo-mark { width: 18px; height: 18px; }

.footer-social { display: flex; gap: 1.25rem; }
.footer-social a {
  color: var(--link);
  transition: opacity 150ms var(--ease);
}
.footer-social a:hover { text-decoration: underline; }

.footer-meta {
  width: 100%;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.footer-meta a { color: var(--link); }
.footer-meta a:hover { text-decoration: underline; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-portrait { order: -1; width: 100%; max-width: 340px; margin: 0 auto; }
  .hero-sub { max-width: 34rem; }
  .spec-strip { grid-template-columns: repeat(3, 1fr); row-gap: 1.75rem; }
  .spec:nth-child(4) { border-left: none; }
  .about-grid { grid-template-columns: 1fr; }
  .about-media { width: 100%; max-width: 340px; margin: 0 auto; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .platform-grid { grid-template-columns: repeat(3, 1fr); }
  .gallery-grid { column-count: 2; }
}

@media (max-width: 640px) {
  .nav-links {
    position: fixed;
    top: 3rem;
    right: 0;
    left: 0;
    height: calc(100vh - 3rem);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    padding: 1rem var(--gutter);
    /* Solid: a full-screen sheet must not stack translucency over content */
    background: #fff;
    /* Enters and exits along the same path */
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 300ms var(--ease), transform 300ms var(--ease-out);
  }
  .nav-links.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-link {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.018em;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }
  .nav-toggle { display: flex; }

  .spec-strip { grid-template-columns: repeat(2, 1fr); }
  .spec:nth-child(3) { border-left: none; }

  .card-grid { grid-template-columns: 1fr; }
  .platform-grid { grid-template-columns: repeat(2, 1fr); }

  .gallery-grid { column-gap: 0.75rem; }
  .gallery-item { margin-bottom: 0.75rem; }

  .footer-inner { justify-content: flex-start; }
}

/* ==========================================================================
   Accessibility preferences
   ========================================================================== */

@media (prefers-reduced-transparency: reduce) {
  .site-nav, .nav-links {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #fff;
  }
}

@media (prefers-contrast: more) {
  :root {
    --border: rgba(0, 0, 0, 0.4);
    --text-dim: #48484a;
    --text-faint: #48484a;
  }
  .card, .platform, .logo-row--brand img { border: 1px solid var(--border); }
}
