/* Resume site styles. One stylesheet for every page; pages differ by body[data-page]. */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1d2330;
  --muted: #5b6475;
  --line: #e4e1da;
  --accent: #1c5fa8;
  --accent-ink: #ffffff;
  --accent-soft: #e8f0fa;
  --mark: #ffe066;
  --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 8px 24px rgba(20, 30, 50, .06);
  --radius: 14px;
  --max: 860px;
  --font: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b;
    --surface: #1a1f28;
    --text: #e8eaef;
    --muted: #a3abba;
    --line: #2b313c;
    --accent: #6aa8f0;
    --accent-ink: #0d1420;
    --accent-soft: #1d2a3c;
    --mark: #7a6514;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--mark); }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
code { font: .88em var(--mono); background: var(--accent-soft); padding: .1em .35em; border-radius: 5px; }
img, video { max-width: 100%; }

/* --- top bar --- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar nav {
  max-width: var(--max); margin: 0 auto; padding: .7rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.links { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; font-size: .92rem; }
.links a { color: var(--muted); text-decoration: none; }
.links a:hover { color: var(--text); }
.links a.cta {
  color: var(--accent-ink); background: var(--accent);
  padding: .3rem .75rem; border-radius: 999px; font-weight: 600;
}

/* --- page body --- */
.content { max-width: var(--max); margin: 0 auto; padding: 2.5rem 1rem 3rem; }
.content h1 { font-size: 1rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 0 0 .75rem; }
.content h2 {
  font-family: var(--serif); font-size: 1.85rem; line-height: 1.2; letter-spacing: -.01em;
  margin: 3.25rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--line);
}
.content h3 { font-size: 1.2rem; line-height: 1.3; margin: 1.6rem 0 .4rem; }
.content p, .content li { max-width: 70ch; }

/* landing hero: the sentence right after the name is the headline */
body[data-page="index"] .content h1 + p {
  font-family: var(--serif); font-size: clamp(2rem, 5.2vw, 3.2rem); line-height: 1.12;
  letter-spacing: -.02em; margin: 0 0 1.25rem; max-width: 20ch;
}
.lede p { font-size: 1.2rem; color: var(--muted); max-width: 62ch; margin: 0 0 1.5rem; }

.actions p { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 2rem; max-width: none; }
.actions a {
  text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: .55rem 1rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
.actions a:first-child { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.actions a:hover { border-color: var(--accent); }

/* proof points: three cards */
.proof ul {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem;
}
.proof li {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow); font-size: .97rem; line-height: 1.55;
}
.proof li strong { display: block; font-family: var(--serif); font-size: 1.3rem; line-height: 1.25; margin-bottom: .35rem; color: var(--accent); }

/* featured case studies */
.case {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .4rem 1.5rem 1.1rem; margin: 0 0 1.25rem; box-shadow: var(--shadow);
}
.case h3 { font-family: var(--serif); font-size: 1.45rem; margin-top: 1.1rem; }
.case h3 + p strong:first-child {
  display: inline-block; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--accent); background: var(--accent-soft); padding: .1rem .55rem; border-radius: 999px; margin-right: .35rem;
}

.bio p { margin: 0 0 1rem; }

/* everything else: compact two-column list */
.more { columns: 2 320px; column-gap: 2.25rem; }
.more h3 { font-size: 1.05rem; margin: 0 0 .25rem; break-after: avoid; }
.more p { font-size: .95rem; color: var(--muted); margin: 0 0 1.4rem; break-inside: avoid; }

/* CV and profile pages */
body[data-page="resume"] .content h1,
body[data-page="profile"] .content h1 {
  font-family: var(--serif); font-size: 2.6rem; letter-spacing: -.02em; text-transform: none; color: var(--text); margin-bottom: .25rem;
}
body[data-page="resume"] .content h2,
body[data-page="profile"] .content h2 { font-size: 1.45rem; margin-top: 2.25rem; }
body[data-page="resume"] .content h3 { font-size: 1.02rem; color: var(--muted); font-weight: 600; margin-bottom: 0; }
body[data-page="resume"] .content h3 + p { margin-top: .1rem; }
body[data-page="profile"] .content h1 + p { font-size: 1.2rem; color: var(--muted); }

.print-btn { display: none; }
body[data-page="profile"] .print-btn {
  display: inline-block; float: right; font: 600 .9rem var(--font);
  padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer;
}

/* --- footer --- */
.site-footer {
  max-width: var(--max); margin: 0 auto; padding: 1.5rem 1rem 6rem;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem;
}
.site-footer .fine { font-size: .82rem; }
.link-btn { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
@media (hover: none) { .site-footer .play { display: none; } }

/* --- AI chat --- */
.chat {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 1000;
  font: 15px/1.5 var(--font);
}
.chat-toggle {
  font: 600 15px var(--font); color: var(--accent-ink); background: var(--accent);
  border: 0; border-radius: 999px; padding: .75rem 1.15rem; cursor: pointer; box-shadow: var(--shadow);
}
.chat-toggle::before { content: "\2726  "; }
.chat.collapsed .chat-body { display: none; }
.chat:not(.collapsed) .chat-toggle { display: none; }
.chat-body {
  width: 340px; max-width: calc(100vw - 2rem);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .22); overflow: hidden;
}
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: .7rem .9rem; background: var(--accent); color: var(--accent-ink); }
.chat-close { font-size: 1.4rem; line-height: 1; background: none; border: 0; color: inherit; cursor: pointer; padding: 0 .2rem; }
.chat-hint { margin: 0; padding: .6rem .9rem 0; font-size: .82rem; color: var(--muted); }
#ai-answer { display: none; margin: .6rem .9rem 0; padding: .6rem .7rem; background: var(--accent-soft); border-radius: 10px; max-height: 40vh; overflow-y: auto; white-space: pre-wrap; }
#ai-answer.visible { display: block; }
#ai-answer.error { background: #fdecea; color: #8a1f15; }
#ai-form { display: flex; gap: .4rem; padding: .7rem .9rem .9rem; }
#ai-q {
  flex: 1; min-width: 0; font: inherit; color: var(--text); background: var(--bg);
  padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 8px; outline: none;
}
#ai-q:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#ai-go { font: 600 15px var(--font); padding: .5rem .9rem; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
#ai-go:disabled { opacity: .6; cursor: progress; }

/* --- air hockey overlay --- */
#hockey-layer { position: fixed; inset: 0; z-index: 4000; display: none; }
#hockey-layer.on { display: block; }
#hockey-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#hockey-exit {
  position: absolute; top: 1rem; left: 50%; transform: translateX(-50%);
  font: 600 15px var(--font); padding: .5rem 1rem; border-radius: 999px; border: 0;
  background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer;
}

/* --- small screens --- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .links a:not(.cta) { display: none; }
  .content { padding-top: 1.75rem; }
  .case { padding: .2rem 1.05rem .9rem; }
}

/* --- print: the profile should fit one page --- */
@media print {
  :root { --bg: #fff; --surface: #fff; --text: #111; --muted: #444; --line: #ccc; --accent: #1c5fa8; --accent-soft: #eef3fa; --shadow: none; }
  body { font-size: 9.5pt; line-height: 1.35; }
  .content p, .content li { max-width: none; margin-top: .15rem; margin-bottom: .15rem; }
  .content ul { margin: .2rem 0; }
  .topbar, .site-footer, .chat, .print-btn, #hockey-layer { display: none !important; }
  .content { padding: 0; max-width: none; }
  .content h2 { margin: .7rem 0 .3rem; padding-top: .3rem; font-size: 1.1rem; }
  body[data-page="profile"] .content h1 { font-size: 2rem; }
  a { color: inherit; text-decoration: none; }
  .actions a { border: 0; padding: 0 1rem 0 0; background: none !important; color: #111 !important; }
  .case, .proof li { break-inside: avoid; }
  @page { margin: 14mm 16mm; }
}
