/* allo — personal site stylesheet.
   Tokens are the profile hero's own GitHub-dark palette (#0D1117 / #E6EDF3 / #30363D / #F7577F)
   with a light counterpart; styles.css loads on every page, script.js resolves which one applies. */

/* ---------------------------------------------------------------- tokens */

:root {
  color-scheme: dark;

  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1b2129;
  --border: #30363d;
  --border-soft: #21262d;
  --fg: #e6edf3;
  --fg-muted: #8b949e;
  --accent: #f7577f;
  --accent-soft: rgba(247, 87, 127, 0.14);
  --blue: #58a6ff;
  --green: #3fb950;
  --amber: #f0883e;
  --purple: #bc8cff;
  --grid: rgba(139, 148, 158, 0.09);
  --glow: rgba(247, 87, 127, 0.16);
  --shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.85);

  --wrap: 1080px;
  --radius: 16px;
  --radius-sm: 10px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

[data-theme="light"] {
  color-scheme: light;

  --bg: #ffffff;
  --surface: #f6f8fa;
  --surface-2: #ffffff;
  --border: #d0d7de;
  --border-soft: #e6eaef;
  --fg: #1f2328;
  --fg-muted: #59636e;
  --accent: #d6396b;
  --accent-soft: rgba(214, 57, 107, 0.1);
  --blue: #0969da;
  --green: #1a7f37;
  --amber: #bc4c00;
  --purple: #8250df;
  --grid: rgba(31, 35, 40, 0.07);
  --glow: rgba(214, 57, 107, 0.12);
  --shadow: 0 20px 44px -30px rgba(31, 35, 40, 0.35);
}

/* ---------------------------------------------------------------- base */

*,
*::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(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The hero grid: a hairline lattice, faded at the edges so it reads as texture. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% -10%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% -10%, #000 0%, transparent 72%);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 680;
}

p {
  margin: 0;
}

a {
  color: var(--fg);
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

code,
kbd,
pre,
.mono {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

img {
  max-width: 100%;
  height: auto;
}

::selection {
  background: var(--accent-soft);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip:focus {
  left: 0;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border-soft);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.brand__mark {
  width: 22px;
  height: 22px;
  flex: none;
}

.brand__path {
  color: var(--fg-muted);
  font-weight: 500;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--fg-muted);
  transition: color 0.16s ease, background 0.16s ease;
}

.site-nav a:hover,
.site-nav a[aria-current] {
  color: var(--fg);
  background: var(--surface);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--fg-muted);
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.icon-btn:hover {
  color: var(--fg);
  border-color: var(--fg-muted);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

[data-theme="dark"] .icon-btn__sun,
[data-theme="light"] .icon-btn__moon {
  display: none;
}

.nav-toggle {
  display: none;
}

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative;
  z-index: 1;
  padding: 84px 0 64px;
}

.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -140px;
  left: 50%;
  /* min() keeps the glow from widening the document on narrow screens: a 760px box centred in a
     390px viewport is 185px of horizontal scroll with nothing visible in it. */
  width: min(760px, 100vw);
  height: 420px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--glow), transparent 70%);
  pointer-events: none;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 52px;
  align-items: center;
}

.prompt {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--fg-muted);
  margin-bottom: 20px;
}

.prompt__caret {
  color: var(--accent);
}

.prompt__cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--fg);
  animation: blink 1.15s steps(2, start) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .prompt__cursor {
    animation: none;
  }
}

.hero h1 {
  font-size: clamp(44px, 7vw, 68px);
  letter-spacing: -0.035em;
}

.hero__lead {
  margin-top: 14px;
  font-size: clamp(19px, 2.2vw, 23px);
  color: var(--fg);
}

.hero__sub {
  margin-top: 10px;
  font-size: 16px;
  color: var(--fg-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 14.5px;
  font-weight: 560;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--fg-muted);
  color: var(--fg);
}

/* Filled buttons take the page background as their text colour: white on #F7577F is only 3.2:1,
   while the theme's own background colour on it is 5.7:1 in dark and 4.5:1 in light. */
.btn--primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--bg);
}

.btn--primary:hover {
  background: var(--accent);
  color: var(--bg);
  filter: brightness(1.06);
}

.btn svg {
  width: 15px;
  height: 15px;
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg-muted);
}

.hero__facts span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}

/* The receipt panel: real entries read from the deployed claims.json. */

.receipt {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.receipt__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
}

.receipt__light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  flex: none;
}

.receipt__title {
  margin-left: 4px;
}

.receipt__count {
  margin-left: auto;
  color: var(--fg);
}

.receipt__body {
  padding: 8px 6px;
  min-height: 208px;
}

.receipt__empty {
  padding: 16px 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg-muted);
}

.receipt__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12.5px;
  opacity: 0;
  transform: translateY(4px);
  animation: row-in 0.42s ease forwards;
}

@keyframes row-in {
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .receipt__row {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.receipt__row:hover {
  background: var(--surface-2);
}

.receipt__id {
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt__value {
  grid-column: 1;
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt__tag {
  grid-row: 1 / span 2;
  align-self: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--green);
  background: color-mix(in srgb, var(--green) 10%, transparent);
  white-space: nowrap;
}

.receipt__tag--manual {
  color: var(--amber);
  background: color-mix(in srgb, var(--amber) 10%, transparent);
}

.receipt__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
}

.receipt__foot a {
  color: var(--fg-muted);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}

.receipt__foot a:hover {
  color: var(--accent);
}

/* ---------------------------------------------------------------- sections */

.section {
  position: relative;
  z-index: 1;
  padding: 56px 0;
  border-top: 1px solid var(--border-soft);
}

.section--first {
  padding-top: 52px;
  border-top: 0;
}

.section__head {
  margin-bottom: 30px;
  max-width: 720px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.section h1,
.section h2 {
  margin-top: 10px;
  font-size: clamp(26px, 3.4vw, 34px);
}

.section__note {
  margin-top: 12px;
  color: var(--fg-muted);
  font-size: 15.5px;
}

.lede {
  font-size: 17.5px;
  color: var(--fg);
}

/* Focus cards */

.focus {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.focus__card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.focus__card:hover {
  border-color: var(--fg-muted);
  transform: translateY(-2px);
}

.focus__icon {
  width: 30px;
  height: 30px;
  margin-bottom: 14px;
}

.focus__card h3 {
  font-size: 18px;
}

.focus__card p {
  margin-top: 8px;
  color: var(--fg-muted);
  font-size: 14.5px;
}

/* Cards shared by projects and the featured grid */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.card:hover {
  border-color: var(--fg-muted);
  transform: translateY(-2px);
}

.card__top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.card h3 {
  font-family: var(--font-mono);
  font-size: 16.5px;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.card__tagline {
  font-size: 13px;
  color: var(--accent);
}

.card__summary {
  color: var(--fg-muted);
  font-size: 14.5px;
  flex: 1;
}

.card__summary code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--fg);
}

.card__foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
}

.card__foot a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-muted);
}

.card__foot a:hover {
  color: var(--accent);
}

.card__foot svg {
  width: 13px;
  height: 13px;
}

.tag {
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.install {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg-muted);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  overflow-x: auto;
  white-space: nowrap;
}

.install::before {
  content: "$ ";
  color: var(--accent);
}

.section__more {
  margin-top: 26px;
}

/* Filters (projects page) */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 26px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search {
  flex: 1 1 240px;
  min-width: 0;
  padding: 8px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--fg);
  font-family: inherit;
  font-size: 13.5px;
}

.search::placeholder {
  color: var(--fg-muted);
}

.search:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--fg-muted);
  font-size: 13.5px;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.chip:hover {
  color: var(--fg);
}

.chip[aria-pressed="true"] {
  color: var(--fg);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg-muted);
}

.group {
  margin-top: 34px;
}

.group__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}

.group__head h3 {
  font-size: 17px;
  font-family: var(--font-mono);
}

.group__head p {
  color: var(--fg-muted);
  font-size: 13.5px;
}

/* Evidence figures */

.evidence {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

figure {
  margin: 0;
}

.evidence figure {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.18s ease;
}

.evidence figure:hover {
  border-color: var(--fg-muted);
}

.evidence img {
  display: block;
  width: 100%;
  background: var(--bg);
}

.evidence figcaption {
  padding: 12px 16px;
  border-top: 1px solid var(--border-soft);
  font-size: 13px;
  color: var(--fg-muted);
}

.evidence figcaption a {
  color: var(--fg-muted);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}

.evidence figcaption a:hover {
  color: var(--accent);
}

.snake {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.snake img {
  display: block;
  width: 100%;
}

/* Writing list */

.posts {
  display: grid;
  gap: 2px;
}

.post {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 6px 20px;
  align-items: baseline;
  padding: 16px 14px;
  border-radius: var(--radius-sm);
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.16s ease;
}

.post:hover {
  background: var(--surface);
}

.post__date {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg-muted);
}

.post__title {
  font-size: 16.5px;
  font-weight: 560;
}

.post__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

a.post:hover .post__title {
  color: var(--accent);
}

.empty {
  padding: 28px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--fg-muted);
  font-size: 14.5px;
}

/* Closing panel */

.cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.cta h2 {
  font-size: clamp(22px, 2.6vw, 28px);
}

.cta p {
  margin-top: 8px;
  color: var(--fg-muted);
  font-size: 15px;
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 40px;
  padding: 34px 0 42px;
  border-top: 1px solid var(--border-soft);
  font-size: 13.5px;
  color: var(--fg-muted);
}

.site-footer__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  align-items: center;
}

.site-footer a {
  color: var(--fg-muted);
}

.site-footer a:hover {
  color: var(--accent);
}

.site-footer__meta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
}

/* ---------------------------------------------------------------- 404 */

.stage {
  position: relative;
  z-index: 1;
  min-height: 62vh;
  display: grid;
  place-items: center;
  padding: 72px 0;
  text-align: center;
}

.stage h1 {
  font-size: clamp(52px, 10vw, 96px);
  font-family: var(--font-mono);
  letter-spacing: -0.05em;
}

.stage p {
  margin-top: 14px;
  color: var(--fg-muted);
  max-width: 46ch;
  margin-inline: auto;
}

.stage .hero__actions {
  justify-content: center;
}

/* ---------------------------------------------------------------- reveal */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  .hero {
    padding-top: 56px;
  }

  .hero__grid,
  .grid,
  .focus,
  .cta {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__grid {
    gap: 36px;
  }

  .cta {
    justify-items: start;
  }

  .post {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .post__tags {
    justify-content: flex-start;
  }

  .site-footer__meta {
    margin-left: 0;
    text-align: left;
  }
}

@media (max-width: 720px) {
  .wrap {
    padding-inline: 18px;
  }

  .section {
    padding: 42px 0;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .site-nav {
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 18px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  .site-nav[data-open="true"] {
    display: flex;
  }

  .site-nav a {
    border-radius: var(--radius-sm);
    padding: 11px 12px;
  }

  .receipt__body {
    min-height: 0;
  }
}
