/* ==========================================================================
   Medorius — website design system
   Same construction as the Gymwise site (tokens -> base -> components), but
   in the Medorius identity: black and white, one quiet blue for numbering,
   and the stencil wordmark. The page is white; the brand is black, so the
   header, the home page hero, the footer and "Built with purpose" are black
   bands (they get the dark tokens below). Only black and white: no grey bands.
   White sections that follow each other are split by a hairline.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Brand. --white is the brand foreground (wordmark, nav and footer links):
     black on the page, white inside the dark bands. */
  --white: #0b0b0c;
  --accent: #1f5eff;               /* the "01. Strategy" blue — numbering and focus only */
  --accent-hover: #4a7dff;

  /* Surfaces */
  --bg: #ffffff;                   /* page */
  --bg-raised: #18191c;            /* nav */
  --bg-dark: #131416;              /* hero, footer */
  --card: #f5f5f7;
  --card-hover: #ececee;
  --fill: rgba(0, 0, 0, 0.05);
  --separator: rgba(0, 0, 0, 0.10);
  --separator-strong: rgba(0, 0, 0, 0.18);

  /* Text */
  --label: #0b0b0c;
  --label-secondary: rgba(0, 0, 0, 0.62);
  --label-tertiary: rgba(0, 0, 0, 0.45);
  --label-quaternary: rgba(0, 0, 0, 0.32);

  /* Geometry */
  --r: 16px;
  --r-inner: 12px;
  --r-btn: 8px;

  /* Type: system grotesque (SF Pro on Apple devices), no webfont to load. */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Inter", "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display",
          "Inter", "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;

  /* Layout */
  --wrap: 1240px;
  --wrap-narrow: 760px;
  --nav-h: 76px;

  color-scheme: light;
}

/* The black bands: header, home page hero, footer, and any section marked
   .band-black ("Built with purpose"). Same tokens, flipped. */
.nav, .hero, .footer, .band-black {
  --white: #ffffff;
  --fill: rgba(255, 255, 255, 0.06);
  --separator: rgba(255, 255, 255, 0.10);
  --separator-strong: rgba(255, 255, 255, 0.18);
  --label: #ffffff;
  --label-secondary: rgba(255, 255, 255, 0.66);
  --label-tertiary: rgba(255, 255, 255, 0.42);
  --label-quaternary: rgba(255, 255, 255, 0.28);
  color: var(--label);
  color-scheme: dark;
}
.hero, .footer, .band-black { background: var(--bg-dark); }

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; display: block; }
a { color: var(--label); text-decoration: none; }
a:hover { color: var(--label-secondary); }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: #0b0b0c; color: #fff; padding: 10px 16px;
  border-radius: 0 0 var(--r-inner) 0; font-weight: 600;
}
.skip-link:focus { left: 0; color: #fff; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: var(--wrap-narrow); }

/* Type scale. Large display sizes, tight tracking: the look of the old site. */
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; }
h1 { font-size: clamp(2.6rem, 1.4rem + 4.6vw, 5rem); line-height: 1.02; letter-spacing: -0.04em; }
h2 { font-size: clamp(2.2rem, 1.3rem + 3.6vw, 4.25rem); line-height: 1.04; letter-spacing: -0.038em; }
h3 { font-size: clamp(1.3rem, 1.1rem + 0.7vw, 1.6rem); line-height: 1.2; letter-spacing: -0.024em; }
h4 { font-size: 1.0625rem; line-height: 1.3; letter-spacing: -0.014em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.lede {
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.6rem);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.02em;
  color: var(--label);
}
.muted { color: var(--label-secondary); }
.small { font-size: 0.9375rem; }
.tiny { font-size: 0.8125rem; }
.center { text-align: center; }

/* Section rhythm */
.section { padding: clamp(72px, 9vw, 140px) 0; }
.section-tight { padding: clamp(48px, 6vw, 88px) 0; }
.section + .section { padding-top: 0; }
.rule { border: 0; border-top: 1px solid var(--separator); margin: 0; }

/* A section's own heading, e.g. "Selected work" above the projects */
.section-title { margin-bottom: clamp(32px, 4vw, 56px); }

.eyebrow {
  display: block;
  font-size: 0.9375rem; font-weight: 500;
  color: var(--label-tertiary);
  margin-bottom: 14px;
}

.section.band-black,
.band-black + .section { padding-top: clamp(72px, 9vw, 140px); }
.page-head.band-black { padding-bottom: clamp(72px, 9vw, 140px); }

/* Two white sections in a row: a hairline between them. */
.section.section-divided,
.section.cta-band { border-top: 1px solid var(--separator); padding-top: clamp(72px, 9vw, 140px); }
.band-black + .section.cta-band { border-top: 0; }

/* Two-column statement: big heading left, paragraph right (screens 2 and 3). */
.statement {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
}
.statement h2 { max-width: 9ch; }
.statement .lede { max-width: 30ch; }
.statement blockquote { margin: 0; }

/* --------------------------------------------------------------------------
   3. Controls
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font: inherit; font-weight: 500; font-size: 1rem;
  letter-spacing: -0.01em;
  padding: 16px 28px;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .18s ease, transform .12s ease, border-color .18s ease, color .18s ease;
  text-align: center;
}
.btn:active { transform: scale(0.985); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-primary { background: #0b0b0c; color: #fff; }
.btn-primary:hover { background: #2a2b2f; color: #fff; }
.hero .btn-primary { background: #fff; color: #000; }
.hero .btn-primary:hover { background: #e6e6e6; color: #000; }

.btn-secondary { background: transparent; color: var(--label); border-color: var(--separator-strong); }
.btn-secondary:hover { background: var(--fill); color: var(--label); }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* Round scroll cue under the hero, as on the old site */
.scroll-cue {
  width: 64px; height: 64px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--white); color: var(--bg-dark);
  transition: transform .2s ease;
}
.scroll-cue:hover { color: var(--bg-dark); transform: translateY(3px); }
.scroll-cue svg { width: 22px; height: 22px; }


/* --------------------------------------------------------------------------
   4. Nav
   -------------------------------------------------------------------------- */

.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--separator);
}
.nav-inner {
  height: var(--nav-h);
  display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; color: var(--white); flex: none; }
.brand:hover { color: var(--white); opacity: 0.8; }
.wordmark { display: block; width: auto; color: var(--white); overflow: visible; }
.brand .wordmark { height: 15px; margin-top: 1px; }   /* the 1px puts it on a whole pixel in the bar (it'd sit at 30.5px), which Firefox otherwise shaves off the top edge */

.nav-links { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-links a {
  color: var(--white);
  font-size: 0.9375rem; font-weight: 600;
  padding: 8px 14px; border-radius: 8px;
  transition: background-color .15s ease, color .15s ease;
}
.nav-links a:hover { background: var(--fill); color: var(--white); }
/* Current page is the dimmed one, as on the old site. */
.nav-links a[aria-current="page"] { color: var(--label-tertiary); }

.icon-btn {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px; border: 0; cursor: pointer;
  background: transparent; color: var(--white);
}
.icon-btn:hover { background: var(--fill); }
.icon-btn svg { width: 20px; height: 20px; }

.nav-toggle { display: none; margin-left: auto; }

.nav-sheet {
  display: none;
  border-top: 1px solid var(--separator);
  padding: 8px 24px 16px;
}
.nav-sheet.open { display: block; }
.nav-sheet a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 0; color: var(--label); font-weight: 500; font-size: 1.0625rem;
  border-bottom: 1px solid var(--separator);
}
.nav-sheet a:last-of-type { border-bottom: 0; }
.nav-sheet a[aria-current="page"] { color: var(--label-tertiary); }
.nav-sheet a svg { width: 15px; height: 15px; color: var(--label-tertiary); }

/* --------------------------------------------------------------------------
   5. Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: calc(100svh - var(--nav-h));
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(56px, 7vw, 96px) 0 clamp(40px, 5vw, 64px);
  overflow: hidden;
}
.hero-inner {
  position: relative;
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 5vw, 64px); align-items: center;
}
.hero-inner > * { min-width: 0; }
.hero h1 { margin-bottom: 24px; }
.hero .lede { max-width: 34ch; }
.hero-cta { margin-top: 36px; }
.hero-cue { display: flex; justify-content: center; margin-top: clamp(40px, 6vw, 72px); }

.hero-media {
  position: relative;
  display: flex; justify-content: center; align-items: flex-start;
  transform: rotate(-8deg);
  /* Give the tilted phones their own layer. Firefox on Windows otherwise
     paints the rotated rounded clips and 1px frame edges without smoothing,
     which looks jagged on 1x screens. */
  will-change: transform;
  backface-visibility: hidden;
}
.hero-media .device { outline: 1px solid transparent; }
.hero-media .device:last-child { margin-left: -60px; margin-top: 70px; }

/* Page header for inner pages */
.page-head { padding: clamp(72px, 9vw, 140px) 0 clamp(40px, 5vw, 72px); }
.page-head h1 { max-width: 14ch; }
.page-head .lede { margin-top: 24px; max-width: 40ch; color: var(--label-secondary); }

/* --------------------------------------------------------------------------
   6. Content blocks
   -------------------------------------------------------------------------- */

/* Numbered disciplines: 01. Strategy / 02. Design / 03. Development */
.steps {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 64px);
  margin-top: clamp(56px, 7vw, 96px);
}
.step h3 { color: var(--accent); margin-bottom: 18px; }
.step p { color: var(--label-secondary); font-size: 1.0625rem; line-height: 1.75; }

/* Stat row: 7+ / 2018 / 100% / 5+ */
.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 48px);
  padding-top: clamp(48px, 6vw, 88px);
  margin-top: clamp(48px, 6vw, 88px);
  border-top: 1px solid var(--separator);
}
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(3rem, 2rem + 3.4vw, 5.25rem);
  font-weight: 600; line-height: 1;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 22px;
}
.stat-label {
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.4rem);
  font-weight: 600; line-height: 1.3; letter-spacing: -0.02em;
  max-width: 16ch;
}

/* Work: one large card per project */
.work-list { display: grid; }
.work {
  display: grid; grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  padding: clamp(56px, 7vw, 104px) 0;
  border-top: 1px solid var(--separator-strong);   /* a clear break between projects */
}
.work:first-child { border-top: 0; padding-top: clamp(16px, 2vw, 24px); }
/* Alternate sides so consecutive projects don't look the same */
.work:nth-child(even) .work-media { order: -1; }
.work-copy h3 { font-size: clamp(2rem, 1.4rem + 2vw, 3rem); letter-spacing: -0.04em; margin: 18px 0 16px; }
.work-copy > h3:first-child { margin-top: 0; }
.work-copy p { color: var(--label-secondary); font-size: 1.0625rem; }
.work-copy .work-sub { color: var(--label); font-size: 1.25rem; font-weight: 500; letter-spacing: -0.02em; margin-top: -6px; }
.work-points { list-style: none; margin: 22px 0 28px; padding: 0; }
.work-points li {
  padding: 11px 0; border-top: 1px solid var(--separator);
  font-size: 0.9875rem; color: var(--label);
}
.work-points li:last-child { border-bottom: 1px solid var(--separator); }
.work-media { display: flex; justify-content: center; align-items: flex-start; }
.work-media .device + .device { margin-left: -48px; margin-top: 48px; }
.work-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.work-link svg { width: 16px; height: 16px; transition: transform .18s ease; }
.work-link:hover svg { transform: translateX(3px); }

/* Official App Store / Google Play badges. Same height, per both guidelines. */
.store-badges { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 28px; }
.store-badges a { display: block; transition: opacity .15s ease; }
.store-badges a:hover { opacity: 0.8; }
.store-badges img { height: 48px; width: auto; }

/* App icon above a project name */
/* A hairline edge shows the icon's shape on a white page, as on the App Store. */
.app-icon {
  width: 56px; height: 56px; border-radius: 13px;
  border: 1px solid rgba(0, 0, 0, 0.10);
}

/* Plain "what it is" line under the subtitle */
.work-copy .work-kind { color: var(--label-tertiary); font-size: 0.9375rem; margin: -4px 0 18px; }

/* Client logo on a white tile, in place of an app icon (the logo is grey) */
.client-logo {
  display: inline-flex; align-items: center;
  height: 56px; padding: 10px 14px;
  background: #ffffff; border-radius: 13px;
  border: 1px solid var(--separator);
}
.client-logo img { height: 100%; width: auto; }

/* Website screenshot in a plain browser window */
.browser {
  width: 100%;
  border-radius: 8px; overflow: hidden;
  background: #ececee;
  border: 1px solid rgba(0, 0, 0, 0.10);
}
.browser-bar {
  display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  background: #ececee;
}
.browser-bar span { width: 10px; height: 10px; border-radius: 50%; background: #c9c9cd; }
.browser-bar em {
  font-style: normal; font-size: 0.75rem; color: var(--label-tertiary);
  margin: 0 auto; padding-right: 42px;
}
.browser img { width: 100%; height: auto; }

/* What we do: four short columns under the About statement */
.services { margin-top: clamp(56px, 7vw, 96px); padding-top: clamp(40px, 5vw, 64px); border-top: 1px solid var(--separator); }
.services-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(24px, 3vw, 40px); }
.services h3 { font-size: 1.2rem; margin-bottom: 8px; }
.services p { color: var(--label-secondary); font-size: 1rem; margin: 0; }

/* Big closing call to action */
.cta-band { text-align: center; }
.cta-band h2 { max-width: 16ch; margin: 0 auto 20px; }
.cta-band p { color: var(--label-secondary); font-size: 1.125rem; max-width: 46ch; margin: 0 auto 36px; }
.cta-band .btn-row { justify-content: center; }

/* Contact */

.brief { counter-reset: brief; list-style: none; margin: 0; padding: 0; }
.brief li {
  counter-increment: brief;
  display: grid; grid-template-columns: 56px 1fr; gap: 12px;
  padding: 22px 0; border-top: 1px solid var(--separator);
}
.brief li::before {
  content: counter(brief, decimal-leading-zero) ".";
  color: var(--accent); font-weight: 600; font-size: 1.125rem;
}
.brief h4 { font-size: 1.125rem; margin-bottom: 4px; }
.brief p { color: var(--label-secondary); margin: 0; }

/* Contact form */
/* Heading and details on the left, form on the right, both above the fold */
.contact-page { padding: clamp(40px, 5vw, 72px) 0 clamp(64px, 8vw, 112px); }
.contact-layout {
  display: grid; grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(32px, 5vw, 80px); align-items: start;
}
.contact-intro h1 { font-size: clamp(2.4rem, 1.6rem + 3vw, 4rem); }
.contact-intro .lede { margin-top: 16px; color: var(--label-secondary); }
.contact-intro .contact-aside { margin-top: clamp(32px, 4vw, 48px); }
.contact-aside { display: grid; gap: 24px; }
.contact-aside h3 { font-size: 1.15rem; margin-bottom: 6px; }
.contact-aside p { color: var(--label-secondary); margin: 0; }
.contact-aside a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--label-quaternary); }
.contact-aside a:hover { text-decoration-color: var(--label); }
.form {
  scroll-margin-top: calc(var(--nav-h) + 16px);   /* /contact.html#form lands below the sticky nav */
  background: var(--card); border: 1px solid var(--separator);
  border-radius: var(--r); padding: clamp(24px, 4vw, 44px);
  display: grid; gap: 20px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 0.9375rem; font-weight: 500; color: var(--label); }
.field .optional { color: var(--label-tertiary); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit; font-size: 1rem; color: var(--label);
  background: var(--bg); border: 1px solid var(--separator-strong);
  border-radius: var(--r-btn); padding: 13px 14px;
  transition: border-color .15s ease;
}
.field textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
.field select {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-opacity='.55' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
}
.field ::placeholder { color: var(--label-quaternary); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--label);
}
.field [aria-invalid="true"] { border-color: #d93025; }
.form-foot { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.form-foot p { margin: 0; }
.form-foot a { text-decoration: underline; text-underline-offset: 3px; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.form-status {
  border-radius: var(--r-inner); padding: 14px 16px; font-size: 0.9375rem;
  border: 1px solid var(--separator-strong); background: var(--fill);
}
.form-status.ok { border-color: rgba(52, 199, 89, 0.5); background: rgba(52, 199, 89, 0.10); }
.form-status.err { border-color: rgba(255, 107, 107, 0.5); background: rgba(255, 107, 107, 0.10); }
.form .cf-turnstile { margin-top: -12px; }   /* "interaction-only": usually empty, so don't leave a full gap */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Case study pages (/work/…): white, with a hairline between sections. */
.case-gallery { margin-top: clamp(40px, 5vw, 64px); }
.case-head + .case-band, .case-band + .case-band { border-top: 1px solid var(--separator); }

.case-band { padding: clamp(64px, 8vw, 120px) 0; }
.case-band .eyebrow { margin-bottom: 20px; }

.case-head { padding: clamp(40px, 5vw, 64px) 0 clamp(48px, 6vw, 80px); }
.back-link { display: inline-block; color: var(--label-tertiary); font-size: 0.9375rem; margin-bottom: clamp(28px, 4vw, 44px); }
.back-link:hover { color: var(--label); }
.case-head-grid { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: clamp(32px, 6vw, 96px); align-items: end; }
.case-title { display: flex; align-items: center; gap: 20px; }
.case-title .app-icon { width: 72px; height: 72px; border-radius: 16px; }
.case-title h1 { font-size: clamp(2.6rem, 1.8rem + 3vw, 4rem); }
.case-sub { margin: 4px 0 0; font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem); color: var(--label-secondary); letter-spacing: -0.02em; }
.case-intro { margin: 28px 0 28px; font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem); line-height: 1.55; max-width: 46ch; color: var(--label); }
.case-head .store-badges { margin-top: 0; }
.case-facts { margin: 0; display: grid; gap: 0; }
.case-facts > div { padding: 14px 0; border-top: 1px solid var(--separator); }
.case-facts > div:last-child { border-bottom: 1px solid var(--separator); }
.case-facts dt { font-size: 0.8125rem; color: var(--label-tertiary); margin-bottom: 2px; }
.case-facts dd { margin: 0; font-weight: 500; }

/* Plain screenshots: rounded like the phone screen, hairline edge, no frame */
.gallery { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(12px, 2vw, 24px); }
.gallery-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.shot { margin: 0; }
.shot img { width: 100%; height: auto; border-radius: clamp(14px, 2vw, 24px); border: 1px solid var(--separator); background: #fff; }
.shot figcaption { font-size: 0.8125rem; color: var(--label-tertiary); margin-top: 10px; }
.case-head + .case-band { padding-top: clamp(48px, 6vw, 80px); }

/* Text on the left, one screenshot or logo on the right. The text column
   carries the section's detail (lists, pillars) so it's as tall as the image. */
.split-aside { display: grid; grid-template-columns: 1fr 260px; gap: clamp(32px, 6vw, 96px); align-items: center; }
.split-aside .case-statement { margin-bottom: clamp(28px, 3.5vw, 44px); }
.split-aside-wide { grid-template-columns: 1fr 440px; }
.shot-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.shot-trio { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.split-aside-wide:has(.shot-trio) { grid-template-columns: 1fr 560px; }
.client-mark { display: flex; justify-content: center; }
.client-mark img { width: 100%; max-width: 240px; height: auto; }

/* What changes with your madhab */
.changes { margin: 0; border-top: 1px solid var(--separator); }
.changes > div { display: grid; grid-template-columns: 160px 1fr; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--separator); }
.changes dt { font-weight: 600; }
.changes dd { margin: 0; color: var(--label-secondary); }

.features-gallery { margin-top: clamp(48px, 6vw, 80px); }
.pillars.pillars-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }

.case-statement {
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.4rem); line-height: 1.3; letter-spacing: -0.03em;
  font-weight: 500; max-width: 30ch; margin: 0 0 clamp(40px, 5vw, 64px);
}
.case-statement-sm { font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.75rem); max-width: 40ch; }

.pillars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.pillars > div { padding-top: 18px; border-top: 2px solid var(--label); }
.pillars h3 { font-size: 1.25rem; margin-bottom: 8px; }
.pillars p { color: var(--label-secondary); margin: 0; }


.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 3.5vw, 48px) clamp(24px, 4vw, 56px); }
.feature { display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; }
.feature-icon { color: #6A5ACD; display: block; }
.feature-icon svg { width: 36px; height: 36px; display: block; margin-top: 2px; }
.feature h3 { font-size: 1.15rem; margin-bottom: 6px; }
.feature p { color: var(--label-secondary); font-size: 0.975rem; line-height: 1.6; margin: 0; }

.design-grid {
  display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(24px, 5vw, 80px);
  padding: clamp(36px, 4vw, 56px) 0; border-top: 1px solid var(--separator);
}
.design-grid h3 { margin-bottom: 10px; }
.design-grid p { font-size: 1.0625rem; line-height: 1.65; max-width: 44ch; }
.swatch-head { font-size: 0.875rem; color: var(--label-tertiary); font-weight: 500; margin: 0 0 10px; }
.swatch-head + .swatches { margin-bottom: 22px; }
.swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.swatch span { display: block; aspect-ratio: 16 / 10; border-radius: 10px; margin-bottom: 8px; }
.swatches-sm .swatch span { aspect-ratio: 16 / 7; }
.swatch b { display: block; font-weight: 600; font-size: 0.9375rem; }
.swatch code { font-size: 0.8125rem; color: var(--label-tertiary); }
.icon-row {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px 8px;
  padding: 20px 16px; border-radius: 12px;
}
.icon-row + .icon-row { margin-top: 10px; }
.icon-row figure { margin: 0; text-align: center; }
.icon-row svg { width: 32px; height: 32px; margin: 0 auto 6px; display: block; }
.icon-row figcaption { font-size: 0.75rem; opacity: 0.8; }
.on-light { background: #ffffff; border: 1px solid var(--separator); }
.on-dark { background: #121212; }
.artwork { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 18px; border-radius: 12px; }
.artwork + .artwork { margin-top: 10px; }
.artwork img { width: 100%; max-width: 100px; height: auto; margin: 0 auto; }

/* Cropped detail from a real screenshot, on a white card */
.crop { margin: 0; background: #ffffff; border: 1px solid var(--separator); border-radius: 12px; padding: clamp(16px, 3vw, 32px); }
.crop img { width: 100%; height: auto; display: block; }
.crop-narrow img { max-width: 420px; margin: 0 auto; }

.ratings { display: flex; gap: clamp(32px, 6vw, 80px); margin-bottom: clamp(32px, 4vw, 56px); }
.ratings b { display: flex; align-items: center; gap: 0.12em; font-size: clamp(2.6rem, 2rem + 2.4vw, 4rem); font-weight: 600; letter-spacing: -0.05em; line-height: 1; margin-bottom: 8px; }
.ratings span { color: var(--label-tertiary); font-size: 0.9375rem; }
.star { color: #ffb400; flex: none; }
.ratings .star { width: 0.7em; height: 0.7em; }
.rating-line .star { display: inline-block; width: 1em; height: 1em; vertical-align: -0.125em; margin-right: 0.2em; }
.quotes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 3.5vw, 48px) clamp(24px, 4vw, 48px); }
.quote { margin: 0; padding-top: 20px; border-top: 1px solid var(--separator-strong); }
.quote blockquote { margin: 0 0 14px; font-size: 1.0625rem; line-height: 1.55; letter-spacing: -0.01em; }
.quote figcaption { font-size: 0.875rem; color: var(--label-tertiary); }
.quote figcaption b { display: block; color: var(--label); font-weight: 600; }
.work-copy .work-link + .store-badges { margin-top: 20px; }

/* Legal pages */
.prose { max-width: var(--wrap-narrow); }
.prose h2 { font-size: 1.6rem; letter-spacing: -0.03em; margin: 48px 0 14px; }
.prose h3 { font-size: 1.15rem; margin: 28px 0 10px; }
.prose p, .prose li { color: var(--label-secondary); }
.prose ul { padding-left: 20px; margin: 0 0 1em; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--label); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--label-quaternary); }
.prose a:hover { text-decoration-color: var(--label); }
.prose strong { color: var(--label); font-weight: 600; }
.callout {
  background: var(--card); border: 1px solid var(--separator);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-inner); padding: 16px 20px;
  color: var(--label-secondary); font-size: 0.9375rem;
  margin-bottom: 32px;
}
.updated { color: var(--label-tertiary); font-size: 0.9375rem; margin-top: 18px; }

/* --------------------------------------------------------------------------
   7. Device frame (same component as the Gymwise site)
   -------------------------------------------------------------------------- */

.device {
  position: relative;
  width: 280px; flex: none;
  background: #0b0b0c;
  border-radius: 50px;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.hero .device { border-color: rgba(255, 255, 255, 0.10); }
.device::after {
  content: ""; position: absolute; right: -2px; top: 140px;
  width: 3px; height: 58px; border-radius: 3px; background: #2c2c2e;
}
.device-screen {
  position: relative;
  border-radius: 40px;
  overflow: hidden;
  background: #000;
}
.device-screen img { display: block; width: 100%; height: auto; }
.device .di-pill {
  position: absolute; top: 1.15%; left: 50%; transform: translateX(-50%);
  width: 28.41%;
  aspect-ratio: 375 / 111;
  background: #000; border-radius: 999px;
  z-index: 2;
}
.device-sm { width: 236px; border-radius: 44px; padding: 9px; }
.device-sm .device-screen { border-radius: 36px; }
.device-sm::after { top: 118px; height: 48px; }

/* Apple Watch frame: flat, like the phones (no gradients or shadows) */
.awatch { position: relative; flex: none; width: 128px; display: flex; flex-direction: column; align-items: center; }
.awatch-band { width: 58%; background: #3a3b40; }
.awatch-band-top { height: 56px; border-radius: 16px 16px 4px 4px; margin-bottom: -18px; }
.awatch-band-bottom { height: 66px; border-radius: 4px 4px 18px 18px; margin-top: -18px; }
.awatch-case {
  position: relative; z-index: 1; width: 100%;
  border-radius: 30% / 25%; padding: 6px;
  background: #0b0b0c; border: 1px solid rgba(0, 0, 0, 0.14);
}
.awatch-crown { position: absolute; right: -5px; top: 30%; width: 5px; height: 22px; border-radius: 3px; background: #3a3b40; }
.awatch-screen { aspect-ratio: 352 / 430; border-radius: 24.5% / 20.5%; overflow: hidden; background: #000; }
.awatch-screen img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* On the Gymwise card the watch sits in front of the phones, bottom right */
.work-media { position: relative; }
.work-watch { position: absolute; right: -44px; bottom: -16px; z-index: 3; }

/* --------------------------------------------------------------------------
   8. Footer — the old site's layout: centred wordmark, four columns,
      copyright and legal on a hairline underneath.
   -------------------------------------------------------------------------- */

.footer { border-top: 0; }
.footer-mark {
  display: flex; justify-content: center;
  padding: clamp(80px, 10vw, 150px) 0 clamp(64px, 8vw, 110px);
}
.footer-mark .wordmark { height: 22px; }
.footer-cols {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px);
  padding-bottom: clamp(64px, 8vw, 120px);
}
.footer-col h4 {
  font-size: clamp(1.3rem, 1.1rem + 0.6vw, 1.6rem);
  font-weight: 600; letter-spacing: -0.04em;
  color: var(--label-tertiary);
  margin-bottom: 22px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 0 0 8px; }
.footer-col li, .footer-col a {
  color: var(--white);
  font-size: clamp(1.1rem, 1rem + 0.35vw, 1.3rem);
  font-weight: 400; letter-spacing: -0.025em;
}
.footer-col a:hover { color: var(--label-secondary); }

.footer-bottom {
  border-top: 1px solid var(--separator);
  padding: 40px 0 48px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.footer-copyright { font-size: 0.9375rem; font-weight: 500; color: var(--label-secondary); letter-spacing: -0.02em; }
.footer-copyright { display: grid; gap: 4px; }
.footer-company { font-size: 0.8125rem; font-weight: 400; color: var(--label-tertiary); }
.footer-legal { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer-legal a { font-size: 0.9375rem; color: var(--label-quaternary); letter-spacing: -0.02em; }
.footer-legal a:hover { color: var(--label-secondary); }
.footer-legal .sep { width: 2px; height: 16px; background: var(--label-secondary); border-radius: 1px; }

/* Back-to-top button, bottom right */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  width: 36px; height: 36px; border-radius: 999px;
  display: grid; place-items: center;
  background: #e8e8ed; color: var(--label);
  border: 0; cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, background-color .15s ease;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { background: #dcdce1; }
.to-top svg { width: 14px; height: 14px; }

/* --------------------------------------------------------------------------
   9. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1000px) {
  .work { grid-template-columns: 1fr; }
  .work-media { order: -1; }
  .work-watch { right: 0; }
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 48px; }
}

@media (max-width: 860px) {
  :root { --nav-h: 64px; }
  .nav-links { display: none; }
  .nav-toggle { display: grid; }

  .hero { min-height: 0; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-media { transform: rotate(-6deg); margin-top: 24px; }
  .hero-media .device { width: 220px; border-radius: 40px; padding: 8px; }
  .hero-media .device .device-screen { border-radius: 32px; }

  .statement { grid-template-columns: 1fr; }
  .statement h2 { max-width: none; }
  .statement .lede { max-width: none; }
  .steps { grid-template-columns: 1fr; gap: 36px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 48px; }
  .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .design-grid { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-head-grid { grid-template-columns: 1fr; align-items: start; }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split-aside { grid-template-columns: 1fr 200px; }
  .split-aside-wide, .split-aside-wide:has(.shot-trio) { grid-template-columns: 1fr; }
  .shot-trio { max-width: 560px; }
  .features, .quotes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-layout { grid-template-columns: 1fr; gap: 0; }
  /* Phones: heading, then the form, then the email details */
  .contact-intro { display: contents; }
  .contact-intro .eyebrow { margin-bottom: 10px; }
  .contact-intro .contact-aside { order: 3; margin-top: 36px; }
  .contact-layout > .form { order: 2; margin-top: 28px; }
  .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .nav-sheet { padding: 8px 16px 16px; }
  .btn { width: 100%; }
  .btn-row { flex-direction: column; align-items: stretch; }
  .hero-media .device { width: 168px; border-radius: 32px; padding: 6px; }
  .hero-media .device .device-screen { border-radius: 26px; }
  .hero-media .device:last-child { margin-left: -40px; margin-top: 44px; }
  .work-media .device { width: 180px; border-radius: 34px; padding: 7px; }
  .work-media .device .device-screen { border-radius: 27px; }
  .work-media .device + .device { margin-left: -36px; margin-top: 36px; }
  .work-watch { width: 96px; right: -4px; bottom: -8px; }
  .awatch-band-top { height: 42px; } .awatch-band-bottom { height: 50px; }
  .device::after { display: none; }
  .brand .wordmark { height: 11px; }
  .footer-mark .wordmark { height: 18px; }
  .footer-cols { grid-template-columns: 1fr; }
  .footer-legal { margin-left: 0; }
  .services-grid { grid-template-columns: 1fr; }
  .features, .quotes, .pillars { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 62%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .gallery .shot { scroll-snap-align: start; }
  .gallery-3 { grid-auto-columns: 46%; }
  .split-aside { grid-template-columns: 1fr; }
  .split-aside .shot { max-width: 240px; }
  .split-aside-wide { grid-template-columns: 1fr; }
  .shot-pair { max-width: 420px; }
  .shot-trio { max-width: none; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 62%; overflow-x: auto; scroll-snap-type: x mandatory; }
  .client-mark { justify-content: flex-start; }
  .client-mark img { max-width: 160px; }
  .changes > div { grid-template-columns: 1fr; gap: 4px; }
  .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .icon-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

@media print {
  .nav, .footer, .to-top { display: none; }
  body { background: #fff; color: #000; }
}
