@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --bg: #0f1a2b;
  --bg-raise: rgba(148, 173, 214, 0.06);
  --line: rgba(148, 173, 214, 0.14);
  --text: #9aabc3;
  --muted: #6e809b;
  --head: #e7edf6;
  --accent: #f2c46d;
  --accent-soft: rgba(242, 196, 109, 0.1);
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--head); text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 3px; }
::selection { background: var(--accent); color: var(--bg); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 20; padding: 8px 14px; background: var(--accent); color: var(--bg); }

/* Soft light that follows the cursor on desktop */
.spotlight {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(560px circle at var(--x, 30%) var(--y, 20%), rgba(70, 110, 175, 0.13), transparent 70%);
}

.layout {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 72px);
}

/* Left column */
.intro { padding: 64px 0 24px; }
.intro h1 {
  margin: 0;
  color: var(--head);
  font-size: clamp(2.6rem, 5vw, 3.4rem);
  font-weight: 700;
  font-stretch: 92%;
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.intro h1 a { color: inherit; }
.role { margin: 14px 0 0; color: var(--head); font-size: 1.2rem; font-weight: 500; }
.line { margin: 10px 0 0; max-width: 20em; color: var(--text); }

.toc { display: none; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.toc a::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  transition: background-color 0.2s, border-color 0.2s;
}
.toc a:hover, .toc a.is-active { color: var(--head); }
.toc a.is-active::before { background: var(--accent); border-color: var(--accent); }

.social { display: flex; gap: 20px; margin: 28px 0 0; padding: 0; list-style: none; }
.social a { color: var(--muted); display: block; }
.social a:hover { color: var(--accent); }
.social svg { width: 24px; height: 24px; }

/* Right column */
.content { padding: 16px 0 72px; }
.chapter { scroll-margin-top: 80px; margin-bottom: 104px; }
.chapter > h2 {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 calc(-1 * clamp(24px, 5vw, 72px)) 24px;
  padding: 18px clamp(24px, 5vw, 72px);
  background: rgba(15, 26, 43, 0.86);
  backdrop-filter: blur(8px);
  color: var(--head);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.chapter p { margin: 0 0 1em; }
.chapter strong { color: var(--head); font-weight: 600; }
.chapter p a, .more-link { color: var(--head); font-weight: 600; border-bottom: 1px solid var(--line); }
.chapter p a:hover, .more-link:hover { color: var(--accent); border-color: var(--accent); }

/* About */
.portrait {
  position: relative;
  width: 100%;
  margin: 0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line);
}
.portrait img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.portrait .color { position: absolute; inset: 0; opacity: 0; transition: opacity 0.4s ease; }
.portrait:hover .color { opacity: 1; }

/* Entries: career, AI work, book, wine */
.entries { list-style: none; margin: 0; padding: 0; }
.entry {
  position: relative;
  display: grid;
  gap: 4px 24px;
  margin: 0 -18px 12px;
  padding: 18px;
  border-radius: 8px;
  transition: background-color 0.2s;
}
.entry:hover { background: var(--bg-raise); }
.entry .when { color: var(--muted); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.03em; padding-top: 3px; font-variant-numeric: tabular-nums; }
.entry h3 { margin: 0; color: var(--head); font-size: 1.0625rem; font-weight: 600; line-height: 1.4; }
.entry h3 .org { color: var(--text); font-weight: 400; }
.entry p { margin: 8px 0 0; font-size: 0.9375rem; line-height: 1.6; }
.entry .thumb { border-radius: 4px; box-shadow: 0 0 0 1px var(--line); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.tags li {
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.6;
}

.subhead { margin: 40px 0 8px; color: var(--head); font-size: 1rem; font-weight: 600; }
.edu { margin: 20px 0 0; font-size: 0.9375rem; }
.more-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; }
.more-link svg { width: 14px; height: 14px; }

.wine-name { color: var(--head); font-size: 1.5rem; font-weight: 700; font-stretch: 85%; line-height: 1.1; }

.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.btn {
  display: inline-block;
  padding: 11px 20px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 600;
}
.btn:hover { background: var(--accent-soft); color: var(--accent); }

.fineprint { color: var(--muted); font-size: 0.8125rem; }

@media (min-width: 640px) {
  .entry { grid-template-columns: 7.5rem minmax(0, 1fr); }
}

@media (min-width: 1024px) {
  .layout { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 64px; }
  .intro {
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 96px 0;
  }
  .toc { display: block; margin-top: 64px; }
  .content { padding: 96px 0; }
  .chapter > h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; padding: 0; }
  .chapter { margin-bottom: 128px; }
}

@media (hover: none), (prefers-reduced-motion: reduce) {
  .spotlight { display: none; }
}

.entry .thumb { width: 100%; max-width: 120px; }

.contact { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 28px; align-items: center; }
.contact p { margin: 0; }
@media (max-width: 480px) { .contact { grid-template-columns: 96px minmax(0, 1fr); gap: 20px; } }
@media (min-width: 1024px) { #contact { min-height: 55vh; margin-bottom: 0; } }
