/* Local preview. Same idea as the reference: dark page, DM Sans, mono labels, full-screen chapters, right-side tick rail. */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --bg: #0b0b0b;
  --card: #111;
  --ink: #ececec;
  --text: #a9a9a9;
  --mute: #666;
  --line: rgba(255, 255, 255, 0.26);
  --line-soft: rgba(255, 255, 255, 0.11);
  --accent: #ff6500;
  --nav: 64px;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-padding-top: var(--nav); scroll-behavior: smooth; }

@media (pointer: fine) {
  html { scroll-snap-type: y mandatory; }
  .hero, .chapter { scroll-snap-align: start; }
  .chapter { scroll-snap-stop: always; }
  .footer { scroll-snap-align: end; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 24px;
  font-family: var(--mono);
  font-size: 13px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
}
.nav-right { display: flex; gap: 18px; align-items: center; }
.btn { border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; }
.btn:hover { border-color: var(--accent); }
.count { font-family: var(--mono); font-size: 12px; color: var(--mute); letter-spacing: 0.08em; }
.count b { color: var(--ink); font-weight: 400; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 14px;
}

.hero, main, .footer { max-width: 1080px; margin: 0 auto; }
.hero {
  padding: 8vh 24px 0;
  min-height: calc(100svh - var(--nav));
  display: flex;
  flex-direction: column;
}
.hero h1 {
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.03em;
  font-size: clamp(44px, 8vw, 96px);
  line-height: 1;
  margin-bottom: 28px;
}
.lead { max-width: 620px; font-size: clamp(17px, 2vw, 20px); }
.links { display: flex; gap: 22px; margin-top: 28px; font-family: var(--mono); font-size: 13px; }
.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 56px; align-items: center; }
.scroll-hint {
  margin-top: auto;
  padding-bottom: 32px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

main { padding: 0 24px; }
@media (max-width: 1200px) and (min-width: 761px) {
  main, .hero, .footer { padding-right: 64px; }
}

.chapter {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 56px;
  align-items: center;
  min-height: calc(100svh - var(--nav));
  padding: 32px 0;
}
.chapter:nth-child(even) .fig { order: 2; }

.fig, .portrait {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  overflow: hidden;
}
.portrait {
  aspect-ratio: 4 / 5;
  max-width: 400px;
  justify-self: end;
  width: 100%;
}
.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  filter: grayscale(1) contrast(1.05) brightness(0.92);
  transition: filter 0.6s ease;
}
.portrait:hover img { filter: none; }
.fig { aspect-ratio: 1 / 0.92; }
.mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.mark span { opacity: 0.45; }
.lbl {
  position: absolute;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--mute);
  text-transform: uppercase;
  z-index: 1;
}
.tl { top: 18px; left: 22px; text-transform: none; }
.tr { top: 18px; right: 22px; }
.bl { bottom: 16px; left: 22px; }
.br { bottom: 16px; right: 22px; text-transform: none; }

.story h2 {
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.02em;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.1;
  margin-bottom: 20px;
}
.story p + p { margin-top: 14px; }

.footer {
  margin-top: 10vh;
  padding: 40px 24px 56px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  font-size: 14px;
}
.muted { color: var(--mute); margin-top: 6px; }

.rail {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rail a {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 4px 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
}
.rail a::after {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--mute);
  transition: width 0.3s, background 0.3s;
}
.rail .name {
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.3s, transform 0.3s;
  white-space: nowrap;
}
.rail a:hover .name, .rail a:focus-visible .name { opacity: 1; transform: none; }
.rail a.active { color: var(--ink); }
.rail a.active::after { width: 30px; background: var(--accent); }
@media (min-width: 1400px) {
  .rail a.active .name { opacity: 1; transform: none; }
}

.blog-page { max-width: 720px; margin: 0 auto; padding: 8vh 24px 80px; }
.blog-page .lead { font-size: 14px; }
.blog-page h1 {
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.03em;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1;
  margin-bottom: 18px;
}
.post { padding: 22px 0; border-top: 1px solid var(--line-soft); }
.post time { font-family: var(--mono); font-size: 12px; color: var(--mute); letter-spacing: 0.08em; }
.post h2 { color: var(--ink); font-weight: 500; font-size: 22px; letter-spacing: -0.02em; margin-top: 8px; }
.note { margin-top: 28px; color: var(--mute); font-size: 14px; }
.cv-links { font-family: var(--mono); font-size: 13px; margin-top: -6px; }
.cv-links a + a::before { content: "·"; color: var(--mute); margin: 0 0.55em; }
.cv { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.cv h2 { color: var(--ink); font-weight: 500; font-size: 22px; letter-spacing: -0.02em; }
.cv h3 { color: var(--ink); font-weight: 500; font-size: 18px; letter-spacing: -0.02em; margin-top: 22px; }
.cv .meta { font-family: var(--mono); font-size: 12px; color: var(--mute); letter-spacing: 0.04em; margin-top: 6px; }
.cv p + p, .cv .skill { margin-top: 10px; }
.cv .skill b { color: var(--ink); font-weight: 500; }
.cv ul { margin: 10px 0 0; padding-left: 1.15em; }
.cv li { margin-top: 0.45em; }
.cv li::marker { color: var(--mute); }
.ask { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line-soft); }

@media (max-width: 760px) {
  .hero-grid, .chapter { grid-template-columns: 1fr; gap: 28px; }
  .chapter:nth-child(even) .fig { order: 0; }
  .portrait { justify-self: start; max-width: none; }
  .rail { display: none; }
  html { scroll-snap-type: none; }
}

html.reading { scroll-snap-type: none; }
.post-body { margin-top: 28px; }
.post-body h2, .post-body h3 { color: var(--ink); font-weight: 500; letter-spacing: -0.02em; margin: 1.4em 0 0.4em; }
.post-body p, .post-body li { margin-top: 0.7em; }
.post-body ul, .post-body ol { padding-left: 1.2em; }
.post-body a { border-bottom: 1px solid var(--line); }
.post-body img, .post-body svg { max-width: 100%; height: auto; margin: 1.2em 0; }
.post-body pre, .post-body code { font-family: var(--mono); font-size: 13px; }
.post-body pre {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 16px;
  overflow: auto;
  margin: 1.2em 0;
}
.post-body .prompt-info {
  border-left: 2px solid var(--accent);
  padding-left: 14px;
  margin: 1.2em 0;
}
.post-body table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 14px; }
.post-body th, .post-body td { border-bottom: 1px solid var(--line-soft); padding: 8px 6px; text-align: left; }
