/* =========================================================================
   Resume — document, engineered
   References: Stripe docs, Notion engineering docs, Linear release notes,
   Vercel changelog, academic CV register.

   Principles
   - Document, not landing page
   - Reverse-chronological experience as the spine
   - Two-column rhythm (date | content), all bullets visible
   - Hairlines as the only structural device
   - Type-led hierarchy, not size-led
   - Calm scroll-driven interaction (4–6px translateY + opacity, 400ms)
   - Numerical emphasis via tabular figures, not size or color contrast
   ========================================================================= */

.resume-page .case-shell {
  display: block;
}

.r {
  max-width: 920px;
  margin: 0 auto;
  padding: 0;
}

/* Topstrip extension — quiet "Resume PDF ↓" affordance on the right */
.case-topstrip-pdf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 200ms ease-out;
}

.case-topstrip-pdf:hover,
.case-topstrip-pdf:focus-visible {
  color: var(--ink);
}

/* =========================================================================
   1 · DOCUMENT HEADER
   ========================================================================= */
.r-head {
  margin-top: 64px;
  padding-bottom: 32px;
  border-bottom: var(--hairline);
}

.r-name {
  font-family: 'Google Sans Flex', system-ui, -apple-system, sans-serif;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 12px 0;
  color: var(--ink);
  font-variation-settings: "ROND" 50;
}

.r-meta {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-2);
  margin: 0;
  line-height: 1.55;
  letter-spacing: 0.005em;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
}

.r-meta + .r-meta {
  margin-top: 6px;
}

.r-meta-dot {
  color: var(--g400, rgba(70, 55, 49, 0.3));
}

.r-meta-links a {
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: var(--g400);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 200ms ease-out, text-decoration-color 200ms ease-out;
}

.r-meta-links a:hover,
.r-meta-links a:focus-visible {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

/* =========================================================================
   Section primitives — number + slash + label
   ========================================================================= */
.r-section {
  padding: 56px 0;
  border-bottom: var(--hairline);
}

.r-section:last-of-type {
  border-bottom: none;
  padding-bottom: 80px;
}

.r-section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 28px;
  font-feature-settings: "tnum";
}

.r-section-num {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.r-section-divider {
  font-size: 11px;
  font-weight: 400;
  color: var(--g400, rgba(70, 55, 49, 0.4));
}

.r-section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* =========================================================================
   2 · ABOUT
   ========================================================================= */
.r-about {
  padding-top: 48px;
}

.r-about-body {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--ink);
  margin: 0;
  max-width: 70ch;
  letter-spacing: 0.005em;
}

.r-about-body strong {
  font-weight: 500;
}

/* Numerical emphasis — used inline through bullets and the about para.
   Tabular figures + slightly tighter letter-spacing give numbers the
   feel of "data" rather than prose. No color, no weight change. */
.r-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: -0.005em;
}

/* =========================================================================
   3 · LIST entries (Experience, Selected Projects)
       Two-column layout: date rail | content
   ========================================================================= */
.r-list {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}

/* Spine — vertical hairline at the right side of the date column,
   ~25px clear of the trailing edge of the date text. Gives the
   section visual continuity without overlapping the dates. */
.r-list::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 80px;
  width: 1px;
  background: rgba(0, 0, 0, 0.06);
  pointer-events: none;
}

.r-entry {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 32px;
  padding: 28px 0;
  border-top: var(--hairline);
  position: relative;
}

.r-entry:first-child {
  border-top: none;
  padding-top: 8px;
}

.r-entry:last-child {
  padding-bottom: 0;
}

.r-entry-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.005em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  line-height: 1.3;
  padding-top: 2px;
  position: relative;
  z-index: 1;
}

.r-entry-date-arrow {
  font-size: 11px;
  color: var(--g400, rgba(70, 55, 49, 0.4));
  font-weight: 400;
  margin-left: 1px;
}

.r-entry-body {
  min-width: 0;
}

.r-entry-title {
  font-family: 'Google Sans Flex', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 4px 0;
  font-variation-settings: "ROND" 50;
}

.r-entry-org {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-2);
  margin: 0 0 16px 0;
  line-height: 1.55;
  letter-spacing: 0.005em;
}

/* =========================================================================
   Bullets — visible always, hairline-style markers
   ========================================================================= */
.r-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.r-bullets li {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.62;
  color: var(--ink);
  letter-spacing: 0.005em;
  position: relative;
  padding-left: 16px;
  max-width: 75ch;
}

.r-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 6px;
  height: 1px;
  background: var(--g500);
}

/* =========================================================================
   4 · SKILLS — definition-list grid
   ========================================================================= */
.r-skills {
  margin: 0;
  display: grid;
  gap: 0;
}

.r-skills-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding: 14px 0;
  border-top: var(--hairline);
  align-items: baseline;
}

.r-skills-row:first-child {
  border-top: none;
}

.r-skills-row dt {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.005em;
  margin: 0;
}

.r-skills-row dd {
  font-size: 13px;
  font-weight: 400;
  color: var(--g700, var(--ink));
  margin: 0;
  line-height: 1.65;
  letter-spacing: 0.005em;
  max-width: 75ch;
}

/* =========================================================================
   5–6 · FOOTER ROW — Education + Community two-column
   ========================================================================= */
.r-footer-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}

.r-footer-col {
  min-width: 0;
}

.r-flat {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0;
}

.r-flat li {
  padding: 12px 0;
  border-top: var(--hairline);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--g700, var(--ink));
  letter-spacing: 0.005em;
}

.r-flat li:first-child {
  border-top: none;
  padding-top: 0;
}

.r-flat li strong {
  font-weight: 500;
  color: var(--ink);
  margin-right: 4px;
}

/* =========================================================================
   Scroll-reveal — calm, restrained
   - 6px Y translate + opacity
   - 450ms ease-out
   - Stagger via data-reveal-stagger="N" (50ms per step)
   ========================================================================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 450ms ease-out, transform 450ms ease-out;
  transition-delay: 0ms;
  will-change: opacity, transform;
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal][data-reveal-stagger="1"].is-revealed { transition-delay: 60ms; }
[data-reveal][data-reveal-stagger="2"].is-revealed { transition-delay: 110ms; }
[data-reveal][data-reveal-stagger="3"].is-revealed { transition-delay: 160ms; }
[data-reveal][data-reveal-stagger="4"].is-revealed { transition-delay: 210ms; }
[data-reveal][data-reveal-stagger="5"].is-revealed { transition-delay: 260ms; }
[data-reveal][data-reveal-stagger="6"].is-revealed { transition-delay: 310ms; }
[data-reveal][data-reveal-stagger="7"].is-revealed { transition-delay: 360ms; }

/* =========================================================================
   Responsive — stack to single column at <760px
   ========================================================================= */
@media (max-width: 760px) {
  .r {
    max-width: none;
  }

  .r-head {
    margin-top: 40px;
    padding-bottom: 24px;
  }

  .r-name {
    font-size: 22px;
  }

  .r-meta {
    font-size: 12px;
  }

  .r-section {
    padding: 40px 0;
  }

  .r-section-head {
    margin-bottom: 20px;
  }

  .r-about {
    padding-top: 32px;
  }

  .r-about-body {
    font-size: 14px;
    line-height: 1.65;
  }

  /* Spine hides on mobile (single-column entries) */
  .r-list::before {
    display: none;
  }

  /* Entries: stack date above content on mobile */
  .r-entry {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 22px 0;
  }

  .r-entry-date {
    flex-direction: row;
    gap: 8px;
    align-items: center;
  }

  .r-entry-date-arrow {
    transform: rotate(-90deg);
    margin: 0;
  }

  .r-entry-title {
    font-size: 15px;
  }

  /* Skills: stack label above content */
  .r-skills-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 0;
  }

  /* Footer: stack columns */
  .r-footer-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .r-footer-col + .r-footer-col {
    border-top: var(--hairline);
    padding-top: 32px;
    margin-top: 32px;
  }
}

/* =========================================================================
   Reduced motion — strip all animation
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
