/* =========================================================
   Inner pages (Services, Work, About, Contact)
   ---------------------------------------------------------
   Motion language: "dot matrix". Everything appears through dots,
   echoing the particle hero on the home page:
   - dot page transitions (js/transition.js)
   - halftone page heroes that ripple around the cursor
   - headlines that decode from dots into letters
   - images revealed through a growing halftone mask
   - a teal dot spotlight that follows the cursor over cards
   - halftone numerals and a dot section rail
   ========================================================= */

/* ---------- Page transition: curved curtain (js/transition.js) ---------- */
.pc { position: fixed; inset: 0; z-index: 150; pointer-events: none; overflow: hidden; }
.pc__panel {
  position: absolute; left: -10vw; width: 120vw; height: 125vh; top: 0;
  transform: translate3d(0, 105vh, 0); will-change: transform;
}
.pc__panel--ink { background: var(--ink); border-radius: 50% 50% 0 0 / 14vh 14vh 0 0; }
.pc__panel--teal { background: var(--teal); border-radius: 50% 50% 0 0 / 14vh 14vh 0 0; }
.pc__label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: clamp(12px, 2vw, 28px);
  opacity: 0; transform: translate3d(0, 40px, 0); will-change: transform, opacity;
}
.pc__label img { width: clamp(44px, 6vw, 88px); height: auto; }
.pc__name { font-size: clamp(48px, 9vw, 150px); font-weight: 600; letter-spacing: -0.055em; line-height: 1; color: var(--ink); }

/* Leaving the page: panels sweep up (ink first, teal on top), then the label rises. */
.pc.is-entering .pc__panel { transform: translate3d(0, -12vh, 0); }
.pc.is-entering .pc__panel--ink { transition: transform 0.5s cubic-bezier(0.76, 0, 0.24, 1); }
.pc.is-entering .pc__panel--teal { transition: transform 0.5s cubic-bezier(0.76, 0, 0.24, 1) 0.08s; }
.pc.is-entering .pc__label { opacity: 1; transform: none; transition: opacity 0.25s 0.32s, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.32s; }

/* Arriving: start covered, then the label lifts and the panels sweep away upwards. */
.pc.is-covered .pc__panel { transform: translate3d(0, -12vh, 0); border-radius: 0 0 50% 50% / 0 0 14vh 14vh; }
.pc.is-covered .pc__label { opacity: 1; transform: none; }
.pc.is-covered.is-leaving .pc__panel { transform: translate3d(0, -130vh, 0); }
.pc.is-covered.is-leaving .pc__panel--teal { transition: transform 0.6s cubic-bezier(0.76, 0, 0.24, 1) 0.12s; }
.pc.is-covered.is-leaving .pc__panel--ink { transition: transform 0.6s cubic-bezier(0.76, 0, 0.24, 1) 0.2s; }
.pc.is-covered.is-leaving .pc__label { opacity: 0; transform: translate3d(0, -40px, 0); transition: opacity 0.2s, transform 0.3s cubic-bezier(0.7, 0, 0.84, 0); }

/* ---------- Custom cursor ---------- */
html.has-cursor, html.has-cursor a, html.has-cursor button, html.has-cursor label, html.has-cursor [role="tab"] { cursor: none; }
.cur, .cur-ring { position: fixed; left: 0; top: 0; z-index: 140; pointer-events: none; opacity: 0; transition: opacity 0.3s; }
html.cursor-on .cur, html.cursor-on .cur-ring { opacity: 1; }
.cur::before {
  content: ""; position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink); box-shadow: 0 0 0 1.5px var(--ivory);
  transition: transform 0.3s var(--ease-out), background 0.3s, box-shadow 0.3s;
}
.cur.on-dark::before { background: var(--ivory); box-shadow: 0 0 0 1.5px var(--ink); }
.cur.is-view::before, .cur.is-text::before { transform: scale(0); }
.cur-ring > span {
  position: absolute; left: -20px; top: -20px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-size: 0; font-weight: 600; color: var(--ink);
  border: 1.5px solid var(--ink); box-shadow: 0 0 0 1px rgba(235, 228, 211, 0.6);
  transition: transform 0.45s var(--ease-out), background 0.3s, border-color 0.3s, font-size 0.2s, opacity 0.3s;
}
.cur-ring.on-dark > span { border-color: var(--ivory); box-shadow: 0 0 0 1px rgba(3, 18, 17, 0.6); }
.cur-ring.is-link > span { transform: scale(1.6); background: rgba(0, 174, 187, 0.22); }
.cur-ring.is-view > span { transform: scale(2.5); background: var(--teal); border-color: var(--teal); box-shadow: none; font-size: 6px; color: var(--ink); }
.cur-ring.is-text > span { opacity: 0; transform: scale(0.4); }
.cur-ring.is-down > span { transform: scale(0.8); }
.cur-ring.is-link.is-down > span { transform: scale(1.3); }

/* Retired: the old cover used by the dot transition */
html.from-transition body::after {
  content: ""; position: fixed; inset: 0; z-index: 150; background: var(--teal);
  animation: cover-fallback 0.5s 2.5s forwards;
}
@keyframes cover-fallback { to { opacity: 0; visibility: hidden; } }
.cursor-label { display: none; }

/* ---------- Active nav link ---------- */
.nav a[aria-current="page"] { position: relative; }
.nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: 50%; bottom: -10px; width: 6px; height: 6px; margin-left: -3px;
  border-radius: 50%; background: var(--teal);
}
.menu__nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 8px; }

/* ---------- Page hero with halftone field ---------- */
.phero {
  position: relative; min-height: 92dvh; overflow: hidden;
  display: flex; align-items: flex-end;
  padding: calc(var(--header-h) + 48px) 0 clamp(48px, 6vw, 88px);
}
.phero__field {
  position: absolute; top: 0; right: 0; width: 56%; height: 100%; z-index: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 34%); mask-image: linear-gradient(90deg, transparent 0%, #000 34%);
}
.phero__inner { position: relative; z-index: 1; }
.phero__crumb { display: flex; gap: 10px; align-items: center; color: var(--text-muted); }
.phero__crumb a:hover { color: var(--ink); }
.phero__crumb span:last-child { color: var(--ink); }
.phero__title {
  margin-top: clamp(20px, 3vw, 32px); max-width: 13ch;
  font-size: clamp(52px, 7vw, 120px); font-weight: 600; letter-spacing: -0.055em; line-height: 0.94;
}
.phero__lead { margin-top: 28px; font-size: var(--fs-lead); line-height: 1.45; color: var(--text-muted); max-width: 40ch; }
.phero__jumps { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 8px; }
.phero__jumps a {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px;
  border: 1.5px solid var(--ink); font-weight: 500; font-size: 15px;
  transition: background 0.3s, color 0.3s;
}
.phero__jumps a::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.phero__jumps a:hover { background: var(--ink); color: var(--ivory); }

/* ---------- Decode headlines ---------- */
.dc { position: relative; display: inline-block; }
.dc.is-hidden { color: transparent; }
.dc.is-hidden::after {
  content: attr(data-g); position: absolute; inset: 0; text-align: center;
  color: var(--teal); font-weight: 600;
}
.on-dark .dc.is-hidden::after, .cband .dc.is-hidden::after { color: var(--teal); }

/* ---------- Halftone image reveal ---------- */
.ht {
  --d: 30px;
  position: relative; overflow: hidden; border-radius: var(--radius-media);
  -webkit-mask-image: radial-gradient(circle at center, #000 var(--d), transparent calc(var(--d) + 0.6px));
  mask-image: radial-gradient(circle at center, #000 var(--d), transparent calc(var(--d) + 0.6px));
  -webkit-mask-size: 18px 18px; mask-size: 18px 18px;
}
.ht.ht-done { -webkit-mask-image: none; mask-image: none; }
.ht img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Dot spotlight on cards ---------- */
.spot { position: relative; isolation: isolate; }
.spot::after {
  content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none;
  background-image: radial-gradient(circle, var(--teal) 1.5px, transparent 2px);
  background-size: 12px 12px;
  -webkit-mask-image: radial-gradient(circle 170px at var(--mx, 50%) var(--my, 50%), #000 0%, transparent 70%);
  mask-image: radial-gradient(circle 170px at var(--mx, 50%) var(--my, 50%), #000 0%, transparent 70%);
  opacity: 0; transition: opacity 0.45s var(--ease-out);
}
.spot:hover::after { opacity: 0.9; }

/* ---------- Halftone numerals ---------- */
.hnum {
  display: inline-block; font-weight: 700; letter-spacing: -0.04em; line-height: 0.9;
  color: var(--ink); -webkit-text-fill-color: transparent; -webkit-text-stroke: 1.5px var(--ink);
  background-image: radial-gradient(circle, var(--ink) 2.3px, transparent 2.7px);
  background-size: 6px 6px;
  -webkit-background-clip: text; background-clip: text;
  transition: background-size 0.6s var(--ease-out);
}
.on-dark .hnum, .cband .hnum { color: var(--teal); -webkit-text-stroke-color: var(--teal); background-image: radial-gradient(circle, var(--teal) 2.3px, transparent 2.7px); }
.principle:hover .hnum, .stat-dot:hover .hnum { background-size: 5px 5px; background-image: radial-gradient(circle, var(--teal) 1.8px, transparent 2.2px); }

/* ---------- Dot section rail ---------- */
.rail {
  position: fixed; left: calc(var(--gutter) * 0.45); top: 50%; z-index: 30; transform: translateY(-50%);
  display: grid; gap: 14px;
}
.rail a { position: relative; display: block; width: 12px; height: 12px; }
.rail a::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--ivory); border: 1.5px solid var(--ink);
  transition: background 0.3s, transform 0.4s var(--ease-out);
}
.rail a.is-active::before { background: var(--teal); border-color: var(--teal); transform: scale(1.35); }
.rail a span {
  position: absolute; left: 22px; top: 50%; transform: translate(-6px, -50%); white-space: nowrap;
  padding: 5px 10px; border-radius: 999px; background: var(--ink); color: var(--ivory);
  font-family: var(--mono); font-size: 12px; opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.4s var(--ease-out);
}
.rail a:hover span, .rail a:focus-visible span { opacity: 1; transform: translate(0, -50%); }

/* ---------- Shared section bits ---------- */
.psec { padding: var(--space-section) 0; }
.psec--tight { padding-top: 0; }
.on-dark { background: var(--ink); color: var(--ivory); }
.psec__title { font-size: var(--fs-h2); font-weight: 600; letter-spacing: -0.05em; line-height: 0.95; max-width: 16ch; }
.psec__lead { margin-top: 20px; font-size: var(--fs-lead); color: var(--text-muted); max-width: 44ch; }
.on-dark .psec__lead { color: var(--on-dark-muted); }

/* ---------- Services blocks ---------- */
.sblock { padding: clamp(72px, 10vw, 140px) 0; border-top: 1px solid var(--line); }
.sblock:first-of-type { border-top: 0; }
.sblock__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 112px); align-items: start; }
.sblock--flip .sblock__media { order: -1; }
.sblock__media { position: sticky; top: calc(var(--header-h) + 32px); aspect-ratio: 4 / 5; max-height: calc(100dvh - var(--header-h) - 64px); }
.sblock__tag { display: inline-flex; gap: 10px; align-items: center; padding: 7px 14px; border-radius: 999px; background: var(--teal); color: var(--ink); }
.sblock h2 { margin-top: 24px; font-size: clamp(44px, 5.6vw, 92px); font-weight: 600; letter-spacing: -0.05em; line-height: 0.95; }
.sblock__lead { margin-top: 20px; font-size: var(--fs-lead); line-height: 1.45; color: var(--text-muted); max-width: 40ch; }
.incl { margin-top: 40px; display: grid; }
.incl li { display: grid; grid-template-columns: 22px 1fr; gap: 4px 14px; padding: 18px 0; border-top: 1px solid var(--line); }
.incl li::before { content: ""; grid-row: 1 / 3; width: 10px; height: 10px; margin-top: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(0, 174, 187, 0.2); }
.incl strong { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.incl span { color: var(--text-muted); }
.sblock__facts { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 28px; }
.sblock__facts div { display: grid; gap: 4px; }
.sblock__facts dt { font-family: var(--mono); font-size: 12px; color: var(--text-muted); }
.sblock__facts dd { margin: 0; font-weight: 600; font-size: 18px; }
.sblock .link-arrow { margin-top: 36px; }

/* ---------- Process dot trail ---------- */
.trail { position: relative; margin-top: clamp(48px, 6vw, 80px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.trail__dots { position: absolute; left: 28px; right: calc(25% - 28px); top: 27px; display: flex; justify-content: space-between; pointer-events: none; }
.trail__dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.tstep { position: relative; }
.tstep__dot {
  position: relative; z-index: 1; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--ivory); border: 1.5px solid var(--ink);
  transition: background 0.5s, color 0.5s, border-color 0.5s, transform 0.5s var(--ease-out);
}
.on-dark .tstep__dot { background: var(--ink); border-color: var(--line-dark); }
.tstep.is-active .tstep__dot { background: var(--teal); border-color: var(--teal); color: var(--ink); transform: scale(1.08); }
.tstep h3 { margin-top: 28px; font-size: clamp(28px, 2.6vw, 40px); font-weight: 600; letter-spacing: -0.045em; }
.tstep p { margin-top: 10px; color: var(--on-dark-muted); max-width: 30ch; }

/* ---------- Ways to work (plans) ---------- */
.plans { margin-top: clamp(48px, 6vw, 80px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan { border-radius: var(--radius-panel); padding: clamp(28px, 3vw, 44px); display: flex; flex-direction: column; min-height: 460px; overflow: hidden; }
.plan--teal { background: var(--teal); color: var(--ink); }
.plan--ink { background: var(--ink); color: var(--ivory); }
.plan--line { border: 1.5px solid var(--ink); }
.plan--teal.spot::after { background-image: radial-gradient(circle, var(--ink) 1.5px, transparent 2px); }
.plan .mono { opacity: 0.75; }
.plan h3 { margin-top: 16px; font-size: clamp(30px, 2.8vw, 44px); font-weight: 600; letter-spacing: -0.045em; line-height: 1; }
.plan p { margin-top: 14px; opacity: 0.85; }
.plan ul { margin: 24px 0 32px; display: grid; gap: 10px; }
.plan li { display: flex; gap: 10px; align-items: baseline; }
.plan li::before { content: ""; flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: currentColor; transform: translateY(-2px); }
.plan .btn { margin-top: auto; align-self: flex-start; }

/* ---------- CTA band ---------- */
.cband { padding: 0 0 var(--space-section); }
.cband__box {
  position: relative; overflow: hidden; border-radius: var(--radius-panel);
  background: var(--ink); color: var(--ivory); padding: clamp(40px, 7vw, 112px);
  display: grid; grid-template-columns: 1.4fr auto; gap: 40px; align-items: end;
}
.cband__box::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(0, 174, 187, 0.35) 1.5px, transparent 2px); background-size: 16px 16px;
  -webkit-mask-image: linear-gradient(110deg, transparent 35%, #000 100%); mask-image: linear-gradient(110deg, transparent 35%, #000 100%);
}
.cband h2 { position: relative; font-size: clamp(44px, 6vw, 104px); font-weight: 600; letter-spacing: -0.05em; line-height: 0.95; }
.cband p { position: relative; margin-top: 20px; color: var(--on-dark-muted); font-size: var(--fs-lead); max-width: 40ch; }
.cband .btn { position: relative; }

/* ---------- Work page ---------- */
.filters { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 8px; }
.filters button {
  padding: 12px 20px; border-radius: 999px; border: 1.5px solid var(--ink); font-weight: 600; font-size: 15px;
  transition: background 0.3s, color 0.3s;
}
.filters button:hover { background: rgba(3, 18, 17, 0.06); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--ivory); }
.filters sup { margin-left: 6px; font-family: var(--mono); font-size: 11px; opacity: 0.7; }
.cases { margin-top: clamp(48px, 6vw, 80px); display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 5vw, 72px) clamp(24px, 3vw, 48px); }
.case-card { display: block; }
.case-card:nth-child(even) { transform: translateY(clamp(0px, 8vw, 140px)); }
.case-card.is-out { display: none; }
.case-card__media { aspect-ratio: 4 / 3; border-radius: var(--radius-media); }
.case-card__media img { transition: transform 1.2s var(--ease-out); }
.case-card:hover .case-card__media img { transform: scale(1.05); }
.case-card__meta { margin-top: 20px; display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; align-items: start; }
.case-card h3 { font-size: clamp(26px, 2.4vw, 36px); font-weight: 600; letter-spacing: -0.04em; }
.case-card p { grid-column: 1; color: var(--text-muted); }
.case-card .tags { grid-row: 1 / span 2; grid-column: 2; }
.case-card .tags li { border-color: var(--line); }
.case-card .case-card__result { grid-column: 1 / -1; margin-top: 10px; display: inline-flex; align-items: baseline; gap: 10px; justify-self: start; padding: 8px 14px; border-radius: 999px; background: var(--ink); color: var(--ivory); font-size: 14px; }
.case-card__result strong { color: var(--teal); font-size: 18px; letter-spacing: -0.02em; }
.cases-wrap { padding-bottom: calc(var(--space-section) + 140px); }

.feature__grid { margin-top: clamp(48px, 6vw, 80px); display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 64px); }
.feature__col h3 { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--teal); }
.feature__col p { margin-top: 14px; font-size: var(--fs-lead); line-height: 1.45; color: var(--on-dark-muted); }
.feature__media { margin-top: clamp(48px, 6vw, 80px); aspect-ratio: 21 / 9; }
.feature__stats { margin-top: clamp(48px, 6vw, 80px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; border-top: 1px solid var(--line-dark); padding-top: 40px; }
.feature__stats strong { display: block; font-size: clamp(56px, 7vw, 120px); }
.feature__stats p { margin-top: 10px; color: var(--on-dark-muted); }

/* ---------- About page ---------- */
.story { display: grid; grid-template-columns: 1fr 2.4fr; gap: clamp(32px, 5vw, 80px); }
.story__z { width: clamp(90px, 12vw, 200px); position: sticky; top: calc(var(--header-h) + 40px); align-self: start; }
.story__z img { width: 100%; height: auto; }
.story__text p { font-size: clamp(26px, 3.2vw, 50px); font-weight: 500; letter-spacing: -0.035em; line-height: 1.15; }
.story__text p + p { margin-top: 0.8em; }
.story__text em { font-family: var(--serif); font-style: italic; font-weight: 500; }
.principles { margin-top: clamp(48px, 6vw, 80px); display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); }
.principle { padding: clamp(32px, 4vw, 56px) clamp(0px, 2vw, 32px) clamp(32px, 4vw, 56px) 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: start; }
.principle:nth-child(odd) { border-right: 1px solid var(--line); }
.principle:nth-child(even) { padding-left: clamp(24px, 3vw, 48px); }
.principle .hnum { font-size: clamp(72px, 8vw, 132px); }
.principle h3 { font-size: clamp(26px, 2.4vw, 36px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.05; }
.principle p { margin-top: 10px; color: var(--text-muted); max-width: 36ch; }
.stats-dots { margin-top: clamp(48px, 6vw, 80px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stat-dot .hnum { font-size: clamp(52px, 5.6vw, 96px); }
.stat-dot p { margin-top: 10px; color: var(--on-dark-muted); font-weight: 500; }

/* ---------- Contact page ---------- */
.ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.way {
  display: flex; flex-direction: column; min-height: 260px; padding: clamp(24px, 3vw, 40px);
  border-radius: var(--radius-panel); border: 1.5px solid var(--ink); overflow: hidden;
  transition: background 0.4s, color 0.4s;
}
.way .mono { color: var(--text-muted); }
.way h3 { margin-top: auto; font-size: clamp(26px, 2.4vw, 38px); font-weight: 600; letter-spacing: -0.04em; overflow-wrap: anywhere; }
.way p { margin-top: 8px; color: var(--text-muted); }
.way i { font-style: normal; display: inline-block; transition: transform 0.5s var(--ease-out); }
.way:hover i { transform: translate(4px, -4px); }
.way--teal { background: var(--teal); border-color: var(--teal); }
.way--teal .mono, .way--teal p { color: var(--on-teal-muted); }
.way--teal.spot::after { background-image: radial-gradient(circle, var(--ink) 1.5px, transparent 2px); }
.cpanel { margin-top: 16px; border-radius: var(--radius-panel); padding: clamp(28px, 5vw, 80px); display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(40px, 6vw, 112px); }
.next h2 { font-size: clamp(30px, 3vw, 48px); font-weight: 600; letter-spacing: -0.045em; }
.next ol { margin-top: 32px; display: grid; gap: 28px; }
.next li { display: grid; grid-template-columns: 48px 1fr; gap: 16px; }
.next li span { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: var(--ink); }
.next li strong { display: block; font-size: 19px; }
.next li p { margin-top: 4px; color: var(--on-dark-muted); }
.faq-page .faq__grid { padding-top: var(--space-section); }


/* ---------- Giant outlined page word ---------- */
.kword { overflow: hidden; padding: 8px 0 clamp(24px, 4vw, 56px); }
.kword__track { display: flex; align-items: center; gap: 0.25em; width: max-content; font-size: clamp(96px, 17vw, 300px); font-weight: 700; letter-spacing: -0.05em; line-height: 0.9; will-change: transform; }
.kword__track span { color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
.kword__track span:nth-child(4n + 3) { color: var(--ink); -webkit-text-stroke: 0; }
.kword__track i { font-style: normal; color: var(--teal); font-size: 0.4em; }

/* ---------- Services: 3D cube overview ---------- */
.cube-sec { padding: clamp(64px, 8vw, 120px) 0; }
.cube-sec__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: center; }
.cube-list { margin-top: 36px; display: grid; }
.cube-list a {
  display: grid; grid-template-columns: 48px 1fr; gap: 4px 12px; padding: 22px 0; border-top: 1px solid var(--line);
  opacity: 0.45; transition: opacity 0.5s var(--ease-out);
}
.cube-list li:last-child a { border-bottom: 1px solid var(--line); }
.cube-list a .mono { grid-row: 1 / 3; padding-top: 6px; }
.cube-list strong { font-size: clamp(24px, 2.4vw, 36px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.1; }
.cube-list em { font-style: normal; color: var(--text-muted); }
.cube-list li.is-active a, .cube-list a:hover { opacity: 1; }
.cube-list li.is-active strong { text-decoration: underline; text-decoration-color: var(--teal); text-decoration-thickness: 4px; text-underline-offset: 8px; }
.cube-scene { --s: min(34vw, 420px, calc((100dvh - var(--header-h) - 120px) / 1.45)); display: grid; place-items: center; height: calc(var(--s) * 1.45); perspective: 1600px; }
.cube { position: relative; width: var(--s); height: var(--s); transform-style: preserve-3d; transform: rotateX(-14deg) rotateY(-28deg); will-change: transform; }
.cube__face { position: absolute; inset: 0; overflow: hidden; display: flex; align-items: flex-end; padding: 8%; border: 1.5px solid var(--ink); }
.cube__face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cube__face span { position: relative; font-size: calc(var(--s) * 0.12); font-weight: 600; letter-spacing: -0.045em; line-height: 0.95; }
.f-ai { color: var(--ink); background: var(--teal); }
.f-web { color: var(--ivory); background: var(--ink); }
.f-app { color: var(--ink); background: var(--ivory); }
.f-z { background: var(--teal); align-items: center; justify-content: center; }
.f-z .cube__z { position: relative; inset: auto; width: 50%; height: auto; object-fit: contain; }
.cube__face--top, .cube__face--bottom { background: var(--ink); }
.cube__face--front { transform: translateZ(calc(var(--s) / 2)); }
.cube__face--right { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.cube__face--back { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.cube__face--left { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.cube__face--top { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.cube__face--bottom { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }

/* ---------- Work: 3D project carousel ---------- */
.spin {
  --w: clamp(160px, 16vw, 250px);
  position: relative; height: calc(var(--w) * 2.05); margin-bottom: 24px;
  perspective: 2000px; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.spin__ring { position: absolute; left: 50%; top: 44%; transform-style: preserve-3d; will-change: transform; }
.r3card {
  position: absolute; left: calc(var(--w) / -2); top: calc(var(--w) * -0.62); width: var(--w); aspect-ratio: 4 / 5;
  border-radius: var(--radius-media); overflow: hidden; background: var(--ink);
  transform: rotateY(var(--a, 0deg)) translateZ(var(--r, calc(var(--w) * 1.55)));
  box-shadow: 0 30px 60px -30px rgba(3, 18, 17, 0.6);
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.r3card img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.r3card span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 18px 16px;
  background: linear-gradient(180deg, rgba(3, 18, 17, 0), rgba(3, 18, 17, 0.9));
  color: var(--ivory); font-weight: 600; font-size: 18px; letter-spacing: -0.02em;
}
.spin__hint { position: absolute; z-index: 2; left: 0; right: 0; bottom: 4px; text-align: center; color: var(--text-muted); }

/* ---------- About: flip cards ---------- */
.pcards { margin-top: clamp(48px, 6vw, 80px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.pcard { perspective: 1200px; min-height: 340px; outline-offset: 6px; }
.pcard__in { position: relative; height: 100%; min-height: inherit; transform-style: preserve-3d; transition: transform 0.9s var(--ease-out); }
.pcard:hover .pcard__in, .pcard:focus-visible .pcard__in, .pcard.is-flipped .pcard__in { transform: rotateY(180deg); }
.pcard__front, .pcard__back {
  position: absolute; inset: 0; border-radius: var(--radius-panel); padding: clamp(24px, 2.4vw, 36px);
  display: flex; flex-direction: column; -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.pcard__front { border: 1.5px solid var(--ink); background: var(--ivory); }
.pcard__front .hnum { font-size: clamp(96px, 9vw, 150px); }
.pcard__front h3 { margin-top: auto; font-size: clamp(24px, 2vw, 32px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.05; }
.pcard__front .mono { margin-top: 12px; color: var(--text-muted); }
.pcard__back { transform: rotateY(180deg); background: var(--teal); color: var(--ink); justify-content: flex-end; }
.pcard__back h3 { font-size: clamp(24px, 2vw, 32px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.05; }
.pcard__back p { margin-top: 12px; font-size: 17px; line-height: 1.5; }

/* ---------- Contact: live message card ---------- */
.note { perspective: 1200px; margin-bottom: 48px; }
.note__card {
  position: relative; padding: 28px; border-radius: 18px; background: var(--ivory); color: var(--ink);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55); transform-style: preserve-3d; will-change: transform;
  background-image: repeating-linear-gradient(180deg, transparent 0 31px, rgba(3, 18, 17, 0.08) 31px 32px);
}
.note__stamp { position: absolute; top: 18px; right: 18px; width: 56px; height: 64px; display: grid; place-items: center; background: var(--teal); border: 2px dashed rgba(3, 18, 17, 0.5); border-radius: 6px; transform: rotate(6deg); }
.note__stamp img { width: 28px; height: auto; }
.note__head { color: var(--text-muted); }
.note__body { margin-top: 16px; padding-right: 64px; font-size: 19px; line-height: 1.5; font-weight: 500; }
.note__body b { font-weight: 600; border-bottom: 2px solid var(--teal); transition: color 0.3s; }
.note__body b.is-empty { color: var(--text-muted); border-bottom-style: dashed; }
.note__msg { margin-top: 12px; min-height: 3em; color: var(--ink); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.note__msg.is-empty { color: var(--text-muted); }
.note__from { margin-top: 16px; color: var(--text-muted); }

/* ---------- Reveals ---------- */
.anim [data-reveal] { opacity: 0; transform: translateY(40px); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .rail { display: none; }
  .pcards { grid-template-columns: 1fr 1fr; }
  .plans, .ways { grid-template-columns: 1fr; }
  .plan { min-height: 0; }
  .cband__box { grid-template-columns: 1fr; }
  .stats-dots { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .phero { min-height: 0; padding-top: calc(var(--header-h) + 260px); }
  .phero__field { width: 100%; height: 320px; top: var(--header-h); opacity: 0.9; -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%); mask-image: linear-gradient(180deg, #000 70%, transparent 100%); }
  .sblock__grid, .cpanel, .story, .feature__grid, .feature__stats { grid-template-columns: 1fr; }
  .sblock--flip .sblock__media { order: 0; }
  .sblock__media { position: static; aspect-ratio: 16 / 11; }
  .trail { grid-template-columns: 1fr; gap: 40px; }
  .trail__dots { display: none; }
  .cases { grid-template-columns: 1fr; }
  .case-card:nth-child(even) { transform: none; }
  .case-card__meta { grid-template-columns: 1fr; }
  .case-card .tags { grid-row: auto; grid-column: 1; justify-content: flex-start; }
  .cases-wrap { padding-bottom: var(--space-section); }
  .principles { grid-template-columns: 1fr; }
  .principle, .principle:nth-child(even) { border-right: 0; padding-left: 0; }
  .story__z { position: static; }
  .feature__media { aspect-ratio: 4 / 3; }
  .cube-sec__grid { grid-template-columns: 1fr; }
  .cube-scene { --s: min(62vw, 300px); order: -1; }
  .cube { animation: cube-spin 16s linear infinite; }
  .pcards { grid-template-columns: 1fr; }
  .pcard { min-height: 280px; }
}
@media (prefers-reduced-motion: reduce) {
  html.from-transition body::after { display: none; }
}

@keyframes cube-spin { from { transform: rotateX(-14deg) rotateY(0deg); } to { transform: rotateX(-14deg) rotateY(-360deg); } }
@media (prefers-reduced-motion: reduce) { .cube { animation: none; } }

/* While the cube section is pinned it is exactly one screen tall. */
@media (min-width: 861px) and (min-height: 640px) {
  .cube-sec { min-height: 100dvh; display: flex; align-items: center; padding: calc(var(--header-h) + 16px) 0 24px; }
  .cube-sec__grid { width: 100%; }
}
@media (min-width: 861px) and (max-height: 820px) {
  .cube-sec .psec__title { font-size: clamp(40px, 5.2vw, 72px); }
  .cube-list { margin-top: 20px; }
  .cube-list a { padding: 14px 0; }
  .cube-list strong { font-size: clamp(22px, 2vw, 30px); }
}
