:root {
  --paper: #F3F4F5;
  --paper-2: #FFFFFF;
  --ink: #14171B;
  --panel: #12161B;
  --steel-700: #2C333B;
  --steel-500: #545D67;
  --steel-300: #8A929B;
  --line: rgba(20, 23, 27, 0.12);
  --line-strong: rgba(20, 23, 27, 0.24);
  --accent: #17627C;      /* temper blue */
  --accent-ink: #10485C;
  --accent-tint: rgba(23, 98, 124, 0.08);
  --add: #2E7D4F;
  --del: #C6533F;
  --add-d: #6FCF97;
  --del-d: #E0806E;
  --paper-d: #E7EAEC;

  --maxw: 1080px;
  --gutter: clamp(20px, 5vw, 64px);
  --font-display: "Archivo Expanded", "Archivo", system-ui, sans-serif;
  --font-head: "Archivo", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
::selection { background: var(--accent); color: #fff; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

.label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--steel-300);
  font-weight: 500;
}

/* ---------- top bar ---------- */
header.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(243, 244, 245, 0.82);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand {
  font-family: var(--font-mono);
  font-size: 0.9rem; letter-spacing: 0.16em; text-transform: uppercase;
  text-decoration: none; display: inline-flex; align-items: baseline; gap: 0.5ch;
  color: var(--ink);
}
.brand b { font-weight: 600; }
.brand span { color: var(--steel-300); font-weight: 400; }
.brand .tick { color: var(--accent); }

.btn {
  font-family: var(--font-head);
  font-weight: 600; font-size: 0.94rem;
  text-decoration: none; display: inline-flex; align-items: center; gap: 0.55ch;
  padding: 0.62em 1.15em; border-radius: 2px;
  background: var(--accent); color: #fff;
  border: 1px solid var(--accent);
  transition: background .18s ease, transform .18s ease;
}
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--ink); }
.btn .arw { transition: transform .18s ease; }
.btn:hover .arw { transform: translateX(2px); }

a:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- hero ---------- */
.hero { padding: clamp(56px, 11vh, 128px) 0 clamp(48px, 8vh, 96px); }
.no-top-border { border-top: none; }
.hero .meta-top {
  display: flex; flex-wrap: wrap; gap: 0.6ch 1.4ch; align-items: center;
  margin-bottom: 28px;
}
.hero .meta-top .dot { color: var(--line-strong); }
h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 6.4vw, 4.7rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
  max-width: 15ch;
}
h1 .soft { color: var(--steel-500); }
.lead {
  font-size: clamp(1.12rem, 1.9vw, 1.34rem);
  line-height: 1.5;
  color: var(--steel-700);
  max-width: 60ch;
  margin: 0 0 36px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero-cta .note { font-family: var(--font-mono); font-size: 0.78rem; color: var(--steel-300); }

/* reveal animation */
.rise { opacity: 0; transform: translateY(14px); }
.rise.in { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.rise.d1 { transition-delay: .06s; }
.rise.d2 { transition-delay: .12s; }
.rise.d3 { transition-delay: .18s; }

/* ---------- section grid ---------- */
section { border-top: 1px solid var(--line); }
.sec {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(20px, 5vw, 64px);
  padding: clamp(52px, 8vh, 92px) 0;
}
.sec .col-label { padding-top: 6px; }
.sec h2 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(1.65rem, 3.2vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 14px 0 20px;
  max-width: 20ch;
}
.sec p { color: var(--steel-700); max-width: 62ch; margin: 0 0 18px; }
.sec p:last-child { margin-bottom: 0; }
.sec p.tight { margin-bottom: 26px; }
.sec strong { color: var(--ink); font-weight: 600; }

/* ---------- signature diff panel ---------- */
.signature { background: var(--panel); border-top: 1px solid var(--ink); color: var(--paper-d); }
.sig-inner { padding: clamp(56px, 9vh, 104px) 0; }
.sig-head { display: grid; grid-template-columns: 200px 1fr; gap: clamp(20px, 5vw, 64px); }
.sig-head .label { color: #6f7982; }
.signature h2 {
  font-family: var(--font-head); font-weight: 600;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem); line-height: 1.08; letter-spacing: -0.015em;
  margin: 14px 0 16px; color: #fff; max-width: 18ch;
}
.signature .sub { color: #A6AEB6; max-width: 58ch; margin: 0; }

.diff {
  margin-top: 40px;
  background: #0C0F13;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: clamp(0.78rem, 1.5vw, 0.95rem);
  line-height: 1.9;
}
.diff-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px; border-bottom: 1px solid rgba(255,255,255,0.07);
  color: #6f7982; font-size: 0.76rem; letter-spacing: 0.02em;
}
.diff-bar .d { width: 9px; height: 9px; border-radius: 50%; background: #2b3138; }
.diff-bar .fname { margin-left: 8px; color: #9aa4ad; }
.diff-body { padding: 14px 0; overflow-x: auto; }
.diff-row { padding: 1px clamp(14px, 3vw, 26px); white-space: pre; }
.diff-row .mark { display: inline-block; width: 1.6ch; opacity: .8; }
.diff-cmt { color: #6b757e; }
.diff-del { color: var(--del-d); background: rgba(198,83,63,0.10); }
.diff-add { color: var(--add-d); background: rgba(46,125,79,0.12); }
.diff-note { color: #59636c; }

/* ---------- writing / feed ---------- */
.feed-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  margin-top: 8px;
}
.post {
  background: var(--paper-2);
  padding: 26px 24px;
  display: flex; flex-direction: column; gap: 12px;
  min-height: 190px;
  text-decoration: none; color: var(--ink);
  transition: background .18s ease;
}
.post:hover { background: #fbfcfc; }
.post .p-date { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; color: var(--steel-300); text-transform: uppercase; }
.post .p-title { font-family: var(--font-head); font-weight: 600; font-size: 1.1rem; line-height: 1.25; letter-spacing: -0.01em; }
.post .p-snip { font-size: 0.92rem; color: var(--steel-500); line-height: 1.5; margin-top: auto; }
.post .p-more { font-family: var(--font-mono); font-size: 0.74rem; color: var(--accent); letter-spacing: 0.04em; }
.feed-state { grid-column: 1 / -1; background: var(--paper-2); padding: 40px 24px; text-align: center; color: var(--steel-300); font-family: var(--font-mono); font-size: 0.85rem; }
.feed-state a { color: var(--accent); text-decoration: none; }
.feed-state a:hover { text-decoration: underline; }
.writing-foot { margin-top: 24px; }
.writing-foot a { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent); text-decoration: none; letter-spacing: 0.03em; }
.writing-foot a:hover { color: var(--accent-ink); text-decoration: underline; }

/* ---------- trajectory / arc ---------- */
.arc {
  list-style: none; margin: 30px 0 0; padding: 0;
  display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line);
}
.arc li { background: var(--paper-2); padding: 22px 24px; }
.arc-step {
  font-family: var(--font-mono); font-size: 0.73rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 9px;
}
.arc li p { margin: 0; color: var(--steel-700); font-size: 0.96rem; line-height: 1.55; max-width: 66ch; }

/* ---------- closing CTA ---------- */
.close { border-top: 1px solid var(--line); padding: clamp(64px, 11vh, 128px) 0; }
.close .label { margin-bottom: 22px; display: block; }
.close h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.03; letter-spacing: -0.02em;
  margin: 0 0 22px; max-width: 16ch;
}
.close p { color: var(--steel-700); max-width: 56ch; font-size: 1.1rem; margin: 0 0 34px; }

/* ---------- footer ---------- */
footer.foot { border-top: 1px solid var(--line-strong); padding: 40px 0 56px; }
.foot-inner { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: baseline; justify-content: space-between; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 26px; font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.04em; }
.foot-links a { color: var(--steel-500); text-decoration: none; }
.foot-links a:hover { color: var(--ink); }
.colophon { font-family: var(--font-mono); font-size: 0.74rem; color: var(--steel-300); letter-spacing: 0.03em; max-width: 42ch; line-height: 1.6; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .sec, .sig-head { grid-template-columns: 1fr; gap: 8px; }
  .sec .col-label, .sig-head .col-label { padding-top: 0; }
  .feed-grid { grid-template-columns: 1fr; }
  .nav .btn .long { display: none; }
  .diff-note { display: none; }
  h1 { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .rise, .rise.in { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
