:root {
  --bg: #f0ede8;
  --paper: #faf8f5;
  --paper-soft: #f2efe9;
  --text: #1a1714;
  --muted: #5c5650;
  --line: #e0d9d0;
  --accent: #1e4535;
  --accent-soft: #e4ede8;
  --accent-mid: #2e6650;
  --shadow: 0 2px 8px rgba(26, 23, 20, 0.06), 0 16px 48px rgba(26, 23, 20, 0.07);
  --shadow-sm: 0 1px 3px rgba(26, 23, 20, 0.07), 0 4px 12px rgba(26, 23, 20, 0.05);
  --radius-lg: 16px;
  --radius-md: 10px;
  --page-width: 1140px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(160deg, #f5f1eb 0%, #ede8e0 100%);
  font-family: "Aptos", "Segoe UI", "Helvetica Neue", sans-serif;
}

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

a,
button {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  min-height: 100vh;
}

.page-glow {
  display: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(240, 237, 232, 0.9);
  border-bottom: 1px solid var(--line);
}

.header-inner,
.resume-page {
  width: min(calc(100% - 2rem), var(--page-width));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.header-brand strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.header-brand span {
  color: var(--muted);
  font-size: 0.88rem;
}

.header-link {
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 140ms ease, color 140ms ease;
}

.header-link:hover {
  background: var(--accent);
  color: #fff;
}

.resume-page {
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
}

/* ── Hero ────────────────────────────────────────────── */

.resume-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(220px, 0.75fr);
  gap: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: inline-block;
  padding: 0.22rem 0.65rem;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-kicker,
.mini-period,
.experience-period {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.resume-hero h1,
.section-head h2 {
  margin: 0;
  font-family: "Georgia", "Iowan Old Style", serif;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.resume-hero h1 {
  margin-top: 0.6rem;
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
  line-height: 1;
  color: var(--text);
}

.hero-title {
  margin: 0.85rem 0 0;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--accent-mid);
}

.hero-summary,
.mini-card p,
.experience-org,
.bullet-list li,
.feature-project p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.hero-summary {
  max-width: 80ch;
  margin-top: 1rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 9rem;
  padding: 0.72rem 1.25rem;
  border: 1.5px solid transparent;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 4px 12px rgba(26, 58, 92, 0.18);
}

.button-primary {
  background: var(--accent);
  color: #ffffff;
}

.button-primary:hover {
  background: var(--accent-mid);
}

.button-secondary {
  background: var(--paper-soft);
  border-color: var(--line);
  color: var(--text);
}

/* ── Hero meta ───────────────────────────────────────── */

.hero-meta {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.meta-row {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper-soft);
}

.meta-row span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.meta-row strong,
.meta-row a {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--accent);
}

/* ── Grid ────────────────────────────────────────────── */

.resume-grid {
  display: grid;
  grid-template-columns: minmax(250px, 0.78fr) minmax(0, 1.22fr);
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.resume-sidebar,
.resume-main {
  min-width: 0;
}

.sidebar-section,
.main-section {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper-soft);
}

.sidebar-section + .sidebar-section,
.main-section + .main-section {
  margin-top: 1rem;
}

.sidebar-section h2,
.main-section h2,
.mini-card h3,
.experience-card h3,
.feature-project h3 {
  margin: 0;
}

.sidebar-section h2,
.main-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

.section-head {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  font-family: "Georgia", "Iowan Old Style", serif;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  line-height: 1;
}

/* ── Lists ───────────────────────────────────────────── */

.plain-list,
.bullet-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.plain-list li,
.bullet-list li {
  position: relative;
  padding-left: 1rem;
}

.plain-list li::before,
.bullet-list li::before {
  position: absolute;
  top: 0.6rem;
  left: 0;
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

/* ── Sidebar cards ───────────────────────────────────── */

.skills-stack {
  display: grid;
  gap: 0.6rem;
}

.mini-card,
.experience-card,
.feature-project {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.mini-card h3,
.experience-card h3,
.feature-project h3 {
  margin-bottom: 0.3rem;
  font-size: 0.93rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

/* ── Experience ──────────────────────────────────────── */

.experience-list {
  display: grid;
  gap: 0.75rem;
}

.experience-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.experience-head {
  min-width: 0;
}

.experience-org {
  margin-top: 0.18rem;
}

.experience-period {
  flex: none;
  padding: 0.24rem 0.6rem;
  border: 1px solid var(--accent-soft);
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Projects ────────────────────────────────────────── */

.feature-project {
  display: grid;
  gap: 1rem;
}

.project-case-grid {
  display: grid;
  gap: 0.75rem;
}

.project-case {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.project-case h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.project-case-videos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.feature-subtitle {
  margin-bottom: 0.4rem;
  color: var(--accent-mid);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ── Video tiles ─────────────────────────────────────── */

.video-tile {
  position: relative;
  display: block;
  overflow: hidden;
  padding: 0.28rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper-soft);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.video-tile:hover,
.video-tile:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(26, 58, 92, 0.14);
  outline: none;
}

.video-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  background: #dde3ea;
}

.video-play {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: calc(100% - 1rem);
  padding: 0.24rem 0.42rem;
  border-radius: 5px;
  background: rgba(13, 27, 42, 0.76);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.2;
}

/* ── Keyframes ───────────────────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes underlineGrow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ── Hero entrance ───────────────────────────────────── */

.resume-hero h1 {
  animation: fadeUp 600ms cubic-bezier(0.22, 1, 0.36, 1) 80ms both;
}

.hero-title {
  animation: fadeUp 600ms cubic-bezier(0.22, 1, 0.36, 1) 200ms both;
}

.hero-summary {
  animation: fadeUp 600ms cubic-bezier(0.22, 1, 0.36, 1) 320ms both;
}

.eyebrow {
  animation: fadeIn 400ms ease 0ms both;
}

.hero-meta {
  animation: slideInRight 600ms cubic-bezier(0.22, 1, 0.36, 1) 180ms both;
}

/* ── Section title underline ─────────────────────────── */

.section-head {
  position: relative;
}

.section-head::after {
  content: "";
  display: block;
  height: 2px;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
  margin-top: 0.6rem;
}

.reveal.is-visible .section-head::after {
  transform: scaleX(1);
}

/* ── Card hover lift ─────────────────────────────────── */

.experience-card,
.mini-card,
.project-case {
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.experience-card:hover,
.mini-card:hover,
.project-case:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 23, 20, 0.1);
}

/* ── Reveal animation ────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 500ms cubic-bezier(0.22, 1, 0.36, 1), transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 980px) {
  .resume-hero,
  .resume-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .resume-page {
    padding: 1.25rem;
  }

  .experience-top {
    flex-direction: column;
  }

  .project-case-videos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .header-inner,
  .resume-page {
    width: min(calc(100% - 1rem), var(--page-width));
  }

  .button,
  .action-row a {
    width: 100%;
  }

  .project-case-videos {
    grid-template-columns: 1fr;
  }
}
