/* ============================================================
   SAMIOS SOFTWARE SOLUTIONS — editorial / spec-sheet design
   ============================================================ */
:root {
  --paper: #f4f1ea;
  --paper-deep: #ebe7dd;
  --ink: #101317;
  --ink-soft: #565c66;
  --accent: #0aa2c7;
  --rule: rgba(16, 19, 23, 0.16);
  --rule-strong: rgba(16, 19, 23, 0.75);
  /* text/borders that sit on top of an --ink surface (ticker, row hover) */
  --on-ink-soft: rgba(244, 241, 234, 0.75);
  --on-ink-faint: rgba(244, 241, 234, 0.3);
  --on-ink-wash: rgba(244, 241, 234, 0.1);
  --stroke: rgba(16, 19, 23, 0.55);
  --logo-tile: #101317;
  --switch-bg: rgba(16, 19, 23, 0.04);
  --font-display: "Archivo", "Arial Narrow", sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: "JetBrains Mono", Consolas, monospace;
  --pad: clamp(20px, 4.5vw, 64px);
  --seg: 30px;
  color-scheme: light;
  /* Custom pointer: an angular dart matching the /// geometry. Ink fill with a
     paper outline so it stays legible over both the paper page and the
     inverted ticker/hover surfaces. Accent variant marks anything clickable. */
  --cursor-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 24 24'%3E%3Cpath d='M4 2 19 11.4 11.6 12.9 8.2 20Z' fill='%23101317' stroke='%23f4f1ea' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 4 2, default;
  --cursor-hot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24'%3E%3Cpath d='M4 2 19 11.4 11.6 12.9 8.2 20Z' fill='%230aa2c7' stroke='%23f4f1ea' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 4 2, pointer;
}

/* Dark palette: applied when explicitly chosen, or when the OS prefers dark
   and the visitor has not explicitly chosen light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1216;
    --paper-deep: #141920;
    --ink: #ece8e1;
    --ink-soft: #9aa3b0;
    --accent: #22d3ee;
    --rule: rgba(236, 232, 225, 0.16);
    --rule-strong: rgba(236, 232, 225, 0.45);
    --on-ink-soft: rgba(15, 18, 22, 0.72);
    --on-ink-faint: rgba(15, 18, 22, 0.28);
    --on-ink-wash: rgba(15, 18, 22, 0.1);
    --stroke: rgba(236, 232, 225, 0.4);
    --logo-tile: #1b2027;
    --switch-bg: rgba(236, 232, 225, 0.06);
    --cursor-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 24 24'%3E%3Cpath d='M4 2 19 11.4 11.6 12.9 8.2 20Z' fill='%23ece8e1' stroke='%230f1216' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 4 2, default;
    --cursor-hot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24'%3E%3Cpath d='M4 2 19 11.4 11.6 12.9 8.2 20Z' fill='%2322d3ee' stroke='%230f1216' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 4 2, pointer;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #0f1216;
  --paper-deep: #141920;
  --ink: #ece8e1;
  --ink-soft: #9aa3b0;
  --accent: #22d3ee;
  --rule: rgba(236, 232, 225, 0.16);
  --rule-strong: rgba(236, 232, 225, 0.45);
  --on-ink-soft: rgba(15, 18, 22, 0.72);
  --on-ink-faint: rgba(15, 18, 22, 0.28);
  --on-ink-wash: rgba(15, 18, 22, 0.1);
  --stroke: rgba(236, 232, 225, 0.4);
  --logo-tile: #1b2027;
  --switch-bg: rgba(236, 232, 225, 0.06);
  --cursor-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 24 24'%3E%3Cpath d='M4 2 19 11.4 11.6 12.9 8.2 20Z' fill='%23ece8e1' stroke='%230f1216' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 4 2, default;
  --cursor-hot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24'%3E%3Cpath d='M4 2 19 11.4 11.6 12.9 8.2 20Z' fill='%2322d3ee' stroke='%230f1216' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 4 2, pointer;
  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 70px; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  font-stretch: 100%;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* clip, not hidden: hidden makes body a scroll container, which causes
     sticky-header flicker on mobile scroll direction changes */
  overflow-x: hidden;
  overflow-x: clip;
  cursor: var(--cursor-arrow);
}

::selection { background: var(--ink); color: var(--paper); }

/* ============ Top bar ============ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  transform: translateZ(0);
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  padding: 14px var(--pad);
  background: var(--paper);
  border-bottom: 1px solid var(--rule-strong);
}
.topbar-brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--ink);
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.mark { width: 30px; height: 30px; flex-shrink: 0; }
/* CSS beats SVG presentation attributes, so the marks follow the theme */
.mark rect { fill: var(--logo-tile); }
.hero-mark g:first-of-type line { stroke: var(--ink); }
.hero-mark g:last-of-type line { stroke: var(--accent); }

/* ============ Theme switch ============ */
.theme-switch {
  position: relative;
  display: inline-flex; align-items: center;
  padding: 3px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--switch-bg);
  flex-shrink: 0;
}
.theme-thumb {
  position: absolute; top: 3px; left: 3px;
  width: var(--seg); height: 24px; border-radius: 999px;
  background: var(--ink);
  transform: translateX(calc(var(--seg) * var(--theme-i, 1)));
  transition: transform 0.34s cubic-bezier(0.65, 0, 0.35, 1);
}
.theme-switch button {
  position: relative; z-index: 1;
  width: var(--seg); height: 24px;
  display: grid; place-items: center;
  background: none; border: 0; padding: 0; cursor: var(--cursor-hot);
  color: var(--ink-soft);
  transition: color 0.28s ease;
}
.theme-switch button:hover { color: var(--ink); }
.theme-switch button.is-active { color: var(--paper); }
.theme-switch svg {
  width: 14px; height: 14px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
@media (prefers-reduced-motion: reduce) {
  .theme-thumb { transition: none; }
}

.topbar-nav { display: flex; gap: 28px; }
.topbar-nav a {
  color: var(--ink); text-decoration: none;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  position: relative; padding-bottom: 2px;
}
.topbar-nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1.5px; background: var(--ink);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1);
}
.topbar-nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.topbar-clock {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.1em; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.clock-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  animation: tick 2s step-end infinite;
}
@keyframes tick { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ============ Hero ============ */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr;
  grid-template-rows: 1fr auto;
  border-bottom: 1px solid var(--rule-strong);
  min-height: calc(100vh - 60px);
  min-height: calc(100svh - 60px);
}
.hero-rail {
  border-right: 1px solid var(--rule);
  position: relative;
}
.hero-rail span {
  position: absolute; top: 28px; left: 50%;
  transform: translateX(-50%);
  writing-mode: vertical-rl;
  font-family: var(--font-mono); font-size: 0.66rem; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-soft); white-space: nowrap;
}
.hero-main {
  min-width: 0;
  padding: clamp(40px, 7vh, 90px) var(--pad) clamp(28px, 4vh, 48px);
  display: flex; flex-direction: column; justify-content: space-between;
  gap: clamp(30px, 6vh, 70px);
}

.hero h1 { display: flex; flex-direction: column; }
.h1-line {
  display: block;
  font-size: clamp(2.4rem, 10.8vw, 10rem);
  font-weight: 800;
  font-stretch: 118%;
  text-transform: uppercase;
  line-height: 0.88;
  letter-spacing: -0.025em;
}
.h1-serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  font-stretch: 100%;
  letter-spacing: -0.02em;
  line-height: 0.98;
  padding-right: 0.05em;
}
.accent { color: var(--accent); }

/* "We build" roll strip filling the hero whitespace */
.hero-build {
  flex: 1;
  display: flex; align-items: center; gap: clamp(18px, 3vw, 40px);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  min-height: 90px;
}
.build-label {
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent); white-space: nowrap;
}
.build-stage {
  display: inline-flex; align-items: baseline;
  overflow: hidden;
  font-family: var(--font-serif); font-style: italic;
  font-size: clamp(1.7rem, 3.4vw, 3rem);
  line-height: 1.3; color: var(--ink);
}
.build-word { display: inline-block; will-change: transform, opacity; }
.build-dot { font-style: normal; }

.hero-foot {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 40px;
}
.hero-copy {
  max-width: 460px;
  font-size: clamp(0.98rem, 1.3vw, 1.15rem);
  line-height: 1.6; color: var(--ink);
  border-left: 3px solid var(--accent);
  padding-left: 20px;
}
.hero-mark { width: clamp(70px, 9vw, 120px); flex-shrink: 0; }

.hero-meta {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule);
}
.hero-meta span {
  padding: 13px var(--pad);
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.16em; color: var(--ink-soft);
}
.hero-meta span + span { border-left: 1px solid var(--rule); }
.hero-meta-domain { color: var(--accent) !important; }

/* ============ Ticker ============ */
.ticker {
  overflow: hidden;
  border-bottom: 1px solid var(--rule-strong);
  background: var(--ink); color: var(--paper);
  padding: 12px 0;
}
.ticker-track {
  display: flex; white-space: nowrap;
  animation: ticker 60s linear infinite;
}
.ticker-track span {
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
}
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============ Sections ============ */
.sect { border-bottom: 1px solid var(--rule-strong); }

.sect-head {
  display: flex; align-items: baseline; gap: 24px;
  padding: 22px var(--pad);
  border-bottom: 1px solid var(--rule);
}
.sect-num {
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600;
  color: var(--accent);
}
.sect-head h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  font-weight: 800; font-stretch: 115%;
  text-transform: uppercase; letter-spacing: -0.01em;
  line-height: 1;
}
.sect-note {
  margin-left: auto;
  font-family: var(--font-serif); font-style: italic;
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  color: var(--ink-soft);
}

/* Capability rows */
.row {
  display: grid;
  grid-template-columns: 90px 1fr 1.1fr 60px;
  gap: clamp(16px, 3vw, 48px);
  align-items: center;
  padding: clamp(26px, 4vw, 44px) var(--pad);
  border-bottom: 1px solid var(--rule);
  transition: background 0.28s ease, color 0.28s ease;
  cursor: var(--cursor-arrow);
}
.row:last-child { border-bottom: none; }
.row-num {
  font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600;
  color: var(--accent);
}
.row-title {
  font-size: clamp(1.7rem, 3.6vw, 3rem);
  font-weight: 800; font-stretch: 115%;
  text-transform: uppercase; line-height: 0.95;
  letter-spacing: -0.015em;
}
.row-desc {
  font-size: clamp(0.95rem, 1.15vw, 1.05rem);
  color: var(--ink-soft); max-width: 520px;
  transition: color 0.28s ease;
}
.row-desc a { color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; }
.row:hover .row-desc a { color: #7dd8ef; }
.row-arrow {
  font-size: 1.6rem; justify-self: end;
  opacity: 0; transform: translate(-8px, 8px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.row:hover { background: var(--ink); color: var(--paper); }
.row:hover .row-desc { color: var(--on-ink-soft); }
.row:hover .row-arrow { opacity: 1; transform: translate(0, 0); color: var(--accent); }

/* Studio */
.studio-grid {
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(36px, 5vw, 90px);
  align-items: start;
  padding: clamp(24px, 4vw, 56px) var(--pad);
}
.studio-lede {
  font-size: clamp(1.5rem, 2.6vw, 2.3rem);
  font-weight: 640; font-stretch: 110%;
  line-height: 1.22; letter-spacing: -0.015em;
  margin-bottom: 30px;
}
.studio-lede em {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  color: var(--accent);
}
.studio-copy .reveal-p {
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.35vw, 1.25rem);
  line-height: 1.65;
  max-width: 54ch;
  margin-bottom: 22px;
  transition: color 0.35s ease;
}
@media (hover: hover) {
  .studio-copy .reveal-p:hover { color: var(--ink); }
}

/* facts as a bordered spec card */
.facts-card {
  border: 1px solid var(--rule); border-radius: 20px;
  padding: clamp(22px, 3vw, 34px);
}
.facts-label {
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.facts > div {
  border-radius: 8px;
  transition: background 0.25s ease;
}
@media (hover: hover) {
  .facts > div:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
}

/* creed as three interactive cards */
.creed {
  list-style: none;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2vw, 24px);
  padding: 0 var(--pad) clamp(50px, 6vw, 90px);
}
.creed li {
  display: flex; flex-direction: column; gap: 16px;
  padding: clamp(22px, 2.5vw, 32px);
  border: 1px solid var(--rule); border-radius: 18px;
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  cursor: var(--cursor-arrow);
}
@media (hover: hover) {
  .creed li:hover {
    transform: translateY(-5px);
    background: var(--ink); color: var(--paper);
    border-color: var(--ink);
  }
  .creed li:hover p { color: var(--on-ink-soft); }
  .creed li:hover .creed-num { color: var(--accent); }
}
.creed-num {
  font-family: var(--font-mono); font-size: 0.82rem; font-weight: 600;
  color: var(--accent);
}
.creed h4 {
  font-size: 1.05rem; font-weight: 700; font-stretch: 110%;
  text-transform: uppercase; letter-spacing: 0.02em;
  margin-bottom: 6px;
}
.creed p { color: var(--ink-soft); font-size: 0.92rem; transition: color 0.3s ease; }

/* Contact */
.sect-contact { background: var(--paper-deep); }
.contact-kicker {
  padding: clamp(44px, 7vw, 90px) var(--pad) 0;
  font-family: var(--font-serif); font-style: italic;
  font-size: clamp(1.4rem, 2.6vw, 2.2rem);
  color: var(--ink);
}
.contact-mail {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  margin: 18px 0 0;
  padding: clamp(10px, 2vw, 24px) var(--pad) clamp(18px, 2.5vw, 32px);
  text-decoration: none; color: var(--ink);
}
/* without JS the copy tools stay hidden, so the section keeps its deep base */
html:not(.js) .contact-mail { padding-bottom: clamp(50px, 7vw, 100px); }
.contact-mail span:first-child {
  position: relative; display: inline-block;
  font-size: clamp(1.6rem, 6.4vw, 6rem);
  font-weight: 800; font-stretch: 116%;
  letter-spacing: -0.03em; line-height: 1;
  text-transform: lowercase;
  word-break: break-all;
}
.contact-mail span:first-child::after {
  content: ""; position: absolute; left: 0; bottom: -0.08em;
  width: 100%; height: 0.06em; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}
.contact-mail:hover span:first-child::after { transform: scaleX(1); }
.contact-arrow {
  font-size: clamp(1.6rem, 4vw, 3.4rem);
  transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}
.contact-mail:hover .contact-arrow { transform: translateX(12px); color: var(--accent); }

/* ============ One-page chapters ============ */
.rows-divider {
  padding: 16px var(--pad);
  font-family: var(--font-mono); font-size: 0.74rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--rule);
}

/* Capabilities: vertical stack by default (no JS, reduced motion, mobile) */
.caps-track { display: flex; flex-direction: column; }
.cap-panel {
  position: relative; overflow: hidden;
  padding: clamp(30px, 5vw, 54px) var(--pad);
  border-bottom: 1px solid var(--rule);
}
.cap-panel:last-child { border-bottom: none; }
.cap-ghost {
  position: absolute; right: var(--pad); top: 50%;
  transform: translateY(-50%);
  font-weight: 900; font-stretch: 122%;
  font-size: clamp(7rem, 18vw, 16rem); line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px var(--rule);
  user-select: none; pointer-events: none;
}
.cap-title {
  font-size: clamp(2rem, 4.6vw, 4.2rem);
  font-weight: 800; font-stretch: 115%;
  text-transform: uppercase; line-height: 0.95;
  letter-spacing: -0.015em;
  margin: 10px 0 16px;
}
.cap-desc { color: var(--ink-soft); max-width: 500px; font-size: clamp(0.95rem, 1.2vw, 1.08rem); }

/* Pinned horizontal scrub, only when the motion layer is running on desktop */
@media (min-width: 901px) {
  html.js-scroll .chapter-caps { height: 340vh; }
  html.js-scroll .caps-sticky {
    position: sticky; top: 0; height: 100vh;
    /* content flows from the top and the track absorbs the remaining
       height, so the pinned viewport never shows empty bands */
    display: flex; flex-direction: column; justify-content: flex-start;
    overflow: hidden; gap: clamp(18px, 3vh, 38px);
    padding-bottom: clamp(22px, 4vh, 54px);
  }
  html.js-scroll .caps-sticky .sect-head { border-bottom: 1px solid var(--rule); }
  html.js-scroll .caps-track {
    flex: 1 1 auto; min-height: 0;
    flex-direction: row; align-items: stretch;
    gap: 3.5vw; padding: 0 var(--pad);
    width: max-content; will-change: transform;
  }
  html.js-scroll .cap-panel {
    width: 56vw; max-width: 860px; flex-shrink: 0;
    display: flex; flex-direction: column; justify-content: center;
    border: 1px solid var(--rule); border-radius: 22px;
    padding: clamp(34px, 4vw, 58px);
  }
  html.js-scroll .cap-panel .cap-ghost { font-size: clamp(9rem, 22vh, 20rem); }
}

/* Studio manifesto: stacked statements whose words illuminate on scroll */
.manifesto {
  padding: clamp(48px, 7vw, 90px) var(--pad) clamp(20px, 3vw, 40px);
  font-size: clamp(1.35rem, 3.2vw, 3rem);
  font-weight: 640; font-stretch: 110%;
  line-height: 1.35; letter-spacing: -0.015em;
  max-width: 1180px;
}
.manifesto-line + .manifesto-line { margin-top: clamp(22px, 3.5vw, 46px); }
/* diagonal composition so the statements occupy the whole canvas */
.manifesto { max-width: none; }
.manifesto .m1 { max-width: 30ch; }
.manifesto .m2 { margin-left: clamp(0px, 14vw, 300px); }
.manifesto .m3 { margin-left: auto; max-width: 32ch; }
.manifesto-punch {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  font-stretch: 100%;
  font-size: 1.2em;
  color: var(--accent);
}
.manifesto .wrd { display: inline-block; transition: color 0.25s ease; }
.manifesto .wrd.hot { color: var(--accent); }

/* Glyph confetti burst on CTA clicks */
.confetti-host {
  position: fixed; inset: 0; z-index: 500;
  pointer-events: none;
  font-family: var(--font-mono); font-weight: 600;
}
.confetti-host span {
  position: absolute; opacity: 0; line-height: 1;
  will-change: transform, opacity;
}

/* ============ Project sheets ============ */
.row[data-project] { cursor: var(--cursor-hot); }
.row[data-project]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.proj-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: var(--paper);
  overflow: hidden;
  display: none;
}
/* header is a permanent flex child so the close button can never scroll away;
   only the inner area scrolls (reliable on iOS, unlike sticky-in-fixed) */
.proj-overlay.open { display: flex; flex-direction: column; }
.pov-scroll {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.pov-head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px var(--pad);
  background: var(--paper);
  border-bottom: 1px solid var(--rule-strong);
}
.pov-eyebrow {
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent);
}
.pov-close {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink); background: none; cursor: var(--cursor-hot);
  border: 1px solid var(--rule-strong); border-radius: 999px;
  padding: 9px 18px;
  transition: background 0.25s ease, color 0.25s ease;
}
.pov-close:hover { background: var(--ink); color: var(--paper); }

.pov-body {
  position: relative;
  padding: clamp(44px, 6vw, 84px) var(--pad) 90px;
  max-width: 1240px;
}
.pov-ghost {
  position: absolute; top: clamp(20px, 3vw, 44px); right: var(--pad);
  font-weight: 900; font-stretch: 122%;
  font-size: clamp(5rem, 14vw, 13rem); line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px var(--rule);
  user-select: none; pointer-events: none;
}
.pov-title {
  font-size: clamp(2.4rem, 7.4vw, 6.6rem);
  font-weight: 800; font-stretch: 118%;
  text-transform: uppercase; line-height: 0.94;
  letter-spacing: -0.025em;
  max-width: 15ch;
}
.pov-title .chr { display: inline-block; }
.pov-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 28px 0 44px; }
.pov-paras p {
  max-width: 780px; color: var(--ink-soft);
  font-size: clamp(1rem, 1.35vw, 1.18rem);
  margin-bottom: 22px;
}
.pov-paras p:first-child {
  color: var(--ink); font-weight: 600;
  font-size: clamp(1.25rem, 2.1vw, 1.7rem);
  line-height: 1.4; max-width: 850px;
}
.pov-facts { border-top: 1px solid var(--rule-strong); margin-top: 52px; max-width: 620px; }
.pov-facts > div {
  display: flex; justify-content: space-between; gap: 20px;
  padding: 14px 4px; border-bottom: 1px solid var(--rule-strong);
}
.pov-facts dt {
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft); padding-top: 2px;
}
.pov-facts dd { font-weight: 600; text-align: right; }
.pov-facts dd a { color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; }
.pov-actions { margin-top: 52px; display: flex; gap: 16px; flex-wrap: wrap; }
.pov-scene {
  margin-top: 56px;
  border: 1px solid var(--rule); border-radius: 20px;
  padding: clamp(16px, 3vw, 34px);
  color: var(--ink);
}
.pov-scene:empty { display: none; }
.pov-scene svg { width: 100%; height: auto; display: block; }

/* anything clickable gets the accent dart; text keeps the arrow rather than
   an I-beam, and touch devices opt out entirely */
a, button, [role="button"], summary,
.cta-btn, .contact-mail, .copy-mail, .pov-close, .theme-switch button {
  cursor: var(--cursor-hot);
}
@media (pointer: coarse) {
  body, a, button, [role="button"], .row[data-project],
  .cta-btn, .contact-mail, .copy-mail, .pov-close, .theme-switch button {
    cursor: auto;
  }
}

/* ============ Interaction polish ============ */
/* inline SVG arrows: iOS renders some arrow characters as emoji */
.row-arrow svg, .cta-arrow svg, .contact-arrow svg, .pov-close svg {
  width: 1em; height: 1em; display: block;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.pov-close { display: inline-flex; align-items: center; gap: 8px; }
.pov-close svg { width: 12px; height: 12px; }
.wrd { display: inline-block; }

/* readable ticker */
@media (hover: hover) {
  .ticker:hover .ticker-track { animation-play-state: paused; }
}

/* capability panels respond to the cursor */
.cap-panel { transition: transform 0.3s ease, border-color 0.3s ease; }
@media (hover: hover) {
  .cap-panel:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
  .cap-panel:hover .cap-ghost { -webkit-text-stroke-color: color-mix(in srgb, var(--accent) 40%, transparent); }
  .cap-ghost { transition: -webkit-text-stroke-color 0.3s ease; }
}

/* creed rows nudge */
.creed li { transition: transform 0.25s ease; }
@media (hover: hover) {
  .creed li:hover { transform: translateX(6px); }
}

/* consistent keyboard focus */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* copy-address tools under the big email */
.contact-tools {
  display: none;
  align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 0 var(--pad) clamp(50px, 7vw, 100px);
}
html.js .contact-tools { display: flex; }
.copy-mail {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink); background: none; cursor: var(--cursor-hot);
  border: 1px solid var(--rule-strong); border-radius: 999px;
  padding: 9px 18px;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.copy-mail:hover { background: var(--ink); color: var(--paper); }
.copy-mail.copied { border-color: var(--accent); color: var(--accent); background: none; }
.contact-hint {
  font-family: var(--font-serif); font-style: italic;
  font-size: 0.95rem; color: var(--ink-soft);
}

/* hero scroll cue (injected by motion.js, fades after first scroll) */
.scroll-cue {
  position: absolute; right: var(--pad); bottom: 24px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-soft);
  writing-mode: vertical-rl;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.scroll-cue::after {
  content: ""; width: 1.5px; height: 36px;
  background: var(--accent);
  animation: cue-slide 1.8s ease-in-out infinite;
}
@keyframes cue-slide {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}
.scroll-cue.gone { opacity: 0; }

/* ============ Footer ============ */
.footer { overflow: hidden; }
.footer-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 20px var(--pad);
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft);
}
.footer-row a { color: var(--ink); text-decoration: none; }
.footer-row a:hover { color: var(--accent); }

.footer-giant {
  white-space: nowrap;
  font-weight: 900; font-stretch: 122%;
  font-size: clamp(4rem, 17.5vw, 19rem);
  line-height: 0.72;
  text-align: center;
  letter-spacing: -0.02em;
  transform: translateY(18%);
  color: transparent;
  -webkit-text-stroke: 1.5px var(--stroke);
  user-select: none;
}
.footer-giant span { -webkit-text-stroke-color: var(--accent); }

/* Footer wordmark hover: outlined letters fill with ink, staggered left to
   right (--i is set per split character by motion.js) */
.footer-giant .chr {
  transition: color 0.28s ease calc(var(--i, 0) * 40ms);
}
.footer-giant:hover .chr { color: var(--ink); }
.footer-giant:hover span.chr { color: var(--accent); }

/* ============ Sub-pages (About / Projects) ============ */
.topbar-nav a.active::after { transform: scaleX(1); }

.page-head {
  padding: clamp(48px, 8vh, 100px) var(--pad) clamp(30px, 5vh, 60px);
  border-bottom: 1px solid var(--rule-strong);
}
.page-eyebrow {
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px;
}
.page-title {
  font-size: clamp(2rem, 6.2vw, 5.6rem);
  font-weight: 800; font-stretch: 118%;
  text-transform: uppercase; line-height: 0.92;
  letter-spacing: -0.025em;
}
.page-serif {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  text-transform: none; font-stretch: 100%; letter-spacing: -0.02em;
}

/* Status pills (light theme) */
.pill {
  display: inline-block;
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 600;
  padding: 4px 11px; border-radius: 999px; white-space: nowrap;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.pill-live { background: rgba(21, 128, 61, 0.09);  color: #15803d; border: 1px solid rgba(21, 128, 61, 0.35); }
.pill-dev  { background: rgba(10, 162, 199, 0.09); color: #0a7ea2; border: 1px solid rgba(10, 162, 199, 0.4); }
.pill-soon { background: rgba(180, 120, 8, 0.09);  color: #a16207; border: 1px solid rgba(180, 120, 8, 0.35); }
.pill-lab  { background: rgba(109, 40, 217, 0.07); color: #6d28d9; border: 1px solid rgba(109, 40, 217, 0.3); }
.pill-done { background: rgba(16, 19, 23, 0.05);   color: var(--ink-soft); border: 1px solid var(--rule); }
.row:hover .pill { border-color: var(--on-ink-faint); background: var(--on-ink-wash); color: var(--paper); }

/* Pills need brighter hues on a dark background */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pill-live { background: rgba(74, 222, 128, 0.1); color: #4ade80; border-color: rgba(74, 222, 128, 0.35); }
  :root:not([data-theme="light"]) .pill-dev  { background: rgba(34, 211, 238, 0.1); color: #22d3ee; border-color: rgba(34, 211, 238, 0.35); }
  :root:not([data-theme="light"]) .pill-soon { background: rgba(251, 191, 36, 0.1); color: #fbbf24; border-color: rgba(251, 191, 36, 0.35); }
  :root:not([data-theme="light"]) .pill-lab  { background: rgba(167, 139, 250, 0.1); color: #a78bfa; border-color: rgba(167, 139, 250, 0.35); }
  :root:not([data-theme="light"]) .pill-done { background: rgba(236, 232, 225, 0.06); color: var(--ink-soft); border-color: var(--rule); }
}
:root[data-theme="dark"] .pill-live { background: rgba(74, 222, 128, 0.1); color: #4ade80; border-color: rgba(74, 222, 128, 0.35); }
:root[data-theme="dark"] .pill-dev  { background: rgba(34, 211, 238, 0.1); color: #22d3ee; border-color: rgba(34, 211, 238, 0.35); }
:root[data-theme="dark"] .pill-soon { background: rgba(251, 191, 36, 0.1); color: #fbbf24; border-color: rgba(251, 191, 36, 0.35); }
:root[data-theme="dark"] .pill-lab  { background: rgba(167, 139, 250, 0.1); color: #a78bfa; border-color: rgba(167, 139, 250, 0.35); }
:root[data-theme="dark"] .pill-done { background: rgba(236, 232, 225, 0.06); color: var(--ink-soft); border-color: var(--rule); }

.proj-name .row-title { margin-bottom: 12px; }
.proj-tags { margin-top: 12px; }
.proj-tags span {
  display: inline-block; font-family: var(--font-mono); font-size: 0.68rem;
  color: var(--ink-soft); border: 1px solid var(--rule);
  padding: 2px 10px; border-radius: 6px; margin-right: 8px;
  transition: color 0.28s ease, border-color 0.28s ease;
}
.row:hover .proj-tags span { color: var(--on-ink-soft); border-color: var(--on-ink-faint); }

/* About sidebar */
.about-side { padding-top: 8px; }
.facts { border-top: 1px solid var(--rule-strong); }
.facts > div {
  display: flex; justify-content: space-between; gap: 20px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--rule-strong);
}
.facts dt {
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft); padding-top: 2px;
}
.facts dd { font-weight: 600; text-align: right; }

.stack-label {
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--accent); margin: 30px 0 14px;
}
.stack-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.stack-chips span {
  font-family: var(--font-mono); font-size: 0.72rem;
  border: 1px solid var(--rule); border-radius: 8px;
  padding: 5px 12px; color: var(--ink);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.stack-chips span:hover { border-color: var(--accent); background: rgba(10, 162, 199, 0.06); }

/* ============ Motion layer (anime.js drives reveals from motion.js) ============ */
/* white-space: pre keeps split space characters from collapsing to zero
   width, which would run words together in any split heading */
.chr { display: inline-block; white-space: pre; }

.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  pointer-events: none;
  /* bridges the gaps between sparse scroll events on the JS fallback path */
  transition: transform 90ms linear;
}
/* compositor-driven where supported: perfectly smooth, immune to the mobile
   URL-bar resize jitter */
@supports (animation-timeline: scroll()) {
  .scroll-progress {
    transition: none;
    animation: progress-grow linear both;
    animation-timeline: scroll(root);
  }
  @keyframes progress-grow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
  }
}

/* Glyph matrix behind the "we build" strip */
.hero-build { position: relative; overflow: hidden; }
.hero-build .build-label, .hero-build .build-stage { position: relative; z-index: 1; }
.glyph-layer {
  position: absolute; inset: 0; z-index: 0;
  display: grid; grid-template-columns: repeat(var(--g-cols, 40), 1fr);
  align-content: space-evenly; justify-items: center;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-soft); pointer-events: none;
  user-select: none;
}
.glyph-layer span { opacity: 0.22; line-height: 1; }

/* Interactive hover CTA (dot expands to fill) */
.hero-cta-col { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }
.cta-btn {
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  padding: 15px 46px 15px 24px;
  border: 1px solid var(--rule-strong); border-radius: 999px;
  overflow: hidden; text-decoration: none;
  font-family: var(--font-mono); font-size: 0.76rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink);
}
/* the fill is a clip-path circle seeded at the dot, sized in percent so it
   always reaches the far corner no matter how long the label is */
.cta-btn::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: var(--accent);
  clip-path: circle(0% at var(--cta-seed, 28px) 50%);
  transition: clip-path 0.55s cubic-bezier(0.65, 0, 0.35, 1);
}
.cta-btn:hover::before, .cta-btn:focus-visible::before {
  clip-path: circle(150% at var(--cta-seed, 28px) 50%);
}
.cta-dot {
  position: relative; z-index: 1;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  transition: opacity 0.25s ease;
}
.cta-btn:hover .cta-dot { opacity: 0; }
.cta-text { position: relative; z-index: 1; transition: color 0.3s ease, transform 0.4s cubic-bezier(0.65, 0, 0.35, 1); }
.cta-arrow {
  position: absolute; right: 20px; z-index: 1;
  opacity: 0; transform: translateX(-10px);
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.65, 0, 0.35, 1);
  color: #07222b;
}
.cta-btn:hover .cta-text, .cta-btn:focus-visible .cta-text { color: #07222b; transform: translateX(-4px); }
.cta-btn:hover .cta-arrow, .cta-btn:focus-visible .cta-arrow { opacity: 1; transform: translateX(0); }

/* Animated theme toggle (View Transitions circle reveal). The new view is
   pre-clipped to a zero circle so no frame can flash the new theme before the
   expanding animation takes over; vt-lock freezes per-element colour
   transitions so the circle contains the fully switched theme. */
::view-transition-old(root), ::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-new(root) {
  clip-path: circle(0px at var(--vt-x, 50%) var(--vt-y, 0px));
}
html.vt-lock * { transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track { animation: none; }
  .clock-dot { animation: none; }
  .cta-btn::before { transition: none; }
  .scroll-progress { display: none; }
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .creed { grid-template-columns: 1fr; }
  .row { position: relative; grid-template-columns: 60px minmax(0, 1fr); grid-template-rows: none; gap: 10px clamp(16px, 3vw, 48px); }
  .row > *:not(.row-num):not(.row-arrow) { grid-column: 2; min-width: 0; }
  .row-desc { max-width: none; }
  /* touch devices get no hover, so tappable rows keep a visible affordance */
  .row-arrow { position: absolute; top: 22px; right: 18px; opacity: 0.45; transform: none; }
  .row:not([data-project]) .row-arrow { display: none; }
  .studio-grid { grid-template-columns: 1fr; }
  .hero-meta { grid-template-columns: repeat(2, 1fr); }
  .hero-meta span:nth-child(3) { border-left: none; }
  .hero-meta span { border-top: 1px solid var(--rule); }
  .hero-meta span:nth-child(-n+2) { border-top: none; }
}

@media (max-width: 640px) {
  .manifesto .m1, .manifesto .m3 { max-width: none; }
  .manifesto .m2, .manifesto .m3 { margin-left: 0; }
  .topbar { padding: 12px 16px; gap: 12px; }
  .topbar-brand span { display: none; }
  /* Capabilities is a section on the home page, so it makes way for the
     theme switch on narrow screens rather than shrinking the tap targets */
  .topbar-nav a[href*="capabilities"] { display: none; }
  .topbar-nav { gap: 14px; }
  .topbar-nav a { font-size: 0.63rem; letter-spacing: 0.08em; }
  .theme-switch { --seg: 28px; }
  .theme-switch button { height: 28px; }
  .theme-thumb { height: 28px; }
  .topbar-clock { display: none; }
  .hero { grid-template-columns: 34px 1fr; }
  .hero-rail span { font-size: 0.58rem; }
  .hero-foot { flex-direction: column; align-items: flex-start; gap: 26px; }
  .sect-head { flex-wrap: wrap; gap: 12px; }
  .sect-note { margin-left: 0; width: 100%; }
  .contact-mail { flex-direction: column; align-items: flex-start; gap: 10px; }
  .hero-build { flex-direction: column; align-items: flex-start; gap: 8px; min-height: 0; padding: 18px 0; }
  .ticker-track { animation-duration: 34s; }
}
