/* Marvellous — visual system
   Ink / Bone / one Pagoda Gold accent. Inter Tight display, Instrument Serif accents,
   JetBrains Mono for instrument labels. */

:root {
  --ink: #0a0a0b;
  --graphite: #1c1c1f;
  --line: rgba(237, 234, 227, 0.14);
  --bone: #edeae3;
  --bone-dim: rgba(237, 234, 227, 0.62);
  --bone-faint: rgba(237, 234, 227, 0.38);
  --gold: #d4a24c;
  --gold-soft: rgba(212, 162, 76, 0.16);

  --display: 'Clash Display', 'Inter Tight', 'Helvetica Neue', Arial, sans-serif;
  --sans: 'Inter Tight', 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.77, 0, 0.18, 1);
  --vh: 100svh;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink); -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection { background: var(--gold); color: var(--ink); }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }

.skip-link {
  position: fixed; left: var(--gutter); top: 12px; z-index: 100;
  background: var(--bone); color: var(--ink); padding: 8px 14px; transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ---------- Stage, grain, fallback ---------- */
.stage { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
}
.fallback { display: none; }
.no-webgl .stage { display: none; }
.no-webgl .fallback, .reduced .fallback {
  display: block; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(circle at 70% 40%, var(--gold-soft), transparent 55%);
}
.reduced:not(.no-webgl) .fallback { display: none; }
.fallback svg { position: absolute; right: 6vw; top: 50%; width: min(46vw, 520px); transform: translateY(-50%); opacity: 0.12; }

main, .site-header, .site-footer, .hud { position: relative; z-index: 2; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px var(--gutter);
  mix-blend-mode: difference;
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: 0.24em; font-size: 13px; }
.brand svg { width: 26px; height: 26px; }
.nav { display: flex; gap: clamp(18px, 2.4vw, 40px); font-size: 14px; }
.nav a, .link-line { position: relative; }
.nav a::after, .link-line::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform 0.6s var(--ease);
}
.nav a:hover::after, .nav a[aria-current='page']::after, .link-line:hover::after { transform: scaleX(1); transform-origin: left; }
.header-cta { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.header-cta span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--bone); margin-right: 10px; vertical-align: 1px; animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
.menu-toggle { display: none; font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; }

.menu {
  position: fixed; inset: 0; z-index: 15; background: var(--ink);
  display: flex; flex-direction: column; justify-content: center; padding: 0 var(--gutter);
  clip-path: inset(0 0 100% 0); transition: clip-path 0.9s var(--ease-io); visibility: hidden;
}
.menu-open .menu { clip-path: inset(0 0 0 0); visibility: visible; }
.menu a { font-family: var(--display); font-size: clamp(44px, 13vw, 96px); font-weight: 500; letter-spacing: -0.04em; line-height: 1.04; }
.menu a small { font-family: var(--mono); font-size: 12px; color: var(--gold); letter-spacing: 0.1em; margin-right: 14px; vertical-align: 0.9em; }
.menu-foot { margin-top: 48px; font-family: var(--mono); font-size: 12px; color: var(--bone-dim); letter-spacing: 0.08em; }

/* ---------- HUD ---------- */
.hud {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; pointer-events: none;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end;
  padding: 0 var(--gutter) 20px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--bone-dim);
}
.hud > :nth-child(3) { text-align: right; }
.hud b { color: var(--bone); font-weight: 400; }
.hud-bar { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 10px; height: 1px; background: var(--line); }
.hud-bar i { position: absolute; inset: 0; background: var(--gold); transform-origin: left; transform: scaleX(0); }

/* ---------- Type ---------- */
.label {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--bone-dim);
  display: flex; align-items: center; gap: 14px;
}
.label::before { content: ''; width: 28px; height: 1px; background: var(--gold); }
.label b { color: var(--gold); font-weight: 400; white-space: nowrap; }
.display {
  font-family: var(--display); font-size: clamp(48px, 9.6vw, 176px); line-height: 0.9; letter-spacing: -0.035em; font-weight: 500; margin: 0;
}
.h2 { font-family: var(--display); font-size: clamp(40px, 6.2vw, 112px); line-height: 0.94; letter-spacing: -0.03em; font-weight: 500; margin: 0; }
.h3 { font-family: var(--display); font-size: clamp(26px, 2.4vw, 38px); line-height: 1.05; letter-spacing: -0.015em; font-weight: 500; margin: 0; }
em, .serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.02em; color: var(--gold); }
.lede { font-size: clamp(18px, 1.5vw, 23px); line-height: 1.5; color: var(--bone-dim); max-width: 36ch; margin: 0; }
.lede strong { color: var(--bone); font-weight: 500; }
.statement { font-family: var(--display); font-size: clamp(28px, 3.6vw, 60px); line-height: 1.12; letter-spacing: -0.035em; font-weight: 400; margin: 0; max-width: 22ch; }

/* Word reveal */
[data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.04em 0.02em 0.12em; margin: -0.04em -0.02em -0.12em; }
[data-split] .w > span { display: inline-block; transform: translate3d(0, 110%, 0); transition: transform 1.2s var(--ease) calc(var(--i) * 45ms); }
[data-split].in .w > span { transform: none; }
.js:not(.loaded) .hero [data-split] .w > span { transform: translate3d(0, 110%, 0); }
.loaded .hero [data-split] .w > span { transition-delay: calc(0.25s + var(--i) * 55ms); }

.reveal { opacity: 0; transform: translate3d(0, 28px, 0); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.js:not(.loaded) .hero .reveal { opacity: 0; transform: translate3d(0, 28px, 0); }
html:not(.js) .reveal { opacity: 1; transform: none; }
html:not(.js) [data-split] .w > span { transform: none; }

/* ---------- Layout ---------- */
.wrap { padding: 0 var(--gutter); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(12px, 2vw, 32px); }
.panel { min-height: var(--vh); display: flex; align-items: center; padding: 140px var(--gutter); }
.panel > .grid { width: 100%; }
.left { grid-column: 1 / span 6; }
.right { grid-column: 7 / span 6; }
.left-wide { grid-column: 1 / span 8; }
.full { grid-column: 1 / -1; }

/* ---------- Hero ---------- */
.hero { min-height: var(--vh); display: flex; flex-direction: column; justify-content: flex-end; padding: 120px var(--gutter) 96px; }
.hero .display { max-width: 12ch; }
.hero-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-top: 44px; flex-wrap: wrap; }
.scroll-cue { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--bone-dim); display: flex; align-items: center; gap: 14px; }
.scroll-cue i { width: 1px; height: 44px; background: var(--line); position: relative; overflow: hidden; }
.scroll-cue i::after { content: ''; position: absolute; left: 0; right: 0; top: -100%; height: 100%; background: var(--gold); animation: cue 2.2s var(--ease-io) infinite; }
@keyframes cue { to { top: 100%; } }
.page-hero { min-height: 82svh; }

/* ---------- Chapters ---------- */
.chapter .label { margin-bottom: 36px; }
.chapter .h2 { margin-bottom: 32px; }
.chapter .lede { margin-bottom: 44px; }
.ticks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); max-width: 560px; }
.ticks li {
  display: grid; grid-template-columns: 52px 1fr; padding: 15px 0; border-bottom: 1px solid var(--line);
  font-size: 16px; transition: padding 0.5s var(--ease), color 0.5s var(--ease);
}
.ticks li span { font-family: var(--mono); font-size: 11px; color: var(--gold); letter-spacing: 0.1em; padding-top: 4px; }
.ticks li:hover { padding-left: 10px; }

/* ---------- Numbers ---------- */
.numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); margin-top: 64px; }
.numbers > div { padding: 32px 24px 0 0; border-right: 1px solid var(--line); }
.numbers > div + div { padding-left: 24px; }
.numbers > div:last-child { border-right: 0; }
.numbers strong { font-family: var(--display); display: block; font-size: clamp(48px, 6.4vw, 112px); font-weight: 400; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.numbers span { display: block; margin-top: 14px; color: var(--bone-dim); font-size: 15px; max-width: 22ch; }
.numbers.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.numbers.two > div { padding: 28px 24px 28px 0; border-bottom: 1px solid var(--line); }
.numbers.two > div:nth-child(even) { padding-left: 24px; border-right: 0; }
.numbers.two strong { font-size: clamp(44px, 5vw, 88px); }

/* ---------- Work list ---------- */
.work-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 48px; flex-wrap: wrap; }
.work-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.work-row a {
  display: grid; grid-template-columns: 70px minmax(0, 1.4fr) minmax(0, 1fr) 90px; align-items: baseline; gap: 20px;
  padding: 30px 0; border-bottom: 1px solid var(--line); position: relative;
}
.work-row a::before {
  content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--gold-soft), transparent 70%);
  transform: scaleY(0); transform-origin: bottom; transition: transform 0.6s var(--ease); z-index: -1;
}
.work-row a:hover::before { transform: scaleY(1); }
.work-row .idx, .work-row .yr { font-family: var(--mono); font-size: 12px; color: var(--bone-faint); letter-spacing: 0.1em; }
.work-row .yr { text-align: right; }
.work-row .name { font-family: var(--display); font-size: clamp(30px, 4.2vw, 72px); letter-spacing: -0.045em; line-height: 1; font-weight: 500; transition: transform 0.7s var(--ease), color 0.5s var(--ease); }
.work-row .tags { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--bone-dim); text-transform: lowercase; }
.work-row a:hover .name { transform: translateX(18px); color: var(--gold); }

.work-preview {
  position: fixed; left: 0; top: 0; z-index: 30; width: 340px; height: 230px; pointer-events: none;
  border-radius: 4px; overflow: hidden; opacity: 0; scale: 0.6; transition: opacity 0.45s var(--ease), scale 0.6s var(--ease);
  background: var(--graphite); box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}
.work-preview.on { opacity: 1; scale: 1; }
.work-preview::before { content: ''; position: absolute; inset: 0; animation: drift 9s linear infinite; background-size: 200% 200%; }
.work-preview span { position: absolute; left: 16px; bottom: 14px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
@keyframes drift { to { background-position: 200% 100%; } }
/* Generated art per project — no stock imagery. */
[data-art='erp']::before { background-image: linear-gradient(90deg, transparent 0 62%, rgba(212,162,76,.55) 62% 62.3%, transparent 62.3%), repeating-linear-gradient(90deg, rgba(237,234,227,.09) 0 1px, transparent 1px 32px), repeating-linear-gradient(0deg, rgba(237,234,227,.09) 0 1px, transparent 1px 32px), radial-gradient(ellipse at 62% 50%, rgba(212,162,76,.42), transparent 45%), linear-gradient(180deg, #141416, #0a0a0b); }
[data-art='school']::before { background-image: radial-gradient(circle at 70% 30%, rgba(212,162,76,.55), transparent 40%), repeating-radial-gradient(circle at 70% 30%, rgba(237,234,227,.12) 0 1px, transparent 1px 22px), linear-gradient(160deg, #141416, #0a0a0b); }
[data-art='arcade']::before { background-image: repeating-linear-gradient(45deg, rgba(212,162,76,.22) 0 2px, transparent 2px 18px), repeating-linear-gradient(-45deg, rgba(237,234,227,.08) 0 1px, transparent 1px 18px), linear-gradient(180deg, #17171a, #0a0a0b); }
[data-art='ops']::before { background-image: radial-gradient(rgba(237,234,227,.35) 1px, transparent 1.5px), radial-gradient(circle at 50% 120%, rgba(212,162,76,.5), transparent 55%), #0d0d0f; background-size: 14px 14px, 100% 100%, auto; }
[data-art='stream']::before { background-image: repeating-linear-gradient(0deg, rgba(237,234,227,.07) 0 1px, transparent 1px 4px), linear-gradient(90deg, transparent 30%, rgba(212,162,76,.5) 50%, transparent 70%), radial-gradient(circle at 50% 50%, rgba(237,234,227,.18), transparent 40%), #0b0b0c; }
[data-art='ai']::before { background-image: conic-gradient(from 210deg at 60% 50%, transparent, rgba(212,162,76,.5), transparent 30%), repeating-conic-gradient(from 0deg at 60% 50%, rgba(237,234,227,.07) 0 2deg, transparent 2deg 12deg), #0b0b0c; }

/* ---------- Products ---------- */
.products { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 2vw, 32px); margin-top: 64px; }
.product {
  position: relative; border: 1px solid var(--line); padding: 28px; min-height: 300px; display: flex; flex-direction: column;
  background: rgba(10, 10, 11, 0.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.6s var(--ease), transform 0.8s var(--ease);
}
.product:hover { border-color: rgba(212, 162, 76, 0.6); transform: translateY(-6px); }
.product .label { margin-bottom: auto; }
.product p { color: var(--bone-dim); margin: 14px 0 0; font-size: 15px; }
.product .arrow { position: absolute; top: 26px; right: 26px; transition: transform 0.6s var(--ease); }
.product:hover .arrow { transform: translate(4px, -4px); color: var(--gold); }

/* ---------- Live product cards ---------- */
.app-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: clamp(12px, 2vw, 28px); gap: clamp(12px, 2vw, 28px); margin-top: 56px; }
.app-card {
  position: relative; display: flex; flex-direction: column; min-height: 400px; padding: 30px;
  border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  background: linear-gradient(180deg, rgba(28, 28, 31, 0.78), rgba(10, 10, 11, 0.82));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.6s var(--ease), transform 0.8s var(--ease);
}
.app-card::before { /* gold glow that follows hover */
  content: ''; position: absolute; inset: -40% -40% auto auto; width: 70%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 162, 76, 0.22), transparent 65%); opacity: 0; transition: opacity 0.8s var(--ease);
}
.app-card:hover { border-color: rgba(212, 162, 76, 0.7); transform: translateY(-8px); }
.app-card:hover::before { opacity: 1; }
.app-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 40px; }
.app-tile { width: 76px; height: 76px; border-radius: 18px; background: var(--tile, #141416); display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(237, 234, 227, 0.08); transition: transform 0.9s var(--ease); }
.app-tile img { width: 72%; height: 72%; object-fit: contain; }
.app-tile img.fill { width: 100%; height: 100%; } /* artwork with its own built-in margin */
.app-card:hover .app-tile { transform: scale(1.06) rotate(-3deg); }
.app-status.private { color: var(--bone-faint); }
.app-status.private i { background: var(--bone-faint); animation: none; box-shadow: none; }
.app-card:not(.live) { background: linear-gradient(180deg, rgba(20, 20, 22, 0.7), rgba(10, 10, 11, 0.8)); }
.app-card:not(.live):hover { border-color: rgba(237, 234, 227, 0.3); }
.app-links { display: inline-flex; gap: 18px; }
.app-status { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone-dim); display: inline-flex; align-items: center; gap: 8px; }
.app-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 0 rgba(212, 162, 76, 0.6); animation: live 2.2s var(--ease) infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 9px rgba(212, 162, 76, 0); } 100% { box-shadow: 0 0 0 0 rgba(212, 162, 76, 0); } }
.app-kind { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin: 0 0 10px; }
.app-card .h3 { font-size: clamp(30px, 2.8vw, 44px); }
.app-desc { color: var(--bone-dim); font-size: 15px; margin: 16px 0 28px; }
.app-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--bone-faint); }
.app-foot > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-go { color: var(--bone); letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; transition: color 0.4s var(--ease); }
.app-go:hover { color: var(--gold); }

.private-head { margin-top: 64px; }
.app-cards.private-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 28px; }
.private-grid .app-card { min-height: 360px; padding: 26px; }
.private-grid .app-card .h3 { font-size: clamp(26px, 2.2vw, 34px); }

/* ---------- Enquiry form (Contact) ---------- */
.form-section { padding: 40px var(--gutter) 140px; }
.enquiry {
  max-width: 1040px; margin: 0 auto; padding: clamp(24px, 5vw, 64px);
  border: 1px solid var(--line); border-radius: 8px;
  background: linear-gradient(180deg, rgba(24, 24, 27, 0.9), rgba(10, 10, 11, 0.94));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.enquiry fieldset { border: 0; margin: 0; padding: 44px 0 0; min-width: 0; }
.enquiry fieldset + fieldset { border-top: 1px solid var(--line); margin-top: 44px; }
.enquiry legend { font-family: var(--display); font-size: clamp(22px, 2vw, 28px); font-weight: 500; letter-spacing: -0.02em; padding: 0; margin-bottom: 18px; float: left; width: 100%; }
.enquiry legend + * { clear: both; }
.hint { color: var(--bone-dim); font-size: 15px; margin: 0 0 18px; max-width: 62ch; }
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 28px; }
.field { display: flex; flex-direction: column; gap: 10px; }
.field > span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone-dim); }
.enquiry input[type="text"], .enquiry input:not([type]), .enquiry input[type="tel"], .enquiry input[type="email"], .enquiry textarea {
  width: 100%; font: inherit; font-size: 17px; color: var(--bone); background: rgba(237, 234, 227, 0.04);
  border: 1px solid var(--line); border-radius: 6px; padding: 15px 16px; outline: none;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.enquiry input::placeholder, .enquiry textarea::placeholder { color: var(--bone-faint); }
.enquiry input:focus, .enquiry textarea:focus { border-color: var(--gold); background: rgba(212, 162, 76, 0.06); }
.enquiry textarea { resize: vertical; min-height: 240px; line-height: 1.6; }
.field.invalid input, .field.invalid textarea { border-color: #e0715a; }
.counter { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--bone-faint); margin: 10px 0 0; text-align: right; }

.loc { display: grid; grid-template-columns: 36px 1fr 40px; gap: 10px; align-items: center; margin-bottom: 12px; }
.loc-n { font-family: var(--mono); font-size: 11px; color: var(--gold); letter-spacing: 0.1em; }
.loc-box { position: relative; }
.loc-x { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); color: var(--bone-dim); font-size: 20px; line-height: 1; }
.loc-x:hover { border-color: var(--gold); color: var(--gold); }
.loc-hints { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5; list-style: none; margin: 0; padding: 6px; background: #151517; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5); }
.loc-hints li { padding: 10px 12px; border-radius: 4px; font-size: 15px; color: var(--bone-dim); cursor: pointer; }
.loc-hints li:hover, .loc-hints li.on { background: rgba(212, 162, 76, 0.14); color: var(--bone); }
.add-loc { margin: 6px 0 0 46px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.add-loc:hover { text-decoration: underline; }
.attrib { font-size: 12px; color: var(--bone-faint); margin: 18px 0 0 46px; }
.attrib a { text-decoration: underline; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 12px 20px; border: 1px solid var(--line); border-radius: 999px; font-size: 15px; color: var(--bone-dim); cursor: pointer; transition: all 0.3s var(--ease); }
.chip span:hover { border-color: rgba(237, 234, 227, 0.4); color: var(--bone); }
.chip input:checked + span { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.chip input:focus-visible + span { outline: 1px solid var(--gold); outline-offset: 3px; }
.products-pick { margin-top: 22px; }
.f-row { margin-bottom: 26px; }
.f-row .q { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone-dim); margin: 0 0 12px; }

.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.f-submit { border-top: 1px solid var(--line); margin-top: 44px; padding-top: 36px; display: grid; gap: 22px; justify-items: start; }
.consent { display: flex; gap: 12px; align-items: flex-start; color: var(--bone-dim); font-size: 15px; cursor: pointer; }
.consent input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--gold); }
.btn.submit { background: var(--bone); color: var(--ink); border-color: var(--bone); font-size: 13px; padding: 20px 34px; }
.btn.submit:hover { background: var(--gold); border-color: var(--gold); }
.btn.submit:disabled { opacity: 0.5; cursor: wait; }
.form-status { margin: 0; font-size: 15px; color: var(--bone-dim); min-height: 1.4em; }
.form-status.bad { color: #f0a38f; }
.enquiry.sent fieldset, .enquiry.sent .f-submit, .enquiry.sent .form-intro { display: none; }
.form-done { padding: 20px 0; }

.places { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); max-width: 560px; }
.places li { display: grid; grid-template-columns: 120px 1fr; align-items: baseline; padding: 20px 0; border-bottom: 1px solid var(--line); }
.places span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.places strong { font-family: var(--display); font-weight: 500; font-size: clamp(22px, 2.2vw, 32px); letter-spacing: -0.02em; }

/* ---------- Process ---------- */
.process { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 2vw, 32px); margin-top: 64px; counter-reset: step; }
.process > div { border-top: 1px solid var(--line); padding-top: 24px; position: relative; }
.process > div::before { content: ''; position: absolute; top: -1px; left: 0; width: 0; height: 1px; background: var(--gold); transition: width 1.6s var(--ease) var(--d, 0s); }
.process > div.in::before { width: 100%; }
.process b { font-family: var(--mono); font-weight: 400; font-size: 12px; color: var(--gold); letter-spacing: 0.12em; }
.process h3 { font-family: var(--display); font-size: 28px; font-weight: 500; letter-spacing: -0.03em; margin: 18px 0 10px; }
.process p { color: var(--bone-dim); margin: 0; font-size: 15px; }

/* ---------- Capabilities page ---------- */
.cap-block { padding: 120px var(--gutter); border-top: 1px solid var(--line); }
.cap-block .grid { row-gap: 32px; }
.cap-block .h2 { font-size: clamp(36px, 4.6vw, 80px); }
.cap-index { font-family: var(--mono); font-size: 12px; color: var(--gold); letter-spacing: 0.12em; }
.cap-list { grid-column: 7 / span 6; columns: 2; column-gap: 32px; list-style: none; margin: 0; padding: 0; }
.cap-list li { break-inside: avoid; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.stack span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; color: var(--bone-dim); }

/* ---------- Case studies ---------- */
.case { padding: 120px var(--gutter); border-top: 1px solid var(--line); }
.case .grid { row-gap: 32px; }
.case .h2 { font-size: clamp(40px, 6vw, 110px); }
.case-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 48px 0; border-top: 1px solid var(--line); padding-top: 22px; }
.case-meta dt { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--bone-faint); margin-bottom: 8px; }
.case-meta dd { margin: 0; font-size: 15px; }
.case-art { grid-column: 1 / -1; aspect-ratio: 21 / 6; max-height: 42vh; width: 100%; border: 1px solid var(--line); position: relative; overflow: hidden; border-radius: 4px; margin-bottom: 48px; }
.case-art::before { content: ''; position: absolute; inset: 0; background-size: 200% 200%; animation: drift 14s linear infinite; }
.case-art::after { content: attr(data-caption); position: absolute; left: 20px; bottom: 16px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone-dim); }
.case-art.has-canvas { aspect-ratio: 21 / 8; max-height: 56vh; background: var(--ink); }
.case-art.has-canvas::before, .case-art.has-canvas::after { display: none; }
.case-art canvas { position: absolute; inset: 0; display: block; }
.case-body p { color: var(--bone-dim); margin: 0 0 18px; max-width: 58ch; }
.case-body p strong { color: var(--bone); font-weight: 500; }

/* ---------- Contact ---------- */
.contact-big {
  display: inline-block; font-family: var(--display); font-size: clamp(24px, 4.4vw, 76px); letter-spacing: -0.045em; font-weight: 500; line-height: 1;
  margin-top: 48px; position: relative; overflow-wrap: anywhere;
}
.contact-big::after { content: ''; position: absolute; left: 0; right: 0; bottom: -10px; height: 2px; background: var(--gold); transform: scaleX(0.18); transform-origin: left; transition: transform 0.9s var(--ease); }
.contact-big:hover::after { transform: scaleX(1); }
.btn {
  display: inline-flex; align-items: center; gap: 14px; padding: 18px 28px; border: 1px solid var(--bone); border-radius: 999px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  transition: background 0.5s var(--ease), color 0.5s var(--ease), transform 0.5s var(--ease), border-color 0.5s var(--ease);
}
.btn:hover { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 80px; border-top: 1px solid var(--line); padding-top: 28px; }
.contact-grid h4 { font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone-faint); margin: 0 0 12px; }
.contact-grid p { margin: 0; }

/* ---------- Footer ---------- */
.site-footer { padding: 96px var(--gutter) 72px; border-top: 1px solid var(--line); background: var(--ink); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone-faint); margin: 0 0 14px; }
.footer-grid p, .footer-grid li { margin: 0; color: var(--bone-dim); font-size: 15px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-grid a:hover { color: var(--bone); }
.footer-word { font-family: var(--display); font-size: clamp(64px, 17.5vw, 330px); letter-spacing: -0.06em; font-weight: 500; line-height: 0.8; margin: 80px 0 24px; color: transparent; -webkit-text-stroke: 1px rgba(237, 234, 227, 0.22); white-space: nowrap; }
.footer-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bone-faint); }

/* ---------- Loader & transitions ---------- */
.loader {
  position: fixed; inset: 0; z-index: 50; background: var(--ink); display: grid; place-items: center;
  transition: clip-path 1.1s var(--ease-io) 0.1s; clip-path: inset(0 0 0 0);
}
.loaded .loader { clip-path: inset(0 0 100% 0); }
.loader.skip { display: none; }
.loader-logo { position: relative; width: clamp(120px, 16vw, 180px); animation: logo-in 1.2s var(--ease) both; }
/* The logo file is used as a stencil and filled with the site's gold, with a sheen moving inside it. */
.loader-logo img { display: block; width: 100%; height: auto; opacity: 0; }
.loader-logo::after {
  content: ''; position: absolute; inset: 0;
  -webkit-mask: url(logo.png) center / contain no-repeat; mask: url(logo.png) center / contain no-repeat;
  background: linear-gradient(105deg, var(--gold) 0 40%, #f3d9a0 50%, var(--gold) 60% 100%);
  background-size: 300% 100%; background-position: 100% 0;
  animation: sheen 2s var(--ease-io) 0.4s infinite;
}
@keyframes logo-in { from { opacity: 0; transform: translateY(14px) scale(0.92); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes sheen { to { background-position: 0% 0; } }
.loader-num { position: absolute; right: var(--gutter); bottom: 28px; font-family: var(--mono); font-size: clamp(56px, 10vw, 140px); letter-spacing: -0.04em; line-height: 0.8; font-variant-numeric: tabular-nums; }
.loader-tag { position: absolute; left: var(--gutter); bottom: 32px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--bone-dim); }
.html-no-loader .loader { display: none; }

.curtain { position: fixed; inset: 0; z-index: 60; background: var(--ink); pointer-events: none; transform: scaleY(0); transform-origin: bottom; transition: transform 0.55s var(--ease-io); }
.leaving .curtain { transform: scaleY(1); }
.js main { opacity: 0; transition: opacity 0.9s var(--ease) 0.15s; }
.js.loaded main { opacity: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .left, .right, .left-wide { grid-column: 1 / -1; }
  .cap-list { grid-column: 1 / -1; }
  .products { grid-template-columns: 1fr 1fr; }
  .app-cards, .app-cards.private-grid { grid-template-columns: 1fr 1fr; }
  .app-card { min-height: 0; }
  .product { min-height: 220px; }
  .process { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav, .header-cta { display: none; }
  .menu-toggle { display: block; }
  .site-header { padding: 18px var(--gutter); }
  .panel { padding: 110px var(--gutter); align-items: flex-end; }
  .hero { padding-bottom: 88px; }
  .numbers { grid-template-columns: 1fr 1fr; }
  .numbers > div { padding: 24px 12px 24px 0 !important; border-right: 0; border-bottom: 1px solid var(--line); }
  .numbers > div:nth-child(odd) { padding-right: 12px; }
  .work-row a { grid-template-columns: 40px 1fr; row-gap: 8px; padding: 24px 0; }
  .work-row .tags { grid-column: 2; }
  .work-row .yr { display: none; }
  .process { grid-template-columns: 1fr; }
  .products { grid-template-columns: 1fr; }
  .app-cards, .app-cards.private-grid { grid-template-columns: 1fr; }
  .cap-list { columns: 1; }
  .case-meta, .contact-grid { grid-template-columns: 1fr; }
  .f-grid { grid-template-columns: 1fr; }
  .loc { grid-template-columns: 28px 1fr 40px; }
  .add-loc, .attrib { margin-left: 38px; }
  .case-art.has-canvas { aspect-ratio: 4 / 3; max-height: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .hud > :nth-child(2) { display: none; }
  .hud { grid-template-columns: 1fr 1fr; }
  .ticks { max-width: none; }
  /* Text over the cloud on phones: give it a soft backing. */
  .panel .left, .panel .right, .panel .left-wide { background: linear-gradient(180deg, transparent, rgba(10, 10, 11, 0.82) 14%); margin: 0 calc(var(--gutter) * -1); padding: 40px var(--gutter) 0; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}
.reduced [data-split] .w > span, .reduced .reveal { transform: none !important; opacity: 1 !important; }
.reduced .grain { display: none; }

/* Page loop cue: appears when scrolling on past the first or last line of a page */
.loop-cue {
  position: fixed; left: 50%; bottom: 52px; z-index: 12; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transform: translate(-50%, 16px); opacity: 0; transition: opacity 0.35s var(--ease), transform 0.5s var(--ease);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--bone-dim);
  padding: 14px 22px 16px; background: rgba(10, 10, 11, 0.72); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.loop-cue.up { bottom: auto; top: 86px; transform: translate(-50%, -16px); }
.loop-cue.on { opacity: 1; transform: translate(-50%, 0); }
.loop-name { font-family: var(--display); font-size: clamp(22px, 3vw, 34px); font-weight: 500; letter-spacing: -0.01em; text-transform: none; color: var(--bone); line-height: 1; }
.loop-name::after { content: ' ↓'; color: var(--gold); }
.loop-cue.up .loop-name::after { content: ' ↑'; }
.loop-bar { position: relative; display: block; width: 160px; height: 1px; background: var(--line); }
.loop-bar i { position: absolute; inset: 0; background: var(--gold); transform-origin: left; transform: scaleX(0); transition: transform 0.12s linear; }
.reduced .loop-cue { transition: none; }
