/* Folio stylesheet. The folio has its own wider layout; the home page keeps
   its own width and composition. Theme token values are copied from the
   :root blocks of index.html rather than linked to them, so the two pages
   share a language without sharing selectors. System type only, no webfonts. */

:root {
  --ground: #F2F2F7;
  --ink: #1D1D1F;
  --ink-secondary: rgba(29, 29, 31, 0.62);
  --ink-tertiary: rgba(29, 29, 31, 0.42);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --glass-edge-bottom: rgba(255, 255, 255, 0.35);
  --hairline: rgba(29, 29, 31, 0.08);
  --link: #0071E3;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 40px rgba(0, 0, 0, 0.08);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.05), 0 24px 60px rgba(0, 0, 0, 0.12);
  --bezel: rgba(29, 29, 31, 0.1);
  --screen-ground: rgba(29, 29, 31, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #09090B;
    --ink: #F5F5F7;
    --ink-secondary: rgba(245, 245, 247, 0.62);
    --ink-tertiary: rgba(245, 245, 247, 0.42);
    --glass: rgba(28, 28, 32, 0.5);
    --glass-strong: rgba(38, 38, 44, 0.6);
    --glass-edge: rgba(255, 255, 255, 0.16);
    --glass-edge-bottom: rgba(255, 255, 255, 0.05);
    --hairline: rgba(245, 245, 247, 0.09);
    --link: #409CFF;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 28px 70px rgba(0, 0, 0, 0.6);
    --bezel: rgba(245, 245, 247, 0.14);
    --screen-ground: rgba(245, 245, 247, 0.06);
  }
}

:root[data-theme="light"] {
  --ground: #F2F2F7;
  --ink: #1D1D1F;
  --ink-secondary: rgba(29, 29, 31, 0.62);
  --ink-tertiary: rgba(29, 29, 31, 0.42);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --glass-edge-bottom: rgba(255, 255, 255, 0.35);
  --hairline: rgba(29, 29, 31, 0.08);
  --link: #0071E3;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 40px rgba(0, 0, 0, 0.08);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.05), 0 24px 60px rgba(0, 0, 0, 0.12);
  --bezel: rgba(29, 29, 31, 0.1);
  --screen-ground: rgba(29, 29, 31, 0.06);
}

:root[data-theme="dark"] {
  --ground: #09090B;
  --ink: #F5F5F7;
  --ink-secondary: rgba(245, 245, 247, 0.62);
  --ink-tertiary: rgba(245, 245, 247, 0.42);
  --glass: rgba(28, 28, 32, 0.5);
  --glass-strong: rgba(38, 38, 44, 0.6);
  --glass-edge: rgba(255, 255, 255, 0.16);
  --glass-edge-bottom: rgba(255, 255, 255, 0.05);
  --hairline: rgba(245, 245, 247, 0.09);
  --link: #409CFF;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 28px 70px rgba(0, 0, 0, 0.6);
  --bezel: rgba(245, 245, 247, 0.14);
  --screen-ground: rgba(245, 245, 247, 0.06);
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.folio {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  background: var(--ground);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

::selection { background: var(--link); color: #fff; }

a { color: inherit; }

.page {
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 4vw, 2.5rem) 4rem;
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 6vh, 4rem);
  min-height: 100vh;
  min-height: 100dvh;
}

.page--gallery { max-width: 1280px; }
.page--case { max-width: 1080px; }

/* ---- Header ---- */
.folio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}
.mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-edge);
  border-bottom-color: var(--glass-edge-bottom);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
}
.mark svg { display: block; }
.mark svg circle, .mark svg path { stroke: var(--ink); }
.wordmark span:last-child {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.toggle {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--glass-edge);
  border-bottom-color: var(--glass-edge-bottom);
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--shadow);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.toggle:hover { transform: scale(1.06); box-shadow: var(--shadow-lift); }
.toggle:active { transform: scale(0.96); }
.toggle .icon-sun, .toggle .icon-moon { position: absolute; transition: opacity 0.3s ease, transform 0.3s ease; }
html:not([data-theme="dark"]) .icon-moon { opacity: 0; transform: rotate(-40deg) scale(0.6); }
html:not([data-theme="dark"]) .icon-sun { opacity: 1; transform: none; }
html[data-theme="dark"] .icon-sun { opacity: 0; transform: rotate(40deg) scale(0.6); }
html[data-theme="dark"] .icon-moon { opacity: 1; transform: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .icon-sun { opacity: 0; transform: rotate(40deg) scale(0.6); }
  html:not([data-theme="light"]) .icon-moon { opacity: 1; transform: none; }
}

a:focus-visible, button:focus-visible, video:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

/* ---- Hero ---- */
.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
}
.hero h1 {
  margin-top: 0.7rem;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  font-size: clamp(2rem, 5.4vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.08;
  text-wrap: balance;
}
.hero-line {
  margin-top: 1rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink-secondary);
  max-width: 34rem;
  text-wrap: pretty;
}

/* ---- Gallery ----
   The landmark carries the same rhythm the page gave its sections before,
   so wrapping them changes the reading order and nothing else. */
.gallery-main {
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 6vh, 4rem);
}

.gallery { display: flex; flex-direction: column; gap: 1.25rem; }
.gallery-toolbar { display: flex; justify-content: flex-end; min-height: 1px; }

.ghost-button {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--glass-edge);
  border-bottom-color: var(--glass-edge-bottom);
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.ghost-button:hover { background: var(--glass-strong); box-shadow: var(--shadow-lift); }

.cards {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.75rem);
}
@media (max-width: 1080px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .cards { grid-template-columns: minmax(0, 1fr); } }

.card-link {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  text-decoration: none;
  color: var(--ink);
}
.card-copy { display: flex; flex-direction: column; gap: 0.3rem; }
.card-name {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card-proposition {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink-secondary);
  text-wrap: pretty;
}
.card-cue {
  margin-top: 0.15rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--link);
}
.card-link:hover .card-cue { text-decoration: underline; }

/* ---- Device frame ----
   The poster's own pixels set the aspect ratio: nothing is stretched to a
   generic rectangle. A restrained bezel, no perspective, no floating. */
.device {
  display: block;
  width: 100%;
  padding: 9px;
  border-radius: 40px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--bezel);
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.card-link:hover .device { transform: translateY(-3px); box-shadow: var(--shadow-lift); }

.device-screen {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--screen-width) / var(--screen-height);
  border-radius: 32px;
  overflow: hidden;
  background: var(--screen-ground);
}
.device-poster,
.device-preview,
.demo-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.device-preview,
.demo-video {
  position: absolute;
  inset: 0;
  background: transparent;
}
.demo-fallback {
  padding: 1.25rem;
  font-size: 0.9rem;
  color: var(--ink-secondary);
}

/* ---- Bridge ---- */
.bridge-glass {
  padding: 1.35rem 1.5rem;
  border-radius: 24px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-edge);
  border-bottom-color: var(--glass-edge-bottom);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}
.bridge-glass h2 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
.bridge-glass p { font-size: 0.92rem; line-height: 1.5; color: var(--ink-secondary); }
.bridge-cta {
  margin-top: 0.4rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--link);
  text-decoration: none;
}
.bridge-cta:hover { text-decoration: underline; }

/* ---- Case page ---- */
.case {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: start;
}
.case > * { grid-column: 1 / -1; }

.case-back { font-size: 0.85rem; }
.back-link { color: var(--ink-secondary); text-decoration: none; }
.back-link:hover { color: var(--link); }

.case-name {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  font-size: clamp(1.9rem, 4.8vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.1;
}
.case-proposition {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ink-secondary);
  max-width: 34rem;
  text-wrap: pretty;
}

.demo { display: flex; flex-direction: column; gap: 1rem; }
.demo-stage { max-width: 380px; width: 100%; }
.demo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 380px;
}

.beats {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.beat {
  padding: 0.9rem 1.1rem;
  border-radius: 18px;
  border: 1px solid transparent;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.9rem;
  align-items: baseline;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.beat.is-active {
  border-color: var(--glass-edge);
  background: var(--glass-strong);
  box-shadow: var(--shadow);
}
.beat-time {
  font-size: 0.78rem;
  color: var(--ink-tertiary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.beat-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
}
.beat-line {
  grid-column: 2;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink);
  text-wrap: pretty;
}

/* ---- The story as stills ----
   The static equivalent of the demonstration: four approved frames that stay
   readable with no script, blocked autoplay or a failed video. */
.stills {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.75rem, 2vw, 1.25rem);
}
.still { display: flex; flex-direction: column; gap: 0.5rem; }
.still img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--bezel);
  background: var(--screen-ground);
}
.still figcaption {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--ink-tertiary);
  text-wrap: pretty;
}
@media (max-width: 700px) {
  .stills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- Transcript ----
   Everything the demonstration says, as text, for a visitor with no sound,
   no script or a screen reader. */
.transcript-block { display: flex; flex-direction: column; gap: 0.75rem; }
.transcript-heading {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
}
.transcript {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-width: 34rem;
}
.transcript li {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.75rem;
  align-items: baseline;
}
.transcript-time {
  font-size: 0.78rem;
  color: var(--ink-tertiary);
  font-variant-numeric: tabular-nums;
}
.transcript-line { font-size: 0.95rem; line-height: 1.5; }

.demo-aside { font-size: 0.85rem; }
.gif-link { color: var(--link); text-decoration: none; }
.gif-link:hover { text-decoration: underline; }

.availability {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: baseline;
  font-size: 0.9rem;
  color: var(--ink-secondary);
  padding-top: 0.5rem;
  border-top: 1px solid var(--hairline);
}
.availability-link { color: var(--link); text-decoration: none; }
.availability-link:hover { text-decoration: underline; }

.case-enquiry { font-size: 0.92rem; }
.enquiry-link { color: var(--link); text-decoration: none; font-weight: 500; }
.enquiry-link:hover { text-decoration: underline; }

.case-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline);
}
.case-nav a { text-decoration: none; display: flex; flex-direction: column; gap: 0.15rem; }
.case-index { align-self: center; color: var(--ink-secondary); font-size: 0.88rem; }
.nav-hint {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
}
.nav-name { font-size: 1rem; font-weight: 600; }
.case-nav a:hover .nav-name { color: var(--link); }
.case-next { text-align: right; }

@media (min-width: 900px) {
  .case { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); }
  .case .demo { grid-column: 1; }
  .case .beats { grid-column: 2; }
}

/* ---- Footer ---- */
.folio-footer { margin-top: auto; padding-top: clamp(2rem, 6vh, 4rem); }
.footer-glass {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.4rem;
  border-radius: 20px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-edge);
  border-bottom-color: var(--glass-edge-bottom);
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}
.footer-links { display: flex; align-items: center; gap: 1.4rem; }
.footer-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.footer-links a:hover { color: var(--link); }
.copyright { font-size: 0.8rem; color: var(--ink-tertiary); font-variant-numeric: tabular-nums; }

@media (max-width: 480px) {
  .footer-glass { justify-content: center; text-align: center; }
  .device { border-radius: 34px; padding: 7px; }
  .device-screen { border-radius: 28px; }
}

/* Reduced motion: stills, no transitions, nothing that moves on its own.
   folio.js reads the same preference and leaves previews paused. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .card-link:hover .device { transform: none; }
}
