/* Portfolio styles. Direction: Framer-like restraint (pure black, hairline panels, medium-weight grotesk,
   white + grey, colour only from brand logos), with careful motion craft. */
:root {
  --bg: #000;
  --panel: #0a0a0b;
  --panel-2: #111113;
  --panel-3: #18181b;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #ffffff;
  --text-2: #e4e4e7;
  --muted: #a1a1aa;
  --faint: #8b8b94;
  --accent: #cfc6ff;      /* used sparingly: live states and AI labels */
  --glow: #6d8cff;        /* hero card edge light */
  --ok: #8ff0bf;
  --warm: #d6d8de; /* silver: the palette is black, white, silver and lilac */
  --urgent: #ff8a7a;

  --font-display: 'Geist', system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', system-ui, sans-serif;

  --text-sm: 0.875rem;
  --text-base: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --text-lead: clamp(1.0625rem, 1rem + 0.35vw, 1.2rem);
  --text-h3: clamp(1.25rem, 1.15rem + 0.4vw, 1.45rem);
  --text-h2: clamp(2.1rem, 1.5rem + 2.2vw, 3.4rem);
  --text-hero: clamp(2.7rem, 1.3rem + 4.6vw, 5.4rem);

  --gutter: clamp(1.25rem, 0.6rem + 3vw, 7.5rem);
  --space-section: clamp(5.5rem, 4rem + 6vw, 11rem);
  --r-panel: 24px;
  --r-card: 18px;
  --r-ctl: 10px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --spring: cubic-bezier(0.34, 1.36, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--muted);
  font: 400 var(--text-base)/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  text-wrap: pretty;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text); margin: 0; font-weight: 500; }
h2 { font-size: var(--text-h2); line-height: 1.06; letter-spacing: -0.045em; max-width: 18ch; }
h3 { font-size: var(--text-h3); line-height: 1.2; letter-spacing: -0.025em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 50; background: var(--text); color: var(--bg); padding: 0.6rem 1rem; border-radius: var(--r-ctl); font-weight: 600; }
.skip:focus { top: 1rem; }
.eyebrow, .kicker, .tag, .block-title { font: 500 0.8rem var(--font-display); letter-spacing: 0; color: var(--faint); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 2rem;
  padding: 0.9rem var(--gutter);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.brandmark { font: 600 1.15rem var(--font-display); color: var(--text); text-decoration: none; letter-spacing: -0.04em; }
.brandmark span { color: var(--faint); }
.topbar nav { margin-right: auto; }
.topbar ul { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.topbar nav a { text-decoration: none; color: var(--text-2); font: 500 0.92rem var(--font-display); letter-spacing: -0.01em; transition: color 160ms var(--ease-out); }
.topbar nav a:hover { color: var(--text); }

/* Buttons: white pill primary, dark pill secondary (Framer). Press on pointer-down. */
.btn-primary, .chat-form button, .lang, .btn-ghost, .chip, .copy-btn {
  font: 500 0.9rem var(--font-display); letter-spacing: -0.01em; cursor: pointer; text-decoration: none; border: 0;
  transition: background 160ms var(--ease-out), color 160ms var(--ease-out), transform 120ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.btn-primary, .chat-form button { background: var(--text); color: #000; border-radius: var(--r-ctl); padding: 0.62rem 1rem; }
.btn-primary:hover, .chat-form button:hover { background: #e9e9ec; }
.lang, .btn-ghost { background: var(--panel-3); color: var(--text); border-radius: var(--r-ctl); padding: 0.62rem 1rem; }
.lang { padding: 0.45rem 0.8rem; }
.lang:hover, .btn-ghost:hover { background: #232327; }
.chip { background: transparent; color: var(--text-2); border-radius: 999px; padding: 0.45rem 0.85rem; font-size: 0.82rem; box-shadow: inset 0 0 0 1px var(--line-2); }
.chip:hover { background: var(--panel-3); color: var(--text); }
.chip[aria-pressed='true'], .chip[aria-selected='true'] { background: var(--text); color: #000; box-shadow: none; }
.copy-btn { align-self: flex-start; margin-top: auto; background: var(--panel-3); color: var(--text-2); border-radius: 8px; padding: 0.35rem 0.7rem; font-size: 0.78rem; }
.copy-btn:hover { color: var(--text); }
.btn-primary:active, .chat-form button:active, .lang:active, .btn-ghost:active, .chip:active, .copy-btn:active { transform: scale(0.97); }
.btn-primary:disabled, .chat-form button:disabled { opacity: 0.5; cursor: progress; }

/* App-icon tiles with official logos. */
.tile {
  display: inline-grid; place-items: center; flex: none;
  width: 2.75rem; height: 2.75rem; border-radius: 12px;
  background: linear-gradient(180deg, #1b1b1f, #121215);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 24px rgba(0, 0, 0, 0.5);
}
.tile img { width: 55%; height: 55%; }
.tile-sm { width: 2.25rem; height: 2.25rem; border-radius: 10px; }
.tile-lg { width: 4.5rem; height: 4.5rem; border-radius: 20px; }
.tile-mark { font: 700 0.74rem var(--font-display); color: var(--text); letter-spacing: -0.02em; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 4vw, 5rem); align-items: center;
  padding: clamp(3.5rem, 8vw, 8rem) var(--gutter) clamp(3rem, 6vw, 6rem);
  max-width: 1440px; margin: 0 auto;
}
.hero h1 { font-size: var(--text-hero); font-weight: 500; line-height: 1.02; letter-spacing: -0.05em; margin: 1.2rem 0 1.5rem; }
.hero h1 > span { display: block; }
.hero h1 em { display: block; font-style: normal; color: #6f6f78; }
.lead { font-size: var(--text-lead); color: var(--muted); max-width: 44ch; }
/* Key numbers in a hairline-divided panel. */
.stats { list-style: none; padding: 0; margin: 2.4rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); max-width: 34rem;
  border-radius: var(--r-card); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.stats li { display: flex; flex-direction: column; gap: 0.35rem; padding: 1.1rem 1.2rem; }
.stats li + li { box-shadow: inset 1px 0 0 var(--line); }
.stat-n { font: 500 2.2rem/1 var(--font-display); color: var(--text); letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 0.86rem; line-height: 1.35; color: var(--faint); }

/* Entrance for the small blocks (the title animates word by word in JS). */
.reveal { opacity: 0; transform: translateY(16px); animation: rise 900ms var(--ease-out) forwards; }
.hero-copy .reveal:nth-child(1) { animation-delay: 60ms; }
.hero-copy .reveal:nth-child(3) { animation-delay: 360ms; }
.hero-copy .reveal:nth-child(4) { animation-delay: 520ms; }
.hero > .chat.reveal { animation-delay: 420ms; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Chat: dark product card with a moving edge light (Framer hero card) ---------- */
.chat {
  position: relative; display: flex; flex-direction: column;
  height: min(620px, 78vh);
  background: var(--panel); border-radius: var(--r-panel);
  box-shadow: inset 0 0 0 1px var(--line), 0 40px 120px -40px rgba(109, 140, 255, 0.35);
  isolation: isolate; transform-style: preserve-3d; will-change: transform;
}
.chat::before {
  content: ''; position: absolute; inset: 0; z-index: -1; padding: 1.5px; border-radius: inherit; pointer-events: none;
  background: conic-gradient(from var(--edge-angle, 0deg), transparent 0deg, rgba(109, 140, 255, 0.6) 50deg, rgba(207, 198, 255, 0.4) 90deg, transparent 140deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: edge 14s linear infinite;
}
@property --edge-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes edge { to { --edge-angle: 360deg; } }
.chat-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.95rem 1.15rem; box-shadow: inset 0 -1px 0 var(--line); }
.chat-head strong { font: 500 0.98rem var(--font-display); color: var(--text); letter-spacing: -0.015em; }
.status { margin-left: auto; display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.8rem; color: var(--muted); }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.status.is-live .dot { background: var(--ok); box-shadow: 0 0 8px rgba(143, 240, 191, 0.7); }
.chat-log { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 1.15rem; display: flex; flex-direction: column; gap: 0.85rem; }
.msg { max-width: 88%; padding: 0.75rem 0.95rem; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); animation: rise 360ms var(--ease-out) both; }
.msg.bot { background: var(--panel-3); border-bottom-left-radius: 6px; }
.msg.user { align-self: flex-end; background: var(--text); color: #000; border-bottom-right-radius: 6px; }
.msg.note { align-self: center; max-width: 100%; font-size: var(--text-sm); color: var(--warm); background: transparent; text-align: center; }
.msg .ai-tag { display: block; margin-top: 0.5rem; font-size: 0.72rem; color: var(--faint); }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chat .chips { padding: 0 1.15rem 0.85rem; }
.chat-form { display: flex; gap: 0.5rem; padding: 0.85rem 0.95rem 0.95rem; box-shadow: inset 0 1px 0 var(--line); }
.chat-form input, .brief input, .brief select {
  flex: 1; min-width: 0; font: 400 0.98rem var(--font-body); color: var(--text);
  background: var(--panel-2); border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--r-ctl); padding: 0.72rem 0.9rem;
  transition: box-shadow 160ms var(--ease-out);
}
.chat-form input::placeholder, .brief input::placeholder { color: var(--faint); }
.chat-form input:focus, .brief input:focus, .brief select:focus { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5); outline: none; }
.brief select option { background: var(--panel-2); }
.msg.typing { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--muted); }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-2); animation: think 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes think { 0%, 80%, 100% { transform: translateY(0); opacity: 0.3; } 40% { transform: translateY(-5px); opacity: 1; } }
.chat.is-thinking .tile-mark { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 0 0 rgba(109, 140, 255, 0.5); } 50% { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 0 7px rgba(109, 140, 255, 0); } }
.chat-log { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent; }
.chat-log::-webkit-scrollbar { width: 6px; }
.chat-log::-webkit-scrollbar-track { background: transparent; }
.chat-log::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 999px; }
.chat-log::-webkit-scrollbar-button { display: none; height: 0; }

/* ---------- Tools ribbon ---------- */
.tools { max-width: 1440px; margin: 0 auto var(--space-section); padding: 0 var(--gutter); text-align: center; }
.marquee { margin-top: 1.4rem; overflow: hidden; -webkit-mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; gap: 2.2rem; width: max-content; list-style: none; margin: 0; padding: 0.8rem 0; animation: slide 50s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track li { display: inline-flex; align-items: center; gap: 0.7rem; }
.tool-name { font: 500 0.95rem var(--font-display); color: var(--text-2); white-space: nowrap; letter-spacing: -0.01em; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter) var(--space-section); }
.section .kicker { margin-bottom: 1rem; }
.section-lead { color: var(--muted); font-size: var(--text-lead); max-width: 58ch; margin-top: 1.2rem; }

/* Divided panel: one hairline container, columns split by 1px lines, visual on top and caption below. */
.skills { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 3rem; border-radius: var(--r-panel); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.skill { display: flex; flex-direction: column; text-decoration: none; min-height: 23rem; transition: background 200ms var(--ease-out); }
.skill + .skill { box-shadow: inset 1px 0 0 var(--line); }
.skill:hover { background: var(--panel); }
.skill-art { flex: none; height: 13rem; display: flex; align-items: center; justify-content: center; gap: 0.55rem; flex-wrap: nowrap; padding: 0 1rem; box-shadow: inset 0 -1px 0 var(--line); }
.skill-art .tile-lg { width: clamp(3rem, 4.2vw, 4.2rem); height: clamp(3rem, 4.2vw, 4.2rem); border-radius: 18px; }
.skill-art .tile { transition: transform 320ms var(--spring); }
.skill:hover .skill-art .tile:nth-child(odd) { transform: translateY(-6px) rotate(-3deg); }
.skill:hover .skill-art .tile:nth-child(even) { transform: translateY(-3px) rotate(3deg); }
.skill-cap { display: flex; flex-direction: column; gap: 0.35rem; padding: 1.5rem 1.6rem 1.7rem; }
.skill h3 { font-size: 1.15rem; }
.skill p { color: var(--muted); font-size: 0.98rem; }
.more { margin-top: 0.9rem; font: 500 0.95rem var(--font-display); color: var(--text); }
.more::after { content: ' →'; display: inline-block; transition: transform 200ms var(--ease-out); }
.skill:hover .more::after { transform: translateX(4px); }

/* ---------- Demo ---------- */
.pipeline { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 2.4rem 0 1.8rem; counter-reset: step; }
.pipeline li {
  counter-increment: step; font: 500 0.82rem var(--font-display); color: var(--faint);
  padding: 0.45rem 0.85rem 0.45rem 0.7rem; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line);
  transition: color 200ms var(--ease-out), background 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.pipeline li::before { content: counter(step); margin-right: 0.45rem; color: var(--faint); }
.pipeline li.is-active { color: #000; background: var(--text); box-shadow: none; }
.pipeline li.is-active::before { color: #000; }
.pipeline li.is-done { color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.pipeline li.is-done::before { content: '✓'; color: var(--ok); }
.demo-grid { display: grid; grid-template-columns: minmax(280px, 370px) 1fr; gap: 1.5rem; align-items: start; }
.brief { position: sticky; top: 5rem; display: flex; flex-direction: column; gap: 1rem; padding: 1.4rem; border-radius: var(--r-panel); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.brief label, .brief legend { display: flex; flex-direction: column; gap: 0.4rem; font: 500 0.84rem var(--font-display); color: var(--text-2); }
.brief fieldset { border: 0; padding: 0; margin: 0; }
.brief legend { margin-bottom: 0.5rem; }
.toggles { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.form-msg { min-height: 1.2em; font-size: var(--text-sm); color: var(--warm); }
.examples-label { font-size: var(--text-sm); color: var(--faint); }
.plan-out { min-height: 20rem; display: flex; flex-direction: column; gap: 1.6rem; }
.plan-out:focus { outline: none; }
.plan-head { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: baseline; justify-content: space-between; }
.plan-head h3 { font-size: 1.6rem; letter-spacing: -0.035em; }
.plan-note { font-size: var(--text-sm); color: var(--warm); }
.ai-badge { display: inline-flex; gap: 0.45rem; align-items: center; font-size: 0.75rem; color: var(--muted); border-radius: 999px; padding: 0.3rem 0.7rem; box-shadow: inset 0 0 0 1px var(--line); }
.ai-badge::before { content: 'IA'; font: 600 0.66rem var(--font-display); color: #000; background: var(--accent); border-radius: 999px; padding: 0.05rem 0.4rem; }
.block-title { margin-bottom: 0.75rem; }
.insights { display: grid; grid-template-columns: repeat(3, 1fr); border-radius: var(--r-card); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.insight { padding: 1.25rem; }
.insight + .insight { box-shadow: inset 1px 0 0 var(--line); }
.insight p { color: var(--text); font-weight: 500; }
.insight small { display: block; margin-top: 0.6rem; color: var(--muted); font-size: 0.86rem; }
.claims { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.claim { font: 500 1.15rem var(--font-display); letter-spacing: -0.025em; color: var(--text); padding: 0.6rem 1rem; border-radius: var(--r-ctl); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.75rem; }
.post { display: flex; flex-direction: column; gap: 0.6rem; padding: 1.15rem; border-radius: var(--r-card); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.post.is-paid { box-shadow: inset 0 0 0 1px rgba(247, 215, 168, 0.35); }
.post-top { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.net { font: 500 0.74rem var(--font-display); padding: 0.2rem 0.55rem; border-radius: 6px; background: var(--panel-3); color: var(--text); }
.mode { font: 500 0.72rem var(--font-display); padding: 0.2rem 0.5rem; border-radius: 6px; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.mode.paid { color: var(--warm); box-shadow: inset 0 0 0 1px rgba(247, 215, 168, 0.4); }
.fmt { font-size: 0.75rem; color: var(--faint); }
.post .hook { font-weight: 600; color: var(--text); }
.post .copy { color: var(--muted); font-size: 0.93rem; white-space: pre-wrap; }
.post .tags { color: var(--text-2); font-size: 0.85rem; }
.kv { font-size: 0.86rem; color: var(--muted); }
.kv b { color: var(--text); font-weight: 600; }
.newsletter { padding: 1.25rem; border-radius: var(--r-card); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); white-space: pre-wrap; color: var(--muted); }
.newsletter strong { display: block; color: var(--text); margin-bottom: 0.6rem; }
.discarded { display: grid; grid-template-columns: repeat(2, 1fr); border-radius: var(--r-card); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.drop { padding: 1.2rem; }
.drop + .drop { box-shadow: inset 1px 0 0 var(--line); }
.drop p:first-child { color: var(--text); text-decoration: line-through; text-decoration-color: rgba(255, 138, 122, 0.8); }
.drop small { display: block; margin-top: 0.5rem; color: var(--muted); }

/* ---------- Cases: big hairline panels ---------- */
.case {
  display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; margin-top: 3.5rem;
  border-radius: var(--r-panel); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden;
}
.case-text { display: flex; flex-direction: column; gap: 0.95rem; padding: clamp(1.6rem, 3vw, 2.6rem); }
.case > * + * { box-shadow: inset 1px 0 0 var(--line); }
.case h3 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.2rem); letter-spacing: -0.04em; }
.case-sub { color: var(--muted); font-size: var(--text-lead); }
.role { font-size: var(--text-sm); color: var(--faint); }
.insight-box { padding: 1rem 1.1rem; border-radius: var(--r-card); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.insight-box span { font: 500 0.78rem var(--font-display); color: var(--faint); }
.insight-box p { margin-top: 0.35rem; color: var(--text); }
.ticks, .steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.ticks li { position: relative; padding-left: 1.5rem; color: var(--muted); font-size: 0.95rem; }
.ticks li::before { content: ''; position: absolute; left: 0; top: 0.55em; width: 0.65rem; height: 0.32rem; border-left: 1.5px solid var(--text-2); border-bottom: 1.5px solid var(--text-2); transform: rotate(-45deg); }
.steps { counter-reset: s; margin-top: 0.3rem; }
.steps li { counter-increment: s; display: flex; gap: 0.9rem; align-items: baseline; color: var(--text-2); }
.steps li::before { content: counter(s, decimal-leading-zero); font: 500 0.8rem var(--font-display); color: var(--faint); font-variant-numeric: tabular-nums; }
.result { font-weight: 600; color: var(--text); }
.link-arrow { align-self: flex-start; color: var(--text); font: 500 1rem var(--font-display); text-decoration: none; }
.link-arrow::after { content: ' →'; display: inline-block; transition: transform 200ms var(--ease-out); }
.link-arrow:hover::after { transform: translateX(4px); }
.case-shots { position: relative; margin: 0; display: grid; place-items: center; padding: clamp(1.6rem, 3vw, 2.6rem); background: radial-gradient(70% 60% at 60% 40%, rgba(109, 140, 255, 0.12), transparent 70%), var(--panel); }
.shot-desk { border-radius: 14px; box-shadow: 0 0 0 1px var(--line-2), 0 30px 80px -30px rgba(0, 0, 0, 0.9); }
.shot-mob { position: absolute; right: 6%; bottom: 8%; width: 24%; border-radius: 18px; border: 3px solid #1c1c20; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9); }
.case-infra, .case-flows { grid-template-columns: 1fr; gap: 0; padding: clamp(1.6rem, 3vw, 2.6rem); row-gap: 1.4rem; }
.case-infra > * + *, .case-flows > * + * { box-shadow: none; }
.case-infra .case-text, .case-flows .case-text { padding: 0; }
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.shots figure { margin: 0; }
.shots img { border-radius: 14px; box-shadow: 0 0 0 1px var(--line-2), 0 24px 60px -24px rgba(0, 0, 0, 0.8); }
.shots figcaption { margin-top: 0.5rem; font-size: var(--text-sm); color: var(--faint); }
.infra-kicker { margin-top: 0.6rem; }
.infra { display: flex; flex-wrap: wrap; gap: 0.55rem; align-items: center; }
.infra-node {
  font: 500 0.88rem var(--font-display); color: var(--text); cursor: pointer; text-align: left; letter-spacing: -0.01em;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); border: 0; border-radius: var(--r-ctl); padding: 0.65rem 0.95rem;
  transition: background 160ms var(--ease-out), transform 220ms var(--spring), box-shadow 160ms var(--ease-out);
}
.infra-node small { display: block; font: 400 0.74rem var(--font-body); color: var(--faint); }
.infra-node:hover, .infra-node[aria-pressed='true'] { background: var(--panel-3); box-shadow: inset 0 0 0 1px var(--line-2); transform: translateY(-2px); }
.infra-node[aria-pressed='true'] { background: var(--text); color: #000; }
.infra-node[aria-pressed='true'] small { color: #3f3f46; }
.infra-arrow { color: var(--faint); }
.infra-step { display: inline-flex; align-items: center; gap: 0.55rem; }
.infra-detail { min-height: 3.2em; color: var(--text-2); padding: 0.9rem 1.1rem; border-radius: var(--r-card); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- n8n canvas ---------- */
.flow-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.canvas-wrap { position: relative; overflow-x: auto; border-radius: var(--r-card); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); scrollbar-width: thin; }
.canvas-wrap.is-wide { box-shadow: inset 0 0 0 1px var(--line), inset -40px 0 30px -30px rgba(255, 255, 255, 0.12); }
.n8n-canvas { display: block; height: auto; }
.n8n-canvas .dot { fill: rgba(255, 255, 255, 0.08); }
.n8n-canvas .edge { fill: none; stroke: rgba(228, 228, 231, 0.5); stroke-width: 2.2; }
.n8n-canvas .edge.ai { stroke: rgba(207, 198, 255, 0.65); stroke-dasharray: 7 6; }
.n8n-canvas .box { fill: #141416; stroke: rgba(255, 255, 255, 0.14); stroke-width: 1.4; }
.n8n-canvas .pip { fill: #a1a1aa; }
.n8n-canvas .name { font: 500 14px var(--font-display); fill: #fff; }
.n8n-canvas .type { font: 400 11.5px var(--font-body); fill: #8b8b94; }
.n8n-canvas .role-trigger .pip { fill: var(--warm); }
.n8n-canvas .role-ai .box { fill: #1b1a26; stroke: rgba(207, 198, 255, 0.7); }
.n8n-canvas .role-ai .pip { fill: var(--accent); }
.n8n-canvas .sub .box { fill: #101012; stroke-dasharray: 5 4; }
.n8n-canvas .role-tool .pip, .n8n-canvas .role-model .pip, .n8n-canvas .role-memory .pip { fill: #8f7bff; }
.n8n-canvas .role-logic .pip { fill: var(--ok); }
.n8n-canvas .role-end .pip { fill: #52525b; }
.flow-desc { padding: 0.9rem 1.1rem; border-radius: var(--r-card); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-2); }
.legend { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; font-size: 0.82rem; color: var(--faint); }
.legend li::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.45rem; vertical-align: middle; }
.legend li:nth-child(1)::before { background: var(--warm); }
.legend li:nth-child(2)::before { background: var(--accent); }
.legend li:nth-child(3)::before { background: #8f7bff; }
.legend li:nth-child(4)::before { background: #a1a1aa; }
.legend li:nth-child(5)::before { background: var(--ok); }

/* ---------- Education & contact ---------- */
.edu { list-style: none; padding: 0; margin: 2.6rem 0 0; display: grid; max-width: 72ch; border-radius: var(--r-panel); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.edu > li { padding: 1.15rem 1.4rem; color: var(--text-2); }
.edu > li + li { box-shadow: inset 0 1px 0 var(--line); }
.certs { list-style: none; padding: 0; margin: 0.8rem 0 0; display: grid; gap: 0.5rem; }
.certs li { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); }
.certs a { color: var(--text); font: 500 var(--text-sm) var(--font-display); text-decoration: none; }
.certs a::after { content: ' ↗'; }
.contact { text-align: center; }
.contact h2 { font-size: clamp(2.8rem, 1.6rem + 4.5vw, 5.6rem); margin: 0 auto; max-width: none; }
.contact .section-lead { margin-left: auto; margin-right: auto; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 2rem; justify-content: center; }
.footer { max-width: 1440px; margin: 0 auto; padding: 2rem var(--gutter) 3rem; box-shadow: inset 0 1px 0 var(--line); color: var(--faint); font-size: 0.82rem; display: grid; gap: 0.3rem; }

/* ---------- Motion system ---------- */
.w { display: inline-block; white-space: pre; }
.reply .w { display: inline; white-space: normal; }
.js-motion [data-reveal]:not(.is-in),
.js-motion [data-stagger]:not(.is-in) > * { opacity: 0; }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 40; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, #6d8cff, #cfc6ff, #fff); }
@supports (animation-timeline: scroll()) {
  .progress { animation: grow linear both; animation-timeline: scroll(root); }
}
@keyframes grow { to { transform: scaleX(1); } }
/* Spotlight: soft light following the pointer on panels. */
.skill, .case, .post, .brief { position: relative; }
.skill::after, .case::after, .post::after, .brief::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.06), transparent 60%);
  transition: opacity 300ms var(--ease-out);
}
.skill:hover::after, .case:hover::after, .post:hover::after, .brief:hover::after { opacity: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .skills { grid-template-columns: repeat(2, 1fr); }
  .skill:nth-child(3) { box-shadow: inset 0 1px 0 var(--line); }
  .skill:nth-child(4) { box-shadow: inset 1px 0 0 var(--line), inset 0 1px 0 var(--line); }
}
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; }
  .chat { height: 560px; }
  .demo-grid { grid-template-columns: 1fr; }
  .brief { position: static; }
  .case { grid-template-columns: 1fr; }
  .case > * + * { box-shadow: inset 0 1px 0 var(--line); }
  .insights { grid-template-columns: 1fr; }
  .insight + .insight { box-shadow: inset 0 1px 0 var(--line); }
}
@media (max-width: 760px) {
  .topbar nav { display: none; }
  .lang { margin-left: auto; }
  .skills { grid-template-columns: 1fr; }
  .skill + .skill, .skill:nth-child(4) { box-shadow: inset 0 1px 0 var(--line); }
  .skill { min-height: 0; }
  .discarded { grid-template-columns: 1fr; }
  .drop + .drop { box-shadow: inset 0 1px 0 var(--line); }
  .stats li { padding: 0.9rem; }
  .stat-n { font-size: 1.8rem; }
  .certs li { flex-direction: column; gap: 0.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .marquee-track { flex-wrap: wrap; justify-content: center; width: auto; }
  .marquee-track li[aria-hidden='true'] { display: none; }
  .progress, .skill::after, .case::after, .post::after, .brief::after { display: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: #000; }
}

/* ---------- Liquid glass panels with a visible light edge ---------- */
.chat, .brief, .post, .case, .skills, .stats, .insights, .discarded, .newsletter, .edu,
.canvas-wrap, .flow-desc, .infra-detail, .insight-box {
  position: relative;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.015) 42%, rgba(255, 255, 255, 0.035)),
    rgba(16, 16, 20, 0.6);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 30px 80px rgba(0, 0, 0, 0.45);
}
/* The edge itself: a gradient hairline (bright top-left, lavender sheen, light again bottom-right). */
.brief::before, .post::before, .case::before, .skills::before, .stats::before, .insights::before, .discarded::before,
.newsletter::before, .edu::before, .canvas-wrap::before, .flow-desc::before, .infra-detail::before, .insight-box::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 1;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.08) 32%, rgba(207, 198, 255, 0.22) 64%, rgba(255, 255, 255, 0.32));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
/* The chat keeps its moving light, over a static glass edge. */
.chat { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 40px 120px -40px rgba(109, 140, 255, 0.3); }
.post.is-paid::before { background: linear-gradient(155deg, rgba(247, 215, 168, 0.7), rgba(247, 215, 168, 0.12) 40%, rgba(247, 215, 168, 0.35)); }
.case-shots { background: radial-gradient(70% 60% at 60% 40%, rgba(109, 140, 255, 0.1), transparent 70%); }
.msg.bot { background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.chat-form input, .brief input, .brief select { background: rgba(255, 255, 255, 0.05); }

/* ---------- Posts: clamped body with See more ---------- */
.post-body { position: relative; display: flex; flex-direction: column; gap: 0.6rem; max-height: 12.5rem; overflow: hidden;
  -webkit-mask: linear-gradient(180deg, #000 70%, transparent); mask: linear-gradient(180deg, #000 70%, transparent); }
.post.is-open .post-body { max-height: 200rem; -webkit-mask: none; mask: none; }
.post-actions { display: flex; gap: 0.45rem; align-items: center; margin-top: auto; padding-top: 0.3rem; }
.post-actions .copy-btn { margin-top: 0; }
.more-btn { font: 500 0.8rem var(--font-display); color: var(--text); background: transparent; border: 0; cursor: pointer; padding: 0.35rem 0.2rem; }
.more-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.posts { align-items: start; }

@media (prefers-reduced-motion: reduce) {
  .post-body { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .chat, .brief, .post, .case, .skills, .stats, .insights, .discarded, .newsletter, .edu,
  .canvas-wrap, .flow-desc, .infra-detail, .insight-box { backdrop-filter: none; -webkit-backdrop-filter: none; background: #111114; }
}

/* ---------- Audit (motion craft) ---------- */
/* Segmented control state. */
.chip.seg[aria-checked='true'] { background: var(--text); color: #000; box-shadow: none; }

/* Cards lift on hover: 180ms ease-out, interruptible (CSS transitions start from the current value).
   Only for real pointers; touch screens keep a pressed state instead. */
.post, .case, .skill, .insight, .stats li, .drop, .claim, .edu > li {
  transition: transform 180ms var(--ease-out), box-shadow 220ms var(--ease-out), background 200ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .post:hover, .case:hover, .claim:hover {
    transform: translateY(-6px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), 0 42px 90px -20px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
  }
  .case:hover { transform: translateY(-4px); }
  /* Columns inside a divided panel rise out of it as their own glass card. */
  .skill:hover, .insight:hover, .stats li:hover, .drop:hover, .edu > li:hover {
    position: relative; z-index: 2; transform: translateY(-6px); border-radius: 18px;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)), rgba(22, 22, 28, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 30px 60px -18px rgba(0, 0, 0, 0.85);
  }
}
.post:active, .claim:active { transform: translateY(-2px) scale(0.995); }

/* Increase contrast: solid panels, clear borders, brighter secondary text. */
@media (prefers-contrast: more) {
  :root { --muted: #d4d4d8; --faint: #c4c4cc; --line: rgba(255, 255, 255, 0.35); }
  .chat, .brief, .post, .case, .skills, .stats, .insights, .discarded, .newsletter, .edu,
  .canvas-wrap, .flow-desc, .infra-detail, .insight-box { background: #0d0d10; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55); }
  .chip { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6); }
}

/* ---------- Mobile and responsive ---------- */
/* Touch targets: at least 44px tall on coarse pointers. */
@media (pointer: coarse) {
  .chip, .lang, .btn-primary, .btn-ghost, .copy-btn, .more-btn, .infra-node, .chat-form button { min-height: 44px; }
  .chip { padding: 0.55rem 1rem; }
  /* Text links get a taller hit area without changing their look. */
  .brandmark, .topbar nav a, .link-arrow, .certs a, .more-btn, .skip { display: inline-flex; align-items: center; min-height: 44px; }
  .chat-form input, .brief input, .brief select { min-height: 44px; font-size: 16px; } /* 16px avoids iOS zoom on focus */
}
@media (max-width: 760px) {
  /* Navigation stays reachable: a second row that scrolls sideways. */
  .topbar { flex-wrap: wrap; row-gap: 0.4rem; padding-top: 0.7rem; padding-bottom: 0.5rem; }
  .topbar nav { display: block; order: 3; width: 100%; margin: 0; overflow-x: auto; scrollbar-width: none;
    -webkit-mask: linear-gradient(90deg, #000 85%, transparent); mask: linear-gradient(90deg, #000 85%, transparent); }
  .topbar nav::-webkit-scrollbar { display: none; }
  .topbar ul { gap: 1.2rem; padding: 0.3rem 0; white-space: nowrap; }
  .topbar nav a { display: inline-block; padding: 0.35rem 0; }
  html { scroll-padding-top: 6.5rem; }

  .hero { padding-top: 2.2rem; gap: 2rem; }
  .hero h1 { margin: 0.8rem 0 1.1rem; }
  .stats { grid-template-columns: 1fr; max-width: none; }
  .stats li { flex-direction: row; align-items: baseline; gap: 0.9rem; }
  .stats li + li { box-shadow: inset 0 1px 0 var(--line); }
  .chat { height: 72vh; min-height: 460px; max-height: 600px; }
  .msg { max-width: 94%; }

  h2 { max-width: none; }
  .section-lead { font-size: 1.02rem; }
  .skill-art { height: 9rem; }
  .skill-art .tile-lg { width: 3.2rem; height: 3.2rem; border-radius: 14px; }
  .case-text { padding: 1.4rem; }
  .case-infra, .case-flows { padding: 1.4rem; }
  .case-shots { padding: 1.4rem 1.4rem 2.2rem; }
  .shot-mob { right: 4%; bottom: 6%; width: 30%; }
  .insight-box p { font-size: 0.98rem; }
  .infra-step { gap: 0.4rem; }
  .infra-node { font-size: 0.84rem; padding: 0.6rem 0.8rem; }
  .flow-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.3rem; scrollbar-width: none; }
  .flow-tabs::-webkit-scrollbar { display: none; }
  .flow-tabs .chip { flex: none; }
  .posts { grid-template-columns: 1fr; }
  .plan-head h3 { font-size: 1.35rem; }
  .contact h2 { font-size: clamp(2.6rem, 12vw, 4rem); }
  .contact-actions .btn-primary, .contact-actions .btn-ghost { flex: 1 1 100%; text-align: center; }
  .marquee-track { gap: 1.6rem; }
  .edu > li { padding: 1rem; }
}
@media (max-width: 380px) {
  :root { --gutter: 1rem; }
  .hero h1 { font-size: 2.45rem; }
}
@media (prefers-reduced-motion: reduce) {
  .post:hover, .case:hover, .claim:hover, .skill:hover, .insight:hover, .stats li:hover, .drop:hover, .edu > li:hover { transform: none; }
}

/* Fix: the glass block made the brief position:relative, so top:5rem pushed it 80px down and broke sticky. */
.brief { position: sticky; top: 5rem; }
@media (max-width: 1024px) { .brief { position: relative; top: 0; } }
@media (max-width: 760px) { html { scroll-padding-top: 8.5rem; } }

/* Plan header framed as its own glass bar (no loose title). */
.plan-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.3rem; border-radius: var(--r-card);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.015) 42%, rgba(255, 255, 255, 0.035)), rgba(16, 16, 20, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 24px 60px rgba(0, 0, 0, 0.4); }
.plan-head::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.08) 32%, rgba(207, 198, 255, 0.22) 64%, rgba(255, 255, 255, 0.32));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.plan-title { display: flex; flex-direction: column; gap: 0.3rem; }
.plan-title .plan-note { margin: 0; }
.ai-pill { flex: none; font: 600 0.7rem var(--font-display); color: #000; background: var(--accent); border-radius: 999px; padding: 0.22rem 0.55rem; letter-spacing: 0.02em; }

/* Hero calls to action (council: the recruiter must find the demo, the CV and the email without searching) */
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem 1rem; margin-top: 1.8rem; }
.hero-cta .btn-primary, .hero-cta .btn-ghost { display: inline-block; padding: 0.75rem 1.2rem; }
.hero-mail { color: var(--text-2); font-size: 0.86rem; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); transition: color 160ms var(--ease-out); }
.hero-mail:hover { color: var(--text); }
.submit-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.submit-row .btn-ghost:disabled { opacity: 0.6; cursor: progress; }
