/* QQ studio site. Plain CSS, no build step. */

:root {
  --paper: #F5F4F0;
  --surface: #FFFFFF;
  --ink: #141310;
  --ink-2: #5E5B54;
  --line: #E4E2DC;
  --spark: #FF4D00;
  --tray: #DDDAD1;
  --tray-base: #C9C5BA;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --margin: clamp(20px, 5vw, 64px);
  --maxw: 1280px;
  --gutter: 24px;
  --r-card: 20px;
  --r-sm: 10px;
  --nav-h: 72px;

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0F0E0C;
    --surface: #1A1916;
    --ink: #F2F0EA;
    --ink-2: #A9A69C;
    --line: #2A2824;
    --tray: #24221E;
    --tray-base: #171512;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.5 var(--font);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, picture { display: block; max-width: 100%; }
a { color: inherit; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p, figure { margin: 0; }

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

.skip {
  position: absolute; left: 16px; top: -64px; z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: 12px 20px; border-radius: 999px; text-decoration: none; font-weight: 500;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: calc(var(--maxw) + 2 * var(--margin)); margin: 0 auto; padding: 0 var(--margin); }

/* ---------- type ---------- */
.h-display {
  font-size: clamp(48px, min(9vw, 15.5svh), 128px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.95;
  text-wrap: balance;
}
.h-display span { display: block; }
.h-sec {
  font-size: clamp(40px, 6.4vw, 88px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.98;
  text-wrap: balance;
}
.label, .code {
  font: 500 12px/1.2 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}
.code::before { content: "[ "; content: "[ " / ""; }
.code::after { content: " ]"; content: " ]" / ""; }
.label--plain::before, .label--plain::after { content: none; }
.lede { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center;
  transition: background .4s var(--ease), box-shadow .4s var(--ease);
}
.nav.is-scrolled { background: var(--paper); box-shadow: 0 1px 0 var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; }
.wordmark { font-size: 26px; font-weight: 600; letter-spacing: -0.06em; text-decoration: none; line-height: 1; padding: 10px 0; }
.nav ul { display: flex; gap: 4px; }
.nav li a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  font-size: 15px; font-weight: 500; text-decoration: none; border-radius: 999px;
  transition: background .3s var(--ease);
}
.nav li a:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font: 500 16px/1 var(--font); letter-spacing: -0.005em; text-decoration: none; cursor: pointer;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  transition: transform .6s var(--ease), background .3s var(--ease), color .3s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--line { border-color: color-mix(in srgb, var(--ink) 28%, transparent); }
.btn--line:hover { border-color: var(--ink); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column;
  padding-top: calc(var(--nav-h) + 24px);
  padding-bottom: 16px;
}
.hero__text {
  position: relative; z-index: 4;
  display: grid; gap: 24px; align-items: end;
  grid-template-columns: minmax(0, 1fr);
}
.hero__side { display: grid; gap: 20px; max-width: 460px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }

@media (min-width: 1100px) {
  .hero__text { grid-template-columns: minmax(0, 1fr) clamp(300px, 28vw, 380px); gap: 24px; }
  .hero__side { max-width: none; padding-bottom: 8px; }
  .cta { flex-direction: column; align-items: stretch; }
}

.stage { flex: 1; display: flex; align-items: flex-end; padding-top: 24px; }
.tray-box {
  position: relative; z-index: 4;
  width: min(100%, calc((100svh - 400px) * 3.1));
  min-width: min(100%, 560px);
  aspect-ratio: 3.1 / 1;
  margin: 0 auto;
}
.tray-img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tray-img img { width: 100%; height: 100%; }
.tray-labels { position: absolute; inset: 0; }
.tray-labels li {
  position: absolute; top: var(--y); left: var(--x); transform: translateX(-50%);
  width: 14%; text-align: center; display: grid; gap: 4px; justify-items: center;
}
.tray-labels .name { font-size: 14px; font-weight: 500; line-height: 1.2; }
.tray-labels .code { white-space: nowrap; }
.code .t { display: inline-block; overflow: hidden; white-space: nowrap; vertical-align: bottom; }
.gl-on .tray-labels li .t { width: 0; }
.gl-on .tray-labels li.is-on .t { animation: tick calc(var(--n) * 45ms) steps(var(--n), end) forwards; }
@keyframes tick { to { width: calc(var(--n) * (1ch + 0.08em)); } }

#gl {
  position: fixed; inset: 0; z-index: 3; width: 100%; height: 100%;
  pointer-events: none; display: none;
}
.gl-on #gl { display: block; }
.gl-on .tray-img { visibility: hidden; }
.gl-on .tray-labels li { opacity: 0; }
.gl-on .tray-labels li.is-on { opacity: 1; transition: opacity .3s var(--ease); }
.tray-labels li .name { opacity: 0; transition: opacity .6s var(--ease); }
.tray-labels li.is-on .name, .gl-off .tray-labels .name, .no-js .tray-labels .name { opacity: 1; }
.gl-off .tray-labels li, .no-js .tray-labels li { opacity: 1; }

/* hero entrance (HTML): nothing waits on JS except the 3D layer */
@media (prefers-reduced-motion: no-preference) {
  .enter { animation: rise .6s var(--ease) both; animation-delay: var(--d, 0s); }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}

/* ---------- sections ---------- */
section { position: relative; }
.sec { padding: 96px 0 0; }
@media (min-width: 900px) { .sec { padding-top: 144px; } }
#work.sec { padding-top: 24px; }
@media (min-width: 900px) { #work.sec { padding-top: 32px; } }
.sec-head { display: grid; gap: 20px; margin-bottom: 48px; }
@media (min-width: 900px) { .sec-head { margin-bottom: 64px; } }

.rv { }
.js.rm-ok .rv { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js.rm-ok .rv.in { opacity: 1; transform: none; }
/* cards fade only: a transform on them would shift the icon spot the 3D handoff aims at */
.js.rm-ok .card.rv { transform: none; transition: opacity .6s var(--ease), transform .6s var(--ease), box-shadow .6s var(--ease); }
.js.rm-ok .card.rv.in:hover { transform: translateY(-4px); }

/* ---------- work ---------- */
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gutter); }
@media (min-width: 900px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card--feature { grid-column: 1 / -1; }
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 12px; display: flex; flex-direction: column; gap: 16px;
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -28px rgba(20, 19, 16, .45); }
.shot {
  position: relative; overflow: hidden; border-radius: var(--r-sm);
  background: var(--paper); aspect-ratio: 16 / 10; border: 1px solid var(--line);
}
.shot > picture, .shot > picture img { width: 100%; height: 100%; }
.shot > picture img { object-fit: cover; object-position: top left; }
.shot .m {
  position: absolute; right: 4%; bottom: 0; width: 21%; aspect-ratio: 360 / 779;
  border-radius: 14px 14px 0 0; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); border-bottom: 0;
  box-shadow: 0 -2px 24px -6px rgba(20, 19, 16, .35);
  background: var(--paper);
}
.shot .m img { width: 100%; height: 100%; object-fit: cover; }
.shot--ember { background: #FFD9B8; }

.meta { padding: 4px 12px 12px; display: grid; gap: 16px; align-content: start; }
.meta-head { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.icon {
  width: 64px; height: 64px; border-radius: 22%; overflow: hidden; display: block;
  box-shadow: 0 8px 18px -10px rgba(20, 19, 16, .55);
  transition: opacity .22s var(--ease);
  background: var(--paper);
}
.icon img { width: 100%; height: 100%; }
.gl-on .icon { opacity: 0; }
.gl-on .card.is-landed .icon { opacity: 1; }
.meta h3 { font-size: clamp(28px, 3.2vw, 40px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; margin-top: 8px; }
.one { font-size: 19px; line-height: 1.35; text-wrap: pretty; max-width: 34em; }
.card--feature .one { font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -0.025em; line-height: 1.2; font-weight: 500; }
.note { font-size: 15px; color: var(--ink-2); max-width: 34em; }

.pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line);
  font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.pill--soon::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  padding: 5px 12px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line);
  font-size: 14px; color: var(--ink-2);
}
.links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.out {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 30%, transparent);
  text-underline-offset: 5px; text-decoration-thickness: 1px;
  transition: text-decoration-color .3s var(--ease);
}
.out:hover { text-decoration-color: var(--ink); }
.out .ar { transition: transform .5s var(--ease); display: inline-block; }
.out:hover .ar { transform: translate(2px, -2px); }

@media (min-width: 900px) {
  .card--feature { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; padding: 16px; }
  .card--feature .shot { aspect-ratio: 2 / 1; align-self: start; }
  .card--feature .meta { padding: 16px 12px 12px 4px; gap: 24px; }
  .card--feature .icon { width: 72px; height: 72px; }
}
@media (max-width: 899px) {
  .shot .m { width: 24%; }
}

.card--slot {
  background: transparent; border: 1px dashed color-mix(in srgb, var(--ink) 30%, transparent);
  flex-direction: row; align-items: center; padding: 24px 28px; gap: 24px;
}
@media (min-width: 900px) { .card--slot { grid-column: 1 / -1; } }
.card--slot:hover { transform: none; box-shadow: none; }
.slotmark { width: 64px; height: 64px; border-radius: 22%; background: var(--paper); box-shadow: inset 0 3px 8px rgba(20, 19, 16, .18), inset 0 0 0 1px var(--line); position: relative; }
.slotmark::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: var(--spark); }
.card--slot h3 { font-size: clamp(28px, 3.2vw, 40px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; margin-top: 8px; }

/* ---------- services ---------- */
.exp-lead { max-width: 36em; font-size: clamp(19px, 1.9vw, 24px); }
.svc { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gutter); }
@media (min-width: 1000px) { .svc { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; } } /* equal-height groups */
.svc-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 8px 24px 12px; }
.svc-label { padding: 20px 0 16px; }
.svc-list li {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 8px; align-items: baseline;
  padding: 18px 0 20px; border-top: 1px solid var(--line);
}
.svc-list .code::before, .svc-list .code::after { content: none; }
.svc-list h3 { font-size: clamp(20px, 1.7vw, 24px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.svc-list p { grid-column: 2; margin-top: 6px; font-size: 16px; line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }
.svc-list li > div { grid-column: 2; grid-row: 1; }
.svc-list li > .code { grid-column: 1; grid-row: 1; }
a.inline { color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); text-underline-offset: 4px; text-decoration-thickness: 1px; transition: text-decoration-color .3s var(--ease); }
a.inline:hover { text-decoration-color: var(--ink); }

.stack { margin-top: 56px; display: grid; gap: 14px; padding-top: 24px; border-top: 1px solid var(--line); }
.stack-clip { overflow: hidden; }
/* separators lead each item; the row-start one is pushed outside the clip, so no dot dangles at a line end */
.stack-list { display: flex; flex-wrap: wrap; gap: 6px 0; margin-left: -28px; font: 500 12px/1.6 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); }
.stack-list li { position: relative; padding-left: 28px; }
.stack-list li::before { content: "\00B7"; content: "\00B7" / ""; position: absolute; left: 12px; }

/* Equal cards, aligned rows: where the three groups sit side by side, subgrid lines item 01 to 05 up across them.
   Without subgrid support the grid still stretches the cards to one height. */
@supports (grid-template-rows: subgrid) {
  @media (min-width: 1000px) {
    .svc { row-gap: 0; }
    .svc-group { display: grid; grid-row: span 6; grid-template-rows: subgrid; row-gap: 0; }
    .svc-list { display: grid; grid-row: 2 / span 5; grid-template-rows: subgrid; }
  }
}

/* ---------- case studies ---------- */
/* site.js equalises the blocks of side-by-side cards, then adds .eq so an opened case grows only its own card */
@media (min-width: 900px) { .cards.eq { align-items: start; } }
.card:not(.card--feature) > .meta { flex: 1; }
.case { border-top: 1px solid var(--line); margin: 4px 12px 0; }
.case summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  min-height: 56px; font-weight: 500; font-size: 17px; border-radius: 8px;
}
.case summary::-webkit-details-marker { display: none; }
.case-mark { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); position: relative; flex: none; transition: transform .5s var(--ease), background .3s var(--ease); }
.case-mark::before, .case-mark::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 1.5px; margin: -0.75px 0 0 -5px; background: var(--ink); }
.case-mark::after { transform: rotate(90deg); transition: transform .5s var(--ease); }
.case[open] .case-mark::after { transform: rotate(0); }
.case summary:hover .case-mark { background: var(--paper); }
.case-body { display: grid; gap: 20px; padding: 4px 0 20px; }
.case-b { display: grid; gap: 8px; align-content: start; }
.case-b p:not(.label) { font-size: 16px; line-height: 1.5; text-wrap: pretty; }
.case-b .tags li { font-size: 13px; padding: 4px 10px; }
@media (min-width: 900px) {
  .card--feature .case { grid-column: 1 / -1; margin: 0 4px; }
  .card--feature .case-body { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
}

/* ---------- studio ---------- */
.studio-body { display: grid; gap: 48px; }
.studio-p { font-size: clamp(22px, 2.6vw, 34px); line-height: 1.22; letter-spacing: -0.025em; font-weight: 500; max-width: 26em; text-wrap: pretty; }
.studio-p + .studio-p { margin-top: 20px; color: var(--ink-2); font-size: clamp(17px, 1.6vw, 20px); letter-spacing: -0.005em; font-weight: 400; line-height: 1.5; max-width: 38em; }
.timeline { display: grid; gap: 0; border-top: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.timeline .when { font: 500 12px/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); display: flex; align-items: center; gap: 10px; }
.timeline .what { font-size: 19px; line-height: 1.35; }
.timeline .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); flex: none; }
.timeline .dot--next { background: var(--spark); }
@media (min-width: 900px) {
  .studio-body { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
  .studio-text { grid-column: 1 / span 7; }
  .timeline { grid-column: 9 / span 4; }
}

/* ---------- contact ---------- */
.contact-mail {
  display: block; font-size: clamp(30px, 11.1vw, 158px); font-weight: 600;
  letter-spacing: -0.05em; line-height: 1; text-decoration: none;
  overflow-wrap: anywhere; padding: 8px 0;
  transition: opacity .3s var(--ease);
}
.contact-mail:hover { opacity: .65; }
.contact-row { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; margin-top: 40px; position: relative; }
#copy { min-width: 10.5em; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }

/* ---------- footer ---------- */
.foot { margin-top: 144px; border-top: 1px solid var(--line); padding: 48px 0 56px; }
.foot-grid { display: grid; gap: 40px; }
.foot-legal { font-size: 15px; color: var(--ink-2); max-width: 30em; }
.foot nav { display: grid; gap: 4px; align-content: start; }
.foot nav .label { margin-bottom: 8px; }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 16px; text-decoration: none; width: fit-content; }
.foot nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot nav ul { display: flex; flex-wrap: wrap; gap: 0 20px; }
.foot-copy { font: 500 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); }
@media (min-width: 900px) {
  .foot-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
  .foot-legal { grid-column: 1 / span 5; }
  .foot nav.n1 { grid-column: 7 / span 3; }
  .foot nav.n2 { grid-column: 10 / span 3; }
  .foot-copy { grid-column: 1 / -1; }
}

/* ---------- fallback hover lifts (no WebGL) ---------- */
.gl-off .icon, .no-js .icon { transition: transform .6s var(--ease); }
.gl-off .card:hover .icon, .no-js .card:hover .icon { transform: translateY(-4px) rotate(-2deg); }

/* ---------- still render for the fallback image ---------- */
.still body, .still { background: transparent !important; }
.still .nav, .still main > *:not(.hero), .still .foot, .still .hero__text, .still .tray-labels, .still .skip { visibility: hidden; }

/* ---------- reduced motion: nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .btn:hover, .card:hover { transform: none; }
}

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  :root { --nav-h: 64px; }
  .hero { padding-bottom: 24px; }
  .hero__side { gap: 16px; }
  .cta .btn { flex: 1 1 100%; }
  .tray-box { width: 100%; min-width: 0; aspect-ratio: 1 / 1; }
  .tray-labels li { width: 44%; left: var(--mx); top: var(--my); }
  .tray-labels .code { font-size: 11px; }
  .tray-labels .name { font-size: 13px; }
  .meta-head { grid-template-columns: auto 1fr; }
  .meta-head .pill { grid-column: 1 / -1; justify-self: start; }
  .icon { width: 56px; height: 56px; }
  .timeline li { grid-template-columns: 80px 1fr; }
  .nav li a { padding: 0 10px; }
}
@media (max-width: 380px) {
  .nav .wrap { gap: 12px; }
  .nav ul { gap: 0; }
  .nav li a { padding: 0 6px; font-size: 14px; }
  .wordmark { font-size: 24px; }
}
