@font-face {
  font-family: Figtree;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/figtree-latin-400.woff2") format("woff2");
}

@font-face {
  font-family: Figtree;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/figtree-latin-500.woff2") format("woff2");
}

@font-face {
  font-family: Figtree;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/figtree-latin-600.woff2") format("woff2");
}

@font-face {
  font-family: Figtree;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/figtree-latin-700.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-latin-400.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-latin-500.woff2") format("woff2");
}

:root {
  --bg: #e4e7ee;
  --bg-raised: #eceef5;
  --ink: #16181d;
  --muted: #3f4656;
  --line: #c5cad4;
  --stroke: #3a4150;
  --lime: #d2f34c;
  --portrait: #d3d8e2;
  --violet: #3730a3;
  --on-violet: #ffffff;
  --accent: var(--violet);
  --accent-soft: #e7e9fb;
  --on-accent: #16181d;
  --danger: #9f1239;
  --grid: rgba(22, 24, 29, 0.035);
  --shadow: 2px 2px 0 rgba(22, 24, 29, 0.22);
  --sans: Figtree, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --header: 4.5rem;
  --content: 72rem;
  --prose: 42rem;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
}

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

a {
  color: var(--violet);
  text-decoration-color: var(--lime);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

button, input, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: var(--bg);
  padding: 0.5rem 0.8rem;
  z-index: 50;
}

.skip:focus { top: 0.75rem; }

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header);
  display: flex;
  align-items: center;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.header-inner,
.page,
.site-footer .footer-inner {
  width: min(var(--content), calc(100% - 2.5rem));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(var(--content), calc(100% - 2.5rem));
}

.brand {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.nav a.nuxt-link-exact-active { color: var(--ink); }

.icon-btn,
.nav-toggle {
  border: 0;
  background: transparent;
  padding: 0.4rem;
  cursor: pointer;
  color: var(--ink);
}

.nav-toggle { display: none; }

.page { flex: 1; padding: 4rem 0 5.5rem; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.7fr);
  gap: 4.5rem;
  align-items: end;
}

.kicker {
  margin: 0 0 0.75rem;
  color: var(--ink);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
}

.kicker::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.85em;
  margin-left: 0.35em;
  background: var(--lime);
  border: 1px solid var(--stroke);
  vertical-align: -0.08em;
  animation: blink 1.05s steps(1) infinite;
}

h1, h2, h3 { font-family: var(--sans); font-weight: 600; letter-spacing: -0.03em; line-height: 1.12; }

h1 { font-size: clamp(2.7rem, 5.2vw, 4rem); margin: 0 0 1.35rem; }

.bio p { margin: 0 0 1.05rem; font-size: 1.05rem; max-width: 40rem; }

.bio a { text-underline-offset: 0.18em; }

.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.75rem; }

.actions a,
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  border: 1px solid var(--stroke);
  background: var(--bg-raised);
  color: var(--ink);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 0.5rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  cursor: pointer;
}

.actions a::before,
.button::before {
  content: ">";
  color: var(--violet);
}

.button.primary,
.actions a.primary {
  background: var(--bg-raised);
  color: var(--ink);
  border-color: var(--line);
}

.portrait {
  position: relative;
  width: min(100%, 260px);
  aspect-ratio: 1;
  margin-left: auto;
  align-self: start;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: var(--portrait);
  box-shadow: 0 0 0 5px var(--lime), var(--shadow);
  transition: transform 0.45s ease;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.portrait:hover { transform: translateY(-3px); }

.portrait.portrait-square {
  border-radius: 22px;
}

.section { margin-top: 6rem; }

.section h2 { font-size: 2rem; margin: 0 0 1.25rem; }

.writing-list { margin: 0; padding: 0; list-style: none; }

.writing-list a {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.writing-list li:last-child a,
.writing-list li:last-child .session-row { border-bottom: 1px solid var(--line); }

.session-row {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 1.5rem;
  width: 100%;
  padding: 1.15rem 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-family: var(--sans);
  text-align: left;
  cursor: pointer;
}

.session-row::before { content: none; }

.transcript { list-style: none; margin: 1.5rem 0 0; padding: 0; }

.transcript li {
  margin: 0 0 0.65rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--stroke);
  border-radius: 6px;
  background: var(--bg);
}

.transcript li.user { background: var(--lime); }

.transcript .who {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.transcript p { margin: 0.35rem 0 0; white-space: pre-wrap; }

.writing-list time,
.meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.writing-list strong { display: block; font-family: var(--sans); font-size: 1.15rem; font-weight: 600; letter-spacing: -0.03em; }

.writing-list span { display: block; color: var(--muted); margin-top: 0.25rem; }

.prose { max-width: var(--prose); }

.prose h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); margin-bottom: 0.4rem; }

.prose .meta { margin: 0 0 2rem; }

.prose :is(h2, h3) { margin: 2.2rem 0 0.7rem; }

.prose h2 { font-size: 1.7rem; }

.prose h3 { font-size: 1.3rem; }

.prose p,
.prose li { font-size: 1.08rem; }

.prose p { margin: 0 0 1.15rem; }

.prose ul,
.prose ol { padding-left: 1.25rem; margin: 0 0 1.15rem; }

.prose li { margin: 0.55rem 0; padding-left: 0.15rem; }

.post-content ul { list-style: disc; }

.post-content li strong { font-weight: 600; }

.prose blockquote {
  margin: 1.5rem 0 1.8rem;
  padding-left: 1rem;
  border-left: 3px solid var(--lime);
  color: var(--muted);
}

.prose a { text-underline-offset: 0.16em; }

.back {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--muted);
  text-decoration: none;
}

.stack { display: grid; gap: 0.85rem; max-width: 40rem; }

.stack label { display: grid; gap: 0.3rem; font-size: 0.95rem; }

.stack input {
  border: 1px solid var(--line);
  background: var(--bg-raised);
  border-radius: 0.6rem;
  padding: 0.55rem 0.7rem;
}

.notice { margin: 0.5rem 0; }

.notice.error { color: var(--danger); }

.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; }

.footer-inner { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; color: var(--muted); font-family: var(--mono); font-size: 0.78rem; }

.footer-links { display: flex; flex-wrap: wrap; gap: 0.9rem 1.1rem; }

.footer-links a { color: var(--muted); text-decoration: none; }

.footer-credit {
  width: min(var(--content), calc(100% - 2.5rem));
  margin: 0.9rem auto 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.footer-credit a { color: var(--ink); }

.footer-links a:hover,
.nav a:hover,
.writing-list a:hover strong { color: var(--accent); }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.twin { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 30; }

.twin-greet {
  position: absolute;
  right: 0;
  bottom: 4.4rem;
  width: min(18rem, calc(100vw - 2.5rem));
  background: var(--lime);
  color: var(--ink);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 0.85rem 2rem 0.85rem 0.95rem;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.twin-greet p { margin: 0; font-size: 0.95rem; }

.twin-greet button,
.twin-close,
.twin-reset {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
}

.twin-greet button { position: absolute; top: 0.35rem; right: 0.4rem; font-size: 1.2rem; }

.twin-launch {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 6px;
  border: 1px solid var(--stroke);
  background: var(--lime);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
}

.twin-panel {
  position: absolute;
  right: 0;
  bottom: 4.6rem;
  width: min(31.25rem, calc(100vw - 48px));
  height: min(40rem, calc(100vh - 6.5rem));
  background: var(--bg-raised);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  box-shadow: 4px 4px 0 rgba(22, 24, 29, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.twin-head,
.twin-form,
.twin-note {
  padding: 0.8rem 0.9rem;
}

.twin-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.twin-head h2 { margin: 0; font-size: 1.15rem; }

.twin-head p { margin: 0.1rem 0 0; color: var(--muted); font-family: var(--mono); font-size: 0.72rem; }

.twin-tools { display: flex; gap: 0.2rem; }

.twin-log {
  flex: 1;
  overflow: auto;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.bubble {
  max-width: 90%;
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--stroke);
  font-size: 0.95rem;
}

.bubble.user {
  margin-left: auto;
  background: var(--lime);
  color: var(--ink);
}

.bubble.assistant {
  background: var(--bg);
}

.bubble p { margin: 0 0 0.55rem; }

.bubble p:last-child { margin: 0; }

.bubble ul { margin: 0.3rem 0; padding-left: 1.1rem; }

.bubble a { color: inherit; }

.bubble code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
}

.suggestions { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0 0.9rem 0.4rem; }

.suggestions button {
  border: 1px solid var(--stroke);
  background: var(--bg-raised);
  border-radius: 6px;
  box-shadow: 2px 2px 0 rgba(55, 48, 163, 0.28);
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  text-align: left;
  font-family: var(--mono);
  font-size: 0.72rem;
}

.twin-form { display: flex; gap: 0.45rem; align-items: flex-end; border-top: 1px solid var(--line); }

.twin-form textarea {
  flex: 1;
  resize: none;
  border: 0;
  background: transparent;
  min-height: 2.6rem;
  max-height: 7rem;
  outline: none;
}

.twin-form:focus-within {
  box-shadow: inset 0 -2px 0 var(--violet);
}

.twin-form button[type="submit"] {
  border: 1px solid var(--stroke);
  background: var(--violet);
  color: var(--on-violet);
  border-radius: 6px;
  box-shadow: 2px 2px 0 rgba(22, 24, 29, 0.22);
  padding: 0.45rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  cursor: pointer;
}

.twin-form button[type="submit"]::before {
  content: ">";
  margin-right: 0.3em;
}

.twin-form button:disabled { opacity: 0.45; cursor: default; }

.twin-note { padding-top: 0; text-align: center; color: var(--muted); font-size: 0.75rem; }

.twin-note a { color: var(--muted); }

.typing { display: inline-flex; gap: 0.25rem; padding: 0.35rem 0.1rem; }

.typing i {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 999px;
  background: currentColor;
  display: block;
  animation: blink 1s infinite ease-in-out;
}

.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

@media (max-width: 800px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    top: var(--header);
    left: 0;
    right: 0;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    padding: 0.8rem 1.25rem 1rem;
  }
  .nav.open { display: flex; }
  .hero { grid-template-columns: 1fr; gap: 1.5rem; }
  .portrait { order: -1; margin: 0; width: min(100%, 240px); }
  .writing-list a,
  .session-row { grid-template-columns: 1fr; gap: 0.2rem; }
  .page { padding-top: 2rem; }
  .twin { right: 0.75rem; bottom: 0.75rem; }
  .twin-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: min(86vh, 40rem);
    border-radius: 6px 6px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .typing i { animation: none; opacity: 0.7; }
  .portrait::before,
  .portrait img { transition: none; }
  .kicker::after { animation: none; }
  .portrait:hover { transform: none; }
}
