/* ============================================================
   REMINGTON HOLDER — PORTFOLIO STYLESHEET
   ============================================================
   Sections:
     1. Variables & Reset
     2. Typography
     3. Navigation
     4. Layout Primitives
     5. Home — Hero
     6. Home — Affiliations
     7. Home — Preview List
     8. Project Grid (Cards)
     9. Project Detail
    10. About Page
    11. Footer
    12. Animations
    13. Responsive
   ============================================================ */


/* ── 1. VARIABLES & RESET ─────────────────────────────────── */

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

:root {
  /* Backgrounds */
  --bg:         #0d0d0d;   /* page background */
  --bg-card:    #111111;   /* card / panel background */
  --bg-hover:   #161616;   /* card hover state */

  /* Borders */
  --border:     #222222;   /* subtle border */
  --border-mid: #2a2a2a;   /* slightly more visible border */

  /*
    TEXT HIERARCHY — two-tier system
    ─────────────────────────────────────────────────────────
    --text    #dddddd  ~18:1 contrast  Primary readable content:
                                       headings, body copy, about paragraphs,
                                       project detail text, bio.

    --muted   #999999  ~8:1 contrast   Secondary readable content:
                                       subtitles, excerpts, descriptions,
                                       affiliation text, nav labels, role line.
                                       Passes WCAG AA at all sizes.

    --faint   #555555  ~4:1 contrast   Decorative / non-essential only:
                                       card index numbers (01, 02…),
                                       footer text, border-adjacent labels.
                                       Not used for content that needs reading.
    ─────────────────────────────────────────────────────────
    To adjust: change the hex values here and the whole site updates.
  */
  --text:       #dddddd;
  --muted:      #999999;
  --faint:      #555555;

  --accent:     #c8f04a;   /* lime green highlight */

  /* Typography */
  --font-mono: 'IBM Plex Mono', monospace;
  --font-sans: 'IBM Plex Sans', sans-serif;

  /* Layout */
  --nav-height: 52px;
  --max-width:  980px;
  --page-pad:   1.75rem;
}

  /* Typography */
  --font-mono: 'IBM Plex Mono', monospace;
  --font-sans: 'IBM Plex Sans', sans-serif;

  /* Layout */
  --nav-height: 52px;
  --max-width:  980px;
  --page-pad:   1.75rem;
}

html {
  scroll-behavior: smooth;
}

body {
  background:  var(--bg);
  color:       var(--text);
  font-family: var(--font-mono);
  font-size:   13px;
  line-height: 1.7;
  min-height:  100vh;
  overflow-x:  hidden;
}

a {
  color: inherit;
  text-decoration: none;
}


/* ── 2. TYPOGRAPHY ────────────────────────────────────────── */

h1, h2, h3 {
  font-family: var(--font-mono);
  font-weight: 600;
  line-height: 1.2;
}

.eyebrow {
  font-size:      0.6rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color:          var(--accent);
  margin-bottom:  1rem;
}

.section-label {
  font-size:      0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color:          var(--accent);
  margin-bottom:  0.85rem;
}

.tag-row {
  display:   flex;
  flex-wrap: wrap;
  gap:       0.4rem;
}

.tag {
  font-size:      0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding:        0.25rem 0.65rem;
  border:         1px solid var(--border-mid);
  color:          var(--muted);
  border-radius:  2px;
}


/* ── 3. NAVIGATION ────────────────────────────────────────── */

nav {
  position:         fixed;
  top:              0;
  left:             0;
  right:            0;
  height:           var(--nav-height);
  display:          flex;
  align-items:      center;
  justify-content:  space-between;
  padding:          0 var(--page-pad);
  background:       rgba(13, 13, 13, 0.95);
  border-bottom:    1px solid var(--border);
  z-index:          99;
}

.logo {
  font-weight:    600;
  font-size:      0.82rem;
  color:          var(--accent);
  cursor:         pointer;
  letter-spacing: 0.04em;
}

.nav-links {
  display: flex;
}

.nav-btn {
  font-family:    var(--font-mono);
  font-size:      0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color:          var(--muted);
  padding:        0.35rem 0.8rem;
  cursor:         pointer;
  background:     none;
  border:         none;
  transition:     color 0.15s;
}

.nav-btn:hover {
  color: var(--text);
}

.nav-btn.active {
  color: var(--accent);
}


/* ── 4. LAYOUT PRIMITIVES ─────────────────────────────────── */

#app {
  padding-top: var(--nav-height);
}

/* Pages are hidden by default; JS adds .active to show one */
.page {
  display: none;
}

.page.active {
  display: block;
}

/* Centered content wrapper */
.wrap {
  max-width: var(--max-width);
  margin:    0 auto;
  padding:   3rem var(--page-pad);
}

/* Section within a page */
.section {
  max-width: var(--max-width);
  margin:    0 auto;
  padding:   2.5rem var(--page-pad);
}

.section-title {
  font-size:      0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color:          var(--accent);
  margin-bottom:  1.5rem;
  display:        flex;
  align-items:    center;
  gap:            0.75rem;
}

/* Horizontal rule after section title */
.section-title::after {
  content:    '';
  flex:       1;
  height:     1px;
  background: var(--border);
}

/* Buttons */
.btn-row {
  display:   flex;
  gap:       0.75rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.btn {
  font-family:    var(--font-mono);
  font-size:      0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding:        0.5rem 1.2rem;
  border-radius:  2px;
  cursor:         pointer;
  transition:     all 0.15s;
  display:        inline-flex;
  align-items:    center;
}

.btn-fill {
  border:      1px solid var(--accent);
  color:       #111;
  background:  var(--accent);
  font-weight: 600;
}

.btn-fill:hover {
  background: #d4f050;
}

.btn-outline {
  border:     1px solid var(--border-mid);
  color:      var(--muted);
  background: none;
}

.btn-outline:hover {
  border-color: var(--accent);
  color:        var(--accent);
}


/* ── 5. HOME — HERO ───────────────────────────────────────── */

.hero {
  max-width:     var(--max-width);
  margin:        0 auto;
  padding:       4.5rem var(--page-pad) 2.5rem;
  border-bottom: 1px solid var(--border);
}

.name {
  font-weight:    600;
  font-size:      clamp(2rem, 5vw, 3.2rem);
  line-height:    1.05;
  letter-spacing: -0.02em;
  color:          #fff;
  margin-bottom:  0.4rem;
}

/* "Holder" in lighter weight */
.name em {
  font-style:  normal;
  font-weight: 300;
  color:       var(--muted);
}

.role {
  font-size:      0.75rem;
  color:          var(--muted);   /* #999 — clearly readable subtitle */
  letter-spacing: 0.06em;
  margin-bottom:  2rem;
}

.bio {
  max-width:   580px;
  font-size:   0.82rem;
  color:       var(--text);   /* readable body copy */
  line-height: 1.85;
  margin-bottom: 2rem;
  font-family: var(--font-sans);
  font-weight: 300;
}

.bio strong {
  color:       var(--text);
  font-family: var(--font-mono);
  font-weight: 500;
}


/* ── 6. HOME — AFFILIATIONS ───────────────────────────────── */

.affil-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap:                   1px;
  background:            var(--border);
}

.affil-card {
  background:     var(--bg-card);
  padding:        1.25rem;
  display:        flex;
  flex-direction: column;
  gap:            0.4rem;
}

.affil-org {
  font-size:      0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color:          var(--accent);
}

.affil-role {
  font-size:   0.8rem;
  color:       var(--text);
  font-weight: 500;
}

.affil-desc {
  font-size:   0.7rem;
  color:       var(--muted);   /* #999 — readable at this size */
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.6;
}


/* ── 7. HOME — PREVIEW LIST ───────────────────────────────── */

.preview-item {
  display:       flex;
  align-items:   center;
  gap:           1.25rem;
  padding:       0.85rem 0;
  border-bottom: 1px solid var(--border);
  cursor:        pointer;
  transition:    opacity 0.15s;
}

.preview-item:hover {
  opacity: 0.75;
}

.preview-num {
  font-size: 0.58rem;
  color:     var(--faint);
  min-width: 20px;
}

.preview-title {
  font-size:     0.82rem;
  font-weight:   500;
  color:         #fff;
  margin-bottom: 0.1rem;
}

.preview-excerpt {
  font-size:   0.68rem;
  color:       var(--muted);
  font-family: var(--font-sans);
}

.preview-arrow {
  margin-left: auto;
  color:       var(--accent);
  font-size:   0.75rem;
}


/* ── 8. PROJECT GRID (CARDS) ──────────────────────────────── */

.page-title {
  font-size:      clamp(1.5rem, 4vw, 2.4rem);
  font-weight:    600;
  letter-spacing: -0.02em;
  color:          #fff;
  margin-top:     0.4rem;
}

.page-subtitle {
  font-size:     0.75rem;
  color:         var(--muted);   /* #999 */
  margin-top:    0.65rem;
  font-family:   var(--font-sans);
  font-weight:   300;
}

.project-grid {
  max-width:             var(--max-width);
  margin:                0 auto;
  padding:               1.75rem;
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap:                   1px;
  background:            var(--border);
}

.project-card {
  background:     var(--bg-card);
  cursor:         pointer;
  transition:     background 0.15s;
  display:        flex;
  flex-direction: column;
  position:       relative;
  overflow:       hidden;
}

.project-card:hover {
  background: var(--bg-hover);
}

.project-card:hover .card-arrow {
  opacity:   1;
  transform: translate(0, 0);
}

/*
  CARD ILLUSTRATION AREA
  ───────────────────────
  This box sits at the top of each project card.
  It will show:
    - An <img> if the project has an `image` property
    - An inline SVG if the project has an `illo` property
    - A placeholder grid pattern if neither is set
*/
.card-illo {
  height:          180px;
  background:      var(--bg);
  border-bottom:   1px solid var(--border);
  overflow:        hidden;
  display:         flex;
  align-items:     center;
  justify-content: center;
  position:        relative;
}

/* Subtle dot-grid placeholder shown when no image/SVG is set */
.card-illo.empty {
  background-image:
    radial-gradient(circle, #2a2a2a 1px, transparent 1px);
  background-size: 20px 20px;
}

.card-illo img {
  width:      100%;
  height:     100%;
  object-fit: cover;
}

.card-illo svg {
  width:  100%;
  height: 100%;
}

.card-body {
  padding:        1.25rem;
  flex:           1;
  display:        flex;
  flex-direction: column;
  gap:            0.5rem;
}

.card-num {
  font-size:      0.58rem;
  letter-spacing: 0.2em;
  color:          var(--faint);
  text-transform: uppercase;
}

.card-title {
  font-size:   0.88rem;
  font-weight: 600;
  color:       #fff;
  line-height: 1.2;
}

.card-excerpt {
  font-size:   0.7rem;
  color:       var(--muted);   /* #999 — primary readable content on card */
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.65;
  flex:        1;
}

.card-tags {
  display:   flex;
  flex-wrap: wrap;
  gap:       0.3rem;
  margin-top: 0.4rem;
}

.card-tag {
  font-size:      0.55rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding:        0.15rem 0.45rem;
  border:         1px solid var(--border-mid);  /* slightly more visible than --faint */
  color:          var(--faint);
  border-radius:  1px;
}

.card-arrow {
  position:  absolute;
  bottom:    1.25rem;
  right:     1.25rem;
  font-size: 0.75rem;
  color:     var(--accent);
  opacity:   0;
  transform: translate(-3px, 3px);
  transition: all 0.15s;
}


/* ── 9. PROJECT DETAIL ────────────────────────────────────── */

.detail-back {
  max-width: var(--max-width);
  margin:    0 auto;
  padding:   1.75rem var(--page-pad) 0.5rem;
}

.back-btn {
  font-family:    var(--font-mono);
  font-size:      0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color:          var(--muted);
  cursor:         pointer;
  background:     none;
  border:         none;
  transition:     color 0.15s;
  padding:        0;
}

.back-btn:hover {
  color: var(--accent);
}

.detail-wrap {
  max-width: var(--max-width);
  margin:    0 auto;
  padding:   0.5rem var(--page-pad) 4rem;
}

/* Two-column layout: meta left, illustration right */
.detail-hero {
  display:       grid;
  grid-template-columns: 1fr 1fr;
  gap:           2.5rem;
  align-items:   start;
  padding:       1.75rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.detail-eyebrow {
  font-size:      0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color:          var(--accent);
  margin-bottom:  0.6rem;
}

.detail-title {
  font-size:      clamp(1.3rem, 3vw, 2.1rem);
  font-weight:    600;
  color:          #fff;
  line-height:    1.1;
  margin-bottom:  0.85rem;
  letter-spacing: -0.02em;
}

.detail-summary {
  font-size:   0.78rem;
  color:       var(--text);   /* this is the first thing you read on a project page */
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.8;
  margin-bottom: 1.2rem;
}

/*
  DETAIL ILLUSTRATION AREA
  ─────────────────────────
  Same as .card-illo but taller for the full detail view.
  JS will inject an <img>, inline SVG, or leave the placeholder.
*/
.detail-illo {
  background:      var(--bg-card);
  border:          1px solid var(--border);
  min-height:      240px;
  display:         flex;
  align-items:     center;
  justify-content: center;
  overflow:        hidden;
  position:        relative;
}

/* Dot-grid placeholder (shown when project has no image or illo) */
.detail-illo.empty {
  background-image:
    radial-gradient(circle, #2a2a2a 1px, transparent 1px);
  background-size: 24px 24px;
}

.detail-illo img {
  width:      100%;
  height:     100%;
  object-fit: cover;
}

.detail-illo svg {
  width:  100%;
  height: auto;
}

/* Placeholder label shown over the dot grid */
.illo-placeholder {
  font-size:      0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color:          var(--faint);
  text-align:     center;
  line-height:    1.8;
}

/* ── Rendered Markdown content ── */

.project-content {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size:   0.82rem;
  line-height: 1.88;
  color:       var(--text);   /* full article — needs to be easy to read at length */
  max-width:   680px;
}

.project-content h1,
.project-content h2,
.project-content h3 {
  font-family: var(--font-mono);
  font-weight: 600;
  color:       #fff;
  margin:      2.25rem 0 0.85rem;
  line-height: 1.2;
}

.project-content h1 { font-size: 1.3rem; }

.project-content h2 {
  font-size:     0.98rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

.project-content h3 {
  font-size: 0.85rem;
  color:     var(--accent);
}

.project-content p {
  margin-bottom: 1.1rem;
}

.project-content ul,
.project-content ol {
  margin: 0 0 1.1rem 1.4rem;
}

.project-content li {
  margin-bottom: 0.35rem;
}

.project-content code {
  font-family:   var(--font-mono);
  font-size:     0.75rem;
  background:    var(--bg-hover);
  border:        1px solid var(--border);
  padding:       0.12rem 0.35rem;
  border-radius: 2px;
  color:         var(--accent);
}

.project-content pre {
  background:    var(--bg-card);
  border:        1px solid var(--border);
  border-radius: 2px;
  padding:       1.1rem;
  overflow-x:    auto;
  margin-bottom: 1.25rem;
}

.project-content pre code {
  background:    none;
  border:        none;
  padding:       0;
  color:         #bbb;
  font-size:     0.74rem;
}

.project-content table {
  width:           100%;
  border-collapse: collapse;
  margin-bottom:   1.25rem;
  font-size:       0.76rem;
}

.project-content th {
  text-align:     left;
  border-bottom:  2px solid var(--border-mid);
  padding:        0.45rem 0.65rem;
  font-family:    var(--font-mono);
  font-size:      0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:          var(--muted);
}

.project-content td {
  border-bottom: 1px solid var(--border);
  padding:       0.45rem 0.65rem;
  color:         var(--muted);   /* slightly de-emphasised vs headings, but readable */
}

.project-content strong {
  color:       #fff;
  font-weight: 500;
}

.project-content hr {
  border:     none;
  border-top: 1px solid var(--border);
  margin:     2.25rem 0;
}

.katex-display {
  overflow-x: auto;
  padding:    0.4rem 0;
}


/* ── 10. ABOUT PAGE ───────────────────────────────────────── */

.about-grid {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   3.5rem;
  align-items:           start;
}

.about-heading {
  font-size:      1.6rem;
  font-weight:    600;
  color:          #fff;
  line-height:    1.15;
  letter-spacing: -0.02em;
  margin-bottom:  1.75rem;
}

.about-p {
  font-size:     0.79rem;
  color:         var(--text);   /* long-form reading — should be full brightness */
  font-family:   var(--font-sans);
  font-weight:   300;
  line-height:   1.88;
  margin-bottom: 1.1rem;
}

.about-p strong {
  color:       var(--text);
  font-family: var(--font-mono);
  font-weight: 500;
}

.about-block {
  margin-bottom: 2rem;
}

.contact-link {
  display:       flex;
  align-items:   center;
  font-size:     0.75rem;
  color:         var(--muted);
  padding:       0.45rem 0;
  border-bottom: 1px solid var(--border);
  transition:    color 0.15s;
}

.contact-link:hover {
  color: var(--accent);
}

.contact-link span {
  margin-left: auto;
  color:       var(--faint);
}

.edu-entry {
  padding:       1rem 0;
  border-bottom: 1px solid var(--border);
}

.edu-school {
  font-size:   0.82rem;
  color:       #fff;
  font-weight: 500;
}

.edu-degree {
  font-size:   0.7rem;
  color:       var(--muted);
  margin-top:  0.25rem;
}


/* ── 11. FOOTER ───────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding:    1.75rem;
  text-align: center;
  font-size:  0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:      var(--faint);
}


/* ── 12. ANIMATIONS ───────────────────────────────────────── */

/* Elements start invisible and slide up; JS adds .visible when in view */
.fade-in {
  opacity:    0;
  transform:  translateY(14px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.fade-in.visible {
  opacity:   1;
  transform: none;
}


/* ── 13. RESPONSIVE ───────────────────────────────────────── */

@media (max-width: 640px) {
  .detail-hero {
    grid-template-columns: 1fr;
  }

  /* Hide the illustration column on small screens */
  .detail-illo {
    display: none;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 3rem 1.25rem 2rem;
  }
}
