:root {
  --bg: #0B0B10;
  --text: #D3D7E0;
  --bright: #F1F3F8;
  --subtle: #B9BFCC;
  --muted: #82889A;
  --accent: #F78C6C;
  --border: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] {
  --bg: #FAFAF8;
  --text: #2E3742;
  --bright: #0C1016;
  --subtle: #3D4854;
  --muted: #75808D;
  --accent: #C15F3C;
  --border: rgba(0, 0, 0, 0.09);
}

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

body {
  font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

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

::selection {
  background: rgba(247, 140, 108, 0.25);
}

/* ---------- Header ---------- */
header {
  padding: 36px 0 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--accent);
}

.theme-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-btn:hover {
  color: var(--text);
}

.theme-btn svg {
  width: 17px;
  height: 17px;
}

.theme-btn .sun { display: none; }
.theme-btn .moon { display: block; }
[data-theme="light"] .theme-btn .sun { display: block; }
[data-theme="light"] .theme-btn .moon { display: none; }

/* ---------- Main ---------- */
main {
  padding: 72px 0 100px;
}

.intro h1 {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.35;
  color: var(--bright);
  margin-bottom: 20px;
}

.intro p {
  font-size: 16.5px;
  line-height: 1.8;
  margin-bottom: 14px;
}

.links-row {
  margin-top: 26px;
  font-size: 15px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
}

.links-row a {
  color: var(--muted);
  position: relative;
}

.links-row a:hover {
  color: var(--text);
}

.pill-primary {
  background: var(--accent);
  color: #0B0B10;
  font-weight: 700;
  font-size: 16px;
  padding: 11px 24px;
  border-radius: 8px;
}

.pill-primary:hover {
  opacity: 0.88;
}

.pill-primary::after {
  display: none;
}

.copy-email {
  color: var(--text);
  cursor: copy;
  position: relative;
}

.copy-email:hover {
  color: var(--accent);
}

.nav-cv {
  font-size: 14px;
  color: var(--subtle);
  margin-right: 10px;
}

.nav-cv:hover {
  color: var(--accent);
}

/* t3-style animated underline */
.links-row a::after,
.row-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 1px;
  width: 0;
  background: var(--accent);
  transition: width 0.25s ease-out;
}

.links-row a:hover::after,
.row-link:hover::after {
  width: 100%;
}

/* ---------- Sections ---------- */
section.block {
  margin-top: 56px;
  padding-top: 46px;
  border-top: 1px solid var(--border);
}

.block-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 20px;
}

.block-title a:hover {
  color: var(--text);
}

/* ---------- t3-style list rows ---------- */
.entry {
  display: block;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.entry:last-of-type {
  border-bottom: none;
}

.entry-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
}

.entry-title {
  font-size: 16.5px;
  font-weight: 600;
  color: var(--bright);
  line-height: 1.5;
  transition: color 0.15s ease;
}

.entry:hover .entry-title {
  color: var(--accent);
}

.entry-date {
  font-size: 13.5px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.entry-desc {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.65;
  margin-top: 6px;
  max-width: 58ch;
}

.more-link {
  display: inline-block;
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
  position: relative;
}

.more-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 1px;
  width: 0;
  background: var(--accent);
  transition: width 0.25s ease-out;
}

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

.more-link:hover::after {
  width: 100%;
}

/* ---------- Article prose (Inter, steipete-style reading) ---------- */
.back-link {
  display: inline-block;
  color: var(--muted);
  font-size: 14.5px;
  margin-bottom: 40px;
}

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

.article-header h1 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.022em;
  color: var(--bright);
  margin-bottom: 16px;
}

.prose {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.8;
  color: var(--text);
}

.prose h2 {
  font-family: 'Geist Mono', monospace;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 48px 0 16px;
  color: var(--bright);
}

.prose h3 {
  font-family: 'Geist Mono', monospace;
  font-size: 16px;
  font-weight: 600;
  margin: 34px 0 12px;
  color: var(--bright);
}

.prose p {
  margin-bottom: 20px;
}

.prose ul, .prose ol {
  margin: 0 0 20px 26px;
}

.prose li {
  margin-bottom: 6px;
}

.prose code {
  font-family: 'Geist Mono', monospace;
  font-size: 0.82em;
  background: rgba(127,127,140,0.14);
  border-radius: 4px;
  padding: 1px 6px;
}

.prose pre {
  background: rgba(127,127,140,0.10);
  border-radius: 10px;
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 20px;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: 0.85em;
}

.prose blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 20px;
  color: var(--muted);
  margin: 0 0 20px;
  font-style: italic;
}

.prose a {
  color: var(--accent);
}

.prose a:hover {
  text-decoration: underline;
}

/* distill-style artifacts */
.tldr-box {
  border-left: 3px solid var(--accent);
  background: rgba(127, 127, 140, 0.08);
  border-radius: 0 8px 8px 0;
  padding: 20px 24px;
  margin-bottom: 28px;
}

.tldr-box .tldr-label {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 8px;
}

.tldr-box p {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.7;
}

.table-wrap {
  overflow-x: auto;
  margin: 24px 0 28px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
}

.prose th {
  text-align: left;
  font-weight: 600;
  color: var(--bright);
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.prose td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}

.prose tbody tr:last-child td {
  border-bottom: none;
}

.prose tbody tr:hover {
  background: rgba(127, 127, 140, 0.06);
}

.prose strong {
  color: var(--bright);
  font-weight: 600;
}

.prose li::marker {
  color: var(--muted);
}

/* ---------- CV ---------- */
.cv-page {
  font-size: 14px;
  line-height: 1.65;
}

.cv-topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 36px;
}

.cv-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--bright);
  line-height: 1.3;
}

.cv-role {
  color: var(--accent);
  font-size: 14px;
  margin-top: 4px;
}

.cv-contact {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 2;
  text-align: right;
}

.cv-contact a:hover {
  color: var(--accent);
}

.cv-section {
  margin-top: 36px;
}

.cv-section > h2 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.cv-item {
  margin-bottom: 17px;
}

.cv-item-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

.cv-item-title {
  font-weight: 600;
  color: var(--bright);
  line-height: 1.5;
}

.cv-item-title a:hover {
  color: var(--accent);
}

.cv-item-sub {
  color: var(--muted);
  white-space: nowrap;
  font-size: 13px;
}

.cv-item ul {
  margin: 6px 0 0 18px;
}

.cv-item li {
  margin-bottom: 4px;
}

.cv-skills {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 20px;
}

.cv-skills dt {
  color: var(--muted);
  font-size: 13px;
}

.cv-skills dd {
  font-size: 13.5px;
}

.print-btn {
  background: none;
  color: var(--muted);
  border: none;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  position: relative;
}

.print-btn:hover {
  color: var(--accent);
}

@media print {
  @page {
    size: A4;
    margin: 15mm;
  }

  body {
    background: #fff !important;
    color: #111 !important;
    font-size: 11px;
    line-height: 1.55;
    font-family: 'Inter', system-ui, sans-serif !important;
  }

  header, footer, .no-print {
    display: none !important;
  }

  main {
    padding: 0 !important;
  }

  .cv-name, .cv-item-title, .article-header h1 {
    color: #000 !important;
  }

  .cv-section > h2 {
    color: #555 !important;
    border-color: #ccc;
  }

  .cv-contact, .cv-item-sub, .cv-role, .cv-skills dt {
    color: #666 !important;
  }

  a {
    color: #111 !important;
    text-decoration: none !important;
  }

  .cv-section {
    break-inside: avoid;
  }
}

/* ---------- Footer ---------- */
footer {
  padding: 30px 0 40px;
  font-size: 13.5px;
  color: var(--muted);
}

footer a {
  position: relative;
}

footer a:hover {
  color: var(--text);
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  main {
    padding: 52px 0 80px;
  }

  section.block {
    margin-top: 46px;
    padding-top: 38px;
  }

  .intro h1 {
    font-size: 23px;
  }

  .entry-top {
    flex-direction: column;
    gap: 2px;
  }

  .article-header h1 {
    font-size: 27px;
  }

  .prose {
    font-size: 16.5px;
  }

  .cv-topbar {
    flex-direction: column;
  }

  .cv-contact {
    text-align: left;
  }

  .cv-item-head {
    flex-direction: column;
    gap: 1px;
  }
}
