:root {
  --paper: #fafaf7;
  --ink: #17181c;
  --muted: #64656d;
  --faint: #8a8b92;
  --line: #e7e6df;
  --card: #ffffff;
  --accent: #2f53d8;
  --accent-ink: #22399a;
  --amber: #e0871e;
  --dark: #111318;
  --dark-2: #1a1d24;
  --dark-line: #2b2f39;
  --on-dark: #f4f4f0;
  --on-dark-muted: #9b9daa;
  --radius: 14px;
  --container: 1120px;
  --pad: clamp(20px, 5vw, 44px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, ui-sans-serif, system-ui, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, p {
  margin: 0;
}

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

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px var(--pad);
  background: rgba(250, 250, 247, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.2) blur(12px);
}

.wordmark {
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 30px);
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--muted);
}

.site-nav a {
  transition: color 0.15s ease;
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a[target="_blank"] {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- layout primitives ---------- */

.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(56px, 9vw, 104px) var(--pad);
}

.section-head {
  max-width: 760px;
  margin-bottom: clamp(30px, 5vw, 54px);
}

.kicker {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.kicker.light {
  color: #7f97ff;
}

h1 {
  font-size: clamp(2.5rem, 5.4vw, 4.3rem);
  line-height: 1.03;
  letter-spacing: -0.025em;
  font-weight: 700;
}

h2 {
  font-size: clamp(1.85rem, 3.6vw, 2.85rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  font-weight: 700;
}

h3 {
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 650;
}

/* ---------- hero ---------- */

.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(52px, 9vw, 108px) var(--pad) clamp(40px, 6vw, 72px);
}

.eyebrow {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.hero h1 {
  max-width: 15ch;
}

.lede {
  max-width: 60ch;
  margin-top: 26px;
  color: var(--muted);
  font-size: clamp(1.1rem, 1.7vw, 1.32rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  font-size: 0.96rem;
  font-weight: 600;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.button.primary {
  background: var(--ink);
  color: #fff;
}

.button.primary:hover {
  background: #000;
}

.button.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.button.ghost:hover {
  border-color: var(--ink);
}

.button:active {
  transform: translateY(1px);
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 720px;
  margin: clamp(40px, 6vw, 64px) 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.hero-facts dt {
  color: var(--faint);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.hero-facts dd {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 550;
}

/* ---------- work ---------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: clamp(18px, 2.4vw, 26px);
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 1px 2px rgba(23, 24, 28, 0.04), 0 18px 40px rgba(23, 24, 28, 0.05);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(24px, 3vw, 32px);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-logo {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  object-fit: contain;
}

.card-badge {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.card-body > p {
  color: var(--muted);
  font-size: 1.02rem;
}

.bullets {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.96rem;
}

.bullets li::marker {
  color: var(--accent);
}

.text-link {
  margin-top: auto;
  align-self: flex-start;
  color: var(--accent);
  font-weight: 650;
  transition: color 0.15s ease;
}

.text-link:hover {
  color: var(--accent-ink);
}

.text-card {
  background: linear-gradient(180deg, #ffffff, #fafaf7);
}

.text-card .card-body {
  gap: 16px;
}

.card-body .tag-list {
  margin-top: 4px;
}

.tag-list.small li {
  padding: 5px 10px;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- resume ---------- */

.resume-section {
  border-top: 1px solid var(--line);
}

.resume-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  max-width: none;
}

.resume-head > div {
  max-width: 720px;
}

.resume-actions {
  display: flex;
  gap: 12px;
}

.resume-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(20px, 4vw, 48px);
}

.resume-summary p {
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.62;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 0.84rem;
  font-weight: 550;
  color: var(--ink);
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.timeline li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(16px, 2.4vw, 22px) clamp(18px, 2.6vw, 26px);
}

.timeline li + li {
  border-top: 1px solid var(--line);
}

.timeline h3 {
  font-size: 1.02rem;
  font-weight: 600;
}

.timeline p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.92rem;
}

.timeline span {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 0.86rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- AI usage (dark band) ---------- */

.usage {
  background: var(--dark);
  color: var(--on-dark);
}

.usage-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(56px, 9vw, 104px) var(--pad);
}

.usage-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: clamp(34px, 5vw, 56px);
}

.usage-head > div {
  max-width: 640px;
}

.usage-head h2 {
  color: var(--on-dark);
}

.usage-sub {
  margin-top: 14px;
  color: var(--on-dark-muted);
  font-size: 1rem;
  line-height: 1.55;
}

.pill {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid var(--dark-line);
  border-radius: 999px;
  background: var(--dark-2);
  color: var(--on-dark-muted);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.usage-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(28px, 5vw, 60px);
  align-items: center;
  padding: clamp(28px, 4vw, 40px);
  border: 1px solid var(--dark-line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--dark-2), #14161d);
}

.big-number {
  display: block;
  font-size: clamp(3.4rem, 9vw, 6.4rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(92deg, #ffffff, #a9b8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.big-caption {
  display: block;
  margin-top: 16px;
  color: var(--on-dark-muted);
  font-size: 1.05rem;
}

.window-label {
  display: block;
  margin-top: 8px;
  color: var(--faint);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.split {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.split-bar {
  display: flex;
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--dark-line);
}

.split-bar span {
  display: block;
  height: 100%;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.split-claude {
  background: linear-gradient(90deg, #4f70ff, #7f97ff);
}

.split-codex {
  background: linear-gradient(90deg, #e0871e, #f2ad4e);
}

.split-rows {
  display: grid;
  gap: 12px;
}

.split-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--dark-line);
}

.split-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  align-self: center;
}

.dot-claude { background: #6f8bff; }
.dot-codex { background: #f2ad4e; }

.split-name {
  font-size: 1rem;
  font-weight: 600;
}

.split-value {
  font-size: 1.28rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.split-models {
  grid-column: 2 / -1;
  color: var(--faint);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
}

/* ---------- chart ---------- */

.chart {
  margin: clamp(30px, 4vw, 44px) 0 0;
}

.chart figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  color: var(--on-dark-muted);
  font-size: 0.9rem;
}

.chart-latest {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 168px;
  padding-bottom: 26px;
}

.usage-bar {
  position: relative;
  flex: 1 1 0;
  min-height: 3px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #6f8bff, #384db8);
  transition: height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.usage-bar[data-label]::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: -22px;
  transform: translateX(-50%);
  color: var(--faint);
  font-size: 0.68rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.bars-empty {
  align-self: center;
  width: 100%;
  text-align: center;
  color: var(--faint);
}

/* ---------- footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 30px var(--pad) 40px;
  border-top: 1px solid var(--line);
}

.foot-name {
  font-weight: 650;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--muted);
  font-size: 0.94rem;
}

.foot-links a {
  transition: color 0.15s ease;
}

.foot-links a:hover {
  color: var(--ink);
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .work-grid,
  .resume-grid,
  .usage-hero {
    grid-template-columns: 1fr;
  }

  .usage-hero {
    gap: 28px;
  }
}

@media (max-width: 560px) {
  .hero-facts {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hero-actions .button {
    flex: 1 1 auto;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .site-nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 10px 16px;
    font-size: 0.9rem;
  }

  .resume-head {
    align-items: flex-start;
  }

  .split-row {
    grid-template-columns: auto 1fr auto;
  }

  .bars {
    gap: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}

/* ---------- condensed /usage terminal strip (near top) ---------- */

.usage-strip {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad) clamp(24px, 5vw, 48px);
}

.terminal {
  display: block;
  overflow: hidden;
  border: 1px solid var(--dark-line);
  border-radius: 12px;
  background: var(--dark);
  color: var(--on-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  box-shadow: 0 14px 36px rgba(23, 24, 28, 0.1);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.terminal:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 48px rgba(23, 24, 28, 0.16);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: var(--dark-2);
  border-bottom: 1px solid var(--dark-line);
}

.tdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3a3f4b;
}

.tdot:nth-child(1) { background: #ff5f57; }
.tdot:nth-child(2) { background: #febc2e; }
.tdot:nth-child(3) { background: #28c840; }

.tcmd {
  margin-left: 8px;
  color: var(--on-dark-muted);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-body {
  display: grid;
  gap: 12px;
  padding: clamp(15px, 2.4vw, 20px) clamp(16px, 2.6vw, 22px);
}

.t-rows {
  display: grid;
  gap: 7px;
}

.t-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  font-size: 0.9rem;
}

.t-name {
  flex: 0 0 auto;
  min-width: 96px;
  color: #7f97ff;
  font-weight: 600;
}

.t-cell {
  color: var(--on-dark-muted);
  font-variant-numeric: tabular-nums;
}

.t-io {
  margin-left: auto;
  color: var(--on-dark);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.t-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 14px;
  padding-top: 12px;
  border-top: 1px solid var(--dark-line);
}

.t-total-main {
  color: var(--on-dark-muted);
  font-size: 0.92rem;
}

.t-big {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--on-dark);
}

.t-window {
  color: #7f97ff;
  font-weight: 600;
}

.t-muted {
  color: var(--faint);
  font-size: 0.84rem;
}

.t-cta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--faint);
}

.t-link {
  color: #7f97ff;
}

/* ---------- usage breakdown table (dark band) ---------- */

.processed-note {
  display: block;
  margin-top: 10px;
  color: var(--faint);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.breakdown {
  margin-top: clamp(26px, 4vw, 38px);
  overflow-x: auto;
}

.breakdown-table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

.breakdown-table th,
.breakdown-table td {
  padding: 12px 10px;
  text-align: right;
  white-space: nowrap;
}

.breakdown-table thead th {
  color: var(--on-dark-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--dark-line);
}

.breakdown-table thead th:first-child,
.breakdown-table tbody th {
  text-align: left;
}

.breakdown-table tbody th {
  font-weight: 600;
  color: var(--on-dark);
}

.breakdown-table tbody td {
  color: var(--on-dark-muted);
}

.breakdown-table tbody tr + tr th,
.breakdown-table tbody tr + tr td {
  border-top: 1px solid rgba(43, 47, 57, 0.55);
}

.breakdown-table .row-total th,
.breakdown-table .row-total td {
  color: var(--on-dark);
  font-weight: 750;
  border-top: 1px solid var(--dark-line);
}

/* ---------- LoRA before/after showcase ---------- */

.section-lede {
  max-width: 64ch;
  margin-top: 16px;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.5vw, 1.16rem);
  line-height: 1.55;
}

.ba-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 24px);
}

.ba {
  margin: 0;
}

.ba-frame {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--dark);
  cursor: ew-resize;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.ba-after,
.ba-before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.ba-static {
  cursor: default;
}

.ba-before {
  clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0);
}

.ba-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos, 50%);
  width: 2px;
  margin-left: -1px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.ba-handle {
  position: absolute;
  top: 50%;
  left: var(--pos, 50%);
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.ba-handle::before,
.ba-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border-block: 5px solid transparent;
}

.ba-handle::before {
  left: 8px;
  transform: translateY(-50%);
  border-right: 6px solid var(--ink);
}

.ba-handle::after {
  right: 8px;
  transform: translateY(-50%);
  border-left: 6px solid var(--ink);
}

.ba-tag {
  position: absolute;
  bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(23, 24, 28, 0.68);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.ba-tag-before { left: 10px; }
.ba-tag-after { right: 10px; }

.ba figcaption {
  margin-top: 12px;
  font-weight: 600;
  font-size: 0.98rem;
}

.lora-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: clamp(28px, 4vw, 42px);
}

.lora-meta {
  color: var(--faint);
  font-size: 0.85rem;
}

@media (max-width: 820px) {
  .ba-grid {
    grid-template-columns: 1fr;
  }

  .ba {
    max-width: 460px;
    margin-inline: auto;
  }
}
