/* Island Modern — deep-ocean band over a sand ground; one coral accent; rounded white "paper" panels */
:root {
  --sand: #F6F1E9;        /* page ground */
  --paper: #FFFFFF;       /* panels */
  --band: #0D3B44;        /* hero / footer band */
  --on-band: #F6F1E9;
  --on-band-soft: #C9DCDA;
  --mist: #8FD3C9;        /* eyebrow text on band */
  --ink: #0D3B44;         /* headings + body */
  --muted: #3F5E64;
  --lagoon: #0E7C70;      /* figures, labels */
  --coral: #FF8A65;       /* the one accent */
  --on-coral: #0D3B44;
  --line: #E3DACB;
  --chip-line: #3E6A72;
  --shadow: 0 12px 40px rgba(13, 59, 68, 0.12);

  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Helvetica Neue", Arial, system-ui, sans-serif;

  --step-hero: clamp(2.6rem, 6.4vw, 6.25rem);
  --step-h1: clamp(2.4rem, 5.6vw, 5.5rem);
  --step-h2: clamp(1.9rem, 3.4vw, 3.25rem);
  --step-h3: clamp(1.4rem, 2.2vw, 2rem);
  --step-fig: clamp(2.8rem, 5vw, 4.25rem);
  --radius: 28px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sand: #0A2227; --paper: #10323A; --band: #061719; --on-band: #EEF4F2; --on-band-soft: #B5CCCB;
    --mist: #8FD3C9; --ink: #EAF2F0; --muted: #A9C2C3; --lagoon: #6CD0C0; --coral: #FF9A7A;
    --on-coral: #0D3B44; --line: #1F4A52; --chip-line: #3E6A72; --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sand: #0A2227; --paper: #10323A; --band: #061719; --on-band: #EEF4F2; --on-band-soft: #B5CCCB;
  --mist: #8FD3C9; --ink: #EAF2F0; --muted: #A9C2C3; --lagoon: #6CD0C0; --coral: #FF9A7A;
  --on-coral: #0D3B44; --line: #1F4A52; --chip-line: #3E6A72; --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--sand); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; line-height: 1; margin: 0; text-wrap: balance; }
p { margin: 0; }
.wrap {
  max-width: 1240px; margin: 0 auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--paper); padding: 8px 12px; z-index: 20; }

/* Band (hero + footer) */
.band { background: var(--band); color: var(--on-band); }
.nav { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; padding-block: 24px; }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.35rem; text-decoration: none; }
.nav ul { display: flex; flex-wrap: wrap; gap: 6px 24px; list-style: none; margin: 0; padding: 0; align-items: center; font-size: 0.95rem; }
.nav a { text-decoration: none; }
.nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--coral); }
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--coral); color: var(--on-coral); text-decoration: none; font-weight: 600; padding: 12px 20px; border-radius: 999px; }
.btn:hover { filter: brightness(1.05); text-decoration: none !important; }
.eyebrow { font-size: 0.95rem; color: var(--mist); }
.label { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lagoon); }

.hero { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-end; padding-block: 56px 96px; }
.hero-copy { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hero h1 { font-size: var(--step-hero); line-height: 0.96; letter-spacing: -0.04em; }
.hero h1 em { font-style: normal; color: var(--coral); }
.hero p { max-width: 40em; font-size: 1.15rem; color: var(--on-band-soft); }
.portrait { flex: 0 1 300px; aspect-ratio: 300 / 380; max-width: 100%; object-fit: cover; object-position: top; border-radius: 160px 160px 24px 24px; }
.meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.95rem; }
.meta span { border: 1px solid var(--chip-line); border-radius: 999px; padding: 8px 14px; }

/* Main sections */
main { display: flex; flex-direction: column; gap: 96px; padding-bottom: 96px; }
.section { display: flex; flex-direction: column; gap: 28px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; }
.section h2 { font-size: var(--step-h2); }
.lede { max-width: 40em; font-size: 1.1rem; color: var(--muted); }

.panel { background: var(--paper); border-radius: var(--radius); }
/* Stat grids always fill every row: set the column count by item count (cols-2/3/4/6) */
.stats { margin-top: -48px; padding: 40px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 32px; box-shadow: var(--shadow); position: relative; text-align: center; }
.stats.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.stat b { font-family: var(--display); font-weight: 800; font-size: var(--step-fig); letter-spacing: -0.03em; line-height: 1.05; color: var(--lagoon); font-variant-numeric: tabular-nums; }
.stat span { font-weight: 600; }
.stat small { font-size: 0.9rem; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 24px; }
.card { text-decoration: none; overflow: hidden; display: flex; flex-direction: column; transition: transform 0.2s ease; }
.card:hover { transform: translateY(-3px); }
.card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-body { padding: 28px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { font-size: var(--step-h3); }
.card p { color: var(--muted); }
.card .more { margin-top: auto; padding-top: 8px; font-weight: 600; }
.card-figure { aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; background: var(--band); color: var(--coral); font-family: var(--display); font-weight: 800; font-size: clamp(3.5rem, 8vw, 6rem); letter-spacing: -0.04em; }

.ai { background: var(--coral); color: var(--on-coral); border-radius: var(--radius); padding: clamp(28px, 5vw, 56px); display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.ai-copy { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.ai h2 { font-size: var(--step-h2); }
.ai .label { color: var(--on-coral); }
.ai > img { flex: 0 1 260px; border-radius: 20px; }
.ai-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ai-stats.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .ai-stats.cols-3 { grid-template-columns: minmax(0, 1fr); } }
.ai-stats div { background: rgba(255, 255, 255, 0.35); border-radius: 16px; padding: 14px 16px; }
.ai-stats b { display: block; font-family: var(--display); font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.ai a { font-weight: 600; }
.ai.alt { background: var(--band); color: var(--on-band); }
.ai.alt .label { color: var(--coral); }
.ai.alt .ai-stats div { background: rgba(255, 255, 255, 0.08); }

.split { display: flex; flex-wrap: wrap; gap: 48px; }
.split > * { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.split > .wide { flex-grow: 2; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.chips li { background: var(--paper); padding: 12px 18px; border-radius: 999px; font-weight: 500; }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.plain-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.plain-list li span { display: block; font-size: 0.9rem; color: var(--muted); }

.cta { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; padding-block: 56px; }
.cta h2 { font-size: var(--step-h2); }
.email { font-family: var(--display); font-weight: 800; font-size: clamp(1.4rem, 3vw, 2.2rem); color: var(--on-band); }
.footer-small { padding-block: 0 32px; font-size: 0.85rem; color: var(--on-band-soft); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* Case study pages */
.case-hero { padding-block: 48px 120px; display: flex; flex-direction: column; gap: 24px; }
.case-hero h1 { font-size: var(--step-h1); max-width: 18ch; line-height: 0.98; letter-spacing: -0.04em; }
.case-hero h1 em { font-style: normal; color: var(--coral); }
.case-hero .standfirst { max-width: 40em; font-size: 1.15rem; color: var(--on-band-soft); }
.lift { margin-top: -88px; border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; position: relative; }
.lift-panel { margin-top: -88px; position: relative; box-shadow: var(--shadow); }
.prose { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 48px; }
.prose > div { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.prose h2 { font-size: clamp(1.7rem, 3vw, 2.6rem); }
.prose p { color: var(--muted); font-size: 1.08rem; max-width: 36em; }
.steps { padding: clamp(28px, 5vw, 56px); display: flex; flex-direction: column; gap: 28px; }
.steps h2 { font-size: var(--step-h2); }
.steps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 24px 40px; counter-reset: step; }
.steps ol.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.steps ol.cols-1 { grid-template-columns: minmax(0, 1fr); max-width: 52em; }
@media (max-width: 960px) { .steps ol.cols-3 { grid-template-columns: minmax(0, 1fr); } }
.steps li { display: grid; grid-template-columns: 40px 1fr; gap: 16px; counter-increment: step; }
.steps li::before { content: counter(step); width: 40px; height: 40px; border-radius: 20px; background: var(--coral); color: var(--on-coral); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.steps li b { display: block; font-size: 1.1rem; margin-bottom: 4px; }
.steps li span { color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 24px; }
.gallery figure { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.gallery img { border-radius: 20px; width: 100%; }
.feature { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.feature img { border-radius: 20px; width: 100%; max-width: 800px; }
.feature figcaption { font-size: 0.9rem; color: var(--muted); }
.gallery.even img { aspect-ratio: 4 / 3; object-fit: cover; object-position: center bottom; }
.gallery figcaption { font-size: 0.9rem; color: var(--muted); }
.skills-row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }
.skills-row h2 { font-size: 1.6rem; margin-right: 8px; }
.next-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 24px; }
.next-row a { text-decoration: none; padding: 36px; display: flex; flex-direction: column; gap: 8px; }
.next-row strong { font-family: var(--display); font-size: clamp(1.5rem, 2.6vw, 2.2rem); letter-spacing: -0.02em; line-height: 1.1; }
.next-row .dark { background: var(--band); color: var(--on-band); border-radius: var(--radius); }
.next-row .dark .label { color: var(--coral); }
.archive { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1080px) { .archive { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .archive { grid-template-columns: minmax(0, 1fr); } }
.archive article { padding: 28px; display: flex; flex-direction: column; gap: 8px; }
.archive h3 { font-size: 1.45rem; letter-spacing: -0.02em; }
.archive p { color: var(--muted); font-size: 0.98rem; }
.note { font-size: 0.9rem; color: var(--muted); }

@media (max-width: 960px) {
  .stats.cols-6, .stats.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats.cols-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .stats, .stats.cols-2, .stats.cols-4, .stats.cols-6 { grid-template-columns: minmax(0, 1fr); }
}

/* Phone mockup around a real app screenshot */
.phone { flex: 0 1 280px; max-width: 100%; aspect-ratio: 1320 / 2868; padding: 10px; border-radius: 48px; background: #101418; box-shadow: 0 24px 48px rgba(13, 59, 68, 0.28), inset 0 0 0 2px #2A3036; }
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 38px; }
.phones { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(16px, 4vw, 48px); padding: clamp(28px, 5vw, 56px); }
.phones .phone { flex-basis: 260px; }

@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover { transform: none; } }
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding-block: 32px 72px; }
  .stats { padding: 28px; }
  /* Nav: brand on its own line, links spread across one row with a compact Contact pill */
  .nav ul { width: 100%; flex-wrap: nowrap; justify-content: space-between; gap: 12px; font-size: 0.875rem; }
  .nav .btn { padding: 8px 14px; }
  /* Homepage: the portrait lives on About at phone width; About shows it first, smaller */
  .portrait.hide-sm { display: none; }
  .portrait.lead-sm { order: -1; flex-basis: 180px; width: 180px; }
}
/* A hero followed by a panel that overlaps it (.lift-panel, -88px) needs that much extra room below its text */
.hero.lifted { padding-bottom: 152px; }
