body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.08; letter-spacing: -0.02em; font-weight: 700; }
p { margin: 0; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
@media (max-width: 480px) { .wrap { padding: 0 20px; } }
.serif { font-family: "Instrument Serif", var(--font-serif); font-weight: 400; }
.mono { font-family: var(--font-mono); }
.label { font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); letter-spacing: 0.02em; font-weight: 500; }
.prompt::before { content: "$ "; color: var(--accent); font-family: var(--font-mono); font-weight: 600; }
.caret {
  display: inline-block;
  width: .55em;
  height: 1.05em;
  background: var(--accent);
  margin-left: .18em;
  transform: translateY(.16em);
  animation: blink 1.15s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }

/* ---- top bar ---- */
header.bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px) saturate(1.3);
  border-bottom: 1px solid var(--border);
}
.bar .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text);
}
.brand b { background: var(--accent); color: var(--on-accent); padding: 2px 7px; border-radius: 5px; }
nav.top { display: flex; gap: 6px; align-items: center; }
nav.top a {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-decoration: none;
  color: var(--muted);
  padding: 7px 11px;
  border-radius: var(--r-sm);
  font-weight: 500;
}
nav.top a:hover { color: var(--text); background: var(--surface); }
.toggle {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  color: var(--text-2);
  font-size: 15px;
}
.toggle:hover { border-color: var(--border-2); color: var(--accent); }
.menu-btn { display: none; }
@media (max-width: 740px) {
  nav.top a { display: none; }
  .menu-btn { display: inline-grid; }
}

/* ---- mobile menu overlay ---- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  width: 100%;
}
.mobile-menu-links { display: flex; flex-direction: column; padding: 18px 28px; }
.mobile-menu-links a {
  font-family: var(--font-mono);
  font-size: var(--step-1);
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  padding: 14px 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border);
}
.mobile-menu-links a:first-child { border-top: none; }
.mobile-menu-links a::before { content: "$ "; color: var(--accent); font-weight: 600; margin-right: 8px; }
.mobile-menu-links a.cta { color: var(--accent); font-weight: 700; }
body.menu-open { overflow: hidden; }

/* ---- hero ---- */
.hero { padding: clamp(48px, 8vw, 96px) 0 0; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }
.term-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.term-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.term-head .lights { display: flex; gap: 7px; }
.term-head .lights i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.term-head .lights i:nth-child(1) { background: oklch(0.72 0.16 28); }
.term-head .lights i:nth-child(2) { background: oklch(0.82 0.13 85); }
.term-head .lights i:nth-child(3) { background: oklch(0.74 0.13 150); }
.term-head .ttl { font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); margin-left: 6px; }
.term-body { padding: clamp(22px, 3.5vw, 36px); }
.kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--accent);
  font-weight: 600;
  line-height: 2;
  margin-bottom: 18px;
}
.kicker .pill {
  display: inline-block;
  white-space: nowrap;
  border: 1px solid var(--accent-line);
  background: var(--accent-tint);
  color: var(--accent);
  padding: 3px 9px;
  border-radius: 100px;
}
h1.headline { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.03em; max-width: 20ch; }
h1.headline em { font-style: normal; color: var(--accent); }
.sub { color: var(--text-2); font-size: var(--step-1); max-width: 54ch; margin-top: 18px; line-height: 1.5; }
.meta-list { margin-top: 26px; display: grid; gap: 10px; max-width: 520px; }
.meta-row {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 12px;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: var(--step--1);
}
.meta-row .k { color: var(--accent); }
.meta-row .v a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-2); text-underline-offset: 3px; }
.meta-row .v a:hover { text-decoration-color: var(--accent); color: var(--accent); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--step--1);
  padding: 12px 18px;
  border-radius: var(--r-sm);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border-2); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.pill-btn { border-radius: 100px; }

/* portrait placeholder */
.portrait { border-radius: var(--r-xl); overflow: hidden; align-self: stretch; min-height: 380px; }
.portrait .ph { width: 100%; height: 100%; }
.ph {
  outline: 1px dashed var(--border-2);
  background: repeating-linear-gradient(
    135deg,
    transparent 0 11px,
    color-mix(in oklab, var(--accent) 9%, transparent) 11px 12px
  );
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--muted);
  text-align: center;
  padding: 18px;
  border-radius: var(--r-sm);
}
@media (max-width: 860px) { .portrait { max-width: 300px; min-height: 320px; } }

/* ---- metrics strip ---- */
.metrics-wrap {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: clamp(40px, 6vw, 72px);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: var(--maxw);
  margin: 0 auto;
}
.metric { padding: 24px 28px; border-left: 1px solid var(--border); }
.metric:first-child { border-left: none; }
.metric .big { font-size: var(--step-2); font-weight: 800; letter-spacing: -0.04em; color: var(--text); }
.metric .big i { font-style: normal; color: var(--accent); }
.metric .cap {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
@media (max-width: 760px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(3) { border-left: none; }
}
@media (max-width: 480px) {
  .metric { padding: 14px 16px; }
  .metric .big { font-size: var(--step-1); }
  .metric .cap { line-height: 1.45; }
}

/* ---- section frame ---- */
section.blk { padding: clamp(54px, 8vw, 92px) 0; border-top: 1px solid var(--border); }
.sec-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 38px; flex-wrap: wrap; }
.sec-head h2 { font-size: var(--step-2); font-weight: 700; }
.sec-no { font-family: var(--font-mono); font-size: var(--step--1); color: var(--accent); font-weight: 600; }
.sec-note { font-family: var(--font-mono); font-size: var(--step--1); color: var(--faint); margin-left: auto; }

/* ---- about ---- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 52px); }
.about-text { display: grid; gap: 18px; max-width: 560px; }
.about-text p { color: var(--text-2); font-size: var(--step-1); line-height: 1.6; }
.about-text p strong { color: var(--text); font-weight: 600; }
.caps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  align-self: start;
}
.cap-cell { background: var(--bg); padding: 20px 18px; }
.cap-cell .h { font-weight: 700; font-size: var(--step-0); display: flex; align-items: center; gap: 8px; }
.cap-cell .h::before { content: ""; width: 7px; height: 7px; background: var(--accent); border-radius: 2px; }
.cap-cell p { font-size: var(--step--1); color: var(--text-2); margin-top: 7px; line-height: 1.5; }
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } }

/* ---- work ---- */
.work-list { display: grid; gap: 16px; }
.case {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease;
}
.case:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent-line); }
.case .idx { font-family: var(--font-mono); font-size: var(--step--1); color: var(--accent); font-weight: 600; align-self: start; padding-top: 5px; }
.case h3 { font-size: var(--step-1); font-weight: 700; letter-spacing: -0.02em; }
.case .desc { color: var(--text-2); margin-top: 7px; font-size: var(--step-0); line-height: 1.5; max-width: 60ch; }
.case .chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.case .chip {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 100px;
  background: var(--bg);
}
.case .arrow {
  font-family: var(--font-mono);
  color: var(--faint);
  font-size: 1.2rem;
  align-self: center;
  transition: transform .2s ease, color .2s ease;
}
.case:hover .arrow { transform: translateX(4px); color: var(--accent); }
@media (max-width: 640px) {
  .case { grid-template-columns: auto 1fr; padding: 18px 16px; gap: 14px; }
  .case .arrow { display: none; }
}

/* ---- testimonials ---- */
.pull { max-width: 900px; margin: 0 auto; text-align: center; }
.pull blockquote {
  font-family: "Instrument Serif", var(--font-serif);
  font-weight: 400;
  font-size: var(--step-3);
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}
.pull blockquote .it { font-style: italic; color: var(--accent); }
.pull .by { margin-top: 30px; font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); }
.pull .by b { color: var(--text-2); font-weight: 500; }
.quotes-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 42px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
.quote-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.quote-card blockquote {
  font-family: "Instrument Serif", var(--font-serif);
  font-weight: 400;
  font-size: var(--step-1);
  line-height: 1.4;
  color: var(--text);
  margin: 0;
}
.quote-card blockquote .it { font-style: italic; color: var(--accent); }
.quote-card .by { margin-top: 18px; font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); }
.quote-card .by b { color: var(--text-2); font-weight: 500; }
@media (max-width: 720px) { .quotes-row { grid-template-columns: 1fr; } }

/* ---- testimonials carousel ---- */
.quotes-carousel {
  position: relative;
  max-width: 900px;
  margin: 32px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.carousel-track-wrap {
  width: 100%;
  overflow: hidden;
  touch-action: pan-y;
}
.carousel-track {
  display: flex;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.carousel-track .quote-card {
  flex: 0 0 100%;
  width: 100%;
  box-sizing: border-box;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: background 0.15s;
}
.carousel-btn:hover { background: var(--border); }
.carousel-prev { left: -52px; }
.carousel-next { right: -52px; }
.carousel-dots {
  display: flex;
  gap: 16px;
}
.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
  position: relative;
}
/* Enlarge tap target to >=24x24 without changing the visual dot size */
.carousel-dot::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
}
.carousel-dot.active { background: var(--accent); }
@media (max-width: 820px) {
  .carousel-prev { left: 0; }
  .carousel-next { right: 0; }
  .carousel-track-wrap { padding: 0 44px; }
}
@media (max-width: 640px) {
  .carousel-btn { display: none; }
  .carousel-track-wrap { padding: 0; }
  .pull blockquote { font-size: var(--step-2); }
}

/* ---- experience timeline ---- */
.tl { display: grid; gap: 0; max-width: 820px; }
.tl-item { display: grid; grid-template-columns: 170px 1fr; gap: 28px; padding: 24px 0; border-top: 1px solid var(--border); }
.tl-item:first-child { border-top: none; }
.tl-when { font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); padding-top: 3px; }
.tl-role { font-size: var(--step-1); font-weight: 700; letter-spacing: -0.01em; }
.tl-co { color: var(--accent); font-weight: 600; }
.tl-desc { color: var(--text-2); margin-top: 7px; line-height: 1.55; font-size: var(--step-0); max-width: 58ch; }
@media (max-width: 600px) { .tl-item { grid-template-columns: 1fr; gap: 6px; } }

/* ---- writing ---- */
.posts { display: grid; gap: 2px; }
.post {
  display: grid;
  grid-template-columns: 128px 1fr auto;
  gap: 20px;
  align-items: baseline;
  text-decoration: none;
  color: inherit;
  padding: 18px 16px;
  border-radius: var(--r-sm);
  transition: background .16s ease;
}
.post:hover { background: var(--surface); }
.post .date { font-family: var(--font-mono); font-size: var(--step--1); color: var(--faint); }
.post .pt { font-size: var(--step-1); font-weight: 600; letter-spacing: -0.01em; }
.post:hover .pt { color: var(--accent); }
.post .rd { font-family: var(--font-mono); font-size: var(--step--1); color: var(--faint); }
@media (max-width: 600px) {
  .post { grid-template-columns: 1fr; gap: 4px; }
  .post .rd { display: none; }
}

/* ---- contact ---- */
.contact {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(34px, 6vw, 64px);
  box-shadow: var(--shadow-md);
  text-align: center;
}
.contact h2 { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.03em; }
.contact p { color: var(--text-2); font-size: var(--step-1); max-width: 46ch; margin: 16px auto 0; }
.contact .cta-row { justify-content: center; }
.links { display: flex; gap: 8px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.links a {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--muted);
  text-decoration: none;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 100px;
}
.links a:hover { color: var(--accent); border-color: var(--accent-line); }

footer { padding: 40px 0 60px; border-top: 1px solid var(--border); }
footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--faint);
}
footer .wrap a { color: var(--muted); text-decoration: none; }
footer .wrap a:hover { color: var(--accent); }
