:root {
  --bg: #0b1215;
  --teal: #2e8996;
  --teal-2: #1f6872;
  --teal-3: #143c46;
  --accent: #8fcbd4;
  --cap: #7fa8af;
  --dim: rgba(255, 255, 255, .75);
  --line: rgba(255, 255, 255, .16);
  --light: #f2f5f5;
  --light-cap: #4f7178;
  --light-dim: #3e5055;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Figtree", system-ui, sans-serif;
  --gutter: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; font: 400 16px/1.5 var(--sans); color: #fff; -webkit-font-smoothing: antialiased; }
img, svg, canvas { display: block; max-width: 100%; }
h1, h2, h3, h4, p, dl, dd, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

.container { width: min(100% - 2 * var(--gutter), 1320px); margin-inline: auto; }
.skip { position: absolute; left: -9999px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { left: 16px; top: 16px; z-index: 50; background: #fff; color: var(--bg); padding: 8px 14px; }

/* Type */
.caption { display: block; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--cap); }
.h1 { font: 400 clamp(44px, 6.4vw, 100px)/1.02 var(--serif); letter-spacing: -.01em; }
.h2 { font: 400 clamp(40px, 5vw, 76px)/1.02 var(--serif); letter-spacing: -.01em; }
.h3 { font: 400 clamp(32px, 3.4vw, 52px)/1.04 var(--serif); letter-spacing: -.01em; }
.k { color: var(--accent); }
.lead { font-size: clamp(17px, 1.35vw, 20px); font-weight: 300; line-height: 1.55; color: var(--dim); }
.dim { color: var(--dim); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 20px; border: 1px solid rgba(255, 255, 255, .55); border-radius: 999px;
  font-size: 12.8px; letter-spacing: 1px; text-transform: uppercase;
  transition: background-color .25s, color .25s, border-color .25s;
}
.btn:hover { background: #fff; color: var(--bg); border-color: #fff; }
.btn svg { width: 12px; height: 12px; }

/* Nav */
.nav { position: absolute; inset: 0 0 auto; z-index: 20; }
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 92px; }
.nav-logo > * { width: 156px; height: auto; }
/* Reset the popover's browser styles so it reads as a plain nav on wider screens. */
.nav-links { display: flex; gap: 6px; position: static; inset: auto; width: auto; height: auto; margin: 0; padding: 0; border: 0; overflow: visible; color: inherit; background: none; }
/* Phone menu: two-line icon that turns into an X once the menu is open. */
.menu-btn, .menu-close { display: none; position: relative; width: 44px; height: 44px; margin-right: -10px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
:is(.menu-btn, .menu-close)::before, :is(.menu-btn, .menu-close)::after { content: ""; position: absolute; left: 10px; right: 10px; top: calc(50% - .75px); height: 1.5px; background: currentColor; }
:is(.menu-btn, .menu-close)::before { transform: translateY(-4px); }
:is(.menu-btn, .menu-close)::after { transform: translateY(4px); }
.nav-links:popover-open .menu-close::before { transform: rotate(45deg); }
.nav-links:popover-open .menu-close::after { transform: rotate(-45deg); }
.menu-mark { display: none; }
.nav-links a { padding: 8px 18px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; opacity: .9; }
.nav-links a:hover { opacity: 1; color: var(--accent); }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(38% 52% at 80% 62%, rgba(46, 137, 150, .34), transparent 72%),
    radial-gradient(34% 42% at 28% 100%, rgba(31, 104, 114, .30), transparent 72%),
    radial-gradient(40% 50% at 0% 0%, rgba(20, 60, 70, .55), transparent 70%),
    var(--bg);
}
.hero .container { min-height: 100svh; display: grid; align-content: start; padding-top: clamp(150px, 24vh, 230px); }
.hero .caption { margin-bottom: 22px; }
.hero-side { justify-self: end; width: min(100%, 420px); margin-top: clamp(40px, 7vh, 80px); }
.hero-side .btn { margin-top: 26px; }

/* Section heads */
.section { padding-block: clamp(96px, 12vw, 170px); }
.section-head { display: flex; align-items: center; gap: 24px; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Featured work: sticky stacking cards */
.work-list { display: grid; gap: 7vh; }
.work-card {
  position: sticky; top: 5vh; height: 90vh; overflow: hidden;
  display: grid; grid-template-rows: auto 1fr auto; gap: 24px; padding: clamp(20px, 3vw, 40px);
  background: var(--card);
  box-shadow: 0 -30px 60px -30px rgba(0, 0, 0, .8);
}
.work-card::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(11, 18, 21, .94)); pointer-events: none; }
.work-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; position: relative; z-index: 2; }
.work-top > :last-child { margin-left: auto; }
/* Logos keep their own colours, so they sit on a light tile. */
.work-logo { display: grid; place-items: center; height: 48px; padding: 0 14px; border-radius: 8px; background: var(--light); }
.work-logo img { height: auto; }
/* The mockup is white, so it must never sit under the white title: it gets its own row and is cropped if the row is short. */
.work-visual { position: relative; z-index: 1; align-self: center; justify-self: center; width: min(100%, 900px); max-height: 100%; overflow: hidden; border-radius: 10px; }
@media (max-height: 940px) { .work-visual .ui { zoom: .8; } }
@media (max-height: 640px) { .work-visual .ui { zoom: .65; } }
.work-meta { position: relative; z-index: 2; display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: end; }
.work-title { font: 400 clamp(48px, 7.5vw, 116px)/.95 var(--serif); letter-spacing: -.015em; }
.work-meta p { color: var(--dim); max-width: 30em; }
.work-meta .btn { margin-top: 20px; }
.card-melody { --card: radial-gradient(70% 70% at 50% 35%, #2a7f8a, #11343b 60%, #0d1d21); }
.card-kick { --card: radial-gradient(70% 70% at 50% 35%, #8a5a3c, #3a2418 60%, #1a120e); }
.card-diamond { --card: radial-gradient(70% 70% at 50% 35%, #5d7690, #22303e 60%, #121a22); }
.card-solar { --card: radial-gradient(70% 70% at 50% 35%, #a07a2c, #3a3016 60%, #15140c); }

/* UI mockups (illustrations inside work cards) */
.ui {
  --line-ui: #e6e9ea;
  background: #fff; color: var(--bg); border-radius: 10px; overflow: hidden;
  font-size: 13px; line-height: 1.4; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .7);
}
.ui-top { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line-ui); }
.ui-top b { font-weight: 600; font-size: 14px; }
.ui-top .push { margin-left: auto; }
.ui-chip { border: 1px solid var(--line-ui); border-radius: 6px; padding: 4px 10px; color: #4a5a5e; }
.ui-mute { color: #6b7b7f; }
.ui-body { padding: 18px; display: grid; gap: 14px; min-width: 0; }
.ui-grid { display: grid; grid-template-columns: 180px 1fr; }
.ui-side { display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; border-right: 1px solid var(--line-ui); background: #f7f9f9; }
.ui-side span { padding: 7px 10px; border-radius: 6px; color: #6b7b7f; }
.ui-side .on { background: var(--bg); color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 10px; }
.box { border: 1px solid var(--line-ui); border-radius: 8px; padding: 12px 14px; min-width: 0; }
.box small { display: block; color: #6b7b7f; }
.kpis strong { display: block; margin-top: 4px; font-size: 17px; font-weight: 600; white-space: nowrap; }
.row-2 { display: grid; grid-template-columns: 1fr 1.5fr; gap: 14px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; margin-top: 14px; }
.bars span { flex: 1; height: var(--v); background: #b9dce1; border-radius: 3px 3px 0 0; }
.bars span:last-child { background: var(--teal-2); }
.bars-x { display: flex; gap: 8px; margin-top: 6px; color: #6b7b7f; font-size: 11px; }
.bars-x span { flex: 1; text-align: center; }
.ui table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.ui th { text-align: left; font-weight: 500; color: #6b7b7f; padding: 6px 8px 6px 0; }
.ui td { padding: 8px 8px 8px 0; border-top: 1px solid var(--line-ui); }
.ui .num { text-align: right; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; background: #e3f1e6; color: #1f6b35; }
.pill.wait { background: #fff1c2; color: #6e5200; }
.products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.product .shot { aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; background: var(--shot, #f1ece6); }
.product .shot svg { width: 74%; }
.product b { display: block; margin-top: 8px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips span { border: 1px solid var(--line-ui); border-radius: 999px; padding: 3px 10px; color: #4a5a5e; }
.chips .on { background: var(--bg); border-color: var(--bg); color: #fff; }
.ui-btn { margin-left: auto; background: var(--bg); color: #fff; border-radius: 6px; padding: 6px 12px; }
.area { width: 100%; height: 130px; margin-top: 10px; }

/* Solutions: light section with a sticky point-cloud stage */
.solutions { background: var(--light); color: var(--bg); }
.solutions .caption { color: var(--light-cap); }
.solutions .lead { color: var(--light-dim); }
.solutions-intro { padding-block: clamp(110px, 14vw, 190px) clamp(20px, 4vw, 40px); display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px 80px; align-items: end; }
.solutions-intro .caption { grid-column: 1 / -1; }
.solutions-track { position: relative; }
.stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.stage canvas { position: absolute; left: 50%; top: 46%; width: min(78vw, 640px); height: auto; aspect-ratio: 1; transform: translate(-50%, -50%); }
.tabs { position: absolute; right: var(--gutter); bottom: 12vh; display: flex; gap: 22px; font-size: 14px; }
.tabs a { color: var(--light-dim); padding-bottom: 4px; border-bottom: 1px solid transparent; }
.tabs a[aria-current="true"] { color: var(--bg); border-color: var(--bg); }
.panels { position: relative; margin-top: -100svh; pointer-events: none; }
.panel { height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 12vh; }
.panel > * { max-width: 440px; pointer-events: auto; }
.panel .h3 { margin: 14px 0 16px; }
.panel p { color: var(--light-dim); }

/* Founder */
.about { background: radial-gradient(40% 60% at 100% 30%, rgba(46, 137, 150, .22), transparent 70%), var(--bg); }
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px clamp(48px, 8vw, 140px); align-items: start; }
.about .h2 { margin-top: 22px; }
.facts { margin-top: 40px; }
.facts div { display: grid; grid-template-columns: 130px 1fr; gap: 20px; padding: 16px 0; border-top: 1px solid var(--line); }
.facts dt { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--cap); padding-top: 3px; }

/* Clients */


/* Footer */
.footer {
  padding-top: clamp(100px, 12vw, 170px); padding-bottom: 40px;
  background: radial-gradient(45% 60% at 10% 100%, rgba(46, 137, 150, .3), transparent 72%), var(--bg);
}
.footer-top { display: grid; grid-template-columns: 1.2fr 1fr; gap: 64px; }
.footer-title { font: 400 clamp(40px, 4.2vw, 64px)/1.04 var(--serif); margin-bottom: 26px; }
.footer-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.footer-cols .caption { margin-bottom: 16px; }
.footer-cols a { display: block; font-size: 21px; line-height: 1.75; }
.footer-cols a:hover { color: var(--accent); }
.footer-bottom { margin-top: clamp(80px, 10vw, 140px); display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 24px; }
.footer-logo { width: min(100%, 440px); }
.footer-bottom p { font-size: 14px; color: var(--dim); text-align: right; }

/* Case study */
.case-hero { background: radial-gradient(40% 55% at 85% 60%, rgba(46, 137, 150, .3), transparent 72%), var(--bg); }
.case-hero .container { padding-top: clamp(150px, 22vh, 210px); padding-bottom: clamp(64px, 9vw, 120px); }
.case-hero .h1 { margin-top: 22px; }
.case-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px clamp(48px, 8vw, 140px); margin-top: clamp(40px, 6vw, 72px); }
.case-visual { padding: clamp(24px, 6vw, 80px); background: var(--card); }
.modules { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(40px, 7vw, 120px); }
.modules > div { border-top: 1px solid var(--line); padding-block: 28px 44px; }
.modules p { margin-top: 12px; color: var(--dim); max-width: 30em; }
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; position: relative; }
.flow::before { content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 1px; background: var(--line); }
.flow li { position: relative; padding-top: 40px; }
.flow li::before { content: ""; position: absolute; top: 0; left: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); }
.flow h3 { font: 400 28px/1.1 var(--serif); margin: 10px 0; }
.flow p { color: var(--dim); }

/* Motion. Every hidden state sits under html.motion, which the inline script in <head>
   sets only when JS runs and the visitor allows motion. Without it the page is static. */
@property --mx { syntax: "<percentage>"; inherits: true; initial-value: 72%; }
@property --my { syntax: "<percentage>"; inherits: true; initial-value: 58%; }
.hero { transition: --mx 1.4s cubic-bezier(.2, .75, 0, 1), --my 1.4s cubic-bezier(.2, .75, 0, 1); }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(30% 40% at var(--mx) var(--my), rgba(143, 203, 212, .13), transparent 70%); }
.hero .container { position: relative; }

.motion .nav-links { animation: fade-in 1s .6s both; }
@keyframes fade-in { from { opacity: 0; } }

.motion .logo-draw path { stroke-dasharray: 1 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s cubic-bezier(.65, 0, .35, 1) calc(var(--i) * 110ms); }
.motion .logo-draw.in path { stroke-dashoffset: 0; }

.motion [data-split]:not(.ready) { opacity: 0; }
.motion .w { display: inline-block; overflow: hidden; vertical-align: top; padding: .08em 0 .14em; margin: -.08em 0 -.14em; }
.motion .w > span { display: inline-block; transform: translateY(110%); transition: transform 1.1s cubic-bezier(.2, .75, 0, 1) calc(var(--d, 0s) + var(--i) * 45ms); }
.motion [data-split].in .w > span { transform: none; }

.motion [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 1s ease, transform 1.1s cubic-bezier(.2, .75, 0, 1); transition-delay: calc(var(--d, 0s) + var(--i, 0) * 90ms); }
.motion [data-reveal].in { opacity: 1; transform: none; }

.motion .section-head::after { transform: scaleX(0); transform-origin: left; transition: transform 1.6s cubic-bezier(.2, .75, 0, 1) .15s; }
.motion .section-head.in::after { transform: none; }

/* Work cards: the mockup rises in, and a card shrinks and dims as the next one covers it (--p, set in main.js). */
.motion .work-visual { opacity: 0; transform: translateY(70px) scale(.94); transition: opacity 1s ease .1s, transform 1.3s cubic-bezier(.2, .75, 0, 1) .1s; }
.motion .work-visual.in { opacity: 1; transform: none; }
.motion .work-card { transform: scale(calc(1 - var(--p, 0) * .06)); transform-origin: 50% 0; }
.motion .work-card::before { content: ""; position: absolute; inset: 0; z-index: 3; background: var(--bg); opacity: calc(var(--p, 0) * .7); pointer-events: none; }

/* Phone menu opens as a circle growing out of the menu icon, and shrinks back into it on close. */
@media (max-width: 640px) and (prefers-reduced-motion: no-preference) {
  .nav .nav-links {
    --from: circle(0 at calc(100% - var(--gutter) - 12px) 46px);
    clip-path: var(--from);
    animation: none; /* the desktop nav fade-in would restart (hidden for .6s) on every open */
    transition: clip-path .75s cubic-bezier(.7, 0, .2, 1), display .75s allow-discrete, overlay .75s allow-discrete;
  }
  .nav .nav-links:popover-open { clip-path: circle(150% at calc(100% - var(--gutter) - 12px) 46px); }
  @starting-style { .nav .nav-links:popover-open { clip-path: var(--from); } }
  .nav .nav-links:popover-open a { animation: menu-rise 1.1s cubic-bezier(.2, .75, 0, 1) both; }
  .nav .nav-links:popover-open a:nth-of-type(1) { animation-delay: .22s; }
  .nav .nav-links:popover-open a:nth-of-type(2) { animation-delay: .3s; }
  .nav .nav-links:popover-open a:nth-of-type(3) { animation-delay: .38s; }
  .menu-close::before, .menu-close::after { transition: transform .6s cubic-bezier(.2, .75, 0, 1) .2s; }
  @starting-style {
    .nav-links:popover-open .menu-close::before { transform: translateY(-4px); }
    .nav-links:popover-open .menu-close::after { transform: translateY(4px); }
  }
  .menu-mark path { stroke-dasharray: 1 1; }
  .nav-links:popover-open .menu-mark path { animation: menu-draw 1.4s cubic-bezier(.65, 0, .35, 1) both; animation-delay: calc(.45s + var(--i) * 90ms); }
}
@keyframes menu-rise { from { transform: translateY(80%) rotate(5deg); transform-origin: 0 100%; clip-path: inset(0 0 100% 0); } to { clip-path: inset(-30% -20% -40% -5%); } }
@keyframes menu-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

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

@media (max-width: 1000px) {
  /* Cards still stack on small screens: one screen tall, mockup cropped from the top with a fade. */
  .work-card { top: 12px; height: calc(100svh - 24px); gap: 20px; }
  .work-visual { align-self: start; width: 100%; mask-image: linear-gradient(#000 72%, transparent); }
  .work-meta, .solutions-intro, .about-grid, .footer-top, .case-grid { grid-template-columns: 1fr; }
  .ui-grid { grid-template-columns: 1fr; }
  .ui-side { display: none; }
  .kpis { --n: 2 !important; }
  .row-2 { grid-template-columns: 1fr; }
  .products { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .flow::before { display: none; }
  .tabs { left: var(--gutter); right: auto; bottom: auto; top: 40px; }
}
@media (max-width: 640px) {
  .work-n { display: none; }
  .menu-btn { display: block; }
  /* Overlay look sits on the menu itself, not on :popover-open, so it holds during the closing transition. */
  .nav-links:not(:popover-open) { display: none; }
  .nav .nav-links {
    flex-direction: column; justify-content: center; gap: 0;
    position: fixed; inset: 0; width: 100%; height: 100%; padding: 92px var(--gutter) 120px;
    background: radial-gradient(80% 55% at 100% 0%, rgba(46, 137, 150, .45), transparent 70%), radial-gradient(60% 40% at 0% 100%, rgba(31, 104, 114, .35), transparent 70%), var(--bg);
  }
  .nav .nav-links a { padding: 0; font: 400 68px/1.08 var(--serif); letter-spacing: -.015em; text-transform: none; opacity: 1; }
  .nav .nav-links a:active { color: var(--accent); }
  .menu-close { display: block; position: absolute; top: 24px; right: calc(var(--gutter) - 10px); margin: 0; }
  .menu-mark { display: block; position: absolute; left: var(--gutter); bottom: 40px; width: calc(100% - 2 * var(--gutter)); height: auto; opacity: .9; }
  .hero-side { justify-self: start; }
  .modules, .flow { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .ui-top { flex-wrap: wrap; gap: 6px 10px; }
  .ui-top .push { margin-left: 0; }
  .kpis strong { font-size: 15px; }
  .tabs { gap: 14px; font-size: 13px; }
  .footer-bottom p { text-align: left; }
  .stage canvas { top: 40%; }
}
