:root {
  --paper: #f6f3ea;
  --dot: rgb(60 70 100 / 0.16);
  --ink: #1c1f26;
  --ink-2: #4b5160;
  --ink-3: #7d8392;
  --line: rgb(28 31 38 / 0.1);
  --field: #ffffff;
  --card-l: 0.955;
  --card-c: 0.045;
  --card-border-l: 0.85;
  --accent-l: 0.5;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --ui: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101217;
    --dot: rgb(200 210 230 / 0.08);
    --ink: #eceef3;
    --ink-2: #b2b7c3;
    --ink-3: #848a98;
    --line: rgb(236 238 243 / 0.1);
    --field: #1b1e26;
    --card-l: 0.25;
    --card-c: 0.045;
    --card-border-l: 0.35;
    --accent-l: 0.8;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(circle at 1.5px 1.5px, var(--dot) 1.3px, transparent 1.8px);
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }

#home {
  max-width: 1180px;
  margin: 0 auto;
  padding: max(56px, env(safe-area-inset-top)) clamp(16px, 4vw, 40px) max(64px, env(safe-area-inset-bottom));
}

/* ---------- Masthead ---------- */
.masthead { max-width: 720px; margin-bottom: 44px; }
.eyebrow {
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 14px;
}
h1 {
  font-family: var(--display); font-weight: 650;
  font-size: clamp(40px, 7vw, 68px); line-height: 1.02; letter-spacing: -0.02em;
  margin: 0 0 18px; font-variation-settings: "opsz" 144;
}
h1 em { font-style: italic; font-weight: 500; color: var(--ink-2); }
.lede { font-size: 17px; color: var(--ink-2); margin: 0; max-width: 54ch; }

.resume {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; white-space: nowrap;
  margin-top: 22px; padding: 10px 14px 10px 16px;
  border-radius: 999px; border: 1px solid oklch(var(--card-border-l) 0.06 var(--h));
  background: oklch(var(--card-l) var(--card-c) var(--h));
  color: var(--ink-2); text-decoration: none; font-size: 14.5px;
  transition: transform .3s var(--ease);
}
.resume b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.resume svg { flex: none; }
.resume svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .resume:hover { transform: translateX(3px); } }

/* ---------- Groups ---------- */
section + section { margin-top: 40px; }
.group-name {
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 14px;
}
.hint { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -6px 0 16px; color: var(--ink-3); font-size: 14px; }
.hint svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.subjects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 268px), 1fr));
  gap: 14px;
}

/* ---------- Subject squircles ---------- */
.subject {
  --bg: oklch(var(--card-l) var(--card-c) var(--h));
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 196px;
  padding: 20px 22px 20px;
  background-color: var(--bg);
  border: 1px solid oklch(var(--card-border-l) 0.06 var(--h));
  border-radius: 32px;
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
@supports (corner-shape: squircle) {
  .subject { corner-shape: squircle; border-radius: 56px; }
}
.subject::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 20% 0%, oklch(1 0 0 / 0.5), transparent 60%);
  opacity: .6;
}
@media (prefers-color-scheme: dark) { .subject::before { background: radial-gradient(120% 80% at 20% 0%, oklch(1 0 0 / 0.06), transparent 60%); opacity: 1; } }
@media (hover: hover) {
  .subject:has(.subject-link:hover) { transform: translateY(-3px) scale(1.012); box-shadow: 0 16px 34px -16px oklch(0.4 0.12 var(--h) / 0.5); }
}
.subject:has(.subject-link:active) { transform: scale(0.98); transition-duration: .12s; }

.subject-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; -webkit-tap-highlight-color: transparent; }
.subject-link:focus-visible { outline: 2px solid oklch(var(--accent-l) 0.15 var(--h)); outline-offset: 3px; }

.subject-kind {
  position: relative;
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: oklch(var(--accent-l) 0.13 var(--h));
}
.subject-name {
  position: relative; margin-top: auto;
  font-family: var(--display); font-weight: 650;
  font-size: 32px; line-height: 1.05; letter-spacing: -0.015em;
  font-variation-settings: "opsz" 96;
  text-wrap: balance;
}
.subject-detail { position: relative; font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.subject-count { position: relative; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.pin {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 40px; height: 40px; padding: 0;
  display: grid; place-items: center;
  border-radius: 999px; border: 1px solid transparent;
  background: transparent; color: var(--ink-3);
  cursor: pointer;
  transition: background-color .2s, color .2s, transform .25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.pin svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .pin:hover { background: oklch(var(--accent-l) 0.1 var(--h) / 0.14); color: var(--ink); } }
.pin:active { transform: scale(0.9); }
.pin[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.pin[aria-pressed="true"] svg path:first-child { fill: currentColor; }
.pin:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.foot { margin-top: 72px; color: var(--ink-3); font-size: 13px; max-width: 70ch; }

@media (max-width: 560px) {
  .subject { min-height: 150px; }
  .subject-name { font-size: 28px; }
}

[hidden] { display: none !important; }
