:root {
  --bg: #111312;
  --surface: #1a1e1c;
  --surface-2: #222725;
  --ink: #eef1ef;
  --muted: #a2aaa6;
  --accent: #7ee0c3;
  --accent-ink: #0c1f19;
  --term: #0a0c0b;

  --step-small: 0.9375rem;
  --step-body: clamp(1.0625rem, 1rem + 0.2vw, 1.125rem);
  --step-lead: clamp(1.1875rem, 1.05rem + 0.5vw, 1.4375rem);
  --step-h3: clamp(1.75rem, 1.3rem + 1.6vw, 2.75rem);
  --step-head: clamp(2.25rem, 1.4rem + 3vw, 4rem);
  --step-display: clamp(2.375rem, 1rem + 5.4vw, 6rem);

  --gutter: clamp(20px, 4vw, 48px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "TikTok Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--step-body); line-height: 1.6; }
img { display: block; width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; font-weight: 600; }
p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1200px, 100% - 2 * var(--gutter)); margin-inline: auto; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px;
  background: var(--accent); color: var(--accent-ink); font-weight: 650; font-size: var(--step-small);
  text-decoration: none; border-radius: 8px; transition: transform .18s var(--ease), background-color .18s var(--ease);
}
.button:hover { color: var(--accent-ink); background: #a2ecd6; transform: translateY(-2px); }
.button:active { transform: none; }
.button.ghost { background: var(--surface-2); color: var(--ink); }
.button.ghost:hover { background: #2c3330; color: var(--ink); }
.quiet { font-size: var(--step-small); color: var(--muted); }

/* ---------- Top bar ---------- */
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); }
.top-in { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.name { font-weight: 650; text-decoration: none; }
nav { display: flex; align-items: center; gap: 22px; font-size: var(--step-small); }
nav a { text-decoration: none; padding: 10px 0; }
.lang { font: inherit; font-weight: 650; color: var(--ink); background: var(--surface-2); border: 0; border-radius: 8px; min-height: 44px; min-width: 48px; cursor: pointer; }
.lang:hover { background: #2c3330; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-rows: auto 1fr; gap: 40px 56px; padding: clamp(40px, 7vh, 88px) 0 72px; }
.hero h1 { grid-column: 1 / -1; font-size: var(--step-display); font-weight: 750; font-stretch: 110%; letter-spacing: -0.025em; line-height: 1.0; max-width: 20ch; }
.hero-text { display: grid; align-content: start; gap: 28px; }
.lead { font-size: var(--step-lead); line-height: 1.45; max-width: 40ch; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; }
.actions .quiet { flex-basis: 100%; }
.skills-inline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.skills-inline li { background: var(--surface); border-radius: 8px; padding: 6px 12px; font-size: var(--step-small); }
.remote { color: var(--accent); font-weight: 600; }

/* The terminal: a real-speed replay of Shura answering */
.term { margin: 0; background: var(--term); border-radius: 14px; overflow: hidden; font-size: 0.9375rem; align-self: start; }
.term-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: #151917; color: var(--muted); font-size: 0.8125rem; }
.term-title { color: var(--ink); font-weight: 600; }
.term-state { display: inline-flex; align-items: center; gap: 8px; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.term-body { padding: 18px 18px 8px; min-height: 252px; }
.t-user { color: var(--ink); margin-bottom: 12px; }
.t-mark { color: var(--accent); font-weight: 600; }
.t-out { margin: 0; font: 0.875rem/1.6 var(--mono); white-space: pre-wrap; color: #cfd6d2; line-height: 1.6; }
.t-out .add { color: var(--accent); }
.t-out .del { color: #f0a49a; }
.t-out::after { content: ""; display: inline-block; width: .55em; height: 1.05em; vertical-align: -0.2em; background: var(--accent); margin-left: 1px; animation: blink 1s steps(1) infinite; }
.t-out.done::after { animation: none; opacity: 0; }
@keyframes blink { 50% { opacity: 0; } }
.term-status { display: flex; justify-content: space-between; gap: 12px; padding: 10px 18px; color: var(--muted); font-size: 0.8125rem; background: #151917; }
.term-status b { color: var(--accent); font-size: 1rem; }
.term-ctx { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 18px 16px; }
.ctx-label { font-size: var(--step-small); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  font: 600 0.875rem var(--font); color: var(--ink); background: var(--surface-2); border: 0; border-radius: 8px;
  min-width: 52px; min-height: 44px; padding: 0 10px; cursor: pointer; transition: background-color .15s var(--ease), color .15s var(--ease);
}
.chips button:hover { background: #2c3330; }
.chips button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }
.term figcaption { font-size: var(--step-small); color: var(--muted); padding: 0 18px 18px; }

/* ---------- Numbers ---------- */
.numbers ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.numbers li { background: var(--surface); border-radius: 14px; padding: 24px 22px; display: grid; gap: 8px; align-content: start; }
.numbers b { white-space: nowrap; font-size: clamp(2rem, 1.4rem + 1.8vw, 3rem); font-weight: 750; font-stretch: 110%; letter-spacing: -0.02em; line-height: 1; color: var(--accent); }
.numbers span { font-size: var(--step-small); line-height: 1.45; }

/* ---------- Projects ---------- */
.section-h { font-size: var(--step-head); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 40px; }
.projects { padding-top: 140px; }
.case { display: grid; gap: 24px; margin-bottom: 120px; }
.case-head { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 8px 20px; }
.case-head h3 { font-size: var(--step-h3); font-weight: 700; letter-spacing: -0.015em; }
.case-tag { color: var(--muted); font-size: var(--step-lead); }
.case-link { font-size: var(--step-small); }
.shot { background: var(--surface); border-radius: 14px; overflow: hidden; }
.shot img { transition: transform .6s var(--ease); }
.shot:hover img { transform: scale(1.015); }
.shot.light { background: #f3f6f4; padding: clamp(16px, 3vw, 40px); }
.shot-open { display: block; cursor: zoom-in; }
.shot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.shot-grid .big { grid-column: 1 / -1; }
.shot-grid .shot img { height: 100%; object-fit: cover; object-position: top left; }
.case-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.case-cols h4 { font-size: var(--step-small); color: var(--accent); font-weight: 650; margin-bottom: 8px; }
.case-cols p { line-height: 1.55; }
.stack { color: var(--muted); font-size: var(--step-small); }

/* ---------- Experience ---------- */
.work { padding-top: 40px; }
.job { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px; background: var(--surface); border-radius: 14px; padding: clamp(24px, 3vw, 40px); }
.job-side { display: grid; gap: 6px; align-content: start; }
.job-side h3 { font-size: var(--step-h3); font-weight: 700; margin-bottom: 6px; }
.job-side p { color: var(--muted); }
.job-list { display: grid; gap: 18px; }
.job-list li { display: grid; gap: 2px; }
.job-list b { font-weight: 650; color: var(--accent); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.facts > div { background: var(--surface); border-radius: 14px; padding: clamp(24px, 3vw, 40px); }
.facts h3 { font-size: 1.5rem; margin-bottom: 18px; }
.facts dl { margin: 0; display: grid; gap: 12px; }
.facts dl { gap: 16px; }
.facts dl div { display: grid; gap: 2px; }
.facts dt { color: var(--muted); font-size: var(--step-small); }
.facts dd { margin: 0; }

/* ---------- Contact ---------- */
.contact { padding: 160px 0 40px; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px 56px; align-items: end; }
.contact-main { display: grid; gap: 20px; }
.contact .section-h { margin-bottom: 0; }
.mail { font-size: clamp(1.375rem, 0.9rem + 2.2vw, 2.75rem); font-weight: 700; letter-spacing: -0.02em; color: var(--accent); text-decoration: none; overflow-wrap: break-word; line-height: 1.15; }
.mail:hover { color: var(--ink); }
.contact-list { display: grid; gap: 10px; }
.contact-list a { display: flex; align-items: center; min-height: 56px; padding: 0 22px; font-size: var(--step-body) !important; background: var(--surface-2); border-radius: 8px; text-decoration: none; font-weight: 600; font-size: var(--step-small); }
.contact-list a:hover { background: #2c3330; color: var(--ink); }

.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 80px 0 32px; color: var(--muted); font-size: var(--step-small); }

/* ---------- Entrances ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-rise] { opacity: 0; transform: translateY(20px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
  .js [data-rise].in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Tablet ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .numbers ul { grid-template-columns: 1fr 1fr; }
  .case-cols { grid-template-columns: 1fr; gap: 20px; }
  .job { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; }
}

/* ---------- Phone ---------- */
@media (max-width: 600px) {
  nav { gap: 14px; }
  nav a:not(:nth-of-type(3)) { display: none; }
  .name { white-space: nowrap; }
  .hero { padding-top: 28px; gap: 28px; }
  .hero h1 { font-stretch: 100%; }
  .term-body { min-height: 300px; padding: 14px 14px 6px; }
  .t-out { font-size: 0.78rem; }
  .term-status { flex-direction: column; gap: 2px; padding: 10px 14px; }
  .term-ctx { padding: 12px 14px 14px; }
  .chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .chips button { min-width: 0; padding: 0; font-size: 0.8125rem; }
  .numbers li { padding: 18px 16px; }
  .projects { padding-top: 64px; }
  .section-h { margin-bottom: 24px; }
  .work { padding-top: 0; }
  .shot.light { overflow-x: auto; padding: 12px; }
  .shot.light img { width: 780px; max-width: none; }
  .case { margin-bottom: 88px; }
  .case-head { grid-template-columns: 1fr; gap: 4px; }
  .shot-grid { grid-template-columns: 1fr; }
  .contact { padding-top: 80px; }
}

/* ---------- Scroll scenes ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 20; pointer-events: none; }
.progress i { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

.flow { position: relative; height: 300svh; }
.flow-stage { position: sticky; top: 0; height: 100svh; display: grid; align-items: center; overflow: hidden; }
.flow-in { display: grid; gap: clamp(32px, 6vh, 64px); }
.flow-h { font-size: var(--step-head); font-weight: 700; letter-spacing: -0.02em; max-width: 16ch; }
.flow-track { position: relative; }
.flow-line { position: absolute; left: 0; right: 0; top: 13px; height: 4px; background: var(--surface-2); border-radius: 2px; }
.flow-fill { position: absolute; inset: 0; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); border-radius: 2px; }
.flow-dot { position: absolute; top: -8px; left: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 8px rgba(126, 224, 195, .18); /* taste-skill-ignore: the glowing request packet */
  transform: translateX(calc(var(--p, 0) * (var(--w, 1000px) - 20px))); }
.flow-nodes { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; list-style: none; margin: 0; padding: 0; }
.flow-nodes li { position: relative; padding-top: 48px; display: grid; gap: 10px; align-content: start; opacity: .28; transform: translateY(18px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.flow-nodes li::before { content: ""; position: absolute; top: 5px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2); transition: background-color .4s var(--ease); }
.flow-nodes li.on { opacity: 1; transform: none; }
.flow-nodes li.on::before { background: var(--accent); }
.flow-nodes b { font-size: var(--step-lead); font-weight: 700; }
.flow-nodes span { line-height: 1.5; }
.flow-count { font-size: var(--step-lead); color: var(--muted); }
.flow-count b { color: var(--accent); font-size: clamp(2.5rem, 1.5rem + 4vw, 5rem); font-weight: 750; font-stretch: 110%; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; display: inline-block; vertical-align: -0.12em; margin-right: .15em; }

@media (prefers-reduced-motion: no-preference) {
  .js .hero[data-scroll] h1 { transform: translateY(calc(var(--p, 0) * -90px)); opacity: calc(1 - var(--p, 0) * 1.4); }
  .js .hero[data-scroll] .hero-text { transform: translateY(calc(var(--p, 0) * -40px)); opacity: calc(1 - var(--p, 0) * 1.2); }
  .js .hero[data-scroll] .term { transform: translateY(calc(var(--p, 0) * 60px)) scale(calc(1 - var(--p, 0) * .06)); }
  .js .shot[data-scroll] { transform: scale(calc(.86 + var(--p, 1) * .14)); opacity: calc(.3 + var(--p, 1) * .7); transform-origin: 50% 100%; }
  .js .section-h[data-scroll] { transform: translateX(calc((1 - var(--p, 1)) * -60px)); opacity: var(--p, 1); }
  .js .hero h1, .js .hero-text, .js .term, .js .shot[data-scroll], .js .section-h[data-scroll] { will-change: transform; }
}
@media (prefers-reduced-motion: reduce) {
  .flow { height: auto; }
  .flow-stage { position: static; height: auto; padding: 120px 0; }
  .flow-fill { transform: none; }
  .flow-dot { display: none; }
  .flow-nodes li { opacity: 1; transform: none; }
  .flow-nodes li::before { background: var(--accent); }
}
html:not(.js) .flow { height: auto; }
html:not(.js) .flow-stage { position: static; height: auto; padding: 120px 0; }
html:not(.js) .flow-nodes li { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .flow { height: 320svh; }
  .flow-in { gap: 24px; }
  .flow-line { left: 9px; right: auto; top: 0; bottom: 0; width: 4px; height: auto; }
  .flow-fill { transform-origin: 50% 0; transform: scaleY(var(--p, 0)); }
  .flow-dot { left: -8px; top: 0; transform: translateY(calc(var(--p, 0) * (var(--h, 400px) - 20px))); }
  .flow-nodes { grid-template-columns: 1fr; gap: 18px; padding-left: 40px; }
  .flow-nodes li { padding-top: 0; }
  .flow-nodes li::before { left: -38px; top: 2px; }
  .flow-nodes span { font-size: var(--step-small); }
}
