/* tabain.me, v3.2 (2026-12). Hand-written, no framework. */

:root {
  --bg: #faf8f3;
  --surface: #ffffff;
  --ink: #1c1b19;
  --ink-2: #4f4b44;      /* body text, 8:1 on bg */
  --ink-3: #6e695f;      /* small labels, 5.2:1 on bg */
  --line: #e3dccd;
  --accent: #2f55d4;     /* royal blue, 5.9:1 on bg */
  --accent-ink: #2443b0;
  --accent-soft: #eaeffc;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --wrap: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --rail: 280px;
  --gap: clamp(32px, 5vw, 72px);
}

*, *::before, *::after { box-sizing: border-box; }

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

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

a { color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; text-decoration: none; font-size: 14px;
}
.skip:focus { top: 16px; }

/* Header */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 28px; padding-bottom: 28px; }
.name { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 16px; text-decoration: none; white-space: nowrap; }
.star { width: 13px; height: 13px; fill: var(--accent); flex: none; transition: transform .6s cubic-bezier(.3,1.6,.5,1); }
.name:hover .star { transform: rotate(90deg) scale(1.2); }
.site-header nav { display: flex; gap: 4px; font-size: 15px; }
.site-header nav a {
  color: var(--ink-2); text-decoration: none; padding: 10px 12px; border-radius: 8px;
  background-image: linear-gradient(var(--accent), var(--accent)); background-size: 0 1.5px;
  background-repeat: no-repeat; background-position: 12px calc(100% - 8px); transition: background-size .25s, color .15s;
}
.site-header nav a:hover { color: var(--ink); background-size: calc(100% - 24px) 1.5px; }

/* Hero */
.hero { padding-top: clamp(48px, 9vh, 112px); padding-bottom: clamp(64px, 10vh, 120px); }
.hero h1 {
  font-family: var(--serif); font-weight: 400; margin: 0;
  font-size: clamp(40px, 5.6vw, 76px); line-height: 1.05; letter-spacing: -0.025em;
  max-width: 13ch;
}
.underlined { position: relative; white-space: nowrap; }
.underlined svg { position: absolute; left: -1%; bottom: -0.1em; width: 102%; height: 0.22em; overflow: visible; }
.underlined path {
  fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1s .7s cubic-bezier(.6,.1,.3,1) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.enter { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
.enter-2 { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; column-gap: var(--gap); row-gap: clamp(32px, 5vh, 56px);
}
.hero-title { grid-column: 1; grid-row: 1; }
.hero-copy { grid-column: 1; grid-row: 2; }
.now { grid-column: 2; grid-row: 1 / span 2; align-self: end; margin: 0; }
.enter-3 { animation-delay: .3s; }
.lede { margin: 0; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.55; color: var(--ink-2); max-width: 44ch; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0 20px;
  border: 1px solid #d6cebd; border-radius: 999px; background: transparent;
  font-size: 15px; font-weight: 500; text-decoration: none; color: var(--ink);
  transition: background .15s, border-color .15s, transform .15s;
}
.btn:hover { background: var(--surface); border-color: var(--ink); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

.now dl { margin: 0; }
.now-title { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 14px; font-weight: 500; color: var(--ink-3); }
.now div { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15.5px; }
.now div:last-child { border-bottom: 1px solid var(--line); }
.now dt { color: var(--ink-3); }
.now dd { margin: 0; color: var(--ink); }

/* Sections with a left rail */
.section {
  position: relative; display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); gap: var(--gap);
  padding-top: 56px; padding-bottom: 88px;
}
/* Hairline divider aligned with the content edges, not the full width */
.section::before {
  content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); height: 1px; background: var(--line);
}
.rail h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3vw, 40px); line-height: 1.1; letter-spacing: -0.015em; margin: 0; }
.rail { align-self: start; position: sticky; top: 24px; }
.rail-link, .rail-note { display: inline-block; margin-top: 14px; font-size: 15px; color: var(--ink-3); }
.rail-link { text-decoration: none; }
.rail-link:hover { color: var(--accent); }
.rail-note { margin: 10px 0 0; }

/* What I do */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); }
.trio-item {
  display: flex; flex-direction: column; padding: 4px 28px 8px; text-decoration: none;
  border-left: 1px solid var(--line); transition: border-color .2s;
}
.trio-item:first-child { padding-left: 0; border-left: 0; }
.trio-item h3 { font-family: var(--serif); font-weight: 400; font-size: 34px; letter-spacing: -0.015em; margin: 0; transition: color .2s; }
.trio-item p { margin: 10px 0 18px; color: var(--ink-2); font-size: 16px; }
.more { margin-top: auto; font-size: 14px; font-weight: 500; color: var(--accent); }
.more span { display: inline-block; transition: transform .2s; }
.trio-item:hover h3 { color: var(--accent); }
.trio-item:hover .more span { transform: translateX(4px); }

/* Selected work: an index of rows */
.works { list-style: none; margin: 0; padding: 0; }
.work { padding: 26px 0 28px; border-top: 1px solid var(--line); }
.work:first-child { padding-top: 0; border-top: 0; }
.work-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; }
.work h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 2.4vw, 32px); letter-spacing: -0.015em; line-height: 1.15; margin: 0; }
.work-meta { font-size: 14px; color: var(--ink-3); white-space: nowrap; }
.work p { margin: 10px 0 0; color: var(--ink-2); max-width: 62ch; }
.work .stack { font-size: 14px; color: var(--ink-3); }
.work-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.work-links a {
  color: var(--accent); font-weight: 500; text-decoration: none; font-size: 15px; display: inline-flex; align-items: center; min-height: 44px;
  background-image: linear-gradient(currentColor, currentColor); background-size: 0 1.5px; background-repeat: no-repeat; background-position: 0 calc(100% - 10px);
  transition: background-size .25s;
}
.work-links a:hover { background-size: 100% 1.5px; }

/* Experience */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { border-bottom: 1px solid var(--line); }
.timeline > li:first-child summary { padding-top: 0; }
.timeline summary {
  display: grid; grid-template-columns: 170px 1fr auto; gap: 20px; align-items: baseline;
  padding: 18px 0; cursor: pointer; list-style: none;
}
.timeline summary::-webkit-details-marker { display: none; }
.timeline summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--ink-3); transition: transform .25s, color .2s; }
.timeline details[open] summary::after { transform: rotate(45deg); color: var(--accent); }
.timeline summary:hover strong { color: var(--accent); }
.when { font-size: 15px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.what strong { display: block; font-weight: 600; font-size: 18px; transition: color .15s; }
.where { display: block; font-size: 15px; color: var(--ink-3); }
.timeline ul { margin: 0 0 22px 190px; padding: 0 0 0 18px; color: var(--ink-2); font-size: 16px; }
.timeline ul li { margin: 5px 0; }
.timeline ul li::marker { color: var(--accent); }

/* Education & skills */
.background { display: grid; grid-template-columns: 1fr 1.3fr; gap: var(--gap); }
.edu-school { margin: 0; font-family: var(--serif); font-size: 26px; line-height: 1.2; }
.edu-degree { margin: 6px 0 0; color: var(--ink-2); }
.muted { margin: 6px 0 0; font-size: 15px; color: var(--ink-3); }
.skills { margin: 0; }
.skills div { display: grid; grid-template-columns: 84px 1fr; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 16px; }
.skills div:first-child { border-top: 0; padding-top: 0; }
.skills dt { color: var(--ink-3); font-size: 15px; }
.skills dd { margin: 0; color: var(--ink-2); }

/* Closing */
.closing { padding-top: 96px; padding-bottom: 40px; position: relative; }
.closing::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); height: 1px; background: var(--line); }
.closing h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5vw, 64px); letter-spacing: -0.02em; line-height: 1.05; margin: 0; }
.closing-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.big-email {
  font-family: var(--serif); font-size: clamp(26px, 3.2vw, 44px); line-height: 1.15; letter-spacing: -0.02em;
  color: var(--accent); text-decoration: none; overflow-wrap: anywhere;
  background-image: linear-gradient(currentColor, currentColor); background-size: 0 3px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size .35s cubic-bezier(.6,.1,.3,1);
}
.big-email:hover { background-size: 100% 3px; }
.closing-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: var(--gap); margin-top: 40px; color: var(--ink-2); font-size: 16px; }
.closing-grid p { margin: 0; }
.closing-grid a { color: var(--accent); }
.pdf-note { color: var(--ink-3); }

.copy {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink-3); cursor: pointer; transition: background .15s, color .15s;
}
.copy:hover { background: var(--accent-soft); color: var(--accent); }
.copy:active { transform: translateY(1px); }
.copy svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }

/* Footer */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  padding-top: 40px; padding-bottom: 40px; font-size: 14px; color: var(--ink-3);
}

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px);
  background: var(--ink); color: #fff; font-size: 14px; padding: 10px 16px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .enter { animation: none; }
  .underlined path { animation: none; stroke-dashoffset: 0; }
  *, *::before, *::after { transition-duration: 0s !important; }
}

/* Medium screens */
@media (max-width: 1000px) {
  .section { grid-template-columns: 1fr; gap: 28px; }
  .rail { position: static; }
  .hero-grid { grid-template-columns: 1fr; }
  .now { grid-column: 1; grid-row: 3; max-width: 520px; align-self: start; }
}

/* Small screens */
@media (max-width: 680px) {
  body { font-size: 16px; }
  .site-header { flex-wrap: wrap; row-gap: 4px; padding-bottom: 12px; }
  .site-header nav { margin-left: -8px; font-size: 14px; }
  .site-header nav a { padding: 12px 8px; background-position: 8px calc(100% - 9px); }
  .site-header nav a:hover { background-size: calc(100% - 16px) 1.5px; }
  .trio { grid-template-columns: 1fr; gap: 22px; }
  .trio-item, .trio-item:first-child { padding: 0 0 22px; border-left: 0; border-bottom: 1px solid var(--line); }
  .trio-item:last-child { border-bottom: 0; padding-bottom: 0; }
  .more { min-height: 44px; display: inline-flex; align-items: center; }
  .background, .closing-grid { grid-template-columns: 1fr; gap: 24px; }
  .timeline summary { grid-template-columns: 1fr auto; gap: 2px 12px; }
  .timeline .what { grid-column: 1; grid-row: 1; }
  .timeline .when { grid-column: 1; grid-row: 2; }
  .timeline summary::after { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .timeline ul { margin-left: 0; }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
  .section { padding-top: 44px; padding-bottom: 64px; }
}

/* Print: a clean summary in place of a résumé PDF */
@media print {
  @page { margin: 15mm; }
  :root { --bg: #fff; --surface: #fff; --ink: #000; --ink-2: #222; --ink-3: #555; --line: #ccc; --accent: #000; --accent-soft: #fff; --gap: 18pt; --rail: 110pt; }
  body { font-size: 10pt; line-height: 1.4; }
  .skip, .site-header nav, .actions, .copy, .toast, .rail-link, .rail-note, .work-links, .underlined svg, .site-footer span:last-child, .timeline summary::after, .more, .pdf-note, .now-title .star { display: none !important; }
  .enter { animation: none; }
  .wrap { max-width: none; padding: 0; }
  .section::before, .closing::before { left: 0; right: 0; }
  .site-header { padding: 0 0 6pt; }
  .hero { padding: 4pt 0 12pt; }
  .hero h1 { font-size: 22pt; max-width: none; }
  .hero-grid { grid-template-columns: 1fr 200pt; gap: 8pt 16pt; }
  .lede { font-size: 10.5pt; }
  .now-title { font-size: 10pt; }
  .now div { font-size: 9.5pt; padding: 3pt 0; }
  .section { padding: 10pt 0 12pt; break-inside: avoid-page; }
  .rail { position: static; }
  .rail h2 { font-size: 14pt; }
  .trio-item h3 { font-size: 13pt; }
  .trio-item p { font-size: 9.5pt; margin: 4pt 0; }
  .work { padding: 6pt 0; break-inside: avoid; }
  .work h3 { font-size: 12pt; }
  .work p { font-size: 9.5pt; margin-top: 3pt; }
  .timeline > li { break-inside: avoid; }
  .timeline summary { padding: 4pt 0; grid-template-columns: 100pt 1fr; }
  .timeline ul { margin: 0 0 5pt 120pt; font-size: 9.5pt; }
  .what strong { font-size: 11pt; }
  .edu-school { font-size: 13pt; }
  .closing { padding: 12pt 0 0; break-inside: avoid; }
  .closing h2 { font-size: 16pt; }
  .big-email { font-size: 16pt; color: #000; }
  .closing-grid { margin-top: 8pt; font-size: 10pt; }
  .site-footer { padding: 8pt 0 0; }
  a { text-decoration: none; }
}
