/* ==========================================================================
   Design tokens
   The page is frosted glass held in front of the garden from the portrait:
   the backdrop is the photo itself, blurred, and every panel is a pane over it.
   ========================================================================== */

:root {
  --font-display: 'Unbounded', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Light theme: milky glass over a sunlit garden */
  --body-bg: #E4EBE5;
  --tint: rgba(232, 239, 234, 0.58);
  --glow-a: rgba(176, 186, 240, 0.45);
  --glow-b: rgba(178, 214, 140, 0.40);
  --ink: #14231A;
  --ink-soft: #3B4C41;
  --ink-faint: #5A6A5F;
  --accent: #2E6826;
  --accent-ink: #F4F8EF;
  --accent-soft: rgba(46, 104, 38, 0.10);
  --glass-bg: rgba(255, 255, 255, 0.50);
  --glass-solid: rgba(246, 249, 246, 0.94);
  --glass-border: rgba(255, 255, 255, 0.78);
  --glass-highlight: rgba(255, 255, 255, 0.95);
  --glass-shadow: 0 28px 60px -32px rgba(28, 52, 36, 0.40);
  --tag-bg: rgba(255, 255, 255, 0.55);
  --tag-border: rgba(20, 35, 26, 0.10);
  --rule: rgba(20, 35, 26, 0.12);
  --row-hover: rgba(255, 255, 255, 0.55);
  --logo-filter: none;

  --radius-pane: 32px;
  --radius-panel: 24px;
  --radius-row: 18px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Dark theme: smoked glass in the shade of the same trees */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --body-bg: #0F1D16;
    --tint: rgba(9, 20, 14, 0.74);
    --glow-a: rgba(132, 144, 232, 0.22);
    --glow-b: rgba(150, 200, 104, 0.18);
    --ink: #EDF2E7;
    --ink-soft: #C2CCBD;
    --ink-faint: #94A190;
    --accent: #B4DA8A;
    --accent-ink: #12210E;
    --accent-soft: rgba(180, 218, 138, 0.12);
    --glass-bg: rgba(255, 255, 255, 0.065);
    --glass-solid: rgba(20, 34, 26, 0.95);
    --glass-border: rgba(255, 255, 255, 0.14);
    --glass-highlight: rgba(255, 255, 255, 0.20);
    --glass-shadow: 0 28px 60px -28px rgba(0, 0, 0, 0.60);
    --tag-bg: rgba(255, 255, 255, 0.06);
    --tag-border: rgba(255, 255, 255, 0.12);
    --rule: rgba(255, 255, 255, 0.10);
    --row-hover: rgba(255, 255, 255, 0.07);
    --logo-filter: invert(1) brightness(1.05);
  }
}

:root[data-theme="dark"] {
  --body-bg: #0F1D16;
  --tint: rgba(9, 20, 14, 0.74);
  --glow-a: rgba(132, 144, 232, 0.22);
  --glow-b: rgba(150, 200, 104, 0.18);
  --ink: #EDF2E7;
  --ink-soft: #C2CCBD;
  --ink-faint: #94A190;
  --accent: #B4DA8A;
  --accent-ink: #12210E;
  --accent-soft: rgba(180, 218, 138, 0.12);
  --glass-bg: rgba(255, 255, 255, 0.065);
  --glass-solid: rgba(20, 34, 26, 0.95);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-highlight: rgba(255, 255, 255, 0.20);
  --glass-shadow: 0 28px 60px -28px rgba(0, 0, 0, 0.60);
  --tag-bg: rgba(255, 255, 255, 0.06);
  --tag-border: rgba(255, 255, 255, 0.12);
  --rule: rgba(255, 255, 255, 0.10);
  --row-hover: rgba(255, 255, 255, 0.07);
  --logo-filter: invert(1) brightness(1.05);
}

/* ==========================================================================
   Reset & base
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  background-color: var(--body-bg);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

body.no-scroll {
  overflow: hidden;
}

main {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

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

ul, ol {
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.skip-link:focus {
  top: 16px;
}

/* ==========================================================================
   Backdrop & glass
   ========================================================================== */

.backdrop {
  position: fixed;
  inset: -12%;
  z-index: -1;
  background: url("Images/main page photo compressed.webp") center 40% / cover no-repeat;
  filter: blur(64px) saturate(1.35);
  transform: translateZ(0);
}

.backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(42% 38% at 82% 18%, var(--glow-a), transparent 70%),
    radial-gradient(38% 34% at 12% 78%, var(--glow-b), transparent 70%),
    linear-gradient(var(--tint), var(--tint));
  transition: background 0.4s var(--ease);
}

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background: var(--glass-solid);
  }
}

/* ==========================================================================
   Header
   ========================================================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: 14px;
}

.nav-bar {
  background: color-mix(in srgb, var(--glass-solid) 55%, transparent);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 8px 8px 8px 20px;
  border-radius: 999px;
}

.logo {
  height: 38px;
  width: auto;
  filter: var(--logo-filter);
  user-select: none;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.nav-link:hover {
  color: var(--ink);
  background: var(--row-hover);
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--tag-border);
  background: var(--tag-bg);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.2s var(--ease);
}

.icon-btn:hover {
  background: var(--row-hover);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

/* Show the icon of the theme you'd switch to */
.theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: block;
  }

  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: none;
  }
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
}

.hamburger-line {
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ==========================================================================
   Buttons & links
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.2;
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 12px 28px -14px var(--accent);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, var(--ink));
}

.btn-glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  color: var(--ink);
}

.btn-glass:hover {
  background: var(--row-hover);
}

.text-link {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.text-link:hover {
  text-decoration-thickness: 2px;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero-section {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4.5rem);
}

.hero-container {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5rem);
}

.hero-location {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.4rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.hero-location svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6.4vw, 4.75rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin-bottom: 1.5rem;
}

.hero-role {
  max-width: 30ch;
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  font-weight: 500;
  line-height: 1.35;
  margin-bottom: 1.1rem;
}

.hero-bio {
  max-width: 54ch;
  color: var(--ink-soft);
  margin-bottom: 2.2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-visual {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 440px;
}

.portrait {
  padding: 10px;
  border-radius: 40px;
  overflow: hidden;
}

.portrait-img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 31px;
  user-select: none;
  animation: defog 1.6s var(--ease) both;
}

/* The page's one orchestrated moment: the glass clears over the portrait */
@keyframes defog {
  from {
    filter: blur(24px) saturate(0.7);
    transform: scale(1.08);
    opacity: 0.55;
  }
  to {
    filter: none;
    transform: none;
    opacity: 1;
  }
}

.award-chip {
  /* Sits over the sharp photo, so it needs a denser pane than the rest */
  background: color-mix(in srgb, var(--glass-solid) 78%, transparent);
  position: absolute;
  left: -28px;
  bottom: 34px;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-row);
  max-width: 270px;
}

.award-chip strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.award-chip span {
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--ink-soft);
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
  scroll-margin-top: 80px;
}

.section-header {
  max-width: 60ch;
  margin-bottom: 2rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
}

.section-subtitle {
  color: var(--ink-soft);
}

.panel-title {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.panel-text {
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tags li {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--tag-border);
  background: var(--tag-bg);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
}

/* ==========================================================================
   About
   ========================================================================== */

.about-panel {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  padding: clamp(1.75rem, 5vw, 3.25rem);
  border-radius: var(--radius-pane);
}

.about-text .section-title {
  margin-bottom: 1.2rem;
}

.about-text p {
  max-width: 62ch;
  color: var(--ink-soft);
}

.about-text p + p {
  margin-top: 1rem;
}

.about-text .lead {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
}

.facts {
  align-self: center;
}

.fact {
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
}

.fact:last-child {
  border-bottom: 1px solid var(--rule);
}

.fact dt {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.2rem;
}

.fact dd {
  font-size: 0.98rem;
  line-height: 1.45;
}

/* ==========================================================================
   Skills
   ========================================================================== */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.skill-panel {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1.75rem;
  border-radius: var(--radius-panel);
}

.skill-icon {
  width: 30px;
  height: 30px;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.skill-panel .tags {
  padding-top: 0.4rem;
}

/* ==========================================================================
   Projects
   ========================================================================== */

.projects-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.1rem;
}

.project-panel {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.75rem;
  border-radius: var(--radius-panel);
}

.project-feature {
  grid-row: span 2;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border-radius: var(--radius-pane);
  background:
    radial-gradient(90% 70% at 100% 0%, var(--accent-soft), transparent 70%),
    var(--glass-bg);
}

/* Retrieval pipeline: a real sequence, drawn as a connected rail */
.rag-flow {
  counter-reset: step;
  display: flex;
  flex-direction: column;
  margin: 1.4rem 0 0.6rem;
}

.rag-flow li {
  counter-increment: step;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0 0 1.2rem 3rem;
}

.rag-flow li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.1rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--tag-border);
  background: var(--tag-bg);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.rag-flow li::after {
  content: '';
  position: absolute;
  left: calc(1rem - 0.5px);
  top: 2.1rem;
  bottom: 0.2rem;
  width: 1px;
  background: var(--rule);
}

.rag-flow li:last-child {
  padding-bottom: 0;
}

.rag-flow li:last-child::after {
  display: none;
}

.rag-flow li:last-child::before {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
}

.rag-flow strong {
  font-weight: 600;
}

.rag-flow span {
  font-size: 0.93rem;
  color: var(--ink-soft);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--tag-border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.chip-accent {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
}

.chip-icon {
  width: 13px;
  height: 13px;
}

.project-title {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.project-title a:hover {
  color: var(--accent);
}

.project-feature .project-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-top: auto;
}

.project-desc {
  color: var(--ink-soft);
  max-width: 58ch;
}

.project-feature .project-desc {
  font-size: 1.1rem;
}

.project-link {
  margin-top: auto;
  padding-top: 0.3rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  align-self: flex-start;
}

.project-link:hover {
  text-decoration-thickness: 2px;
}

.mini-projects {
  display: grid;
  gap: 1.1rem;
  margin-top: 1.1rem;
}

.mini-project {
  border-radius: var(--radius-row);
  transition: background-color 0.2s var(--ease);
}

.mini-project:hover {
  background: var(--row-hover);
}

.mini-project a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.15rem 1.4rem;
  border-radius: inherit;
}

.mini-title {
  font-weight: 600;
}

.mini-desc {
  font-size: 0.93rem;
  color: var(--ink-soft);
}

/* ==========================================================================
   Experience timeline
   ========================================================================== */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 10rem 1fr auto;
  gap: 1.5rem;
  align-items: start;
  padding: 1.6rem 1.75rem;
  border-radius: var(--radius-panel);
}

.timeline-date {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-faint);
  padding-top: 0.15rem;
}

.timeline-award .timeline-date {
  color: var(--accent);
}

.timeline-org {
  font-weight: 500;
  color: var(--accent);
  margin: 0.1rem 0 0.55rem;
}

.timeline-body .panel-text {
  max-width: 64ch;
}

.award-figure {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 4rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.05em;
  color: var(--accent);
  text-align: right;
}

.award-figure sup {
  font-size: 0.38em;
  letter-spacing: 0;
  vertical-align: top;
  margin-left: 0.08em;
}

.award-figure span {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink-soft);
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-panel {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(1.75rem, 5vw, 3.25rem);
  border-radius: var(--radius-pane);
}

.contact-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin-bottom: 1rem;
}

.contact-text {
  color: var(--ink-soft);
  max-width: 42ch;
}

.contact-list li + li {
  border-top: 1px solid var(--rule);
}

.contact-row {
  display: grid;
  grid-template-columns: 22px 6.5rem 1fr;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 0.9rem;
  border-radius: 14px;
  transition: background-color 0.2s var(--ease);
}

a.contact-row:hover {
  background: var(--row-hover);
}

.contact-row svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.contact-label {
  font-size: 0.92rem;
  color: var(--ink-faint);
}

.contact-value {
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  padding: 2rem 0 2.5rem;
  font-size: 0.9rem;
  color: var(--ink-faint);
}

.footer-container {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

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

  .hero-visual {
    order: -1;
    justify-self: start;
    max-width: 360px;
  }

  .award-chip {
    left: auto;
    right: -16px;
  }

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

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

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

  .project-feature {
    grid-row: auto;
  }
}

@media (max-width: 760px) {
  .mobile-menu-btn {
    display: inline-flex;
  }

  /* The bar's backdrop-filter stops nested panes blurring the page, so the menu is near-opaque */
  .nav-links {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.6rem;
    border-radius: var(--radius-panel);
    border: 1px solid var(--glass-border);
    background: linear-gradient(var(--glass-solid), var(--glass-solid)), var(--body-bg);
    box-shadow: var(--glass-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
  }

  .nav-links.nav-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-link {
    padding: 0.85rem 1rem;
    font-size: 1.05rem;
    border-radius: 14px;
  }

  .logo {
    height: 34px;
  }

  .timeline-item {
    grid-template-columns: 1fr auto;
    gap: 0.4rem 1rem;
    padding: 1.4rem;
  }

  .timeline-date {
    grid-column: 1 / -1;
  }

  .timeline-body {
    grid-column: 1;
  }

  .award-figure {
    grid-column: 2;
    grid-row: 2;
    font-size: 2.6rem;
  }
}

@media (max-width: 480px) {
  .hero-visual {
    max-width: none;
  }

  /* Landscape crop keeps the name above the fold on phones */
  .portrait-img {
    aspect-ratio: 4 / 3;
    object-position: center 25%;
  }

  /* Below the photo rather than over the face */
  .award-chip {
    position: relative;
    right: auto;
    bottom: auto;
    max-width: none;
    margin: -30px 12px 0;
  }

  .hero-section {
    padding-top: 2rem;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .skill-panel,
  .project-panel {
    padding: 1.4rem;
  }

  .contact-row {
    grid-template-columns: 20px 1fr;
    gap: 0.15rem 0.8rem;
    padding: 0.85rem 0.4rem;
  }

  .contact-row svg {
    grid-row: span 2;
  }

  .footer-container {
    flex-direction: column;
    gap: 0.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
