/* rorycox.ie
   Apple-style system type and spacing, with a terminal as the one bold element. */
:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --line: #e3e3e8;
  --link: #0066cc;
  --term-bg: #1c1c1e;
  --term-bar: #2c2c2e;
  --term-text: #f2f2f7;
  --term-dim: #98989f;
  --term-green: #32d74b;
  --term-blue: #64d2ff;
  --status: #ff9f0a;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
  --radius-lg: 22px;
  --radius-md: 14px;
  --wrap: 1040px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #1c1c1e; --surface-2: #111113; --text: #f5f5f7; --text-2: #a1a1a6;
    --line: #2c2c2e; --link: #2997ff; --term-bg: #161618; --term-bar: #232326; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1c1c1e; --surface-2: #111113; --text: #f5f5f7; --text-2: #a1a1a6;
  --line: #2c2c2e; --link: #2997ff; --term-bg: #161618; --term-bar: #232326; 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: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.53;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 6px; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }

/* Header: frosted bar, three links fit on every screen */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.wordmark { font-family: var(--mono); font-size: 0.9375rem; font-weight: 600; color: var(--text); letter-spacing: 0; }
.wordmark:hover { text-decoration: none; }
.wordmark .tilde { color: var(--text-2); }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--text-2); font-size: 0.875rem; padding: 8px 12px; border-radius: 999px; transition: color .2s, background-color .2s; }
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); font-weight: 600; }

/* Type scale */
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.035em; line-height: 1.06; }
.display { font-size: clamp(3rem, 9vw, 6rem); letter-spacing: -0.045em; line-height: 1.02; }
h1 { font-size: clamp(2.5rem, 6.5vw, 4rem); }
h2 { font-size: clamp(1.875rem, 4.4vw, 2.75rem); }
h3 { font-size: 1.3125rem; letter-spacing: -0.02em; line-height: 1.2; }
.sub { font-size: clamp(1.1875rem, 2.4vw, 1.5rem); color: var(--text-2); line-height: 1.35; letter-spacing: -0.02em; max-width: 34em; }

/* Hero */
.hero { text-align: center; padding: 72px 0 40px; }
@media (min-width: 760px) { .hero { padding: 112px 0 64px; } }
.hero .sub { margin: 18px auto 0; }
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.875rem; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--line);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 26px;
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--status); }

/* Terminal */
.terminal {
  max-width: 760px; margin: 48px auto 0; text-align: left;
  background: var(--term-bg); color: var(--term-text);
  border-radius: var(--radius-md); overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.06) inset;
}
.term-bar { position: relative; display: flex; align-items: center; height: 40px; padding: 0 14px; background: var(--term-bar); }
.dots { display: flex; gap: 8px; }
.dots span { width: 12px; height: 12px; border-radius: 50%; }
.dots span:nth-child(1) { background: #ff5f57; }
.dots span:nth-child(2) { background: #febc2e; }
.dots span:nth-child(3) { background: #28c840; }
.term-title { position: absolute; left: 0; right: 0; text-align: center; font-size: 0.8125rem; color: var(--term-dim); pointer-events: none; letter-spacing: 0; }
.term-body {
  margin: 0; padding: 18px 20px 22px;
  font-family: var(--mono); font-size: 0.8125rem; line-height: 1.75; letter-spacing: 0;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
@media (min-width: 760px) { .term-body { font-size: 0.9375rem; padding: 22px 26px 28px; } }
.term-body .line { display: block; min-height: 1.75em; }
.prompt .user { color: var(--term-green); }
.prompt .path { color: var(--term-blue); }
.out { color: var(--term-text); }
.out .dim { color: var(--term-dim); }
.out .dir { color: var(--term-blue); font-weight: 600; }
.cursor { display: inline-block; width: .6em; height: 1.15em; vertical-align: -0.2em; background: var(--term-text); margin-left: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .cursor { animation: blink 1.1s steps(1) infinite; }
}
@keyframes blink { 50% { opacity: 0; } }
.js .term-body .line.pending { visibility: hidden; }

/* Sections */
.section { padding: 64px 0; }
@media (min-width: 760px) { .section { padding: 96px 0; } }
.section-head { text-align: center; margin-bottom: 40px; }
.section-head .sub { margin: 14px auto 0; }

/* Bento grid */
.grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
.tile {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 28px;
}
@media (min-width: 760px) { .tile { padding: 36px; } }
.tile .dir { font-family: var(--mono); font-size: 0.8125rem; color: var(--text-2); letter-spacing: 0; display: block; margin-bottom: 14px; }
.tile p { color: var(--text-2); margin: 10px 0 0; }
.tile .stack { font-family: var(--mono); font-size: 0.8125rem; color: var(--text); letter-spacing: 0; margin-top: 18px; }

/* Page head (About, Contact) */
.page-head { padding: 72px 0 24px; }
@media (min-width: 760px) { .page-head { padding: 104px 0 32px; } }
.page-head .sub { margin-top: 16px; }

/* About */
.prose { max-width: 640px; font-size: 1.1875rem; line-height: 1.6; }
.prose p { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.chips li { font-family: var(--mono); font-size: 0.8125rem; letter-spacing: 0; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.skills { display: grid; gap: 16px; margin-top: 8px; }
@media (min-width: 760px) { .skills { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; gap: 2px; padding: 18px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; padding-top: 4px; }
.timeline strong { font-weight: 600; }
.timeline span { color: var(--text-2); }

/* Contact */
.contact-card { max-width: 640px; }
.email {
  display: inline-block; font-size: clamp(1.5rem, 4.5vw, 2.25rem); font-weight: 600; letter-spacing: -0.03em;
  margin: 8px 0 12px; overflow-wrap: anywhere;
}
.note { color: var(--text-2); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0 40px; font-size: 0.8125rem; color: var(--text-2); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.site-footer nav { display: flex; gap: 20px; }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--text); }

/* Keep the footer at the bottom on short pages */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }

/* ---------- Header extras */
.site-header .wrap { gap: 12px; }
.nav { margin-left: auto; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.palette-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2);
  font: inherit; font-size: 0.75rem; cursor: pointer; transition: color .2s, border-color .2s;
}
.palette-btn:hover { color: var(--text); border-color: var(--text-2); }
.palette-btn svg { width: 15px; height: 15px; }
kbd { font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0; }
.palette-btn kbd { color: inherit; }
@media (max-width: 560px) {
  .nav a { padding: 8px 8px; font-size: 0.8438rem; }
  .palette-btn { width: 32px; padding: 0; justify-content: center; }
  .palette-btn kbd { display: none; }
  .wordmark .tilde { display: none; }
}
@media (hover: none) { .palette-btn kbd, .kbd-hint { display: none; } }
.kbd-hint { margin: 22px 0 0; font-size: 0.8125rem; color: var(--text-2); }
.kbd-hint kbd { display: inline-block; min-width: 22px; padding: 1px 6px; margin: 0 2px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); color: var(--text); }

/* ---------- Command palette */
.palette { padding: 0; border: 0; background: transparent; width: min(620px, calc(100vw - 32px)); max-height: none; margin: 12vh auto auto; color: var(--text); overflow: visible; }
.palette::backdrop { background: rgba(0,0,0,.28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.palette-box { background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 80px -10px rgba(0,0,0,.45); overflow: hidden; }
@media (prefers-reduced-motion: no-preference) { .palette[open] .palette-box { animation: pop .16s ease-out; } }
@keyframes pop { from { transform: scale(.98) translateY(-6px); opacity: 0; } }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.palette-prompt { font-family: var(--mono); color: var(--term-green); font-weight: 700; }
.palette-input input { flex: 1; height: 56px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 1.125rem; outline: none; }
.palette-input kbd { color: var(--text-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.palette-list { list-style: none; margin: 0; padding: 8px; max-height: min(52vh, 420px); overflow-y: auto; overscroll-behavior: contain; }
.palette-list li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 12px; border-radius: 10px; cursor: pointer; }
.palette-list li[aria-selected="true"] { background: var(--link); color: #fff; }
.palette-list li[aria-selected="true"] .pal-hint { color: rgba(255,255,255,.75); }
.pal-hint { font-family: var(--mono); font-size: 0.75rem; color: var(--text-2); letter-spacing: 0; align-self: center; }
.palette-empty { margin: 0; padding: 18px 20px 22px; color: var(--text-2); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 0.875rem; z-index: 60; }

/* ---------- Section head with a link on the right */
.section-head.row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; text-align: left; }
.more { font-size: 1.0625rem; white-space: nowrap; }

/* ---------- Project cards */
.cards { display: grid; gap: 20px; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card {
  display: flex; flex-direction: column; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s cubic-bezier(.2,.8,.2,1);
}
.card:hover { text-decoration: none; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card:hover { transform: translateY(-4px); box-shadow: 0 24px 48px -24px rgba(0,0,0,.35); }
}
.card[hidden] { display: none; }
.card-media { aspect-ratio: 16 / 10; background: var(--term-bg); display: grid; place-items: center; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-placeholder { font-family: var(--mono); font-size: 0.875rem; color: var(--term-green); letter-spacing: 0; padding: 0 16px; text-align: center; overflow-wrap: anywhere; }
.card-body { padding: 22px 24px 26px; }
.card-meta { font-family: var(--mono); font-size: 0.75rem; color: var(--text-2); letter-spacing: 0; }
.card h3 { margin: 8px 0 0; }
.card p { color: var(--text-2); margin: 8px 0 0; font-size: 1rem; }
.card .chips { margin-top: 14px; }
.card .chips li { font-size: 0.75rem; padding: 4px 10px; }

/* ---------- Filters */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 18px; margin: 0 -22px; padding-left: 22px; padding-right: 22px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter { flex: none; font: inherit; font-size: 0.875rem; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.filter[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- Empty states and 404 */
.empty { text-align: center; padding: 24px 0 40px; color: var(--text-2); }
.empty-term { display: inline-block; text-align: left; margin: 0 0 20px; padding: 18px 22px; border-radius: var(--radius-md); background: var(--term-bg); color: var(--term-text); font-family: var(--mono); font-size: 0.875rem; letter-spacing: 0; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
.empty-term .user { color: var(--term-green); }
.empty-term .path { color: var(--term-blue); }
.empty-term .dim { color: var(--term-dim); }

/* ---------- Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; align-items: center; }
.actions form { margin: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border-radius: 999px; background: var(--link); color: #fff; font: inherit; font-size: 1rem; font-weight: 500; border: 1px solid transparent; cursor: pointer; transition: filter .2s; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--link); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--link); filter: none; }

/* ---------- Project page */
.narrow { max-width: 760px; }
.crumb { display: inline-block; font-family: var(--mono); font-size: 0.875rem; letter-spacing: 0; margin-bottom: 18px; color: var(--text-2); }
.crumb span { color: var(--term-green); }
.facts { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 28px 0 0; }
.facts dt { font-size: 0.8125rem; color: var(--text-2); }
.facts dd { margin: 2px 0 0; font-weight: 500; }
.hero-image { margin: 16px 0 0; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-2); }
.hero-image img { width: 100%; height: auto; display: block; }
.writeup { padding: 48px 0 32px; font-size: 1.1875rem; line-height: 1.6; }
.writeup h2 { font-size: 1.875rem; margin: 48px 0 14px; }
.writeup h3 { font-size: 1.4375rem; margin: 36px 0 10px; }
.writeup h4 { font-size: 1.1875rem; margin: 28px 0 8px; letter-spacing: -0.02em; }
.writeup p, .writeup ul, .writeup ol { margin: 0 0 1em; }
.writeup li { margin: 4px 0; }
.writeup code { font-family: var(--mono); font-size: .85em; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; letter-spacing: 0; }
.writeup pre { background: var(--term-bg); color: var(--term-text); padding: 18px 20px; border-radius: var(--radius-md); overflow-x: auto; font-size: 0.875rem; line-height: 1.6; margin: 0 0 1.4em; }
.writeup pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }

/* ---------- Admin */
.admin-narrow { max-width: 480px; }
.admin-form-wrap { max-width: 760px; }
.admin-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.admin-top .actions { margin: 0; }
.notice { margin-top: 20px; padding: 12px 16px; border-radius: 12px; background: color-mix(in srgb, var(--term-green) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--term-green) 40%, var(--line)); }
.admin-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.admin-list li { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--line); }
.admin-list li:first-child { border-top: 0; }
.admin-thumb { flex: none; width: 64px; height: 44px; border-radius: 8px; background: var(--term-bg); overflow: hidden; }
.admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-info { flex: 1; min-width: 0; display: grid; }
.admin-info strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-info span { font-size: 0.875rem; color: var(--text-2); }
.admin-actions { display: flex; align-items: center; gap: 14px; font-size: 0.9375rem; }
.admin-actions form { margin: 0; }
.link-danger { background: none; border: 0; padding: 0; font: inherit; color: #e5484d; cursor: pointer; }
.link-danger:hover { text-decoration: underline; }
@media (max-width: 560px) {
  .admin-list li { flex-wrap: wrap; }
  .admin-actions { width: 100%; padding-left: 80px; }
}
.empty-admin { text-align: center; }
.form { display: grid; gap: 20px; }
.form label { display: block; font-weight: 600; font-size: 0.9375rem; margin: 16px 0 6px; }
.form .fieldset > label:first-of-type, .form.tile > label:first-of-type { margin-top: 12px; }
.form input[type=text], .form input:not([type]), .form input[type=password], .form input[type=file], .form textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; letter-spacing: -0.01em;
}
.form textarea { font-family: var(--mono); font-size: 0.875rem; line-height: 1.6; letter-spacing: 0; resize: vertical; }
.form input:focus, .form textarea:focus { outline: 3px solid color-mix(in srgb, var(--link) 35%, transparent); border-color: var(--link); }
.form .btn { margin-top: 8px; }
.help { font-size: 0.8438rem; color: var(--text-2); margin: 6px 0 0; }
.help code { font-family: var(--mono); font-size: 0.75rem; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; letter-spacing: 0; }
.check { display: flex !important; align-items: center; gap: 10px; font-weight: 500 !important; }
.check input { width: 18px; height: 18px; accent-color: var(--link); }
.two { display: grid; gap: 0 16px; }
@media (min-width: 560px) { .two { grid-template-columns: 1fr 1fr; } }
.preview { width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; margin-top: 12px; }
.slug { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); overflow: hidden; }
.slug span { padding: 0 0 0 14px; color: var(--text-2); font-size: 0.9375rem; white-space: nowrap; }
.slug input { border: 0 !important; padding-left: 2px !important; background: transparent !important; }
.form-error { margin: 0; padding: 12px 16px; border-radius: 12px; color: #e5484d; background: color-mix(in srgb, #e5484d 10%, var(--surface)); border: 1px solid color-mix(in srgb, #e5484d 35%, var(--line)); }
pre.code { font-family: var(--mono); font-size: 0.875rem; background: var(--term-bg); color: var(--term-text); padding: 14px 16px; border-radius: 10px; overflow-x: auto; letter-spacing: 0; }

/* =========================================================
   Premium pass
   ========================================================= */
::selection { background: color-mix(in srgb, var(--link) 30%, transparent); }

/* ---------- Dark hero (always dark, in both themes) */
.hero-dark {
  position: relative; isolation: isolate; overflow: hidden;
  background: #000; color: #f5f5f7;
  margin-top: -53px; padding: 140px 0 96px; text-align: center;
}
@media (min-width: 760px) { .hero-dark { padding: 176px 0 128px; } }
.hero-dark .sub { color: #a1a1a6; margin: 20px auto 0; }
.hero-inner { position: relative; z-index: 1; }
.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; }
.g1 { width: 620px; height: 620px; left: 50%; top: 42%; margin-left: -560px; background: radial-gradient(circle, #0a84ff 0%, transparent 65%); }
.g2 { width: 560px; height: 560px; left: 50%; top: 30%; margin-left: -20px; background: radial-gradient(circle, #30d158 0%, transparent 65%); opacity: .38; }
@media (prefers-reduced-motion: no-preference) {
  .g1 { animation: drift1 18s ease-in-out infinite alternate; }
  .g2 { animation: drift2 22s ease-in-out infinite alternate; }
}
@keyframes drift1 { to { transform: translate(120px, -60px) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-140px, 50px) scale(.92); } }
.grid-lines {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 56px 56px; background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
}
.status.dark { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: #c7c7cc; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.gradient-text {
  background: linear-gradient(180deg, #ffffff 30%, #8e8e93 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-bottom: .06em;
}
.hero-dark .kbd-hint { color: #8e8e93; }
.hero-dark .kbd-hint kbd { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: #f5f5f7; }

/* Terminal with a soft gradient edge and glow */
.glow-border { position: relative; border: 1px solid transparent; background:
  linear-gradient(var(--term-bg), var(--term-bg)) padding-box,
  linear-gradient(140deg, rgba(100,210,255,.55), rgba(255,255,255,.08) 40%, rgba(48,209,88,.5)) border-box;
  box-shadow: 0 40px 120px -30px rgba(10,132,255,.45), 0 30px 60px -30px rgba(0,0,0,.8);
}
.hero-dark .terminal { --term-bg: #0c0c0e; --term-bar: #18181b; }

/* Header sits over the dark hero on the home page until you scroll */
.site-header { transition: background-color .3s, border-color .3s; }
.site-header.over-dark { background: rgba(0,0,0,.35); border-bottom-color: rgba(255,255,255,.08); }
.site-header.over-dark .wordmark { color: #f5f5f7; }
.site-header.over-dark .wordmark .tilde, .site-header.over-dark .nav a { color: #a1a1a6; }
.site-header.over-dark .nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.site-header.over-dark .nav a[aria-current="page"] { color: #fff; }
.site-header.over-dark .palette-btn { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: #c7c7cc; }

/* ---------- Bento */
.bento { display: grid; gap: 16px; }
@media (min-width: 860px) {
  .bento { grid-template-columns: repeat(6, 1fr); gap: 20px; }
  .b-wide { grid-column: span 4; }
  .b-narrow { grid-column: span 2; }
}
.bento .tile { display: flex; flex-direction: column; overflow: hidden; }
.viz { margin: 24px 0 0; }
.chart { margin-top: auto; padding-top: 24px; }
.chart svg { width: 100%; height: 150px; display: block; overflow: visible; }
.chart .gridlines line { stroke: var(--line); stroke-dasharray: 3 5; }
.chart .line { fill: none; stroke: var(--term-green); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart figcaption { display: flex; justify-content: space-between; margin-top: 10px; font-family: var(--mono); font-size: 0.75rem; color: var(--text-2); letter-spacing: 0; }
.chart .up { color: var(--term-green); }
@media (prefers-reduced-motion: no-preference) {
  .js .chart .line { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .js .chart.in .line { transition: stroke-dashoffset 2.2s cubic-bezier(.4,0,.2,1) .2s; stroke-dashoffset: 0; }
  .js .chart .area { opacity: 0; }
  .js .chart.in .area { transition: opacity 1.2s ease 1.4s; opacity: 1; }
}
.chip { margin-top: auto; padding-top: 16px; }
.chip svg { width: 100%; max-width: 260px; height: auto; display: block; margin: 0 auto; }
.chip .pins rect { fill: #c08a3e; }
.chip .die { fill: #1c1c1e; }
.chip text { fill: #e5e5ea; font-family: var(--mono); font-size: 0.9375rem; font-weight: 600; letter-spacing: .5px; }
.chip .dot1 { fill: #3a3a3c; }
.trace {
  margin-top: auto; padding: 16px 18px; border-radius: 14px;
  background: var(--term-bg); color: #d1d1d6; font-family: var(--mono); font-size: 0.7812rem; line-height: 1.7; letter-spacing: 0;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.bento .tile p + .trace { margin-top: 24px; }
.trace .k { color: var(--term-green); }
.trace .t { color: var(--term-blue); }
.trace .ok { color: var(--term-green); }

/* ---------- Cursor spotlight on tiles and cards (mouse only) */
.spot { position: relative; }
@media (hover: hover) {
  .spot::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--link) 9%, transparent), transparent 60%);
    transition: opacity .3s;
  }
  .spot:hover::after { opacity: 1; }
  .tile.spot:hover { border-color: color-mix(in srgb, var(--link) 25%, var(--line)); }
}
.tile { transition: border-color .3s; }

/* ---------- One gentle reveal as sections scroll in */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s cubic-bezier(.2,.8,.2,1), transform .8s cubic-bezier(.2,.8,.2,1); }
  .js .reveal.in { opacity: 1; transform: none; }
}

.actions.center { justify-content: center; }

/* Inner pages get a faint glow behind the title */
.page-head { position: relative; isolation: isolate; }
.page-head::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: -120px; width: 900px; height: 420px; margin-left: -450px; pointer-events: none;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--link) 9%, transparent), transparent 65%);
}
.js .card.reveal.in { transition: opacity .8s cubic-bezier(.2,.8,.2,1), transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s cubic-bezier(.2,.8,.2,1); }
.page-head { overflow-x: clip; }
html, body { overflow-x: clip; }
@media (min-width: 860px) { .b-half { grid-column: span 3; } }

/* Touch screens: every tap target is at least 44 x 44 px (Apple HIG) */
@media (pointer: coarse) {
  .site-header .wrap { height: 56px; }
  .hero-dark { margin-top: -57px; }
  .nav a { min-height: 44px; display: inline-flex; align-items: center; }
  .palette-btn { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .palette-btn kbd { display: none; }
  .filter { min-height: 44px; }
  .more, .crumb { display: inline-flex; align-items: center; min-height: 44px; }
  .site-footer a { display: inline-flex; align-items: center; min-height: 44px; }
  .admin-actions a, .admin-actions .link-danger { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
  .check { min-height: 44px; }
  .check input { width: 22px; height: 22px; }
  .palette-list li { min-height: 48px; align-items: center; }
}
@media (pointer: coarse) and (max-width: 560px) {
  .nav { gap: 0; }
  .nav a { padding: 0 7px; }
}
@media (pointer: coarse) {
  .palette-btn { flex: none; }
  .wordmark { display: inline-flex; align-items: center; min-height: 44px; flex: none; }
  .site-footer nav { gap: 4px; }
  .site-footer a { min-width: 44px; padding: 0 10px; justify-content: center; }
}

/* =========================================================
   Home: "you are the current"
   ========================================================= */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.home { background: #000; }
.home main { background: #000; color: #f5f5f7; }

/* ---------- Particle hero */
.spark-hero {
  position: relative; height: 100vh; height: 100svh; min-height: 560px; margin-top: -53px;
  background: radial-gradient(ellipse 80% 60% at 50% 45%, #0b1220 0%, #000 70%);
  overflow: hidden; touch-action: pan-y; cursor: crosshair;
}
@media (pointer: coarse) { .spark-hero { margin-top: -57px; } }
#spark { position: absolute; inset: 0; display: block; }
.spark-copy { position: absolute; left: 0; right: 0; top: 58%; text-align: center; padding: 0 22px; pointer-events: none; }
@media (max-width: 639px) { .spark-copy { top: 60%; } }
.spark-fallback {
  display: block; position: absolute; left: 0; right: 0; top: clamp(-200px, -17vh, -95px);
  margin: 0; color: #f5f5f7; font-size: clamp(4rem, 15vw, 14rem); font-weight: 800;
  line-height: .9; letter-spacing: -0.055em;
  background: linear-gradient(180deg, #fff 24%, #8e8e93 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  transition: opacity .35s ease, visibility .35s ease;
}
.spark-ready .spark-fallback { opacity: 0; visibility: hidden; }
.spark-tag { margin: 0 auto; max-width: 30em; font-size: clamp(1.15rem, 2.4vw, 1.6rem); line-height: 1.35; color: #a1a1a6; letter-spacing: -0.02em; }
.spark-tag em { font-style: normal; color: #f5f5f7; }
.spark-hint { margin-top: 14px; font-size: 0.875rem; color: #6e6e73; }
.for-touch { display: none; }
.touch .for-touch { display: inline; }
.touch .for-mouse { display: none; }
@media (prefers-reduced-motion: reduce) { .spark-hint { display: none; } }
/* Keep the hero copy available while the optional canvas effect loads or fails. */
.spark-copy { opacity: 1; transform: none; }
.scroll-cue { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; color: #8e8e93; font-size: 0.8125rem; min-height: 44px; }
.scroll-cue:hover { color: #f5f5f7; text-decoration: none; }
.scroll-cue i { width: 1px; height: 36px; background: linear-gradient(#8e8e93, transparent); }
@media (prefers-reduced-motion: no-preference) {
  .scroll-cue i { animation: cue 2s ease-in-out infinite; transform-origin: top; }
}
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- Circuit */
.circuit { position: relative; padding: 120px 0 80px; background: #000; }
.circuit-intro { max-width: 640px; margin: 0 auto 64px; text-align: center; font-size: clamp(1.4rem, 3vw, 2.1rem); line-height: 1.3; letter-spacing: -0.025em; color: #f5f5f7; font-weight: 600; }
.wire { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: #1c1c1e; }
.wire-fill { position: absolute; left: 0; top: 0; width: 100%; height: 0; background: linear-gradient(#0a84ff, #30d158); box-shadow: 0 0 12px #30d158, 0 0 2px #30d158; }
.spark-head { position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px 3px #30d158, 0 0 30px 8px rgba(48,209,88,.6); }
@media (max-width: 859px) { .wire { left: 22px; } }

.chapter { position: relative; display: grid; gap: 28px; align-items: center; padding: 72px 0; }
@media (min-width: 860px) {
  .chapter { grid-template-columns: 1fr 1fr; gap: 96px; padding: 110px 0; }
  .chapter.flip .ch-text { order: 2; }
}
@media (max-width: 859px) { .chapter { padding-left: 32px; } }
.node {
  position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 6px;
  background: #0c0c0e; border: 2px solid #2c2c2e; transition: background .4s, border-color .4s, box-shadow .4s; z-index: 1;
}
@media (max-width: 859px) { .node { left: -10px; top: 92px; margin: 0; } }
.chapter.on .node { background: #30d158; border-color: #30d158; box-shadow: 0 0 0 6px rgba(48,209,88,.15), 0 0 24px #30d158; }
.ch-num { display: block; font-family: var(--mono); font-size: 0.875rem; color: #6e6e73; margin-bottom: 14px; letter-spacing: 0; transition: color .4s; }
.chapter.on .ch-num { color: #30d158; }
.ch-text h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -0.04em; line-height: 1.04; color: #f5f5f7; }
.ch-text p { margin-top: 18px; font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: #a1a1a6; line-height: 1.55; max-width: 30em; }
.ch-demo { opacity: .35; filter: saturate(.2); transition: opacity .8s, filter .8s; }
.chapter.on .ch-demo { opacity: 1; filter: none; }
@media (prefers-reduced-motion: reduce) { .ch-demo { opacity: 1; filter: none; } }

.demo-card { background: linear-gradient(180deg, #121214, #0a0a0b); border: 1px solid #232326; border-radius: 24px; padding: 26px; box-shadow: 0 40px 80px -40px rgba(0,0,0,.9); }
.demo-note { margin: 14px 0 0; font-size: 0.8125rem; color: #6e6e73; }

/* Ticker */
.ticker-top { display: flex; justify-content: space-between; align-items: center; }
.ticker-pair { font-weight: 600; color: #f5f5f7; }
.ticker-pair span { color: #6e6e73; font-weight: 400; }
.live-dot { display: inline-flex; align-items: center; gap: 7px; font-size: 0.75rem; color: #30d158; font-weight: 600; }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #30d158; box-shadow: 0 0 8px #30d158; }
@media (prefers-reduced-motion: no-preference) { .live-dot::before { animation: pulse 1.6s ease-in-out infinite; } }
@keyframes pulse { 50% { opacity: .3; } }
.live-dot.off { color: #6e6e73; }
.live-dot.off::before { background: #6e6e73; box-shadow: none; animation: none; }
.ticker-price { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-top: 14px; font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 700; letter-spacing: -0.04em; color: #f5f5f7; font-variant-numeric: tabular-nums; }
.ticker-change { font-size: 1rem; font-weight: 600; letter-spacing: 0; }
.ticker-change.up { color: #30d158; }
.ticker-change.down { color: #ff453a; }
.ticker-chart { width: 100%; height: 130px; display: block; margin-top: 18px; overflow: visible; }

/* Car dashboard */
.dash { position: relative; padding: 18px; border-radius: 28px; background: linear-gradient(160deg, #2a2a2d, #111113 60%); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 40px 80px -40px rgba(0,0,0,.9); }
.dash-screen { position: relative; border-radius: 14px; overflow: hidden; background: #0b1016; aspect-ratio: 16 / 9; border: 1px solid #000; }
.dash-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.dash-map .roads path { fill: none; stroke: #1d2733; stroke-width: 9; stroke-linecap: round; }
.dash-map .route { fill: none; stroke: #0a84ff; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; filter: drop-shadow(0 0 6px #0a84ff); }
.dash.play .route { animation: route 2.4s cubic-bezier(.4,0,.2,1) both; }
@keyframes route { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.dash-map .me { fill: #fff; stroke: #0a84ff; stroke-width: 3; }
.dash-map .dest { fill: #ff453a; }
.dash-bar { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: rgba(28,28,30,.85); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.dash-play { width: 0; height: 0; border-left: 12px solid #f5f5f7; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.dash-track { display: grid; line-height: 1.2; font-size: 0.8125rem; flex: 1; min-width: 0; }
.dash-track b { color: #f5f5f7; font-weight: 600; }
.dash-track i { color: #8e8e93; font-style: normal; }
.dash-eta { font-size: 0.8125rem; color: #30d158; font-weight: 600; }
.dash-knobs { display: flex; justify-content: space-between; padding: 14px 18px 0; }
.dash-knobs span { width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #4a4a4e, #18181a 70%); box-shadow: 0 2px 4px rgba(0,0,0,.6); }

/* Binary clock */
.bin-row { display: grid; grid-template-columns: 5.2em 1fr 2.2em; align-items: end; gap: 12px; padding: 12px 0; border-top: 1px solid #1c1c1e; }
.bin-row:first-child { border-top: 0; padding-top: 0; }
.bin-label { color: #8e8e93; font-size: 0.875rem; padding-bottom: 6px; }
.bin-val { text-align: right; font-family: var(--mono); font-size: 1.1rem; color: #f5f5f7; padding-bottom: 4px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.leds { display: flex; gap: 8px; flex-wrap: nowrap; }
.led { position: relative; width: 26px; height: 26px; border-radius: 50%; background: #1a1a1c; border: 1px solid #2c2c2e; margin-top: 18px; transition: background .25s, box-shadow .25s, border-color .25s; }
.led::before { content: attr(data-v); position: absolute; left: 50%; top: -19px; transform: translateX(-50%); font-family: var(--mono); font-size: 0.6875rem; color: #6e6e73; letter-spacing: 0; }
.led.lit { background: #30d158; border-color: #30d158; box-shadow: 0 0 12px #30d158, inset 0 -3px 6px rgba(0,0,0,.25); }
.led.lit::before { color: #30d158; }
@media (max-width: 420px) { .led { width: 22px; height: 22px; } .leds { gap: 6px; } .bin-row { grid-template-columns: 4.4em 1fr 2em; gap: 8px; } }

/* AI inbox */
.inbox { display: grid; gap: 8px; position: relative; overflow: hidden; }
.mail { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: #161618; border: 1px solid #232326; font-size: 0.875rem; }
.mail b { color: #e5e5ea; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail i { color: #6e6e73; font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary { position: absolute; left: 26px; right: 26px; top: 50%; transform: translateY(-50%); padding: 20px; border-radius: 16px; background: linear-gradient(135deg, rgba(10,132,255,.22), rgba(48,209,88,.22)), #111113; border: 1px solid rgba(48,209,88,.45); box-shadow: 0 20px 60px -10px rgba(48,209,88,.35); opacity: 0; }
.sum-label { font-size: 0.75rem; font-weight: 700; color: #30d158; }
.summary p { margin: 6px 0 0; color: #f5f5f7; font-size: 1.05rem; line-height: 1.45; }
.inbox.play .mail { animation: squash 1.1s cubic-bezier(.6,0,.4,1) forwards; }
.inbox.play .mail:nth-child(2) { animation-delay: .08s; } .inbox.play .mail:nth-child(3) { animation-delay: .16s; }
.inbox.play .mail:nth-child(4) { animation-delay: .24s; } .inbox.play .mail:nth-child(5) { animation-delay: .32s; }
.inbox.play .summary { animation: appear-sum .6s ease 1.1s forwards; }
@keyframes squash { to { opacity: .12; transform: scale(.94); filter: blur(2px); } }
@keyframes appear-sum { from { opacity: 0; transform: translateY(-40%) scale(.96); } to { opacity: 1; transform: translateY(-50%); } }
@media (prefers-reduced-motion: reduce) { .summary { opacity: 1; } .mail { opacity: .15; } }

/* Projects on the dark home */
.home-projects { background: #000; padding-top: 40px; }

/* Finale */
.finale { padding: 140px 0 160px; text-align: center; background: radial-gradient(ellipse 60% 70% at 50% 100%, rgba(10,132,255,.25), transparent 70%), #000; }
.finale-time { color: #8e8e93; font-size: 1.05rem; margin: 0; }
.finale-time span { color: #f5f5f7; font-variant-numeric: tabular-nums; }
.finale-title { font-size: clamp(3.5rem, 11vw, 9rem); letter-spacing: -0.055em; line-height: 1; margin: 18px 0 26px; background: linear-gradient(180deg, #fff 35%, #6e6e73); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .08em; }
.finale-mail { display: inline-flex; align-items: center; min-height: 44px; font-size: clamp(1.3rem, 3.4vw, 2rem); font-weight: 600; letter-spacing: -0.02em; color: #2997ff; }
.finale-note { margin: 18px 0 0; color: #6e6e73; }

.home .site-footer { background: #000; border-top-color: #1c1c1e; }

/* ---------- Chapter 2: head unit with hidden features */
.unit-screen { display: flex; flex-direction: column; aspect-ratio: auto; min-height: 250px; padding: 16px 18px 14px; background: linear-gradient(180deg, #0e141b, #090c10); }
.unit-head { display: flex; justify-content: space-between; align-items: center; font-size: 0.875rem; font-weight: 600; color: #f5f5f7; padding-bottom: 10px; border-bottom: 1px solid #1d2733; }
.unit-os { font-family: var(--mono); font-size: 0.6875rem; font-weight: 400; color: #64d2ff; letter-spacing: 0; }
.unit-list { list-style: none; margin: 4px 0 0; padding: 0; flex: 1; }
.unit-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #141c25; font-size: 0.875rem; color: #c7c7cc; }
.unit-list li span { min-width: 0; }
.toggle { position: relative; flex: none; width: 40px; height: 24px; border-radius: 999px; background: #2c2c2e; transition: background .35s ease; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #8e8e93; transition: transform .35s cubic-bezier(.3,1.4,.5,1), background .35s; }
.unit.play .toggle { animation: tog-bg .01s linear forwards; }
.unit.play .toggle::after { animation: tog-knob .45s cubic-bezier(.3,1.4,.5,1) forwards; }
.unit.play li:nth-child(1) .toggle, .unit.play li:nth-child(1) .toggle::after { animation-delay: .5s; }
.unit.play li:nth-child(2) .toggle, .unit.play li:nth-child(2) .toggle::after { animation-delay: 1s; }
.unit.play li:nth-child(3) .toggle, .unit.play li:nth-child(3) .toggle::after { animation-delay: 1.5s; }
.unit.play li:nth-child(4) .toggle, .unit.play li:nth-child(4) .toggle::after { animation-delay: 2s; }
@keyframes tog-bg { to { background: #30d158; } }
@keyframes tog-knob { to { transform: translateX(16px); background: #fff; } }
.unit-foot { padding-top: 10px; }
.unit-status { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.6875rem; color: #6e6e73; letter-spacing: 0; }
.unit-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3a3a3c; }
.unit.play .unit-status { animation: status-ok .3s ease 2.6s forwards; }
.unit.play .unit-status::before { animation: status-dot .3s ease 2.6s forwards; }
@keyframes status-ok { to { color: #30d158; } }
@keyframes status-dot { to { background: #30d158; box-shadow: 0 0 8px #30d158; } }
@media (prefers-reduced-motion: reduce) {
  .toggle { background: #30d158; } .toggle::after { transform: translateX(16px); background: #fff; }
  .unit-status { color: #30d158; } .unit-status::before { background: #30d158; }
}

/* ---------- Chapter 4: jobs that run themselves */
.jobs-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; color: #f5f5f7; margin-bottom: 8px; }
.jobs-auto { display: inline-flex; align-items: center; gap: 7px; font-size: 0.75rem; color: #30d158; }
.jobs-auto::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #30d158; box-shadow: 0 0 8px #30d158; }
@media (prefers-reduced-motion: no-preference) { .jobs-auto::before { animation: pulse 1.6s ease-in-out infinite; } }
.job-list { list-style: none; margin: 0; padding: 0; }
.job-list li { display: grid; grid-template-columns: 6.2em 1fr 24px; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid #1c1c1e; font-size: 0.9375rem; color: #c7c7cc; }
.job-list time { font-family: var(--mono); font-size: 0.75rem; color: #6e6e73; letter-spacing: 0; }
.tick { position: relative; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #3a3a3c; transition: background .3s, border-color .3s; }
.tick::after { content: ""; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px; border: solid #000; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform .3s cubic-bezier(.3,1.6,.5,1); }
.jobs.play .tick { animation: tick-bg .01s linear forwards; }
.jobs.play .tick::after { animation: tick-mark .35s cubic-bezier(.3,1.6,.5,1) forwards; }
.jobs.play li:nth-child(1) .tick, .jobs.play li:nth-child(1) .tick::after { animation-delay: .4s; }
.jobs.play li:nth-child(2) .tick, .jobs.play li:nth-child(2) .tick::after { animation-delay: .85s; }
.jobs.play li:nth-child(3) .tick, .jobs.play li:nth-child(3) .tick::after { animation-delay: 1.3s; }
.jobs.play li:nth-child(4) .tick, .jobs.play li:nth-child(4) .tick::after { animation-delay: 1.75s; }
.jobs.play li:nth-child(5) .tick, .jobs.play li:nth-child(5) .tick::after { animation-delay: 2.2s; }
@keyframes tick-bg { to { background: #30d158; border-color: #30d158; } }
@keyframes tick-mark { to { transform: rotate(45deg) scale(1); } }
@media (prefers-reduced-motion: reduce) { .tick { background: #30d158; border-color: #30d158; } .tick::after { transform: rotate(45deg) scale(1); } }
@media (max-width: 420px) { .job-list li { grid-template-columns: 5.4em 1fr 22px; gap: 10px; font-size: 0.875rem; } }

/* The circuit is now the last section on the home page */
.circuit { padding-bottom: 140px; }

/* ---------- Chapter 5: business report */
.report-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 600; color: #f5f5f7; }
.report-tag { font-size: 0.6875rem; font-weight: 600; color: #8e8e93; border: 1px solid #2c2c2e; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.kpi { display: grid; gap: 2px; padding: 12px; border-radius: 14px; background: #161618; border: 1px solid #232326; min-width: 0; }
.kpi-label { font-size: 0.75rem; color: #8e8e93; }
.kpi b { font-size: clamp(1.05rem, 2.2vw, 1.4rem); font-weight: 700; letter-spacing: -0.02em; color: #f5f5f7; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-up { font-size: 0.75rem; font-weight: 600; color: #30d158; }
.bars { display: grid; grid-template-columns: repeat(6, 1fr); align-items: end; gap: 10px; height: 140px; margin-top: 20px; padding-bottom: 22px; border-bottom: 1px solid #1c1c1e; }
.bar { position: relative; height: var(--h); border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #2c3a4a, #1a222c); transform-origin: bottom; }
.bar.now { background: linear-gradient(180deg, #30d158, #1f7a39); box-shadow: 0 0 20px rgba(48,209,88,.35); }
.bar span { position: absolute; left: 0; right: 0; bottom: -22px; text-align: center; font-size: 0.6875rem; color: #6e6e73; }
@media (prefers-reduced-motion: no-preference) {
  .js .report .bar { transform: scaleY(0); }
  .report.play .bar { animation: grow .8s cubic-bezier(.2,.8,.2,1) forwards; }
  .report.play .bar:nth-child(2) { animation-delay: .08s; } .report.play .bar:nth-child(3) { animation-delay: .16s; }
  .report.play .bar:nth-child(4) { animation-delay: .24s; } .report.play .bar:nth-child(5) { animation-delay: .32s; }
  .report.play .bar:nth-child(6) { animation-delay: .40s; }
  .js .report .insight { opacity: 0; transform: translateY(8px); }
  .report.play .insight { animation: rise .6s ease 1.2s forwards; }
}
@keyframes grow { to { transform: scaleY(1); } }
@keyframes rise { to { opacity: 1; transform: none; } }
.insight { margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: linear-gradient(135deg, rgba(10,132,255,.16), rgba(48,209,88,.16)), #111113; border: 1px solid rgba(48,209,88,.35); }
.insight-label { font-size: 0.75rem; font-weight: 700; color: #30d158; }
.insight p { margin: 4px 0 0; color: #f5f5f7; font-size: 0.9375rem; line-height: 1.45; }
@media (max-width: 420px) { .kpis { gap: 6px; } .kpi { padding: 10px 8px; } .bars { gap: 6px; } }

/* ---------- Boot sequence */
.boot { display: none; }
.booting .boot {
  display: flex; flex-direction: column; justify-content: flex-end;
  position: fixed; inset: 0; z-index: 100; background: #000; padding: 32px 22px 64px;
  font-family: var(--mono); font-size: 0.875rem; line-height: 1.8; color: #c7c7cc; letter-spacing: 0;
}
@media (min-width: 760px) { .booting .boot { padding: 48px 64px 80px; font-size: 0.9375rem; } }
.booting { overflow: hidden; }
.boot-line { white-space: pre-wrap; animation: boot-in .12s steps(2) both; }
.boot-ok { color: #30d158; }
@keyframes boot-in { from { opacity: 0; } }
.boot-skip { position: absolute; top: 18px; right: 18px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid #2c2c2e; background: transparent; color: #8e8e93; font: inherit; font-size: 0.8125rem; cursor: pointer; }
.boot-skip:hover { color: #f5f5f7; border-color: #6e6e73; }
.boot.glitch-out { animation: glitch-out .45s steps(6) forwards; }
@keyframes glitch-out {
  0% { clip-path: inset(0 0 0 0); transform: none; }
  20% { clip-path: inset(10% 0 40% 0); transform: translateX(-8px); filter: hue-rotate(90deg); }
  40% { clip-path: inset(50% 0 5% 0); transform: translateX(10px); }
  60% { clip-path: inset(30% 0 30% 0); transform: translateX(-4px); opacity: .7; }
  80% { clip-path: inset(48% 0 48% 0); transform: scaleY(.3); opacity: .5; }
  100% { clip-path: inset(50% 0 50% 0); opacity: 0; }
}

/* =========================================================
   Redesign: phosphor green, cinematic terminal
   ========================================================= */
:root[data-theme="dark"] { --link: #32d74b; --bg: #000; --surface: #0e0e10; --surface-2: #141416; --line: #1f1f22; }
:root[data-theme="dark"] .btn { color: #031a0a; font-weight: 600; }
:root[data-theme="dark"] .btn.ghost { color: #32d74b; }
:root[data-theme="dark"] .palette-list li[aria-selected="true"] { color: #031a0a; }
:root[data-theme="dark"] .palette-list li[aria-selected="true"] .pal-hint { color: rgba(3,26,10,.7); }
::selection { background: rgba(50,215,75,.35); }

/* Terminal-style location above each page title */
.prompt-crumb { display: block; font-family: var(--mono); font-size: 0.875rem; letter-spacing: 0; color: #32d74b; margin-bottom: 18px; }
.prompt-crumb::before { content: "rory@trinity:"; color: #8e8e93; }
.prompt-crumb::after { content: "$"; color: #8e8e93; margin-left: 2px; }

/* Status pills: green means open */
.status.open::before { background: #32d74b; box-shadow: 0 0 8px #32d74b; }
.status.open { color: var(--text); margin-bottom: 22px; }
.page-head .status.open { display: inline-flex; }
.spark-status { margin: 18px 0 0; }
.spark-status .status { margin: 0; pointer-events: auto; }
.spark-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; pointer-events: none; }
.spark-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px;
  padding: 0 18px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px;
  color: #f5f5f7; background: rgba(255,255,255,.045); font-size: .9375rem; font-weight: 550;
  pointer-events: auto; transition: background .2s, border-color .2s, transform .2s;
}
.spark-action.primary { color: #06140a; background: #32d74b; border-color: #32d74b; }
.spark-action:hover { text-decoration: none; transform: translateY(-2px); background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.35); }
.spark-action.primary:hover { background: #57e46d; border-color: #57e46d; }
.spark-action span { font-size: 1.05em; }
@media (prefers-reduced-motion: reduce) { .spark-action { transition: none; } }

/* Inner pages: faint grid behind the title, like the hero */
.page-head::after {
  content: ""; position: absolute; inset: -60px 0 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 60% 80% at 30% 0%, #000 20%, transparent 70%);
  mask-image: radial-gradient(ellipse 60% 80% at 30% 0%, #000 20%, transparent 70%);
}
:root[data-theme="dark"] .page-head::before { background: radial-gradient(ellipse at center, rgba(50,215,75,.10), transparent 65%); }

/* Contact layout */
.contact-grid-2 { display: grid; gap: 16px; }
@media (min-width: 860px) { .contact-grid-2 { grid-template-columns: 1.1fr 1fr; gap: 20px; } }
.contact-card .dir { font-family: var(--mono); font-size: 0.8125rem; color: var(--text-2); letter-spacing: 0; }
.contact-card { max-width: none; }

/* Footer hint for the hidden terminal (keyboards only) */
.footer-hint { margin-left: 10px; color: #6e6e73; }
.footer-hint kbd { display: inline-block; min-width: 20px; padding: 0 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; font-family: var(--mono); color: var(--text); text-align: center; }
@media (hover: none), (pointer: coarse) { .footer-hint { display: none; } }

/* ---------- Hidden terminal */
.term-panel {
  position: fixed; left: 50%; top: 0; z-index: 90; width: min(860px, 100%); height: min(62vh, 520px); height: min(62dvh, 520px);
  transform: translate(-50%, -104%); transition: transform .22s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
  background: rgba(8,10,9,.94); -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(50,215,75,.28); border-top: 0; border-radius: 0 0 16px 16px;
  box-shadow: 0 30px 80px -10px rgba(0,0,0,.8), 0 0 60px -20px rgba(50,215,75,.35);
  font-family: var(--mono); font-size: 0.875rem; letter-spacing: 0; color: #d1d1d6;
}
.term-panel.open { transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .term-panel { transition: none; } }
@media (max-width: 860px) { .term-panel { border-radius: 0 0 14px 14px; border-left: 0; border-right: 0; } }
.tp-bar { position: relative; display: flex; align-items: center; height: 40px; padding: 0 12px; border-bottom: 1px solid rgba(255,255,255,.06); flex: none; }
.tp-dots { display: flex; gap: 7px; }
.tp-dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.tp-dots i:nth-child(2) { background: #febc2e; } .tp-dots i:nth-child(3) { background: #28c840; }
.tp-title { position: absolute; left: 0; right: 0; text-align: center; color: #6e6e73; font-size: 0.75rem; pointer-events: none; }
.tp-close { margin-left: auto; position: relative; min-height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid #2c2c2e; background: transparent; color: #8e8e93; font: inherit; font-size: 0.75rem; cursor: pointer; }
@media (pointer: coarse) { .tp-close { min-height: 44px; min-width: 44px; } }
.tp-out { flex: 1; overflow-y: auto; padding: 14px 18px 4px; line-height: 1.65; overscroll-behavior: contain; }
.tp-row { white-space: pre-wrap; overflow-wrap: anywhere; }
.tp-row.cmd { color: #f5f5f7; margin-top: 6px; }
.tp-row.hl { color: #32d74b; }
.tp-row.ok { color: #32d74b; }
.tp-row.err { color: #ff6961; }
.tp-row.dim { color: #6e6e73; }
.tp-row.dir { color: #64d2ff; font-weight: 600; }
.tp-row.mono-art { color: #32d74b; }
.tp-row a { color: #32d74b; }
.tp-line { display: flex; align-items: center; gap: 8px; padding: 10px 18px 16px; flex: none; }
.tp-prompt { color: #32d74b; white-space: nowrap; }
.tp-in { flex: 1; min-width: 0; height: 32px; border: 0; outline: none; background: transparent; color: #f5f5f7; font: inherit; font-size: 1rem; caret-color: #32d74b; }
.tp-matrix { position: fixed; inset: 0; z-index: 89; pointer-events: none; opacity: .9; transition: opacity .6s; }
.tp-matrix.fade { opacity: 0; }

/* =========================================================
   October 2026 pass
   ========================================================= */
/* Terminal hint only where there is a keyboard */
@media (hover: none) { .footer-hint { display: none; } }

/* Home: projects intro line and the closing call to action */
.section-head.row { flex-wrap: wrap; }
.section-kicker { flex-basis: 100%; order: 3; margin: 6px 0 0; color: #8e8e93; font-size: 1.0625rem; }
.home-projects { padding-bottom: 24px; }
.home-projects .section-head h2 { color: #f5f5f7; }
.finale-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px; margin: 26px 0 0; font-size: 0.9375rem; }
.finale-links a { color: #a1a1a6; }
.finale-links a:hover { color: #f5f5f7; }

/* Project page: call to action and more projects */
.project-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin: 8px 0 24px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.project-cta p { margin: 0; color: var(--text-2); max-width: 30em; }
.more-projects { border-top: 1px solid var(--line); padding-top: 56px; }
.more-projects .section-head { margin-bottom: 28px; }

/* About: quick facts and "right now" */
.facts-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 48px 0 0; max-width: 760px; }
.facts-strip > div { display: grid; gap: 4px; padding: 18px 20px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line); }
.fs-num { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.fs-label { font-size: 0.875rem; color: var(--text-2); line-height: 1.35; }
@media (max-width: 560px) { .facts-strip { grid-template-columns: 1fr; } .facts-strip > div { grid-template-columns: 4.2em 1fr; align-items: center; } }
.about-h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); margin: 64px 0 20px; }
.now-grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .now-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
.tile.now { display: flex; flex-direction: column; color: var(--text); transition: transform .3s cubic-bezier(.2,.8,.2,1), border-color .3s; }
.tile.now:hover { text-decoration: none; border-color: var(--text-2); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .tile.now:hover { transform: translateY(-3px); } }
.now-date { font-family: var(--mono); font-size: 0.75rem; color: var(--term-green); letter-spacing: 0; margin-bottom: 10px; }
.now-go { margin-top: auto; padding-top: 16px; color: var(--link); font-size: 0.9375rem; }

/* Contact: four tiles */
.contact-grid-2 { display: grid; gap: 16px; }
@media (min-width: 760px) { .contact-grid-2 { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
.contact-link { color: var(--text); transition: border-color .3s; }
.contact-link:hover { text-decoration: none; border-color: var(--text-2); }
.contact-link h3 { margin-top: 2px; }

/* Certificates tile */
@media (min-width: 760px) {
  .skills .tile-wide { grid-column: 1 / -1; }
  .cert-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .cert-list li, .cert-list li:first-child { border-top: 0; padding: 4px 0 0; }
}

.cert-img { display: block; margin-bottom: 12px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.cert-img img { display: block; width: 100%; height: auto; transition: transform .25s ease; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .cert-img:hover img { transform: scale(1.02); } }

/* Admin: traffic */
.tr-range { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.tr-range a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); font-size: .9375rem; }
.tr-range a[aria-current="page"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.tr-range a:hover { text-decoration: none; border-color: var(--link); }
.tr-range .tr-bots { margin-left: auto; border-style: dashed; }
.tr h2 { font-size: 1.0625rem; margin: 0 0 12px; }
.tr .tile h2 + h2, .tr-tech h2:not(:first-child) { margin-top: 20px; }
.tr-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
@media (min-width: 760px) { .tr-stats { grid-template-columns: repeat(6, 1fr); } }
.tr-stats .tile { padding: 16px 18px; }
.tr-k { display: block; color: var(--text-2); font-size: .8125rem; }
.tr-v { display: flex; align-items: center; gap: 8px; font-size: 1.75rem; font-weight: 600; letter-spacing: -.02em; }
.tr-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--term-green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--term-green) 25%, transparent); }
.tr-chart-tile { margin-bottom: 16px; }
.tr-chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.tr-chart-head span { color: var(--text-2); font-size: .8125rem; display: inline-flex; align-items: center; gap: 6px; }
.tr-key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.tr-key.v, .tr-colv { background: #0a84ff; }
.tr-key.u, .tr-colu { background: var(--term-green); }
.tr-chart { display: flex; align-items: flex-end; gap: 3px; height: 160px; margin-top: 8px; }
.tr-col { flex: 1; height: 100%; display: flex; align-items: flex-end; gap: 1px; min-width: 0; }
.tr-col span { flex: 1; border-radius: 3px 3px 0 0; min-height: 1px; }
.tr-col:hover span { filter: brightness(1.2); }
.tr-axis { display: flex; justify-content: space-between; color: var(--text-2); font-size: .75rem; margin-top: 6px; }
.tr-grid { display: grid; gap: 16px; margin-bottom: 8px; }
@media (min-width: 760px) { .tr-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .tr-grid { grid-template-columns: repeat(3, 1fr); } }
.tr-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tr-bars li { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; font-size: .9375rem; }
.tr-bar { position: absolute; inset: 0 auto 0 0; width: var(--w); background: color-mix(in srgb, var(--link) 16%, transparent); border-radius: 8px; }
.tr-label { position: relative; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tr-num { position: relative; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tr-empty { color: var(--text-2); margin: 0; }
.tr-visits { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tr-visits .tile { padding: 0; }
.tr-visits summary { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 14px 18px; cursor: pointer; list-style: none; }
.tr-visits summary::-webkit-details-marker { display: none; }
@media (min-width: 760px) { .tr-visits summary { grid-template-columns: 110px 1fr auto; align-items: center; gap: 16px; } }
.tr-when { color: var(--text-2); font-variant-numeric: tabular-nums; font-size: .9375rem; }
.tr-who { min-width: 0; display: grid; }
.tr-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-meta { color: var(--text-2); font-size: .8125rem; }
.tr-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-tag { font-size: .75rem; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--term-green) 16%, var(--surface)); white-space: nowrap; }
.tr-tag.src { background: color-mix(in srgb, var(--link) 16%, var(--surface)); }
.tr-tag.dim { background: var(--surface-2); color: var(--text-2); }
.tr-tag.bot { background: color-mix(in srgb, #ff453a 18%, var(--surface)); }
.tr-path { list-style: none; margin: 0; padding: 4px 18px 6px; border-top: 1px solid var(--line); }
.tr-path li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.tr-path li:first-child { border-top: 0; }
.tr-time { font-family: var(--mono); font-size: .8125rem; color: var(--text-2); width: 64px; }
.tr-path a { word-break: break-all; }
.tr-ev { font-size: .8125rem; color: var(--term-green); word-break: break-all; }
.tr-id { padding: 0 18px 14px; margin: 0; }
.tr-foot { color: var(--text-2); font-size: .8125rem; margin-top: 24px; }

/* ---------- study to-do (/admin/todo) ---------- */
.td-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pill { font-size: .8rem; font-weight: 600; letter-spacing: .02em; padding: 4px 11px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2); }
.pill.late { background: color-mix(in srgb, #e5484d 14%, var(--surface)); border-color: color-mix(in srgb, #e5484d 40%, var(--line)); color: #c2412d; }
.pill.soon { background: color-mix(in srgb, var(--status) 16%, var(--surface)); border-color: color-mix(in srgb, var(--status) 42%, var(--line)); color: #a86a00; }

.td-add { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px; margin-bottom: 26px; }
.td-in { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; min-width: 0; }
.td-add .btn { min-height: 40px; }
.td-add .td-in[name="title"] { grid-column: 1 / -1; }
@media (max-width: 640px) { .td-add { grid-template-columns: 1fr 1fr; } .td-add .btn, .td-add .td-more { grid-column: 1 / -1; } }

.td-h { display: flex; align-items: center; gap: 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-2); margin: 22px 0 8px; }
.td-h.late { color: #c2412d; } .td-h.soon { color: #a86a00; }
.td-n { font-family: var(--mono); font-size: .78rem; color: var(--text-2); }

.td-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.td-item { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px;
  padding: 12px 2px; border-bottom: 1px solid var(--line); }
.td-body { min-width: 0; }
.td-title { overflow-wrap: anywhere; }
.td-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 3px; font-size: .82rem; color: var(--text-2); }
.td-mod { font-family: var(--mono); font-size: .72rem; padding: 1px 7px; border-radius: 6px;
  background: color-mix(in srgb, var(--link) 12%, var(--surface)); color: var(--link); }
.td-due { font-family: var(--mono); font-size: .78rem; font-variant-numeric: tabular-nums; color: var(--text-2); white-space: nowrap; }
.td-due.late { color: #c2412d; } .td-due.soon { color: #a86a00; }
.td-item.done .td-title { text-decoration: line-through; color: var(--text-2); }

.td-toggle { margin: 0; display: flex; }
.chk { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; border: 2px solid var(--text-2);
  border-radius: 6px; margin: 0; cursor: pointer; display: grid; place-content: center; background: var(--surface); }
.chk:checked { background: var(--term-green); border-color: var(--term-green); }
.chk:checked::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.td-del { margin: 0; }
.js .td-go { display: none; }

.td-donebox > summary { cursor: pointer; font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--text-2); margin: 26px 0 8px; }
.td-donebox[open] > summary { margin-bottom: 4px; }

/* ---------- planner: tabs, side cards, calendar, settings ---------- */
.pl-tabs { display: flex; gap: 4px; margin-top: 18px; border-bottom: 1px solid var(--line); }
.pl-tabs a { padding: 9px 14px; border-radius: 10px 10px 0 0; color: var(--text-2); font-weight: 600; font-size: .92rem; text-decoration: none;
  border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; }
.pl-tabs a:hover { color: var(--text); }
.pl-tabs a[aria-current="page"] { color: var(--text); background: var(--bg); border-color: var(--line); }
.pill.ann { background: color-mix(in srgb, var(--link) 14%, var(--surface)); border-color: color-mix(in srgb, var(--link) 40%, var(--line)); color: var(--link); text-decoration: none; }

.pl-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
@media (max-width: 900px) { .pl-grid { grid-template-columns: 1fr; } .pl-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; } }
.pl-side { display: grid; gap: 14px; position: sticky; top: 76px; }
@media (max-width: 900px) { .pl-side { position: static; } }
.pl-card { padding: 16px 18px; }
.pl-card h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--text-2); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.pl-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pl-card-head h2 { margin: 0; }
.pl-card .btn { min-height: 36px; }
.pl-small { font-size: .85rem; color: var(--text-2); margin: 0 0 10px; line-height: 1.45; }
.pl-badge { font-family: var(--mono); font-size: .7rem; letter-spacing: 0; background: var(--link); color: #fff; border-radius: 999px; padding: 1px 7px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: .82rem; color: var(--link); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

.pl-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c, #8e8e93); margin-right: 7px; vertical-align: .05em; flex: none; }
.pl-dot.hollow { background: transparent; border: 2px solid var(--text-2); width: 9px; height: 9px; box-sizing: border-box; }
.pl-src { font-size: .7rem; font-weight: 600; padding: 1px 7px; border-radius: 6px; }
.pl-src.bb { background: color-mix(in srgb, #ff9f0a 16%, var(--surface)); color: #a86a00; }
.pl-src.ann { background: color-mix(in srgb, #bf5af2 14%, var(--surface)); color: #9a3fc9; }
.pl-bell { font-size: .75rem; }
.td-link { font-size: .82rem; }
.td-item:target { background: color-mix(in srgb, var(--link) 7%, transparent); }

.td-more { grid-column: 1 / -1; }
.td-more > summary, .td-edit > summary { cursor: pointer; font-size: .82rem; color: var(--text-2); width: max-content; }
.td-more[open] { display: grid; gap: 8px; }
.td-more .td-note-in { width: 100%; }
.td-edit { margin-top: 4px; }
.td-edit > summary { list-style: none; display: inline; }
.td-edit > summary::-webkit-details-marker { display: none; }
.td-edit[open] > summary { color: var(--link); }
.td-edit-form { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; margin: 8px 0 4px; align-items: center; }
.td-edit-form .td-wide { grid-column: 1 / -1; }
@media (max-width: 640px) { .td-edit-form { grid-template-columns: 1fr 1fr; } .td-edit-form input[name="title"] { grid-column: 1 / -1; } }
.pl-label { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); margin: 4px 0 6px; }
.pl-remind { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-chip-check { position: relative; cursor: pointer; }
.pl-chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.pl-chip-check span { display: inline-block; font-size: .8rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); background: var(--bg); }
.pl-chip-check input:checked + span { background: color-mix(in srgb, var(--link) 14%, var(--surface)); border-color: color-mix(in srgb, var(--link) 45%, var(--line)); color: var(--link); }
.pl-chip-check input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }

.pl-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: -8px 0 6px; }
.pl-filter a { display: inline-flex; align-items: center; font-size: .82rem; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); text-decoration: none; }
.pl-filter a[aria-current="true"] { color: var(--text); border-color: var(--text-2); background: var(--surface); }

.pl-ann { list-style: none; margin: 4px 0 0; padding: 0; max-height: 520px; overflow: auto; }
.pl-ann li { border-top: 1px solid var(--line); }
.pl-ann summary { cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 9px 0; list-style: none; }
.pl-ann summary::-webkit-details-marker { display: none; }
.pl-ann-course { font-size: .72rem; color: var(--text-2); display: flex; align-items: center; }
.pl-ann-date { font-size: .72rem; color: var(--text-2); font-family: var(--mono); }
.pl-ann-title { grid-column: 1 / -1; font-size: .9rem; }
.pl-ann li.unread .pl-ann-title { font-weight: 650; }
.pl-ann li.unread .pl-ann-title::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--link); margin-right: 6px; vertical-align: .1em; }
.pl-ann p { font-size: .86rem; color: var(--text-2); margin: 0 0 8px; white-space: pre-line; }
.pl-ann-actions { display: flex; gap: 14px; align-items: center; font-size: .82rem; padding-bottom: 10px; }
.pl-ann-actions form { margin: 0; }

.pl-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 16px; font-size: .82rem; color: var(--text-2); }
.pl-legend span { display: inline-flex; align-items: center; }
.pl-cal-tile { padding: 14px; }
.pl-cal-hint { margin-top: 10px; }
#cal { --fc-border-color: var(--line); --fc-page-bg-color: var(--surface); --fc-neutral-bg-color: var(--bg);
  --fc-today-bg-color: color-mix(in srgb, var(--link) 9%, transparent); --fc-list-event-hover-bg-color: var(--bg);
  --fc-button-bg-color: var(--bg); --fc-button-border-color: var(--line); --fc-button-text-color: var(--text);
  --fc-button-hover-bg-color: var(--surface); --fc-button-hover-border-color: var(--text-2);
  --fc-button-active-bg-color: var(--text); --fc-button-active-border-color: var(--text);
  --fc-now-indicator-color: #e5484d; font-size: .9rem; }
#cal .fc-button { font-weight: 600; font-size: .82rem; box-shadow: none !important; border-radius: 9px; }
#cal .fc-button-active { color: var(--bg); }
#cal .fc-toolbar-title { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
#cal .fc-col-header-cell-cushion, #cal .fc-daygrid-day-number { color: var(--text-2); text-decoration: none; font-size: .8rem; }
#cal .fc-event { cursor: pointer; border-radius: 6px; }
#cal .ev-task.fc-daygrid-event { font-weight: 600; }
#cal .ev-done { opacity: .45; text-decoration: line-through; }
#cal .ev-late { box-shadow: 0 0 0 2px #e5484d inset; }
#cal .ev-class { opacity: .7; }
#cal .fc-daygrid-dot-event .fc-event-title { font-weight: 600; }
#cal .fc-list-day-cushion { background: var(--bg); }
#cal a { color: inherit; }

.pl-dialog { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 0; background: var(--surface); color: var(--text); width: min(460px, calc(100vw - 32px)); }
.pl-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.pl-dialog-box { padding: 20px; display: grid; gap: 10px; margin: 0; }
.pl-dialog h2 { margin: 0; font-size: 1.2rem; }
.pl-dialog-kicker { margin: 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); }
.pl-dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pl-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pl-row .td-in { flex: 1 1 120px; }

.pl-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.pl-settings .pl-card { padding: 20px; }
.pl-form { display: grid; gap: 10px; margin-bottom: 10px; }
.pl-email label { display: grid; gap: 4px; font-size: .82rem; color: var(--text-2); }
.pl-email label.pl-check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: .9rem; }
.pl-settings code { font-size: .78rem; word-break: break-all; }
.pl-card [hidden], .pl-dialog [hidden], #push-card [hidden] { display: none !important; }

/* calendar filters */
.pl-filters { gap: 6px 8px; }
.pl-chip { display: inline-flex; align-items: center; font: inherit; font-size: .8rem; color: var(--text); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; cursor: pointer; }
.pl-chip[aria-pressed="false"] { opacity: .4; text-decoration: line-through; }
.pl-chip:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.pl-toggles { margin-top: 10px; gap: 6px 20px; }
.pl-toggles label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
#cal .fc-daygrid-block-event .fc-event-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#cal .fc-daygrid-day-frame { min-height: 96px; }
