/* ==========================================================================
   Vince Aaron Genodipa — portfolio
   Dark, editorial, one accent. No framework.
   ========================================================================== */

:root {
  --bg: #08080a;
  --bg-2: #0d0d11;
  --surface: #121217;
  --surface-2: #18181f;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #ededf0;
  --muted: #a3a3ad;
  --faint: #80808b;
  --accent: #ff6b3d;
  --accent-2: #ffb08c;
  --accent-soft: rgba(255, 107, 61, 0.12);
  --gate: #f2b84b;
  --live: #4ade80;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;

  --radius: 18px;
  --radius-sm: 10px;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1240px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

html.is-loading {
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

strong,
b {
  font-weight: 600;
  color: var(--text);
}

::selection {
  background: var(--accent);
  color: #111;
}

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Buttons, chips, tags ---------- */

.btn {
  --pad-y: 0.85rem;
  --pad-x: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: var(--pad-y) var(--pad-x);
  border-radius: 999px;
  font: 500 0.95rem/1 var(--font-sans);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.35s var(--ease-out);
  will-change: transform;
  white-space: nowrap;
}

.btn--primary {
  background: var(--text);
  color: #0a0a0c;
}

.btn--primary:hover {
  background: var(--accent);
  color: #0a0a0c;
}

.btn--ghost {
  border-color: var(--line-2);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}

.btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
}

.btn--sm {
  --pad-y: 0.6rem;
  --pad-x: 1rem;
  font-size: 0.85rem;
}

.btn--lg {
  --pad-y: 1.05rem;
  --pad-x: 1.6rem;
  font-size: 1.02rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--line-2);
  color: var(--muted);
}

.chip--accent {
  color: var(--accent-2);
  border-color: rgba(255, 107, 61, 0.4);
  background: var(--accent-soft);
}

.chip--gate {
  color: var(--gate);
  border-color: rgba(242, 184, 75, 0.4);
  background: rgba(242, 184, 75, 0.08);
}

.pill {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-size: 0.75rem;
  font-weight: 500;
  margin-right: 0.5rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tags span {
  font: 400 0.74rem/1 var(--font-mono);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--muted);
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
}

.dot--live {
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--text);
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}

.link-arrow::after {
  content: "↗";
  font-size: 0.85em;
  transition: transform 0.3s var(--ease-out);
}

.link-arrow:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.link-arrow:hover::after {
  transform: translate(2px, -2px);
}

/* ---------- Preloader ---------- */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: transform 1s var(--ease-io), visibility 0s linear 1s;
}

.preloader__inner {
  width: min(360px, 80vw);
  display: grid;
  gap: 1.1rem;
  justify-items: start;
  transition: opacity 0.4s, transform 0.6s var(--ease-io);
}

.preloader__mark {
  color: var(--text);
}

.preloader__ring {
  stroke: var(--accent);
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.2s linear;
}

.preloader__count {
  font: 300 clamp(4rem, 14vw, 7rem) / 0.9 var(--font-sans);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.preloader__count small {
  font-size: 0.35em;
  color: var(--faint);
  margin-left: 0.15em;
}

.preloader__bar {
  width: 100%;
  height: 2px;
  background: var(--line);
  overflow: hidden;
  border-radius: 2px;
}

.preloader__bar span {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform-origin: left;
  transform: scaleX(calc(var(--p, 0) / 100));
  transition: transform 0.2s linear;
}

.preloader__status {
  font: 400 0.78rem/1.4 var(--font-mono);
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  min-height: 1.4em;
}

html.is-ready .preloader {
  transform: translateY(-100%);
  visibility: hidden;
}

html.is-ready .preloader__inner {
  opacity: 0;
  transform: translateY(-30px);
}

/* ---------- Scroll progress ---------- */

.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 60;
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(var(--scroll, 0));
}

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background 0.35s, border-color 0.35s, backdrop-filter 0.35s, transform 0.5s var(--ease-out);
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  background: rgba(8, 8, 10, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-color: var(--line);
}

.js .nav {
  transform: translateY(-100%);
}

.js.is-ready .nav {
  transform: none;
  transition-delay: 0.4s;
}

.nav__inner {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav__logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--text);
  color: #0a0a0c;
  font-size: 0.8rem;
  font-weight: 700;
  transition: background 0.3s, transform 0.5s var(--ease-out);
}

.nav__brand:hover .nav__logo {
  background: var(--accent);
  transform: rotate(-8deg);
}

.nav__links {
  display: flex;
  gap: 1.7rem;
  margin-left: auto;
  font-size: 0.9rem;
}

.nav__links a {
  color: var(--muted);
  position: relative;
  transition: color 0.2s;
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-out);
}

.nav__links a:hover,
.nav__links a.is-active {
  color: var(--text);
}

.nav__links a.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav__cta-mobile {
  display: none;
}

.nav__toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: transparent;
  cursor: pointer;
  position: relative;
  margin-left: auto;
}

.nav__toggle span {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.35s var(--ease-out), top 0.35s var(--ease-out);
}

.nav__toggle span:first-child { top: 16px; }
.nav__toggle span:last-child { top: 24px; }

.nav.is-open .nav__toggle span:first-child { top: 20px; transform: rotate(45deg); }
.nav.is-open .nav__toggle span:last-child { top: 20px; transform: rotate(-45deg); }

@media (max-width: 960px) {
  .nav__toggle { display: block; }
  .nav__cta { display: none; }
  .nav__links {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.5rem;
    background: rgba(8, 8, 10, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    font-size: 1.15rem;
    clip-path: inset(0 0 100% 0);
    transition: clip-path 0.5s var(--ease-io);
    pointer-events: none;
  }
  .nav__links a { padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
  .nav__links a::after { display: none; }
  .nav__cta-mobile { display: block; color: var(--accent) !important; border-bottom: 0 !important; }
  .nav.is-open .nav__links { clip-path: inset(0 0 0 0); pointer-events: auto; }
  .nav.is-open { background: rgba(8, 8, 10, 0.96); }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px 0 90px;
  overflow: hidden;
  isolation: isolate;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0;
  transition: opacity 1.6s ease 0.3s;
  cursor: crosshair;
}

.is-ready .hero__canvas {
  opacity: 1;
}

.hero__glow {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(60% 55% at 72% 45%, rgba(255, 107, 61, 0.13), transparent 70%),
    radial-gradient(40% 40% at 15% 85%, rgba(120, 110, 255, 0.07), transparent 70%);
}

.no-webgl .hero__glow {
  background:
    radial-gradient(45% 50% at 72% 45%, rgba(255, 107, 61, 0.22), transparent 70%),
    radial-gradient(40% 40% at 15% 85%, rgba(120, 110, 255, 0.1), transparent 70%);
}

.hero__inner {
  position: relative;
  pointer-events: none;
}

.hero__inner > * {
  pointer-events: auto;
}

.hero__status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.9rem 0.45rem 0.75rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--muted);
  background: rgba(8, 8, 10, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  margin-bottom: 1.8rem;
}

.hero__title {
  font-size: clamp(2.6rem, 7.2vw, 6.4rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.045em;
  max-width: 13ch;
}

.hero__title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.hero__title .line > span {
  display: inline-block;
}

.hero__title em {
  color: var(--accent);
  letter-spacing: -0.02em;
  padding-right: 0.06em;
}

.hero__lead {
  margin-top: 1.8rem;
  max-width: 560px;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.2rem;
}

.hero__stats {
  margin-top: clamp(3rem, 7vh, 5rem);
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: start;
  gap: 0 clamp(1.5rem, 4vw, 3.5rem);
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  max-width: 760px;
}

.hero__stats dt {
  font: 400 0.72rem/1.3 var(--font-mono);
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  order: 2;
  margin-top: 0.35rem;
}

.hero__stats div {
  display: flex;
  flex-direction: column;
}

.hero__stats dd {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.hero__stats .hero__award {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent-2);
  letter-spacing: -0.01em;
}

.hero__hint {
  position: absolute;
  right: var(--gutter);
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font: 400 0.72rem/1 var(--font-mono);
  color: var(--faint);
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 1s 1.6s;
}

.is-ready .hero__hint {
  opacity: 1;
}

.hero__hint-mouse {
  width: 14px;
  height: 22px;
  border: 1.5px solid var(--faint);
  border-radius: 8px;
  position: relative;
}

.hero__hint-mouse::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 4px;
  width: 2px;
  height: 5px;
  margin-left: -1px;
  border-radius: 2px;
  background: var(--faint);
  animation: wheel 1.8s infinite;
}

@keyframes wheel {
  0% { transform: translateY(0); opacity: 1; }
  80% { transform: translateY(7px); opacity: 0; }
  100% { opacity: 0; }
}

/* Agent labels projected from the WebGL scene */
.agent-tags {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s 1.2s;
}

.is-ready .agent-tags {
  opacity: 1;
}

.agent-tag {
  position: absolute;
  left: 0;
  top: 0;
  font: 500 0.68rem/1 var(--font-mono);
  color: var(--text);
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: rgba(10, 10, 14, 0.72);
  border: 1px solid var(--line-2);
  white-space: nowrap;
  will-change: transform;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.agent-tag i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
}

.agent-tag.is-busy i {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* Intro (post-preloader) choreography */
.js .intro {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease-out), transform 1.1s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms + 250ms);
}

.js .hero__title .intro {
  opacity: 1;
  transform: translateY(105%);
}

.js.is-ready .intro {
  opacity: 1;
  transform: none;
}

@media (max-width: 760px) {
  .hero { align-items: flex-end; padding-top: 330px; padding-bottom: 60px; }
  .is-ready .hero__canvas { opacity: 0.95; }
  .hero__stats { grid-template-columns: repeat(2, auto); gap: 1.25rem 2.5rem; }
  .hero__hint { display: none; }
  .agent-tags { display: none; }
}

/* ---------- Logos marquee ---------- */

.logos {
  padding: 2.5rem 0 1rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}

.logos__label {
  font: 400 0.74rem/1 var(--font-mono);
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
}

.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  padding-bottom: 1.5rem;
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee var(--marquee-dur, 40s) linear infinite;
}

.marquee:hover .marquee__track {
  animation-play-state: paused;
}

.marquee__list {
  display: flex;
  gap: 1rem;
  padding-right: 1rem;
}

.marquee__list li {
  width: 168px;
  height: 84px;
  border-radius: 14px;
  background: #ecebe7;
  display: grid;
  place-items: center;
  padding: 14px 22px;
  flex: none;
}

.marquee__list img {
  max-height: 56px;
  width: auto;
  object-fit: contain;
  filter: grayscale(1) contrast(1.1);
  mix-blend-mode: multiply;
  opacity: 0.85;
  transition: filter 0.4s, opacity 0.4s;
}

.marquee__list li:hover img {
  filter: none;
  opacity: 1;
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(5rem, 11vw, 9rem) 0;
  position: relative;
}

.section--alt {
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section__head {
  max-width: 820px;
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.section__head--row {
  max-width: none;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2rem;
  align-items: end;
}

.eyebrow {
  font: 400 0.78rem/1 var(--font-mono);
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.section__title {
  font-size: clamp(2.1rem, 5vw, 4rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.section__title em {
  color: var(--accent-2);
}

.section__lead {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.3vw, 1.12rem);
  max-width: 620px;
}

.section__head--row .section__lead {
  margin-top: 0;
}

@media (max-width: 760px) {
  .section__head--row { grid-template-columns: 1fr; }
}

/* Reveal on scroll */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 1s var(--ease-out);
  transition-delay: var(--d, 0ms);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* Tilt */
[data-tilt] {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;
  transform-style: preserve-3d;
}

.tilt-active {
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry)) !important;
  transition: transform 0.15s linear, opacity 0.9s var(--ease-out) !important;
}

/* ---------- Solutions ---------- */

.solutions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.solution {
  position: relative;
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), rgba(18, 18, 23, 0.4));
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
  transition: border-color 0.4s, transform 0.6s var(--ease-out), opacity 0.9s var(--ease-out);
}

.solution::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 107, 61, 0.1), transparent 45%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.solution:hover {
  border-color: rgba(255, 107, 61, 0.35);
}

.solution:hover::before {
  opacity: 1;
}

.solution__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.solution__num {
  font: 400 0.8rem/1 var(--font-mono);
  color: var(--faint);
}

.solution__tag {
  font: 400 0.72rem/1 var(--font-mono);
  color: var(--accent-2);
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  background: var(--accent-soft);
}

.solution h3 {
  font-size: 1.28rem;
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.solution p {
  color: var(--muted);
  font-size: 0.95rem;
}

.solution__proof {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px dashed var(--line-2);
  font-size: 0.86rem !important;
  color: var(--text) !important;
}

.solution__proof span {
  display: block;
  font: 400 0.68rem/1 var(--font-mono);
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.45rem;
}

@media (max-width: 1024px) {
  .solutions { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .solutions { grid-template-columns: 1fr; }
}

/* ---------- Case studies ---------- */

.case {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding: clamp(2.5rem, 6vw, 5rem) 0;
  border-top: 1px solid var(--line);
}

.case:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.case--reverse .case__text {
  order: 2;
}

.case--wide {
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}

/* Grid children must be allowed to shrink below their min-content width,
   otherwise wide inner tracks (e.g. the SDLC pipeline) stretch the page. */
.case > *,
.product > *,
.forge > *,
.about > *,
.faq > *,
.contact__inner > *,
.section__head--row > * {
  min-width: 0;
}

.case__text--wide {
  max-width: 900px;
}

.case__kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  font: 400 0.78rem/1.4 var(--font-mono);
  color: var(--faint);
  margin-bottom: 1rem;
}

.case__title {
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.case__title em {
  color: var(--accent);
}

.case__summary {
  margin-top: 1.1rem;
  color: var(--muted);
  font-size: 1.02rem;
}

.checks {
  margin-top: 1.5rem;
  display: grid;
  gap: 0.7rem;
}

.checks li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 4px;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.5l4.5-5' fill='none' stroke='%23ff8a63' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/80% no-repeat;
}

.checks--compact li {
  font-size: 0.9rem;
}

.case__outcome {
  margin-top: 1.75rem;
  padding: 1rem 1.15rem;
  border-left: 2px solid var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  border-radius: 0 10px 10px 0;
  font-size: 0.95rem;
}

.case__outcome span {
  display: block;
  font: 400 0.68rem/1 var(--font-mono);
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.45rem;
}

@media (max-width: 960px) {
  .case { grid-template-columns: 1fr; }
  .case--reverse .case__text { order: 0; }
}

/* Chat demo */
.chat {
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, #121218, #0d0d12);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  overflow: hidden;
}

.chat__bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.chat__dots {
  display: flex;
  gap: 6px;
}

.chat__dots i,
.frame__bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.chat__title {
  font: 500 0.8rem/1 var(--font-mono);
  color: var(--muted);
}

.chat__replay {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: 400 0.75rem/1 var(--font-mono);
  color: var(--muted);
  background: none;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.chat__replay:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.chat__body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 470px;
}

.chat [data-step] {
  transition: opacity 0.5s var(--ease-out), transform 0.6s var(--ease-out);
}

.js .chat:not(.is-static) [data-step]:not(.is-on) {
  opacity: 0;
  transform: translateY(12px);
}

.msg {
  max-width: 90%;
  border-radius: 14px;
  padding: 0.8rem 1rem;
  font-size: 0.93rem;
}

.msg--user {
  align-self: flex-end;
  background: var(--text);
  color: #0b0b0e;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.msg--ai {
  align-self: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  color: var(--text);
}

.msg--ai sup {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.7em;
  margin-left: 1px;
}

.trace {
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
}

.trace__title {
  font: 400 0.68rem/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  margin-bottom: 0.65rem;
}

.trace ol {
  display: grid;
  gap: 0.45rem;
}

.trace li {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  color: var(--muted);
  transition: opacity 0.4s, color 0.4s;
}

.js .chat:not(.is-static) .trace li:not(.is-on) {
  opacity: 0.2;
}

.trace li b {
  color: var(--text);
  font-weight: 500;
}

.trace__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--faint);
  flex: none;
  transform: translateY(-1px);
}

.trace li.is-on .trace__dot {
  background: var(--live);
  border-color: var(--live);
}

.typing-caret::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 1em;
  margin-left: 2px;
  background: var(--accent);
  vertical-align: -2px;
  animation: blink 0.8s steps(2) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.sources {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.9rem;
  transition: opacity 0.5s, transform 0.5s var(--ease-out);
}

.js .chat:not(.is-static) .msg--ai:not(.is-done) .sources,
.js .chat:not(.is-static) .msg--ai:not(.is-done) .feedback {
  opacity: 0;
  transform: translateY(6px);
}

.source {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  transition: border-color 0.2s, background 0.2s;
}

.source:hover {
  border-color: rgba(255, 107, 61, 0.45);
  background: var(--accent-soft);
}

.source__n {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 600 0.7rem/1 var(--font-mono);
  flex: none;
}

.source b {
  display: block;
  font-weight: 500;
}

.source small {
  color: var(--faint);
  font-size: 0.72rem;
}

.feedback {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.7rem;
  transition: opacity 0.5s 0.2s, transform 0.5s 0.2s var(--ease-out);
}

.feedback span {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  filter: grayscale(0.4);
}

.chat__note {
  font: 400 0.7rem/1.4 var(--font-mono);
  color: var(--faint);
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 520px) {
  .sources { grid-template-columns: 1fr; }
  .chat__body { min-height: 540px; padding: 1rem; }
}

/* SDLC pipeline */
.sdlc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1.5rem;
}

.cmd {
  font: 400 0.82rem/1 var(--font-mono);
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  background: #050507;
  border: 1px solid var(--line-2);
  color: var(--text);
  margin-right: 0.25rem;
}

.cmd span {
  color: var(--accent);
  margin-right: 0.4rem;
}

.sdlc {
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: var(--surface);
  padding: clamp(1rem, 2.5vw, 1.75rem);
}

.sdlc__toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.sdlc__hint {
  font: 400 0.78rem/1.4 var(--font-mono);
  color: var(--faint);
}

.sdlc__track {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding: 0.25rem 0.25rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
  overscroll-behavior-x: contain;
}

.stage {
  flex: 1 0 128px;
  min-width: 128px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font: inherit;
  transition: border-color 0.3s, transform 0.4s var(--ease-out), background 0.3s, box-shadow 0.3s;
}

.stage:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
}

.stage__head {
  padding: 0.6rem 0.75rem;
  background: rgba(255, 107, 61, 0.14);
  border-bottom: 1px solid rgba(255, 107, 61, 0.25);
  font-weight: 600;
  font-size: 0.86rem;
  line-height: 1.2;
  min-height: 3.1em;
  transition: background 0.3s;
}

.stage__head small {
  display: block;
  font: 400 0.68rem/1 var(--font-mono);
  color: var(--accent-2);
  margin-bottom: 0.3rem;
}

.stage__skills {
  padding: 0.6rem 0.75rem 0.8rem;
  display: grid;
  gap: 0.3rem;
  font: 400 0.7rem/1.3 var(--font-mono);
  color: var(--faint);
  word-break: break-word;
}

.stage.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 18px 40px -20px rgba(255, 107, 61, 0.6);
}

.stage.is-selected .stage__head,
.stage.is-done .stage__head {
  background: var(--accent);
  color: #0b0b0e;
}

.stage.is-selected .stage__head small,
.stage.is-done .stage__head small {
  color: rgba(0, 0, 0, 0.6);
}

.stage.is-running {
  border-color: var(--accent);
  animation: running 0.9s ease-in-out infinite alternate;
}

@keyframes running {
  to { box-shadow: 0 0 0 4px rgba(255, 107, 61, 0.18); }
}

.connector {
  flex: 0 0 18px;
  align-self: center;
  height: 2px;
  background: var(--line-2);
  position: relative;
}

.connector.is-done {
  background: var(--accent);
}

.gate {
  flex: 0 0 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: var(--gate);
  font: 500 0.72rem/1 var(--font-sans);
  position: relative;
}

.gate::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: var(--line-2);
  z-index: 0;
}

.gate.is-done::before {
  background: var(--accent);
}

.gate__lock {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1a160c;
  border: 1px solid rgba(242, 184, 75, 0.45);
  transition: background 0.3s, transform 0.4s var(--ease-out);
}

.gate.is-waiting .gate__lock {
  animation: running 0.6s ease-in-out infinite alternate;
  transform: scale(1.1);
}

.gate.is-done .gate__lock {
  background: var(--gate);
  color: #1a1206;
}

.gate span {
  position: relative;
  z-index: 1;
  background: var(--surface);
  padding: 0 0.2rem;
}

.sdlc__detail {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.5rem;
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  min-height: 150px;
}

.sdlc__detail h4 {
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.sdlc__detail h4 small {
  font: 400 0.75rem/1 var(--font-mono);
  color: var(--accent);
  margin-right: 0.5rem;
}

.sdlc__detail p {
  color: var(--muted);
  font-size: 0.92rem;
}

.sdlc__detail .label {
  display: block;
  font: 400 0.68rem/1 var(--font-mono);
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}

.artifact {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  font: 400 0.78rem/1.35 var(--font-mono);
  color: var(--text);
  margin-bottom: 0.4rem;
  animation: pop 0.45s var(--ease-out) both;
}

.artifact::before {
  content: "▤";
  color: var(--accent);
}

.sdlc__log {
  font: 400 0.8rem/1.6 var(--font-mono);
  color: var(--muted);
}

.sdlc__log .ok { color: var(--live); }
.sdlc__log .gate-txt { color: var(--gate); }

@keyframes pop {
  from { opacity: 0; transform: translateY(6px); }
}

@media (max-width: 760px) {
  .sdlc__detail { grid-template-columns: 1fr; }
  .sdlc__toolbar { flex-direction: column; align-items: flex-start; }
}

/* Skills board */
.skills-board {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: clamp(1.25rem, 3vw, 2rem);
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(255, 107, 61, 0.07), transparent 60%),
    var(--bg);
}

.skills-board__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.skills-board__head h4 {
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.skills-board__head p {
  color: var(--muted);
  font-size: 0.9rem;
}

.skills-board__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.skillset {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.3s, transform 0.4s var(--ease-out);
}

.skillset:hover {
  border-color: rgba(255, 107, 61, 0.35);
  transform: translateY(-2px);
}

.skillset h5 {
  font: 500 0.7rem/1 var(--font-mono);
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.skillset li {
  font: 400 0.82rem/1.35 var(--font-mono);
  color: var(--text);
  padding: 0.2rem 0;
  word-break: break-word;
}

.skillset li span {
  color: var(--accent);
}

@media (max-width: 1024px) {
  .skills-board__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .skills-board__grid { grid-template-columns: 1fr; }
}

/* Semantic search vector space */
.vecspace {
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, #111116, #0b0b0f);
  padding: 1rem;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8);
}

.vecspace__queries {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.qchip {
  font: 400 0.8rem/1 var(--font-mono);
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: all 0.25s;
}

.qchip::before {
  content: "⌕ ";
  color: var(--faint);
}

.qchip:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.35);
}

.qchip.is-active {
  color: #0b0b0e;
  background: var(--text);
  border-color: var(--text);
}

.qchip.is-active::before {
  color: #0b0b0e;
}

.vecspace__svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 26px 26px;
  background-color: #08080b;
}

.vecspace__svg text {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--muted);
}

.vecspace__svg .cluster-label {
  font-size: 9px;
  fill: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.vec-doc circle {
  fill: #3a3a44;
  transition: fill 0.4s, r 0.4s;
}

.vec-doc.is-hit circle {
  fill: var(--accent);
}

.vec-doc.is-hit text {
  fill: var(--text);
}

.vec-line {
  stroke: var(--accent);
  stroke-width: 1.2;
  stroke-dasharray: 4 3;
  opacity: 0.85;
}

.vec-query circle.core {
  fill: var(--text);
}

.vec-query circle.halo {
  fill: none;
  stroke: var(--text);
  stroke-opacity: 0.3;
}

.vec-query text {
  fill: var(--text) !important;
  font-weight: 500;
}

.vecspace__compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.vecspace__compare div {
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.vecspace__compare .label {
  display: block;
  font: 400 0.68rem/1 var(--font-mono);
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.vecspace__compare b {
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--muted);
}

.vecspace__compare b.accent {
  color: var(--accent);
}

/* ---------- Products ---------- */

.frame {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  background: #0c0c10;
  box-shadow: 0 50px 100px -40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  position: relative;
}

.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.08), transparent 40%);
  opacity: 0;
  transition: opacity 0.4s;
}

[data-tilt]:hover .frame::after {
  opacity: 1;
}

.frame__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--line);
  background: #111116;
}

.frame__bar span {
  margin-left: 0.6rem;
  font: 400 0.72rem/1 var(--font-mono);
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frame--light .frame__bar {
  background: #f4f2ee;
  border-color: #e5e2dc;
}

.frame--light .frame__bar i {
  background: #d9d5ce;
}

.frame--light .frame__bar span {
  color: #77736c;
}

.frame img {
  width: 100%;
}

.product {
  display: grid;
  gap: 1.75rem;
}

.product--feature {
  grid-template-columns: 1.45fr 1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
  margin-bottom: clamp(4rem, 8vw, 6rem);
}

.product__kicker {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font: 400 0.76rem/1 var(--font-mono);
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.9rem;
}

.product h3 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 0.9rem;
}

.product__body > p {
  color: var(--muted);
}

.product__body .checks {
  margin-top: 1.1rem;
}

.product__body .tags {
  margin-top: 1.4rem;
}

.product__body .link-arrow {
  margin-top: 1.25rem;
}

.forge {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: clamp(3rem, 6vw, 4.5rem);
}

.forge__link {
  align-self: center;
  margin-top: -8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent);
  font: 400 0.7rem/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.forge__link svg {
  width: 64px;
}

.forge__link svg path {
  stroke-dasharray: 6 6;
  animation: dash 1.2s linear infinite;
}

@keyframes dash {
  to { stroke-dashoffset: -12; }
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 1.4rem;
}

.mini-stats div {
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.mini-stats b {
  display: block;
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}

.mini-stats span {
  font: 400 0.68rem/1.3 var(--font-mono);
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.card-product {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.4s, opacity 0.9s var(--ease-out), transform 0.6s var(--ease-out);
}

.card-product:hover {
  border-color: var(--line-2);
}

.card-product__media {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #0c0c10;
}

.card-product__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.9s var(--ease-out);
}

.card-product:hover .card-product__media img {
  transform: scale(1.04);
}

.badge {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(10, 10, 14, 0.85);
  border: 1px solid rgba(242, 184, 75, 0.45);
  color: var(--gate);
  backdrop-filter: blur(6px);
}

.card-product__body {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  flex: 1;
}

.card-product__body h3 {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.card-product__body p {
  color: var(--muted);
  font-size: 0.92rem;
}

.card-product__links {
  display: flex;
  gap: 1.25rem;
  margin-top: auto;
  padding-top: 0.3rem;
}

@media (max-width: 1024px) {
  .product--feature { grid-template-columns: 1fr; }
  .forge { grid-template-columns: 1fr; }
  .forge__link { margin: 0; flex-direction: row; }
  .forge__link svg { transform: rotate(90deg); width: 40px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .product-grid { grid-template-columns: 1fr; }
  .mini-stats b { font-size: 1.25rem; }
}

/* ---------- Experience timeline ---------- */

.timeline {
  border-top: 1px solid var(--line);
}

.role {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  padding: 2.25rem 0;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.role::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  height: 1px;
  width: 0;
  background: var(--accent);
  transition: width 1.2s var(--ease-out);
}

.role.is-in::before {
  width: 100%;
}

.role__when {
  font: 400 0.82rem/1.5 var(--font-mono);
  color: var(--faint);
  padding-top: 0.3rem;
}

.role h3 {
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.role__org {
  color: var(--accent-2);
  font-size: 0.92rem;
  margin-top: 0.2rem;
}

.role ul {
  margin: 1rem 0 1.2rem;
  display: grid;
  gap: 0.5rem;
}

.role li {
  color: var(--muted);
  font-size: 0.95rem;
  padding-left: 1.1rem;
  position: relative;
}

.role li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 5px;
  height: 1px;
  background: var(--faint);
}

@media (max-width: 760px) {
  .role { grid-template-columns: 1fr; gap: 0.6rem; }
}

/* ---------- Client sites ---------- */

.sites {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
}

.site > a,
.site > div {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3.4;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0c0c10;
}

.site img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 1s var(--ease-out), filter 0.5s;
  filter: saturate(0.85) brightness(0.85);
}

.site a:hover img {
  transform: scale(1.06);
  filter: none;
}

.site__meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.2rem 0.85rem 0.8rem;
  background: linear-gradient(180deg, transparent, rgba(6, 6, 8, 0.95) 55%);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.site__meta b {
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.25;
}

.site__meta small {
  font: 400 0.68rem/1.2 var(--font-mono);
  color: var(--faint);
}

.site a .site__meta b::after {
  content: " ↗";
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.3s;
}

.site a:hover .site__meta b::after {
  opacity: 1;
}

.site--archived img {
  filter: grayscale(0.7) brightness(0.6);
}

@media (max-width: 1100px) {
  .sites { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  .sites { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- About & stack ---------- */

.about {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}

.about__person {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0 1.5rem;
}

.about__person img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-2);
}

.about__name {
  font-weight: 600;
  font-size: 1.05rem;
}

.about__loc {
  color: var(--faint);
  font-size: 0.88rem;
}

.about__copy {
  display: grid;
  gap: 1rem;
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 560px;
}

.edu {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.edu__deg {
  font-weight: 500;
}

.edu__deg em {
  color: var(--accent-2);
  font-size: 1.1em;
}

.edu__school {
  color: var(--faint);
  font-size: 0.9rem;
}

.edu__honors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.edu__honors li {
  font-size: 0.8rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--muted);
}

.stack {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: clamp(1.5rem, 3vw, 2.25rem);
}

.stack__title {
  font: 400 0.78rem/1 var(--font-mono);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
}

.stack__group + .stack__group {
  margin-top: 1.4rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.stack__group h4 {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.7rem;
}

.stack__group ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.stack__group li {
  font: 400 0.76rem/1 var(--font-mono);
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 960px) {
  .about { grid-template-columns: 1fr; }
  .stack { position: static; }
}

/* ---------- FAQ ---------- */

.faq {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.faq .section__head {
  margin-bottom: 0;
}

.faq__list details {
  border-bottom: 1px solid var(--line);
}

.faq__list details:first-child {
  border-top: 1px solid var(--line);
}

.faq__list summary {
  list-style: none;
  cursor: pointer;
  padding: 1.35rem 2.5rem 1.35rem 0;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  position: relative;
  transition: color 0.2s;
}

.faq__list summary::-webkit-details-marker {
  display: none;
}

.faq__list summary::after {
  content: "";
  position: absolute;
  right: 0.25rem;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  background:
    linear-gradient(var(--text), var(--text)) center/12px 1.5px no-repeat,
    linear-gradient(var(--text), var(--text)) center/1.5px 12px no-repeat;
  transition: transform 0.4s var(--ease-out);
}

.faq__list details[open] summary::after {
  transform: rotate(135deg);
}

.faq__list summary:hover {
  color: var(--accent-2);
}

.faq__list details p {
  color: var(--muted);
  padding: 0 2.5rem 1.5rem 0;
}

.faq__list details a {
  color: var(--accent);
}

@media (max-width: 860px) {
  .faq { grid-template-columns: 1fr; }
}

/* ---------- Contact ---------- */

.contact {
  background:
    radial-gradient(70% 80% at 0% 100%, rgba(255, 107, 61, 0.12), transparent 60%),
    var(--bg);
  border-top: 1px solid var(--line);
}

.contact__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.contact__title {
  font-size: clamp(2.6rem, 6.5vw, 5.4rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.contact__title em {
  color: var(--accent);
  display: block;
}

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.contact__facts {
  margin-top: 2.5rem;
  display: grid;
  gap: 0.65rem;
  font-size: 0.95rem;
}

.contact__facts li {
  display: flex;
  gap: 1rem;
  color: var(--text);
}

.contact__facts span {
  width: 80px;
  flex: none;
  font: 400 0.75rem/1.9 var(--font-mono);
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.contact__facts a {
  border-bottom: 1px solid var(--line-2);
}

.contact__facts a:hover {
  color: var(--accent);
}

.contact__form {
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: #fff;
  overflow: hidden;
  min-height: 640px;
  display: flex;
  flex-direction: column;
}

.contact__form iframe {
  border: 0;
  width: 100%;
  flex: 1;
  min-height: 600px;
  display: block;
}

.contact__credit {
  font: 400 0.72rem/1 var(--font-mono);
  color: #6b6b74;
  padding: 0.8rem 1rem;
  border-top: 1px solid #eee;
  background: #fafafa;
}

.contact__credit a {
  color: #d1491f;
}

@media (max-width: 960px) {
  .contact__inner { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  font-size: 0.85rem;
  color: var(--faint);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer a:hover {
  color: var(--text);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }
  .marquee__track {
    animation: none;
  }
  .marquee {
    overflow-x: auto;
  }
}

/* ---------- Avatar & portraits ---------- */

.hero__status {
  padding-left: 0.35rem;
}

.hero__avatar {
  position: relative;
  width: 30px;
  height: 30px;
  flex: none;
}

.hero__avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-2);
}

.hero__avatar .dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--bg);
}

.section__head--portrait {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: end;
}

.section__head--portrait > div {
  max-width: 820px;
}

.portrait {
  position: relative;
  isolation: isolate;
  margin: 0;
  display: flex;
  justify-content: center;
}

/* Warm key light behind the cut-out so the dark suit separates from the page */
.portrait::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: 6%;
  width: 92%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 107, 61, 0.32), rgba(255, 107, 61, 0.08) 45%, transparent 68%);
  filter: blur(6px);
}

/* Orbit ring echoing the hero swarm */
.portrait::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 46%;
  width: 104%;
  aspect-ratio: 1 / 0.36;
  transform: translate(-50%, -50%) rotate(-12deg);
  border-radius: 50%;
  border: 1px solid rgba(255, 176, 140, 0.28);
  animation: orbit-tilt 9s ease-in-out infinite alternate;
}

@keyframes orbit-tilt {
  to { transform: translate(-50%, -50%) rotate(8deg); }
}

.portrait img {
  width: 100%;
  max-width: 440px;
  height: auto;
  filter:
    drop-shadow(0 0 1px rgba(255, 220, 200, 0.55))
    drop-shadow(-10px 0 28px rgba(255, 107, 61, 0.18))
    drop-shadow(0 40px 50px rgba(0, 0, 0, 0.55));
  -webkit-mask-image: linear-gradient(180deg, #000 78%, transparent 99%);
  mask-image: linear-gradient(180deg, #000 78%, transparent 99%);
  will-change: transform;
}

.portrait--thinking img {
  max-width: 380px;
  margin-bottom: -2rem;
}

.portrait__chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  font: 500 0.76rem/1 var(--font-mono);
  color: var(--text);
  background: rgba(14, 14, 19, 0.78);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
  animation: chip-float 5s ease-in-out infinite;
}

.portrait__chip b {
  font-weight: 600;
  color: var(--accent);
}

.portrait__chip--a {
  left: 2%;
  top: 22%;
}

.portrait__chip--b {
  right: 0;
  bottom: 22%;
  animation-delay: -2.5s;
  color: var(--muted);
}

@keyframes chip-float {
  50% { transform: translateY(-8px); }
}

.about__side {
  display: grid;
  gap: 1.5rem;
}

.portrait--laptop img {
  max-width: 400px;
}

@media (max-width: 960px) {
  .section__head--portrait { grid-template-columns: 1fr; }
  .portrait--thinking img { max-width: 300px; margin-bottom: -1rem; }
}

@media (max-width: 520px) {
  .portrait__chip { font-size: 0.68rem; }
  .portrait__chip--a { left: 0; }
  .portrait__chip--b { right: 0; }
  .portrait img { max-width: 300px; }
}

/* ---------- EvenTidey feature (media on the right) ---------- */

.product--reverse {
  grid-template-columns: 1fr 1.45fr;
}

.product--reverse .product__media {
  order: 2;
}

@media (max-width: 1024px) {
  .product--reverse { grid-template-columns: 1fr; }
  .product--reverse .product__media { order: 0; }
}

/* ---------- Contact: front-facing portrait beside the facts ---------- */

.contact__me {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 1.75rem;
  align-items: end;
  margin-top: 2.5rem;
}

.contact__me .contact__facts {
  margin-top: 0;
  padding-bottom: 1.5rem;
}

.portrait--front img {
  max-width: 220px;
}

.portrait--front::after {
  top: 52%;
  width: 120%;
}

@media (max-width: 520px) {
  .contact__me { grid-template-columns: 1fr; justify-items: center; }
  .contact__me .contact__facts { justify-self: stretch; }
  .portrait--front img { max-width: 240px; }
}

/* The source photo crops the shoulders at the frame edge: fade the sides and
   bottom with an ellipse so the cut-out blends instead of ending in hard lines. */
.portrait--front img {
  -webkit-mask-image: radial-gradient(ellipse 58% 80% at 50% 32%, #000 60%, transparent 100%);
  mask-image: radial-gradient(ellipse 58% 80% at 50% 32%, #000 60%, transparent 100%);
}

.portrait--front::before {
  width: 150%;
  bottom: -10%;
  background: radial-gradient(circle at 50% 42%, rgba(255, 107, 61, 0.26), rgba(255, 107, 61, 0.06) 42%, transparent 66%);
  filter: blur(14px);
}

.portrait--front img {
  filter: drop-shadow(0 0 1px rgba(255, 220, 200, 0.5)) drop-shadow(0 0 22px rgba(255, 107, 61, 0.16));
}

/* ==========================================================================
   Sub-pages: case studies & blog (hand-authored HTML, see _templates/)
   ========================================================================== */

.page {
  padding: 132px 0 clamp(4rem, 9vw, 7rem);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font: 400 0.78rem/1.4 var(--font-mono);
  color: var(--faint);
  margin-bottom: 1.75rem;
}

.crumbs a:hover {
  color: var(--accent);
}

.crumbs .sep {
  opacity: 0.5;
}

.page-hero {
  max-width: 900px;
}

.page-hero__title {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.page-hero__title em {
  color: var(--accent);
}

.page-hero__lead {
  margin-top: 1.5rem;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--muted);
  max-width: 720px;
}

.page-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.page-meta dt {
  font: 400 0.7rem/1 var(--font-mono);
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.page-meta dd {
  font-size: 0.95rem;
  color: var(--text);
}

@media (max-width: 760px) {
  .page-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.page-figure {
  margin: clamp(2.5rem, 5vw, 4rem) 0 0;
}

.page-figure figcaption {
  margin-top: 0.75rem;
  font: 400 0.75rem/1.5 var(--font-mono);
  color: var(--faint);
}

/* Long-form body: a reading column with a sticky aside */
.article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: clamp(2rem, 6vw, 5rem);
  margin-top: clamp(3rem, 6vw, 5rem);
  align-items: start;
}

.article--single {
  grid-template-columns: minmax(0, 720px);
  justify-content: center;
}

.article__aside {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 1.25rem;
  font-size: 0.9rem;
}

.article__aside h2 {
  font: 400 0.72rem/1 var(--font-mono);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.toc {
  display: grid;
  gap: 0.55rem;
  border-left: 1px solid var(--line);
  padding-left: 1rem;
}

.toc a {
  color: var(--muted);
  transition: color 0.2s;
}

.toc a:hover {
  color: var(--text);
}

@media (max-width: 960px) {
  .article { grid-template-columns: minmax(0, 1fr); }
  .article__aside { position: static; order: -1; }
}

.prose {
  font-size: 1.06rem;
  line-height: 1.75;
  color: var(--muted);
  max-width: 720px;
  min-width: 0;
}

.prose > * + * {
  margin-top: 1.25rem;
}

.prose h2 {
  margin-top: 3.5rem;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  scroll-margin-top: 96px;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  margin-top: 2.25rem;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
}

.prose strong {
  color: var(--text);
}

.prose > p a,
.prose > ul a,
.prose > ol a {
  color: var(--accent-2);
  border-bottom: 1px solid rgba(255, 176, 140, 0.35);
}

.prose > p a:hover,
.prose > ul a:hover,
.prose > ol a:hover {
  color: var(--accent);
}

.prose > ul,
.prose > ol {
  display: grid;
  gap: 0.6rem;
  padding-left: 1.2rem;
}

.prose > ul {
  list-style: disc;
}

.prose > ol {
  list-style: decimal;
}

.prose > ul > li::marker,
.prose > ol > li::marker {
  color: var(--accent);
}

.prose blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 1.1rem 1.4rem;
  border-left: 2px solid var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  border-radius: 0 12px 12px 0;
  color: var(--text);
  font-size: 1.1rem;
}

.prose code {
  font: 400 0.88em/1 var(--font-mono);
  padding: 0.15em 0.4em;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.prose pre {
  padding: 1.1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: #050507;
  overflow-x: auto;
  font: 400 0.85rem/1.6 var(--font-mono);
  color: var(--text);
}

.prose pre code {
  padding: 0;
  background: none;
}

/* Demos and tables placed inside an article */
.breakout {
  margin: 2.5rem 0;
}

.prose .breakout .checks li,
.prose .breakout p {
  font-size: 0.95rem;
}

.table-scroll {
  overflow-x: auto;
}

.stage-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.5;
}

.stage-table th,
.stage-table td {
  text-align: left;
  padding: 0.8rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.stage-table th {
  font: 400 0.7rem/1 var(--font-mono);
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stage-table td:first-child {
  color: var(--text);
  white-space: nowrap;
}

.stage-table code {
  font-size: 0.78em;
}

.stage-table tr.gate-row td {
  color: var(--gate);
  font-weight: 500;
  background: rgba(242, 184, 75, 0.05);
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.results div {
  padding: 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.results b {
  display: block;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.15;
}

.results span {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

/* Prev / next */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: clamp(4rem, 8vw, 6rem);
}

.pager a {
  padding: 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.3s, transform 0.4s var(--ease-out);
}

.pager a:hover {
  border-color: rgba(255, 107, 61, 0.4);
  transform: translateY(-2px);
}

.pager small {
  display: block;
  font: 400 0.72rem/1 var(--font-mono);
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}

.pager b {
  font-size: 1.15rem;
  font-weight: 500;
}

.pager .next {
  text-align: right;
  grid-column: 2;
}

@media (max-width: 640px) {
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; grid-column: auto; }
}

/* CTA band at the end of sub-pages */
.cta-band {
  margin-top: clamp(4rem, 8vw, 6rem);
  padding: clamp(2rem, 5vw, 3.5rem);
  border-radius: 24px;
  border: 1px solid var(--line-2);
  background:
    radial-gradient(80% 140% at 100% 0%, rgba(255, 107, 61, 0.16), transparent 60%),
    var(--surface);
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.cta-band h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.1;
  max-width: 620px;
}

.cta-band h2 em {
  color: var(--accent);
}

/* Listing pages */
.listing {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.listing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.4s, opacity 0.9s var(--ease-out), transform 0.6s var(--ease-out);
}

.listing-card:hover {
  border-color: rgba(255, 107, 61, 0.4);
}

.listing-card__media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #0c0c10;
  position: relative;
}

.listing-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.9s var(--ease-out);
}

.listing-card:hover .listing-card__media img {
  transform: scale(1.04);
}

/* Generated cover for case studies without a screenshot (brand-neutral) */
.cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(60% 80% at 70% 30%, rgba(255, 107, 61, 0.28), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 28px 28px,
    #0b0b0f;
  transition: transform 0.9s var(--ease-out);
}

.listing-card:hover .cover {
  transform: scale(1.04);
}

.cover span {
  font: 500 clamp(1rem, 2.2vw, 1.5rem)/1.2 var(--font-mono);
  color: var(--text);
  letter-spacing: -0.02em;
  padding: 0.8rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: rgba(8, 8, 10, 0.75);
  text-align: center;
}

.cover span b {
  color: var(--accent);
  font-weight: 500;
}

.listing-card__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.listing-card__kicker {
  font: 400 0.74rem/1.4 var(--font-mono);
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.listing-card h2,
.listing-card h3,
.listing-card h4 {
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.listing-card p {
  color: var(--muted);
  font-size: 0.95rem;
}

.listing-card .link-arrow {
  margin-top: auto;
  align-self: flex-start;
}

/* The whole card is clickable through one real link */
.listing-card .stretched::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

@media (max-width: 760px) {
  .listing { grid-template-columns: minmax(0, 1fr); }
}

.post-list {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  border-top: 1px solid var(--line);
}

.post-row {
  position: relative;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
}

.post-row time {
  font: 400 0.8rem/1.5 var(--font-mono);
  color: var(--faint);
}

.post-row h2 {
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
  transition: color 0.2s;
}

.post-row p {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.post-row:hover h2 {
  color: var(--accent-2);
}

.post-row .tags {
  margin-top: 0.75rem;
}

.post-row__arrow {
  color: var(--faint);
  transition: transform 0.3s var(--ease-out), color 0.2s;
}

.post-row:hover .post-row__arrow {
  color: var(--accent);
  transform: translateX(4px);
}

@media (max-width: 640px) {
  .post-row { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
  .post-row__arrow { display: none; }
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: center;
  margin-top: 1.75rem;
  font: 400 0.8rem/1.4 var(--font-mono);
  color: var(--faint);
}

.post-meta img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.post-meta .author {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
}

/* Home page: links into the sub-pages */
.case__more {
  margin-top: 1.5rem;
}

.more-cases {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding-top: clamp(2.5rem, 6vw, 4rem);
  border-top: 1px solid var(--line);
}

.more-cases__head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 1.75rem;
}

.more-cases__head h3 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.listing--home {
  margin-top: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.listing--home .listing-card h4 {
  font-size: 1.15rem;
}

.listing--home .listing-card p {
  font-size: 0.88rem;
}

@media (max-width: 1100px) {
  .listing--home { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .listing--home { grid-template-columns: minmax(0, 1fr); }
}

.post-row .stretched-row::before {
  content: "";
  position: absolute;
  inset: 0;
}

/* Inside long-form text, italics stay in the body face for readability */
.prose > p em,
.prose > ul em,
.prose > ol em {
  font-family: inherit;
  font-style: italic;
}

.listing--home .cover span {
  font-size: 0.95rem;
  padding: 0.6rem 0.85rem;
}
