/* ==========================================================================
   Miao Lab — Main Stylesheet

   QUICK REFERENCE FOR EDITORS
   ─────────────────────────────────────────────────────────────────────────
   • To change a COLOR: edit the hex value in :root below (e.g. --color-red)
   • To change a FONT: edit --font-serif or --font-sans in :root
   • To change the site MAX WIDTH: edit --max-width in :root
   • Fonts are loaded from Google Fonts — see the <link> tags in each HTML file

   FILE STRUCTURE (what styles what)
   ─────────────────────────────────────────────────────────────────────────
   1.  Design tokens (colors, fonts, spacing)
   2.  Base / reset
   3.  Buttons
   4.  Chess pawn divider
   5.  Header & navigation
   6.  Homepage video hero
   7.  Homepage hero text block
   8.  Page hero — plain text header (used on People, Lab Fun, Contact)
   9.  Image hero — full-bleed image header (used on Research)
   10. Content sections (.block)
   11. Homepage philosophy / Evolution two-column layout
   12. Research cards
   13. People grid & cards
   14. Lab Fun gallery
   15. Contact
   16. Footer
   17. Utility classes
   ========================================================================== */


/* ==========================================================================
   1. Design Tokens
   Change colors and fonts here — they cascade everywhere automatically.
   ========================================================================== */

:root {
  /* --- Colors --- */
  --color-cream:      #ffffff;        /* page background (white) */
  --color-cream-deep: #f4f3f0;        /* alternate section background (off-white) */
  --color-ink:        #1c1a17;        /* primary text / dark backgrounds */
  --color-ink-soft:   #4a4540;        /* secondary / body text */
  --color-red:        #a32424;        /* accent — headings, labels, active states */
  --color-red-deep:   #7a1818;        /* accent hover state */
  --color-teal:       #2f6f6a;        /* unused accent, available if needed */
  --color-gold:       #c8a24a;        /* dot separator color in video hero tagline */
  --color-line:       #e3e0da;        /* borders and dividers */

  /* --- Fonts ---
     Loaded from Google Fonts (see <link> in each HTML <head>).
     --font-serif  → used for all headings and the main lede paragraph
     --font-sans   → used for body text, nav, labels, captions */
  --font-serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-sans:  "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* --- Layout --- */
  --max-width: 1120px; /* maximum width of all page content */
  --radius:    2px;    /* border-radius on cards, buttons, images */
}


/* ==========================================================================
   2. Base / Reset
   ========================================================================== */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-ink);
  background: var(--color-cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--color-red-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Heading scale — all headings use the serif font */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--color-ink);
  margin: 0 0 0.5em;
}
h1 { font-size: 2.75rem; }
h2 { font-size: 2.1rem; }
h3 { font-size: 1.55rem; }
h4 { font-size: 1.2rem; }

/* Centered, max-width wrapper used on every page */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Small all-caps label above section titles */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-red);
}


/* ==========================================================================
   3. Buttons
   Usage: <a class="btn">Default</a>  or  <a class="btn btn-primary">Red</a>
   ========================================================================== */

.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  padding: 0.75em 1.7em;
  border-radius: var(--radius);
  border: 1px solid var(--color-ink);
  color: var(--color-ink);
  background: transparent;
  transition: all 0.15s ease;
}
.btn:hover { background: var(--color-ink); color: var(--color-cream); text-decoration: none; }

/* Red filled button (used for "Meet the Lab" CTA) */
.btn-primary { background: var(--color-red); border-color: var(--color-red); color: #fff; }
.btn-primary:hover { background: var(--color-red-deep); border-color: var(--color-red-deep); color: #fff; }


/* ==========================================================================
   4. Chess Pawn Divider
   A centered decorative divider with two pawn SVGs flanking a label.
   Usage in HTML:
     <div class="pawn-divider" aria-hidden="true">
       <svg ...>...</svg>
       <span class="eyebrow">Section Title</span>
       <svg ...>...</svg>
     </div>
   ========================================================================== */

.pawn-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 2.5rem 0;
  color: var(--color-red);
}
/* Horizontal lines on either side of the divider */
.pawn-divider::before,
.pawn-divider::after {
  content: "";
  height: 1px;
  width: 80px;
  background: var(--color-line);
}
.pawn-divider svg { width: 22px; height: 22px; fill: currentColor; }
.pawn-divider .eyebrow { font-size: 0.96rem; letter-spacing: 0.22em; }


/* ==========================================================================
   5. Header & Navigation
   The nav is sticky — it stays at the top while the user scrolls.
   ========================================================================== */

.site-header {
  position: sticky;
  top: 10;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px); /* frosted-glass effect */
  border-bottom: 1px solid var(--color-line);
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo + lab name on the left */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 20px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-ink);
}
.nav-brand:hover { text-decoration: none; }
.nav-brand img { height: 80px; width: auto; }

/* Navigation links on the right */
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--color-ink-soft);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--color-red);
  text-decoration: none;
  border-bottom-color: var(--color-red);
}
/* External links (Publications) get an arrow indicator */
.nav-links a.external::after {
  content: "↗";
  font-size: 0.75em;
  margin-left: 3px;
}

/* Hamburger button — hidden on desktop, shown on mobile */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 8px 10px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-ink);
  margin: 4px 0;
}

/* Mobile nav — collapses into a dropdown below the header */
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-cream);
    border-bottom: 1px solid var(--color-line);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 24px 16px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 10px 0; }
}


/* ==========================================================================
   6. Homepage Video Hero
   Full-bleed video section — the first thing visitors see.
   The video file lives in img/headers/.
   To resize: adjust max-height (e.g. 50vh = shorter, 80vh = taller).
   aspect-ratio matches the video's native dimensions (256×230 px).
   ========================================================================== */

.video-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 250 / 230; /* matches native video dimensions */
  max-height: 80vh; /* caps height so it doesn't fill the whole screen */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.video-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Dark gradient overlay so the text on top remains readable */
.video-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17, 15, 13, 0.25) 0%, rgba(17, 15, 13, 0.55) 100%);
}
.video-hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
}
/* Tagline text shown on top of the dark video */
.hero-tagline.on-dark { color: #fdfbf6; }
.hero-tagline.on-dark .sep { color: var(--color-gold); }


/* ==========================================================================
   7. Hero Text Block
   The large introductory paragraph block used on Home and Research pages.
   .hero-lede  → the big serif paragraph(s)
   .hero-tagline → the small all-caps label above it
   ========================================================================== */

.hero {
  padding: 56px 0;
  text-align: center;
  background: var(--color-cream);
}
.hero-tagline {
  font-family: var(--font-sans);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
  margin-bottom: 0;
}
.hero-tagline .sep { color: var(--color-red); margin: 0 0.6em; }

/* Main introductory paragraph — large serif, left-aligned within a centered container */
.hero-lede {
  max-width: 860px;
  margin: 0 auto 1.4em;
  font-family: var(--font-serif);
  font-size: 1.65rem;  /* increase or decrease to change lede text size */
  font-weight: 400;
  line-height: 1.85;
  color: var(--color-ink);
  text-align: left;
}
.hero-lede:last-child { margin-bottom: 0; }


/* ==========================================================================
   8. Plain Page Hero
   Simple text-only header used on People, Lab Fun, and Contact pages.
   ========================================================================== */

.page-hero {
  padding: 56px 0 36px;
  text-align: center;
  border-bottom: 1px solid var(--color-line);
  background: var(--color-cream-deep);
}
.page-hero h1 { font-size: 3rem; letter-spacing: -0.025em; }
.page-hero p  { color: var(--color-ink-soft); max-width: 640px; margin: 0 auto; }


/* ==========================================================================
   9. Image Hero
   Full-bleed image header used on the Research page.
   Header images live in img/headers/.

   If you replace the header image with one of different dimensions,
   update the aspect-ratio value to match: width / height.
   (Current image: granuloma-timecourse.png, 1992 × 432 px)
   ========================================================================== */

.img-hero {
  position: relative;
  width: 100%;
  height: clamp(400px, 58vh, 680px); /* fixed banner height — works for any photo ratio */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-ink);
}
.img-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Dark gradient so overlaid text stays readable */
.img-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17, 15, 13, 0.3) 0%, rgba(17, 15, 13, 0.65) 100%);
}
.img-hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 24px;
}
.img-hero-content .eyebrow { color: rgba(253, 251, 246, 0.75); }
.img-hero-content h1 { color: #fdfbf6; font-size: 3.3rem; letter-spacing: -0.025em; margin-bottom: 0; }

/* Thin caption bar that sits flush below the hero image */
.hero-caption {
  background: var(--color-ink);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.hero-caption .container {
  display: flex;
  justify-content: flex-end;
  padding-top: 7px;
  padding-bottom: 8px;
}
.hero-caption p {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(253, 251, 246, 0.42);
  font-style: italic;
  letter-spacing: 0.02em;
}


/* ==========================================================================
   10. Content Sections
   .block       → standard white section  (padding top + bottom)
   .block.alt   → same but cream-deep background (alternating sections)
   .block.dark  → dark ink background (used for the "Meet the Lab" CTA)
   ========================================================================== */

section.block { padding: 64px 0; }
section.block.alt  { background: var(--color-cream-deep); }
section.block.dark { background: var(--color-ink); color: #ece6d8; }
section.block.dark h2,
section.block.dark h3 { color: #fff; }


/* ==========================================================================
   11. Philosophy / Evolution Two-Column Layout
   Used on the homepage Evolution section.
   Left column is text (2fr), right column is the image (1.5fr).
   To flip image left / text right: swap the column order in the HTML.
   ========================================================================== */

.philosophy-grid {
  display: grid;
  grid-template-columns: 2fr 1.5fr; /* text:image ratio — adjust to taste */
  gap: 64px;
  align-items: start;
}
.philosophy-grid figure { margin: 0; }
.philosophy-grid figcaption {
  font-size: 0.93rem;
  color: var(--color-ink-soft);
  margin-top: 10px;
  text-align: center;
  font-style: italic;
}
.philosophy-text h3 { font-size: 1.8rem; letter-spacing: -0.02em; }
.philosophy-text p  { color: var(--color-ink-soft); }

/* Pull quote with a red left border */
blockquote.lit {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-ink);
  border-left: 2px solid var(--color-red);
  padding-left: 20px;
  margin: 1.6rem 0;
}

/* Stack to single column on narrow screens */
@media (max-width: 820px) {
  .philosophy-grid { grid-template-columns: 1fr; }
}


/* ==========================================================================
   12. Research Cards
   Each research direction is a two-column card: image | text (or text | image).
   Even-numbered cards automatically flip the image to the right side.
   To add a new research direction: copy an <article class="research-card"> block
   in research.html and update the image src, title, and description text.
   ========================================================================== */

.research-list { display: flex; flex-direction: column; gap: 0; }

.research-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 56px 0;
  border-bottom: 1px solid var(--color-line);
}
.research-card:last-child { border-bottom: none; }

/* Even cards: move the image to the right by changing its order */
.research-card:nth-child(even) .research-media { order: 2; }

/* Large faint number in the top-left of each card */
.research-number {
  font-family: var(--font-serif);
  font-size: 4.5rem;
  font-weight: 300;
  letter-spacing: -0.04em;
  color: var(--color-red);
  opacity: 0.18;
  line-height: 1;
  margin-bottom: 0.1rem;
}
.research-media img {
  border-radius: var(--radius);
  border: 1px solid var(--color-line);
}
/* Dashed box shown when no image is available yet */
.research-media.placeholder {
  aspect-ratio: 4 / 3;
  border: 1.5px dashed var(--color-line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-ink-soft);
  font-size: 0.98rem;
  background: var(--color-cream-deep);
  text-align: center;
  padding: 1rem;
}
.research-card p.placeholder-text { color: var(--color-ink-soft); font-style: italic; }

/* Stack to single column on narrow screens */
@media (max-width: 820px) {
  .research-card,
  .research-card:nth-child(even) .research-media { grid-template-columns: 1fr; order: 0; }
}


/* ==========================================================================
   13. Milestones Timeline
   Each milestone is a two-column row: large faint number | text + link.
   To add a milestone: copy a <article class="milestone"> block in
   milestones.html and paste it before the closing </div>.
   ========================================================================== */

.milestone-list { display: flex; flex-direction: column; }

.milestone {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 48px;
  align-items: start;
  padding: 56px 0;
  border-bottom: 1px solid var(--color-line);
}
.milestone:last-child { border-bottom: none; }

/* Large faint ordinal number — matches the research-number style */
.milestone-number {
  font-family: var(--font-serif);
  font-size: 4.5rem;
  font-weight: 300;
  letter-spacing: -0.04em;
  color: var(--color-red);
  opacity: 0.18;
  line-height: 1;
}

.milestone-body h2 { margin-bottom: 0.75rem; }
.milestone-body p { color: var(--color-ink-soft); margin: 0 0 1rem; }
.milestone-body p:last-of-type { margin-bottom: 0; }

/* "Read the paper →" inline link at the end of each milestone */
.milestone-link {
  display: inline-block;
  margin-top: 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-red);
}
.milestone-link:hover { text-decoration: underline; }

@media (max-width: 620px) {
  .milestone { grid-template-columns: 1fr; gap: 12px; padding: 40px 0; }
  .milestone-number { font-size: 3rem; }
}


/* ==========================================================================
   14. People Grid & Cards
   Cards auto-fill the row. The PI uses .people-grid--single to stay centered.

   To add a new lab member:
   1. Create a folder:  img/people/[Name]/
   2. Add a photo:      img/people/[Name]/photo.jpg
   3. Copy a <div class="people-card"> block in people.html and fill in details.

   Photo aspect ratios:
   • Default (.people-photo)             → square (1:1)
   • Landscape photo (.people-photo--landscape) → 3:2
   ========================================================================== */

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
}
/* Single-card row (e.g. PI) — kept narrow and centered */
.people-grid--single {
  grid-template-columns: minmax(300px, 400px);
  justify-content: center;
}

.people-card {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
}
.people-photo {
  aspect-ratio: 1;             /* square crop by default */
  background: var(--color-cream-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-ink-soft);
  border-bottom: 1px solid var(--color-line);
}
.people-photo svg { width: 46%; height: 46%; opacity: 0.5; } /* placeholder silhouette */
.people-photo img { width: 100%; height: 100%; object-fit: cover; }
.people-photo--landscape { aspect-ratio: 3 / 2; } /* use for landscape photos */

.people-info { padding: 16px 14px 20px; }
.people-info .name { font-family: var(--font-serif); font-weight: 600; font-size: 1.3rem; letter-spacing: -0.01em; }
.people-info .role { font-size: 0.8rem; color: var(--color-red); margin: 3px 0 10px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; }
.people-info .bio  { font-size: 0.95rem; color: var(--color-ink-soft); line-height: 1.6; }

/* Section headings within the People page (Principal Investigator / Lab Members / Alumni) */
.people-section-title {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
  margin: 56px 0 22px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-line);
}
.people-section-title:first-of-type { margin-top: 0; }

/* Alumni line list — simpler than cards: one row per person */
.alumni-list { list-style: none; margin: 0; padding: 0; }
.alumni-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-line);
}
.alumni-row:first-child { border-top: 1px solid var(--color-line); }
.alumni-name { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 600; }
.alumni-now  { font-size: 0.9rem; color: var(--color-ink-soft); flex-shrink: 0; }


/* ==========================================================================
   14. Lab Fun — Photo Feed
   Two-column grid, newest photo first (top-left).

   To add a photo:
   1. Drop the file into img/lab-fun/
   2. Copy one <article class="moment"> block in lab-fun.html
   3. Paste it BEFORE the first existing <article> (so it appears at the top)
   4. Update: src, alt, date, title, and description
   ========================================================================== */

.moments-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 52px 40px;
}
.moment img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
  background: var(--color-cream-deep);
}
.moment-placeholder {
  aspect-ratio: 4 / 3;
  background: var(--color-cream-deep);
  border-radius: var(--radius);
  border: 1.5px dashed var(--color-line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-ink-soft);
  font-size: 0.93rem;
}
.moment-caption { padding: 12px 0 0; }
.moment-date {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-red);
  margin-bottom: 4px;
}
.moment-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 4px;
}
.moment p { font-size: 0.93rem; color: var(--color-ink-soft); margin: 0; line-height: 1.55; }

/* Single photo in its own section: span full width, center, and cap at a readable size */
.moments-grid .moment:only-child {
  grid-column: 1 / -1;
  max-width: 820px;
  justify-self: center;
  width: 100%;
}

@media (max-width: 640px) {
  .moments-grid { grid-template-columns: 1fr; gap: 40px; }
}


/* ==========================================================================
   15. Contact Page
   Two-column layout: info card on the left, embedded map on the right.
   ========================================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
}
.contact-card {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 28px;
}
.contact-card h3 { font-size: 1.2rem; }
.contact-card .field { margin-bottom: 1.1rem; }
.contact-card .field .label {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-red);
  margin-bottom: 2px;
}
.contact-card .field .value { color: var(--color-ink-soft); }

.map-frame {
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.map-frame iframe { width: 100%; height: 100%; border: 0; }

@media (max-width: 820px) {
  .contact-grid { grid-template-columns: 1fr; }
}


/* ==========================================================================
   16. Footer
   ========================================================================== */

.site-footer {
  background: var(--color-cream-deep);
  color: var(--color-ink-soft);
  padding: 44px 0 26px;
  border-top: 1px solid var(--color-line);
}
.footer-support {
  font-size: 0.93rem;
  color: var(--color-ink-soft);
  font-style: italic;
  max-width: 680px;
  margin: 0 0 24px;
  line-height: 1.6;
}
.footer-logos {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-line);
}
.footer-logos img { height: 48px; width: auto; opacity: 0.8; transition: opacity 0.15s ease; }
.footer-logos img:hover { opacity: 1; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.93rem;
}
.footer-bottom a    { color: var(--color-red-deep); }
.footer-bottom .addr { color: var(--color-ink-soft); }


/* ==========================================================================
   17. Resources Page
   Two stacked cards, each linking to a lab tool.
   ========================================================================== */

.resource-list { display: flex; flex-direction: column; gap: 40px; }

.resource-card {
  border: 1px solid var(--color-line);
  border-top: 3px solid var(--color-red);
  border-radius: var(--radius);
  padding: 40px 44px;
  background: #fff;
}
.resource-card .resource-number {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-red);
  margin-bottom: 10px;
}
.resource-card h2 { font-size: 1.75rem; margin-bottom: 14px; }
.resource-card p  { color: var(--color-ink-soft); line-height: 1.7; max-width: 680px; margin: 0 0 28px; }
.resource-links { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.resource-links .btn-launch {
  display: inline-block;
  background: var(--color-red);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 10px 22px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s ease;
}
.resource-links .btn-launch:hover { background: var(--color-red-deep); text-decoration: none; }
.resource-links .btn-github {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-ink-soft);
  text-decoration: none;
  border: 1px solid var(--color-line);
  padding: 9px 18px;
  border-radius: var(--radius);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.resource-links .btn-github:hover { border-color: var(--color-ink); color: var(--color-ink); text-decoration: none; }

.resource-developer {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
}

@media (max-width: 640px) {
  .resource-card { padding: 28px 24px; }
}


/* ==========================================================================
   18. Utility Classes
   ========================================================================== */

.text-center { text-align: center; }
