/* ── Redaction (local webfont, SIL OFL — see fonts/OFL.txt) ── */
@font-face {
  font-family: 'Redaction';
  src: url('../fonts/Redaction-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Redaction';
  src: url('../fonts/Redaction-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Redaction';
  src: url('../fonts/Redaction-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
/* the degraded grades of the family: they drive the About page decipher
   animation and the hover pixelation on headers (see script.js) */
@font-face {
  font-family: 'Redaction 100';
  src: url('../fonts/Redaction_100-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Redaction 70';
  src: url('../fonts/Redaction_70-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Redaction 50';
  src: url('../fonts/Redaction_50-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Redaction 35';
  src: url('../fonts/Redaction_35-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Redaction 20';
  src: url('../fonts/Redaction_20-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Redaction 10';
  src: url('../fonts/Redaction_10-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Theme palettes ── */
:root {
  color-scheme: light;
  --bg: #FAF9F5;
  --text: #4a4a52;
  --muted: #6b7280;
  --faint: #9ca3af;
  --border: #e2e8f0;
  --border-soft: #d1d5db;
  --grid-line: rgba(226, 232, 240, 0.35);
  --surface: rgba(255, 255, 255, 0.45);
  --surface-hover: rgba(255, 255, 255, 0.65);
  --pill: rgba(255, 255, 255, 0.65);
  --pill-active: rgba(255, 255, 255, 0.75);
  --nav-bg: rgba(250, 249, 245, 0.85);
  --tag-bg: rgba(255, 255, 255, 0.6);
  --code-bg: #f5f2f0;
  --shadow: rgba(0, 0, 0, 0.04);
}
html.dark {
  color-scheme: dark;
  --bg: #201f1d;
  --text: #d6d4cd;
  --muted: #a09e97;
  --faint: #75746e;
  --border: #3a3935;
  --border-soft: #46443f;
  --grid-line: rgba(255, 255, 255, 0.045);
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --pill: rgba(255, 255, 255, 0.07);
  --pill-active: rgba(255, 255, 255, 0.11);
  --nav-bg: rgba(32, 31, 29, 0.85);
  --tag-bg: rgba(255, 255, 255, 0.06);
  --code-bg: #2a2925;
  --shadow: rgba(0, 0, 0, 0.35);
}

/* ── Home background boxes ── */
#home {
  padding: 0;
  min-height: calc(100vh - 77px);
  position: relative;
  overflow: hidden;
}
#home.active {
  display: flex;
  align-items: center;
  justify-content: center;
}
#boxes-grid {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) skewX(-48deg) skewY(14deg) scale(0.675) translateZ(0);
  display: flex;
  padding: 16px;
  z-index: 0;
}
.box-row {
  width: 64px;
  position: relative;
  border-left: 1px solid var(--border);
}
.box-cell {
  width: 64px;
  height: 32px;
  border-right: 1px solid var(--border);
  border-top: 1px solid var(--border);
  position: relative;
  transition: background-color 600ms ease;
}
.box-plus {
  position: absolute;
  height: 24px;
  width: 40px;
  top: -14px;
  left: -22px;
  color: var(--border);
  stroke-width: 1px;
  pointer-events: none;
}
.boxes-mask {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  -webkit-mask-image: radial-gradient(transparent 30%, white 70%);
  mask-image: radial-gradient(transparent 30%, white 70%);
  pointer-events: none;
  z-index: 1;
}
.home-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 20px;
}
.home-content a {
  display: inline-block;
  margin: 0 8px;
}

/* ── About ── */
.about-layout {
  display: flex;
  gap: 48px;
  align-items: flex-start;
}
.about-text {
  flex: 1;
  max-width: 560px;
  /* single knob for the decipher animation: script.js steps this through
     Redaction's degraded grades, then removes it to land on the clean cut */
  --about-font: 'Redaction', 'EB Garamond', Georgia, serif;
}
.about-text p {
  line-height: 1.8;
  margin-bottom: 1.1em;
}
#about-deco {
  display: flex;
  flex-shrink: 0;
  opacity: 0.82;
}
.deco-col {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
}
.deco-col:last-child {
  border-right: 1px solid var(--border);
}
.deco-cell {
  width: 22px;
  height: 22px;
  border-bottom: 1px solid var(--border);
  transition: background-color 400ms ease;
  box-sizing: border-box;
}
.deco-cell:first-child {
  border-top: 1px solid var(--border);
}
@media (max-width: 640px) {
  .about-layout { flex-direction: column; }
  #about-deco { display: none; }
}

/* ── Cards ── */
.section-subtitle {
  color: var(--muted);
  margin-bottom: 4px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 28px;
}
.card {
  position: relative;
  isolation: isolate;
  display: block;
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px 22px;
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  transition: transform 220ms ease, box-shadow 300ms ease, border-color 300ms ease, background 300ms ease;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}
.card:hover::before {
  opacity: 1;
}
.card:hover {
  transform: translateY(-5px);
  background: var(--surface-hover);
  box-shadow: 0 8px 32px var(--glow, rgb(186 230 253)), 0 2px 8px var(--shadow);
  border-color: var(--glow, rgb(186 230 253));
}
html.dark .card:hover {
  box-shadow: 0 8px 32px -8px var(--glow, rgb(186 230 253)), 0 2px 8px var(--shadow);
}
.card-plus {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 18px;
  color: var(--border);
  font-family: "Andale Mono", monospace;
  pointer-events: none;
  transition: color 300ms ease;
}
.card:hover .card-plus {
  color: var(--glow, rgb(186 230 253));
}
.card h2 {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.card p {
  margin: 0;
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.6;
}
.card-date {
  font-size: 0.72rem;
  color: var(--faint);
  letter-spacing: 0.04em;
  margin: -6px 0 10px;
}
.card-tag {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--tag-bg);
  border: 1px solid var(--border);
  color: var(--text);
  letter-spacing: 0.04em;
}

body {
  font-family: "Andale Mono", monospace;
  margin: 0;
  padding: 20px;
  background: var(--bg);
  color: var(--text);
  transition: background-color 300ms ease, color 300ms ease;
}

/* ── Links: body-colored text, soft underline that darkens on hover ── */
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--faint);
  transition: text-decoration-color 200ms ease;
}
a:hover {
  text-decoration-color: currentColor;
}

/* ── Serif: content headings & prose ── */
.home-content h1 {
  font-family: 'Redaction', 'EB Garamond', Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.01em;
  font-size: 2.8rem;
  margin-bottom: 0.25em;
}
/* section headings share the display face */
#blog > h1,
#projects > h1,
#post-interests h1 {
  font-family: 'Redaction', 'EB Garamond', Georgia, serif;
  font-weight: 400;
}
.about-text h1 {
  font-family: var(--about-font);
  font-weight: 400;
}
.about-text p {
  font-family: var(--about-font);
  font-size: 1.1rem;
}
.about-text h2 {
  font-family: var(--about-font);
  font-weight: 400;
}

/* ── Project page prose ── */
[id^="project-"] h1 {
  font-family: 'Redaction', 'EB Garamond', Georgia, serif;
  font-weight: 400;
  font-size: 2rem;
  margin-bottom: 0.5em;
}
[id^="project-"] p {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.1rem;
  line-height: 1.8;
}

/* ── Post datelines ── */
.post-date {
  font-family: "Andale Mono", monospace;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin: -2.6em 0 2.8em;
}
html {
  /* keep anchor-scroll targets clear of the sticky nav */
  scroll-padding-top: 68px;
}
nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -20px -20px 0;
  padding: 12px 26px;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
nav a {
  cursor: pointer;
  text-decoration: none;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 200ms ease, background-color 200ms ease, border-color 200ms ease, box-shadow 300ms ease;
}
nav a:hover {
  color: var(--text);
  background: var(--pill);
  border-color: var(--glow, var(--border));
}
nav a.active {
  color: var(--text);
  background: var(--pill-active);
  border-color: var(--glow, var(--border));
  box-shadow: 0 2px 12px var(--glow, rgba(0, 0, 0, 0.05));
}

/* ── Dark mode toggle ── */
#theme-toggle {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: color 200ms ease, background-color 200ms ease, border-color 200ms ease;
}
#theme-toggle:hover {
  color: var(--text);
  background: var(--pill);
  border-color: var(--border);
}
#theme-toggle svg {
  width: 18px;
  height: 18px;
}
.theme-icon-sun { display: none; }
html.dark .theme-icon-sun { display: block; }
html.dark .theme-icon-moon { display: none; }

.tab {
  display: none;
  padding: 20px;
}
.tab.active {
  display: block;
}
/* Blog image styles */
.blog-image {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
  margin: 12px 0;
}
.image-caption {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 12px;
}
/* Make Prism/inline code blocks scrollable when long */
pre[class*="language-"] {
  max-height: 320px;
  overflow: auto;
  padding: 12px;
  border-radius: 6px;
  background: var(--code-bg);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.02);
}
pre[class*="language-"] code {
  white-space: pre;
}

/* ── Dark-mode overrides for the Prism light theme ── */
html.dark pre[class*="language-"] {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}
html.dark code[class*="language-"],
html.dark pre[class*="language-"] {
  color: var(--text);
  text-shadow: none;
}
html.dark .token.comment,
html.dark .token.prolog,
html.dark .token.doctype,
html.dark .token.cdata {
  color: var(--faint);
}
html.dark .token.punctuation {
  color: var(--muted);
}
html.dark .token.property,
html.dark .token.tag,
html.dark .token.boolean,
html.dark .token.number,
html.dark .token.constant,
html.dark .token.symbol,
html.dark .token.deleted {
  color: rgb(251 207 232);
}
html.dark .token.selector,
html.dark .token.attr-name,
html.dark .token.string,
html.dark .token.char,
html.dark .token.builtin,
html.dark .token.inserted {
  color: rgb(187 247 208);
}
html.dark .token.operator,
html.dark .token.entity,
html.dark .token.url,
html.dark .language-css .token.string,
html.dark .style .token.string {
  color: rgb(254 240 138);
  background: transparent;
}
html.dark .token.atrule,
html.dark .token.attr-value,
html.dark .token.keyword {
  color: rgb(199 210 254);
}
html.dark .token.function,
html.dark .token.class-name {
  color: rgb(186 230 253);
}
html.dark .token.regex,
html.dark .token.important,
html.dark .token.variable {
  color: rgb(253 230 138);
}

.image-container {
    display: flex; /* Aligns children (images) side by side */
    justify-content: center; /* Horizontally centers the images within the container */
    gap: 20px; /* Adds space between the images */
}

.image-container img {
    max-width: 100%;
    height: auto;
    width: 300px; /* Example fixed width */
}

.image-container {
    display: flex; /* Aligns children (images) side by side */
    justify-content: center; /* Horizontally centers the images within the container */
    gap: 20px; /* Adds space between the images */
}

.image-container img {
    max-width: 100%;
    height: auto;
    width: 300px; /* Example fixed width */
}

.image-container {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.image-container img {
    max-width: 100%;
    height: auto;
    width: 300px;
}
