/* ==========================================================================
   minicki.com — design system
   Dark-first. Tokens on :root, light theme via [data-theme="light"].
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  --bg: #0a1220;
  --bg-elev: #101a2b;
  --bg-card: rgba(255, 255, 255, 0.028);
  --bg-card-hover: rgba(255, 255, 255, 0.055);
  --ink: #e9edf2;
  --ink-soft: #b8c2cc;
  --muted: #8d99a6;
  --line: rgba(155, 170, 185, 0.16);
  --line-strong: rgba(155, 170, 185, 0.3);

  --accent: #4c93da;          /* logo blue, lightened for dark bg */
  --accent-ink: #051428;
  --blue: #7fb4f0;            /* lighter blue, secondary */
  --violet: #e0555c;          /* logo red, used sparingly */
  --accent-soft: rgba(76, 147, 218, 0.14);
  --blue-soft: rgba(127, 180, 240, 0.1);
  --violet-soft: rgba(224, 85, 92, 0.1);

  --glow: radial-gradient(60% 50% at 70% 12%, rgba(76, 147, 218, 0.09), transparent 65%),
          radial-gradient(45% 40% at 15% 85%, rgba(224, 85, 92, 0.05), transparent 60%);

  --font-display: "Sora", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --radius: 14px;
  --radius-lg: 20px;
  --maxw: 1180px;
  --pad-x: clamp(1.25rem, 4vw, 2.5rem);
  --section-gap: clamp(5rem, 10vw, 8.5rem);

  --shadow-card: 0 1px 0 rgba(255,255,255,0.04) inset, 0 20px 40px -30px rgba(0,0,0,0.6);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8fb;
  --bg-elev: #ffffff;
  --bg-card: rgba(16, 21, 27, 0.025);
  --bg-card-hover: rgba(16, 21, 27, 0.05);
  --ink: #10151b;
  --ink-soft: #39434d;
  --muted: #5d6873;
  --line: rgba(16, 21, 27, 0.12);
  --line-strong: rgba(16, 21, 27, 0.26);

  --accent: #1a5ea8;
  --accent-ink: #ffffff;
  --blue: #2f77c0;
  --violet: #c22a33;
  --accent-soft: rgba(26, 94, 168, 0.1);
  --blue-soft: rgba(47, 119, 192, 0.08);
  --violet-soft: rgba(194, 42, 51, 0.07);

  --glow: radial-gradient(60% 50% at 70% 10%, rgba(26, 94, 168, 0.07), transparent 65%),
          radial-gradient(45% 40% at 12% 90%, rgba(194, 42, 51, 0.04), transparent 60%);

  --shadow-card: 0 1px 2px rgba(16,21,27,0.04), 0 18px 36px -28px rgba(16,21,27,0.25);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background-image: var(--glow);
  background-attachment: fixed;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

p { margin: 0 0 1em; }
a { color: var(--ink); text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }

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

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

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 200;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  transition: top 0.2s;
}
.skip-link:focus-visible { top: 1rem; }

.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

/* ---------- Utility type ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  flex: none;
}

.section { padding-block: calc(var(--section-gap) / 2); }
.section-head { max-width: 46ch; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-head h2 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); }
.section-note { color: var(--muted); font-size: 0.95rem; max-width: 60ch; }

/* connector divider between sections — echoes the node motif */
.divider {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad-x);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 0.7;
}
.divider::before, .divider::after {
  content: "";
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
  flex: 1;
}
.divider span {
  width: 6px; height: 6px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  flex: none;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  margin-right: auto;
}
.brand svg { width: 34px; height: 27px; }
.brand .b1 { color: var(--accent); font-weight: 700; }
.brand .b2 { color: var(--ink); font-weight: 400; }

.nav-links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.nav-links a {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--ink); background: var(--bg-card-hover); }

.nav-actions { display: flex; align-items: center; gap: 0.4rem; }

.lang-switch, .theme-toggle {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.lang-switch:hover, .theme-toggle:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--bg-card-hover);
}
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.menu-btn {
  display: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
}
.menu-btn svg { width: 20px; height: 20px; }

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(3rem, 7vw, 5.5rem);
  overflow: clip;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-bottom: 1.4rem;
}
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.55rem);
  max-width: 16ch;
  margin-bottom: 1.1rem;
}
.hero-sub {
  color: var(--ink-soft);
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  max-width: 52ch;
  margin-bottom: 1.9rem;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-bottom: 2.1rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 24px -12px color-mix(in srgb, var(--accent) 65%, transparent);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -12px color-mix(in srgb, var(--accent) 75%, transparent); }
.btn-ghost {
  border-color: var(--line-strong);
  color: var(--ink);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hero-tags li {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  background: var(--bg-card);
}

/* Signature diagram */
.hero-visual { position: relative; min-height: 320px; }
.ambiguity-svg { width: 100%; height: auto; overflow: visible; }
.ambiguity-svg .edge-chaos {
  stroke: var(--line-strong);
  stroke-width: 1;
  opacity: calc(0.55 * (1 - var(--p, 0)));
}
.ambiguity-svg .edge-order {
  stroke: var(--accent);
  stroke-width: 1.6;
  opacity: calc(0.9 * var(--p, 0) * (1 - var(--q, 0)));
  stroke-dasharray: 4 5;
}
.ambiguity-svg .node {
  fill: var(--ink-soft);
  transition: fill 0.4s;
}
.ambiguity-svg .node-main { fill: var(--accent); }
.ambiguity-svg .node-sat { opacity: calc(0.85 - 0.55 * var(--p, 0) * (1 - var(--q, 0))); }
.ambiguity-svg .node-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  fill: var(--ink);
  opacity: calc(var(--p, 0) * (1 - var(--q, 0)));
}
.ambiguity-svg .node-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  opacity: calc(0.5 * var(--p, 0) * (1 - var(--q, 0)));
}
.hero-visual-caption {
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  text-align: right;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.about-lead {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.015em;
  margin-bottom: 1.4rem;
}
.about-copy p { color: var(--ink-soft); }
.about-facts {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky;
  top: 6rem;
}
.about-facts > div { background: var(--bg-elev); padding: 1.1rem 1.25rem; }
.about-facts dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.about-facts dd { margin: 0; font-weight: 500; font-size: 0.98rem; }

/* ---------- Expertise (bento) ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}
.bento-card {
  grid-column: span 2;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.6rem 1.4rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.25s, background 0.25s, transform 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}
.bento-card:hover {
  border-color: var(--line-strong);
  background: var(--bg-card-hover);
  transform: perspective(900px) translateY(-3px) rotateX(1.2deg);
}
.bento-card.large { grid-column: span 3; }
.bento-card h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.bento-card .summary { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 1rem; }
.bento-card ul { display: flex; flex-direction: column; gap: 0.4rem; }
.bento-card li {
  font-size: 0.88rem;
  color: var(--muted);
  padding-left: 1.1rem;
  position: relative;
}
.bento-card li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.55em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
}
.bento-card[data-id="ai"] li::before,
.bento-card[data-id="prototyping"] li::before { background: var(--violet); }

.bento-index {
  position: absolute;
  top: 1.35rem; right: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.7;
}

/* ---------- Services ---------- */
.service {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(1.25rem, 3vw, 3rem);
  padding-block: 1.9rem;
  border-top: 1px solid var(--line);
}
.service:last-of-type { border-bottom: 1px solid var(--line); }
.service h3 { font-size: 1.3rem; margin-bottom: 0.55rem; }
.service .for-label, .service .outcomes-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}
.service .for-who { color: var(--ink-soft); font-size: 0.98rem; margin: 0; }
.service .outcomes { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.service .outcomes li {
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  transition: border-color 0.2s, color 0.2s;
}
.service:hover .outcomes li { border-color: var(--line-strong); }

/* ---------- Approach (process flow) ---------- */
.process-flow {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  position: relative;
  counter-reset: step;
}
.process-flow::before {
  content: "";
  position: absolute;
  top: 17px; left: 6%; right: 6%;
  height: 2px;
  background: linear-gradient(90deg, #4c93da, #7fb4f0, #e0555c);
  opacity: 0.5;
}
.process-step { padding: 0 0.9rem; position: relative; }
.process-step .dot {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 33% 26%, #cfe6fb 0%, #4c93da 42%, #1a5ea8 78%, #0b3f7e 100%);
  border: none;
  box-shadow: 0 6px 14px -6px rgba(11, 63, 126, 0.55), inset 0 -3px 6px rgba(0,0,0,0.18);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.8rem;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.process-step:nth-child(5) .dot { background: radial-gradient(circle at 33% 26%, #fbd0d3 0%, #e0555c 42%, #c22a33 78%, #8e1017 100%); box-shadow: 0 6px 14px -6px rgba(142, 16, 23, 0.5), inset 0 -3px 6px rgba(0,0,0,0.18); }
.process-step:hover .dot, .process-step:focus-within .dot {
  transform: scale(1.12);
  box-shadow: 0 0 0 6px var(--accent-soft);
}
.process-step h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.process-step p { color: var(--muted); font-size: 0.88rem; margin: 0; }

/* ---------- Problems ---------- */
.problems-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.problems-grid li {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--bg-card);
  padding: 0.95rem 1.15rem;
  font-size: 0.97rem;
  color: var(--ink-soft);
  font-style: italic;
  transition: border-color 0.2s, background 0.2s;
}
.problems-grid li:nth-child(even) { border-left-color: var(--blue); }
.problems-grid li:hover { background: var(--bg-card-hover); border-color: var(--line-strong); }
.problems-grid li::before { content: "“"; color: var(--muted); margin-right: 0.15rem; }
.problems-grid li::after { content: "”"; color: var(--muted); margin-left: 0.15rem; }

/* ---------- Selected experience ---------- */
.work-list { display: grid; gap: 0.9rem; }
.work-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
  transition: border-color 0.25s;
}
.work-item[open] { border-color: var(--line-strong); background: var(--bg-card-hover); }
.work-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.4rem;
}
.work-item summary::-webkit-details-marker { display: none; }
.work-item summary:hover { background: var(--bg-card-hover); }
.work-item .area {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  white-space: nowrap;
  flex: none;
}
.work-item .work-title { font-weight: 600; font-family: var(--font-display); font-size: 1.02rem; letter-spacing: -0.01em; }
.work-item .chevron {
  margin-left: auto;
  flex: none;
  width: 18px; height: 18px;
  color: var(--muted);
  transition: transform 0.25s var(--ease);
}
.work-item[open] .chevron { transform: rotate(180deg); }
.work-body {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem 2rem;
  padding: 0.4rem 1.4rem 1.4rem;
}
.work-body h4 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.work-body h4.outcome-label { color: var(--accent); }
.work-body p { color: var(--ink-soft); font-size: 0.93rem; margin: 0; }

/* ---------- Lab ---------- */
.lab-section { position: relative; }
.lab-cloud { display: flex; flex-wrap: wrap; gap: 0.6rem; max-width: 56rem; }
.lab-cloud li {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
  border: 1px dashed color-mix(in srgb, var(--violet) 45%, var(--line-strong));
  background: var(--violet-soft);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  transition: transform 0.2s var(--ease), border-color 0.2s, color 0.2s;
}
.lab-cloud li:hover {
  transform: translateY(-2px) rotate(-0.5deg);
  border-color: var(--violet);
  color: var(--ink);
}
.lab-disclaimer {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.lab-disclaimer::before { content: "▲"; font-size: 0.6rem; color: var(--violet); }

/* ---------- Principles ---------- */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}
.principles-grid li {
  border-bottom: 1px solid var(--line);
  padding: 1.3rem 0.5rem 1.3rem 0;
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  display: flex;
  gap: 1rem;
  align-items: baseline;
}
.principles-grid li:nth-child(odd) { padding-right: 2.5rem; }
.principles-grid li:nth-child(even) { padding-left: 2.5rem; border-left: 1px solid var(--line); }
.principles-grid .p-index {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  flex: none;
}

/* ---------- Contact ---------- */
.contact-section { text-align: center; }
.contact-section .section-head { margin-inline: auto; }
.contact-section h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
.contact-section .contact-text { color: var(--ink-soft); max-width: 52ch; margin-inline: auto; }
.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 2.2rem;
}
.contact-links .btn { font-size: 1rem; }
.placeholder-note {
  display: block;
  margin-top: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: calc(var(--section-gap) / 2);
  padding-block: 2rem;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.footer-row .tagline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  margin-right: auto;
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
html.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 480px; min-height: 0; }
  .about-grid { grid-template-columns: 1fr; }
  .about-facts { position: static; }
  .bento-card, .bento-card.large { grid-column: span 3; }
  .process-flow { grid-template-columns: 1fr; gap: 1.4rem; }
  .process-flow::before { top: 0; bottom: 0; left: 17px; right: auto; width: 2px; height: auto;
    background: linear-gradient(180deg, #4c93da, #7fb4f0, #e0555c); }
  .process-step { display: grid; grid-template-columns: 36px 1fr; gap: 0 1rem; padding: 0; }
  .process-step .dot { margin-bottom: 0; }
  .process-step h3, .process-step p { grid-column: 2; }
  .service { grid-template-columns: 1fr; gap: 1rem; }
}

@media (max-width: 760px) {
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--line);
    padding: 0.75rem var(--pad-x) 1rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.75rem; font-size: 1rem; }
  .menu-btn { display: inline-flex; }
  .bento-card, .bento-card.large { grid-column: span 6; }
  .problems-grid { grid-template-columns: 1fr; }
  .work-body { grid-template-columns: 1fr; }
  .work-item summary { flex-wrap: wrap; gap: 0.5rem; }
  .principles-grid { grid-template-columns: 1fr; }
  .principles-grid li:nth-child(odd) { padding-right: 0.5rem; }
  .principles-grid li:nth-child(even) { padding-left: 0; border-left: none; }
  .hero-visual-caption { text-align: left; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero-visual { --p: 1; --q: 0; }
}

/* Signature diagram: --p (0 = chaos, 1 = pipeline), --q (0 = pipeline, 1 = logo) */
.ambiguity-svg .anim {
  transform: translate(
    calc((1 - var(--p, 0)) * var(--dx, 0px) + var(--q, 0) * var(--lx, 0px)),
    calc((1 - var(--p, 0)) * var(--dy, 0px) + var(--q, 0) * var(--ly, 0px))
  );
}
.ambiguity-svg .anim-s {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(calc(1 + var(--q, 0) * (var(--ls, 1) - 1)));
}
.ambiguity-svg .anim-ts {
  transform-box: fill-box;
  transform-origin: center;
  transform: translate(
    calc((1 - var(--p, 0)) * var(--dx, 0px) + var(--q, 0) * var(--lx, 0px)),
    calc((1 - var(--p, 0)) * var(--dy, 0px) + var(--q, 0) * var(--ly, 0px))
  ) scale(calc(1 + var(--q, 0) * (var(--ls, 1) - 1)));
}


/* ---------- Floating glossy spheres (logo motif) ---------- */
.orb-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}
.hero { position: relative; z-index: 0; }
.orb {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 33% 26%, #cfe6fb 0%, #4c93da 42%, #1a5ea8 78%, #0b3f7e 100%);
  opacity: 0.16;
  filter: blur(1px);
  animation: orb-float 14s ease-in-out infinite;
}
.orb.red { background: radial-gradient(circle at 33% 26%, #fbd0d3 0%, #e0555c 42%, #c22a33 78%, #8e1017 100%); }
.orb.o1 { width: 130px; height: 130px; top: 6%; right: 4%; animation-duration: 17s; }
.orb.o2 { width: 54px; height: 54px; top: 58%; right: 30%; animation-delay: -5s; }
.orb.o3 { width: 84px; height: 84px; bottom: -20px; left: 6%; animation-delay: -9s; animation-duration: 20s; opacity: 0.12; }
.orb.o4 { width: 34px; height: 34px; top: 20%; left: 42%; animation-delay: -3s; opacity: 0.2; }
[data-theme="light"] .orb { opacity: 0.2; }
[data-theme="light"] .orb.o3 { opacity: 0.14; }

@keyframes orb-float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33%      { transform: translate3d(-14px, -20px, 0) scale(1.04); }
  66%      { transform: translate3d(10px, 12px, 0) scale(0.97); }
}

@media (prefers-reduced-motion: reduce) {
  .orb { animation: none; }
}
@media (max-width: 760px) {
  .orb.o1 { width: 84px; height: 84px; }
  .orb.o3, .orb.o4 { display: none; }
}

/* Lab chips: red dashed accent from the logo */
.lab-cloud li { border-color: color-mix(in srgb, var(--violet) 40%, var(--line-strong)); }

/* E-mail reveal (assembled client-side; hidden from bots) */
.email-fallback { font-family: var(--font-mono); font-size: 0.9rem; color: var(--muted); }
