/* terrana.dev - theme tokens. Change colors/fonts here, everything follows. */
:root {
  --bg: #000000;
  --bg-2: #090c0f;
  --surface: #0e1216;
  --surface-2: #141a1f;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f2f4f6;
  --muted: #a6b0b9;
  --accent: #00a6d6;
  --accent-2: #2fc2ea;
  --accent-dim: rgba(0, 166, 214, 0.12);
  --font: "Mulish", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: Consolas, "Cascadia Mono", "SFMono-Regular", Menlo, monospace;
  --max: 1080px;
  --prose: 76ch;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { color: #fff; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #000; padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand img { width: 34px; }
.wordmark { font-size: 1.15rem; letter-spacing: 0.01em; }
.wordmark .dot { color: var(--accent); }
.nav { display: flex; gap: 22px; font-size: 0.95rem; }
.nav a { color: var(--muted); white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { color: #fff; }
@media (max-width: 640px) {
  .nav { gap: 14px; font-size: 0.88rem; }
  .nav a.hide-sm { display: none; }
}

/* Hero and page heads */
.hero {
  padding: 88px 0 64px;
  background: radial-gradient(900px 480px at 82% 18%, rgba(0, 166, 214, 0.16), transparent 62%);
}
.hero-grid { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 48px; align-items: center; }
.page-head { padding: 72px 0 24px; }
.page-head .lede { max-width: 66ch; }
.kicker { color: var(--accent); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.8rem; margin: 0 0 14px; }
.kicker a { color: var(--accent); }
.kicker a:hover { color: #fff; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.08; margin: 0 0 20px; font-weight: 800; letter-spacing: -0.01em; }
h1 .accent { color: var(--accent); }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 56ch; margin: 0 0 30px; }
.cta { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; font-family: inherit; font-size: 1rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--accent); color: #001018; }
.btn-primary:hover { background: var(--accent-2); color: #001018; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: #fff; }
.hero-mark img { width: min(100%, 340px); margin: 0 auto; filter: drop-shadow(0 0 40px rgba(0, 166, 214, 0.28)); }
.hero-photo { position: relative; }
.hero-photo::before {
  content: ""; position: absolute; inset: 10% 10% 0 10%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 166, 214, 0.22), transparent 72%);
  filter: blur(18px); z-index: 0;
}
.hero-photo img { position: relative; z-index: 1; width: min(100%, 380px); margin: 0 auto; }
.now { color: var(--muted); font-size: 0.98rem; margin: -12px 0 28px; }
.now-label { color: var(--accent); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.72rem; margin-right: 10px; }
.loop.loop-wide { max-width: 100%; display: inline-block; white-space: pre; }
@media (max-width: 820px) {
  .hero { padding: 56px 0 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-mark, .hero-photo { order: -1; }
  .hero-mark img { width: 150px; margin: 0; }
  .hero-photo img { width: 180px; margin: 0; }
  .hero-photo::before { inset: 0 auto 0 0; width: 180px; }
  .page-head { padding-top: 48px; }
}

/* Sections */
section { padding: 64px 0; }
section + section { border-top: 1px solid var(--line); }
.page-head + section { border-top: 0; padding-top: 16px; }
.section-label { color: var(--accent); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.78rem; margin: 0 0 10px; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 0 0 28px; font-weight: 800; letter-spacing: -0.01em; }
.tool-intro { color: var(--muted); max-width: 66ch; margin: -12px 0 28px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 800; }
.card p { margin: 0; color: var(--muted); font-size: 0.97rem; }
a.card { display: block; color: var(--text); transition: border-color 0.15s, transform 0.15s; }
a.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 0.9rem; color: var(--muted); }
.contact-box { background: linear-gradient(135deg, var(--surface) 0%, var(--accent-dim) 100%); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; display: grid; gap: 16px; }
.contact-box h2 { margin: 0; }
.contact-box p { margin: 0; color: var(--muted); max-width: 60ch; }
.contact-box .cta { margin-top: 6px; }
.verify { color: var(--muted); font-size: 0.95rem; margin: 24px 0 0; max-width: 76ch; }

/* Write-up lists */
.writeup-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.writeup-link {
  display: grid; grid-template-columns: 56px 1fr; gap: 18px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px;
  color: var(--text); transition: border-color 0.15s, transform 0.15s;
}
.writeup-link:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); }
.writeup-num { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; color: var(--accent); line-height: 1.2; }
.writeup-body { display: grid; gap: 6px; min-width: 0; }
.writeup-title { font-size: 1.12rem; font-weight: 800; line-height: 1.3; }
.writeup-summary { color: var(--muted); font-size: 0.97rem; }
.writeup-meta { color: var(--muted); font-size: 0.85rem; }
@media (max-width: 560px) {
  .writeup-link { grid-template-columns: 1fr; gap: 6px; padding: 18px; }
  .writeup-num { font-size: 1rem; }
}
.loop {
  margin: 0; padding: 16px 20px; max-width: 360px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  font: 0.9rem/1.5 var(--mono); color: #cbd5e1; white-space: pre; overflow-x: auto;
}

/* Spec sheet ("how this site runs") */
.spec { margin: 0; max-width: 76ch; border-top: 1px solid var(--line); }
.spec > div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.spec dt { color: var(--accent); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.78rem; padding-top: 5px; }
.spec dd { margin: 0; }
@media (max-width: 560px) { .spec > div { grid-template-columns: 1fr; gap: 4px; } }

/* Article */
.article { padding: 64px 0 48px; }
.article-head { max-width: var(--prose); margin-bottom: 36px; }
.article-head h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.article-meta { color: var(--muted); font-size: 0.92rem; margin: 0 0 18px; }
.article-head .lede { margin-bottom: 18px; max-width: none; }
.sanitized {
  margin: 0; padding: 10px 14px; border-left: 3px solid var(--accent);
  background: var(--surface); color: var(--muted); font-size: 0.88rem; border-radius: 0 8px 8px 0;
}
.prose { max-width: var(--prose); }
.prose h2 { font-size: 1.45rem; margin: 44px 0 14px; padding-top: 22px; border-top: 1px solid var(--line); }
.prose h3 { font-size: 1.12rem; margin: 28px 0 10px; font-weight: 800; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 24px; }
.prose li { margin-bottom: 6px; }
.prose li > p { margin-bottom: 6px; }
.prose strong { color: #fff; }
.prose a { text-decoration: underline; text-decoration-color: rgba(47, 194, 234, 0.4); text-underline-offset: 3px; }
.prose blockquote {
  margin: 0 0 16px; padding: 10px 18px; border-left: 3px solid var(--accent);
  background: var(--surface); border-radius: 0 8px 8px 0; color: var(--muted);
}
.prose blockquote p { margin: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 20px; font-size: 0.95rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--muted); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
.prose code {
  font-family: var(--mono); font-size: 0.88em;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px;
  color: #dbe4ec; overflow-wrap: anywhere;
}
.prose pre {
  margin: 0 0 20px; padding: 14px 16px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  font: 0.85rem/1.55 var(--mono); color: #cbd5e1;
  white-space: pre; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; overflow-wrap: normal; }
.prose img { border-radius: 10px; border: 1px solid var(--line); }
.article-tech { max-width: var(--prose); margin: 40px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.article-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 40px; }
.article-nav .card h3 { margin: 6px 0 0; font-size: 1rem; }
.article-nav .section-label { margin: 0; }

/* Prism (syntax highlight) tokens, tuned to the palette */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6b7a86; font-style: italic; }
.token.punctuation { color: #94a3b8; }
.token.operator { color: #a5b4c3; }
.token.keyword, .token.selector, .token.important, .token.atrule { color: #7dd3fc; }
.token.string, .token.char, .token.attr-value { color: #86efac; }
.token.function, .token.class-name { color: #fbbf24; }
.token.variable { color: #c4b5fd; }
.token.number, .token.boolean, .token.constant, .token.symbol { color: #fca5a5; }
.token.property, .token.tag, .token.attr-name, .token.namespace { color: #f9a8d4; }
.token.builtin { color: #7dd3fc; }
.token.deleted { color: #f87171; }
.token.inserted { color: #86efac; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 32px 0 40px; color: var(--muted); font-size: 0.9rem; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
footer .links { display: flex; gap: 18px; flex-wrap: wrap; }
footer .links a { color: var(--muted); }
footer .links a:hover { color: #fff; }

/* Resume page */
.toolbar { padding: 28px 0 0; }
.toolbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.toolbar h1 { font-size: 1.5rem; margin: 0; }
.toolbar .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.paper-wrap { padding: 8px 0 64px; }
.paper {
  background: #fff; color: #1a1a1a;
  max-width: 8.5in; margin: 24px auto; padding: 0.6in 0.65in;
  border-radius: 6px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
  font-size: 10.6pt; line-height: 1.32;
}
.paper * { margin: 0; padding: 0; }
.paper header { text-align: center; margin-bottom: 12pt; }
.paper h1 { font-size: 21pt; letter-spacing: 1px; color: #0b3a52; margin-bottom: 2pt; font-weight: 700; line-height: 1.15; }
.paper .title { font-size: 12.5pt; font-weight: bold; color: #0087ae; margin-bottom: 3pt; }
.paper .tagline { font-size: 9.4pt; font-weight: bold; color: #0087ae; margin-bottom: 5pt; }
.paper .contact { font-size: 9pt; color: #444; border-top: 1px solid #0087ae; border-bottom: 1px solid #0087ae; padding: 3pt 0; }
.paper .contact a { color: #0087ae; text-decoration: underline; }
.paper h2 { font-size: 10.6pt; text-transform: uppercase; letter-spacing: 0.5px; color: #0087ae; border-bottom: 1px solid #b9dfec; margin: 9pt 0 4pt; padding-bottom: 1.5pt; font-weight: 700; break-after: avoid; }
.paper p { margin-bottom: 4.5pt; }
.paper ul { margin: 0 0 5pt 16pt; }
.paper li { margin-bottom: 2.6pt; break-inside: avoid; }
.paper .skills p { margin-bottom: 3.5pt; }
.paper .skills strong { display: block; margin-bottom: 0.5pt; }
.paper .job { margin-bottom: 7pt; }
.paper .job-header { break-inside: avoid; break-after: avoid; }
.paper .company { font-size: 10.6pt; font-weight: bold; color: #0b3a52; }
.paper .role { font-weight: bold; margin-bottom: 3pt; }
.paper .job p { margin-bottom: 3.5pt; }
@media (max-width: 700px) { .paper { padding: 0.45in 0.4in; margin: 12px 8px; } }

@media print {
  @page { size: letter; margin: 0.5in 0.6in; }
  body { background: #fff; color: #1a1a1a; font-size: 9.6pt; }
  .site-header, .toolbar, footer, .skip { display: none !important; }
  .paper-wrap { padding: 0; }
  .paper { box-shadow: none; border-radius: 0; max-width: none; margin: 0; padding: 0; font-size: 9.6pt; line-height: 1.23; }
  .paper a { color: #0087ae; }
}

/* Phones: the mark alone is the brand, the wordmark text would crowd the nav */
@media (max-width: 440px) { .wordmark { display: none; } }
