@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,600;1,400;1,600&family=IBM+Plex+Serif:ital,wght@0,400;0,600;1,400;1,600&display=swap');

:root {
  /* Foundations */
  --void:       #0a0c0c;
  --workbench:  #151a1a;
  --graphline:  #2b6263;

  /* Text */
  --aluminum:   #cee4e5;
  --patina:     #81aaab;

  /* Accents */
  --furnace:    #f15f22;
  --phosphor:   #00c420;
  --arc:        #0096ff;

  /* Semantic */
  --slag:       #a64a2e;
  --gold:       #cfc041;
  --magenta:    #da5bd6;
  --joppa-blue: #1f68b9;
  --eudoxia:    #6252fa;
  --klanq:      #e98913;
  --red-eye:    #f00;

  --seraphic: #ffffff;

  /* Typography — fluid base: 18px @ 375px → 22px @ 1440px */
  --font-mono:  'IBM Plex Mono', monospace;
  --font-serif: 'IBM Plex Serif', serif;

  --type-base:     clamp(1.125rem, 0.95rem + 0.5vw, 1.375rem);
  --type-sm:       0.85em;
  --type-md:       1em;
  --type-lg:       1.35em;
  --type-xl:       1.8em;
  --type-2xl:      2.4em;

  --leading-body:    1.55;
  --leading-heading: 1.15;
  --weight-body:     400;
  --weight-emphasis: 600;

  /* Spacing — proportional to type */
  --sp-1: 0.35em;
  --sp-2: 0.75em;
  --sp-3: 1em;
  --sp-4: 1.5em;
  --sp-6: 2em;
  --sp-8: 3em;

  /* Layout */
  --content-width: 58rem;
  --prose-width:   42rem;
  --gutter:        clamp(1.5rem, 4vw, 4rem);
}

/* ── Reset ── */

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

/* ── Base ── */

html {
  font-size: var(--type-base);
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-mono);
  font-weight: var(--weight-body);
  line-height: var(--leading-body);
  color: var(--aluminum);
  background-color: var(--void);
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--sp-6) var(--gutter);
  overflow-x: hidden;
}

/* ── Typography ── */

h1, h2, h3 {
  font-family: var(--font-mono);
  font-weight: var(--weight-emphasis);
  line-height: var(--leading-heading);
  color: var(--aluminum);
}

h1 {
  font-size: var(--type-2xl);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-3);
}

h2 {
  font-size: var(--type-lg);
  margin-top: var(--sp-4);
  margin-bottom: var(--sp-2);
}

h3 {
  font-size: var(--type-md);
  margin-top: var(--sp-3);
  margin-bottom: var(--sp-2);
}

p {
  margin-bottom: var(--sp-2);
  color: var(--aluminum);
}

.prose {
  font-family: var(--font-serif);
  max-width: var(--prose-width);
}

strong {
  font-weight: var(--weight-emphasis);
  color: var(--aluminum);
}

em {
  font-style: italic;
  color: var(--patina);
}

small, .secondary {
  color: var(--patina);
  font-size: var(--type-sm);
}

/* ── Site header ── */

.site-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5em 1.5em;
  margin-bottom: var(--sp-3);
}

.site-header .mark {
  font-size: var(--type-2xl);
  font-weight: var(--weight-emphasis);
  color: var(--aluminum);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.site-header .mark:hover {
  color: var(--aluminum);
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em 1.2em;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: var(--type-lg);
}

.site-nav a {
  color: var(--patina);
}

.site-nav a:hover {
  color: var(--aluminum);
}

.breadcrumb {
  font-size: var(--type-lg);
  margin-bottom: var(--sp-3);
}

.breadcrumb a {
  color: var(--patina);
}

.breadcrumb .current {
  color: var(--aluminum);
  filter: url("#tear-sm");
}

/* ── Links ── */

a {
  color: var(--furnace);
  text-decoration: none;
  transition: color 0.05s linear;
}

a:hover {
  color: var(--aluminum);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:focus-visible {
  outline: 2px solid var(--phosphor);
  outline-offset: 2px;
}

/* ── Borders & Rules ── */

hr {
  border: none;
  border-top: 1px dashed var(--graphline);
  margin: var(--sp-6) 0;
}

/* ── Code ── */

code {
  font-family: var(--font-mono);
  background-color: var(--workbench);
  color: var(--phosphor);
  padding: 2px 6px;
  font-size: 0.9em;
}

pre {
  background-color: var(--workbench);
  border: 1px solid var(--graphline);
  padding: var(--sp-2);
  overflow-x: auto;
  margin-bottom: var(--sp-3);
}

pre code {
  background: none;
  padding: 0;
}

/* ── Blockquotes ── */

blockquote {
  border-left: 3px solid var(--furnace);
  padding-left: var(--sp-2);
  margin-bottom: var(--sp-3);
  color: var(--aluminum);
}

/* ── Lists ── */

ul, ol {
  padding-left: var(--sp-3);
  margin-bottom: var(--sp-3);
}

li {
  margin-bottom: var(--sp-1);
}

/* ── Buttons ── */

button, .btn {
  font-family: var(--font-mono);
  font-size: var(--type-md);
  color: var(--aluminum);
  background: none;
  border: 1px solid var(--graphline);
  padding: var(--sp-1) var(--sp-2);
  cursor: pointer;
  min-height: 44px;
  transition: border-color 0.05s linear;
}

button:hover, .btn:hover {
  border-color: var(--furnace);
}

button:active, .btn:active {
  transform: translateY(2px);
  border-top-color: transparent;
  border-bottom-width: 3px;
  border-bottom-color: var(--furnace);
}

button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--phosphor);
  outline-offset: 2px;
}

/* ── Glitch Effect ── */

.glitch {
  text-shadow:
    -2px 0 var(--furnace),
     2px 0 var(--phosphor);
}

/* ── Repo Links ── */

.repo-link,
.repo-link strong {
  color: var(--phosphor);
}

.repo-link:hover,
.repo-link:hover strong {
  color: var(--aluminum);
}

/* ── Repo entry (description + links row) ── */

.repo-entry {
  margin-bottom: var(--sp-4);
}

.repo-entry .repo-links {
  margin-top: 0.2em;
}

@media (width >= 64rem) {
  .repo-entry {
    display: grid;
    grid-template-columns: 1fr 10ch;
    gap: 0 2em;
    align-items: start;
  }

  .repo-entry .repo-links {
    margin-top: 0;
    text-align: right;
  }
}

/* ── Section Spacing ── */

section {
  margin-bottom: var(--sp-6);
}

/* ── Page Footer ── */

.page-footer {
  margin-top: var(--sp-6);
  padding: var(--sp-3) 0;
  font-size: var(--type-lg);
  color: var(--joppa-blue);
}

.page-footer a {
  color: var(--joppa-blue);
}

.page-footer a:hover {
  color: var(--aluminum);
}

/* ── Footer ── */

footer {
  padding-top: var(--sp-2);
  font-size: var(--type-lg);
}

/* ── Responsive ── */

@media (width <= 480px) {
  .site-header {
    flex-direction: column;
    gap: 0.3em;
  }

  .glitch {
    text-shadow:
      -1px 0 var(--furnace),
       1px 0 var(--phosphor);
  }
}
