/* ============================================================
   Janidu Pabasara — Portfolio Stylesheet
   Theme: Golden + Brown + Yellow + White · Glass + Aurora
   Tech: Vanilla CSS3 (custom properties, Grid, Flexbox)
   ============================================================ */

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

/* ============================================================
   Design Tokens
   ============================================================ */
:root {
  /* Brand — golden / amber / brown */
  --clr-gold:       #c8932f;
  --clr-gold-light: #e0b057;
  --clr-amber:      #f0b429;
  --clr-brown:      #7a5230;
  --clr-brown-deep: #4a3620;

  /* Light theme (soft warm white) */
  --clr-bg:         #faf8f4;
  --clr-bg-soft:    #f1ece2;
  --clr-surface:    #ffffff;
  --clr-surface-2:  #f8f5ef;
  --clr-text:       #2b2118;
  --clr-text-muted: #6f5f4d;
  --clr-border:     #ece0cb;
  --clr-primary:        #b5811f;
  --clr-primary-strong: #946615;

  /* Glass + aurora */
  --glass-bg:     rgba(255, 255, 255, 0.62);
  --glass-border: rgba(200, 147, 47, 0.28);
  --glass-blur:   14px;
  --aurora-1: rgba(240, 180, 41, 0.09);
  --aurora-2: rgba(122, 82, 48, 0.06);
  --aurora-3: rgba(224, 176, 87, 0.08);
  --sym-color: #2b2d3a;  /* floating code-symbol colour (neutral) */
  --bar-mid: 24%;        /* side-bar intensity at the middle */

  /* Gradients */
  --gradient-gold: linear-gradient(135deg, #f0b429 0%, #c8932f 48%, #7a5230 100%);
  --gradient-soft: linear-gradient(135deg, #e0b057 0%, #c8932f 100%);

  /* Typography */
  --ff-heading: 'Sora', system-ui, sans-serif;
  --ff-body:    'Inter', system-ui, -apple-system, sans-serif;
  --fs-sm:   0.875rem;
  --fs-base: 1rem;
  --fs-lg:   1.125rem;
  --fs-xl:   1.5rem;
  --fs-2xl:  clamp(1.75rem, 1.2rem + 2.4vw, 2.5rem);
  --fs-3xl:  clamp(2.5rem, 1.4rem + 5vw, 4.5rem);
  --fw-light: 300; --fw-regular: 400; --fw-medium: 500;
  --fw-semibold: 600; --fw-bold: 700; --fw-extra: 800;

  /* Spacing */
  --space-xs: 0.25rem; --space-sm: 0.5rem;  --space-md: 1rem;
  --space-lg: 1.5rem;  --space-xl: 2rem;    --space-2xl: 3rem;
  --space-3xl: 4.5rem;

  /* Layout */
  --max-width: 1140px;
  --header-h: 4.25rem;

  /* Radii & shadows */
  /* Tightened ~40% from 0.5/0.875/1.25. Crisper without going square;
     --radius-pill stays, so avatars, chips and social buttons stay round. */
  --radius-sm: 0.3rem; --radius-md: 0.5rem; --radius-lg: 0.75rem; --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(74, 54, 32, 0.08);
  --shadow-md: 0 8px 24px rgba(74, 54, 32, 0.12);
  --shadow-lg: 0 18px 50px rgba(74, 54, 32, 0.18);
  --shadow-glow: 0 8px 30px rgba(200, 147, 47, 0.28);

  --transition: 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  --clr-bg:         #1b1c20;   /* soft dark gray, not pitch black */
  --clr-bg-soft:    #232429;
  --clr-surface:    #25262c;
  --clr-surface-2:  #2c2e35;
  --clr-text:       #f1efe9;
  --clr-text-muted: #a9aab4;
  --clr-border:     #3a3b43;
  --clr-primary:        #e0b057;
  --clr-primary-strong: #f0c878;

  --glass-bg:     rgba(40, 42, 49, 0.55);
  --glass-border: rgba(224, 176, 87, 0.18);
  --aurora-1: rgba(240, 180, 41, 0.06);
  --aurora-2: rgba(122, 82, 48, 0.07);
  --aurora-3: rgba(224, 176, 87, 0.05);
  --sym-color: #cdd0db;
  --bar-mid: 28%;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 8px 36px rgba(224, 176, 87, 0.25);
}

/* ============================================================
   Base
   ============================================================ */
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  font-family: var(--ff-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--clr-text);
  background-color: var(--clr-bg);
  overflow-x: hidden;
  transition: background-color var(--transition), color var(--transition);
}

/* Aurora background layer */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(40% 50% at 18% 12%, var(--aurora-1), transparent 70%),
    radial-gradient(45% 55% at 85% 18%, var(--aurora-3), transparent 70%),
    radial-gradient(50% 60% at 50% 95%, var(--aurora-2), transparent 70%);
  background-size: 180% 180%;
  animation: aurora 22s ease-in-out infinite alternate;
  pointer-events: none;
}
/* Subtle grain/vignette */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(120% 120% at 50% 0%, transparent 55%, rgba(74, 54, 32, 0.06));
  pointer-events: none;
}

@keyframes aurora {
  0%   { background-position: 0% 0%, 100% 0%, 50% 100%; }
  100% { background-position: 30% 40%, 60% 30%, 40% 70%; }
}

h1, h2, h3, h4 {
  font-family: var(--ff-heading);
  line-height: 1.15;
  font-weight: var(--fw-bold);
}

a { color: var(--clr-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--clr-primary-strong); }
img { display: block; max-width: 100%; height: auto; }
ul { list-style: none; }

::selection { background: var(--clr-gold); color: #fff; }

/* ============================================================
   Utilities
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.section { padding-block: var(--space-3xl); position: relative; }
.section--alt { background: color-mix(in srgb, var(--clr-bg-soft) 60%, transparent); }

.section__head { text-align: center; margin-bottom: var(--space-2xl); }
.section__eyebrow {
  display: inline-block;
  font-family: var(--ff-heading);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clr-primary);
  margin-bottom: var(--space-sm);
}
.section__title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-extra);
}
.section__title .accent { /* gradient text */
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.text-gradient {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Glass surface helper */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.8rem 1.6rem;
  font-family: var(--ff-heading);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition),
              background-color var(--transition), color var(--transition);
}
.btn:active { transform: translateY(0) scale(0.98); }

.btn--primary {
  background: var(--gradient-gold);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn--primary:hover { color: #fff; transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.btn--outline {
  background: transparent;
  color: var(--clr-primary);
  border-color: var(--clr-primary);
}
.btn--outline:hover {
  background: var(--clr-primary);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.btn--ghost {
  background: var(--clr-surface-2);
  color: var(--clr-text);
  border-color: var(--clr-border);
}
.btn--ghost:hover { color: var(--clr-primary); border-color: var(--clr-primary); transform: translateY(-3px); }

/* ============================================================
   Header / Nav
   ============================================================ */
#header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 100;
  transition: background-color var(--transition), box-shadow var(--transition),
              backdrop-filter var(--transition), border-color var(--transition);
  border-bottom: 1px solid transparent;
}
#header.scrolled {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border-bottom-color: var(--glass-border);
  box-shadow: var(--shadow-sm);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  font-family: var(--ff-heading);
  font-size: var(--fs-xl);
  font-weight: var(--fw-extra);
  letter-spacing: -0.02em;
}
.nav__logo span { color: var(--clr-text); }
.nav__logo .dot { color: var(--clr-primary); }

.nav__list { display: flex; gap: var(--space-lg); align-items: center; }
.nav__link {
  position: relative;
  font-family: var(--ff-heading);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--clr-text);
  padding: 0.25rem 0;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  border-radius: 2px;
  background: var(--gradient-gold);
  transition: width var(--transition);
}
.nav__link:hover { color: var(--clr-primary); }
.nav__link:hover::after,
.nav__link.active::after { width: 100%; }
.nav__link.active { color: var(--clr-primary); }

.nav__actions { display: flex; align-items: center; gap: var(--space-sm); }

.nav__theme-toggle,
.nav__hamburger {
  display: grid;
  place-items: center;
  width: 2.4rem; height: 2.4rem;
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-pill);
  font-size: var(--fs-base);
  color: var(--clr-text);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), transform var(--transition);
}
.nav__theme-toggle:hover,
.nav__hamburger:hover { color: var(--clr-primary); border-color: var(--clr-primary); transform: translateY(-2px); }
.nav__hamburger { display: none; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: var(--header-h);
  text-align: center;
}
.hero__content { max-width: 820px; margin-inline: auto; }

.hero__greeting {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  margin-bottom: var(--space-lg);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
}
.hero__flag {
  width: 1.45em; height: auto;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
  vertical-align: -0.18em;
}
.hero__greeting .wave { animation: wave 2.4s ease-in-out infinite; transform-origin: 70% 70%; }
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); }
}

.hero__title {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-extra);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
}
.hero__title .text-gradient { display: inline-block; }

.hero__role {
  font-family: var(--ff-heading);
  font-size: clamp(1.1rem, 0.8rem + 1.4vw, 1.6rem);
  font-weight: var(--fw-semibold);
  color: var(--clr-text);
  margin-bottom: var(--space-md);
  min-height: 1.6em;
}
.hero__role .typed { color: var(--clr-primary); }
.hero__cursor {
  display: inline-block;
  width: 2px; height: 1.1em;
  margin-left: 2px;
  background: var(--clr-primary);
  vertical-align: -0.15em;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__tagline {
  font-size: var(--fs-lg);
  color: var(--clr-text-muted);
  max-width: 640px;
  margin: 0 auto var(--space-xl);
}

.hero__cta { display: flex; gap: var(--space-md); justify-content: center; flex-wrap: wrap; }

.hero__cvmeta {
  display: flex; align-items: center; gap: 0.45rem;
  justify-content: center;
  margin-top: var(--space-sm);
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
}
.hero__cvmeta i { color: var(--clr-primary); }

.hero__socials {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  margin-top: var(--space-xl);
}
.hero__socials a {
  display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem;
  font-size: var(--fs-lg);
  color: var(--clr-text-muted);
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-pill);
  transition: all var(--transition);
}
.hero__socials a:hover {
  color: #fff;
  background: var(--gradient-gold);
  border-color: transparent;
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.hero__scroll {
  position: absolute;
  bottom: 1.5rem; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ============================================================
   About
   ============================================================ */
.about__grid { display: block; }

.about__text > p:first-child {
  font-size: var(--fs-lg);
  max-width: 68ch;
}
.about__text p { color: var(--clr-text-muted); margin-bottom: var(--space-md); }
.about__text strong { color: var(--clr-text); font-weight: var(--fw-semibold); }

.about__facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  margin-block: 0 var(--space-lg);
}

/* Two-column split for highlights + CV block on wide screens */
.about__lower {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 360px);
  gap: var(--space-2xl);
  align-items: start;
}
.about__fact {
  display: flex; gap: 0.65rem; align-items: flex-start;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
}
.about__fact i { color: var(--clr-primary); margin-top: 0.2rem; }
.about__fact span { font-size: var(--fs-sm); }
.about__fact b { display: block; font-family: var(--ff-heading); font-size: var(--fs-sm); color: var(--clr-text); }
.about__fact small { color: var(--clr-text-muted); }

/* CV download card — closes the "always latest version" loop */
.cvcard {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-lg);
}
.cvcard__eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--ff-heading);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--clr-primary);
  margin-bottom: 0.75rem;
}
.cvcard__btn { width: 100%; justify-content: center; margin-top: 0.35rem; }
.cvcard__meta {
  display: flex; align-items: center; gap: 0.45rem;
  margin: 0.85rem 0 0 !important;
  font-size: var(--fs-xs, 0.8rem);
  color: var(--clr-text-muted);
}

/* Labels the block before the project name, so the section doesn't open cold
   on "Code Sage AI" with no indication of what it is. Same treatment as
   .section__eyebrow, tighter margin because it sits inside a card. */
.about__now-eyebrow {
  display: inline-block;
  font-family: var(--ff-heading);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clr-primary);
  margin-bottom: 0.45rem;
}
.about__now-title {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--ff-heading); font-size: var(--fs-lg); font-weight: var(--fw-semibold);
  margin-bottom: 0.3rem;
}
.about__now-title i { color: var(--clr-primary); }
.about__now-tag {
  color: var(--clr-text-muted);
  margin-bottom: var(--space-md);
}
/* Sub-points sit under the title, so indent them to read as its children. */
.about__now .about__highlights { padding-left: 1.9rem; }

.about__highlights { display: grid; gap: 0.6rem; margin-bottom: var(--space-lg); }
.about__highlights li { display: flex; gap: 0.6rem; align-items: flex-start; color: var(--clr-text-muted); }
.about__highlights i { color: var(--clr-primary); margin-top: 0.3rem; }

/* ============================================================
   Skills — grouped rows of logo chips
   ============================================================ */
.skills__groups { display: grid; gap: var(--space-xl); }
.skills__group-title {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--ff-heading);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-md);
}
.skills__group-title i { color: var(--clr-primary); }

.skills__chips { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.95rem 0.4rem 0.45rem;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  border-radius: var(--radius-pill);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  color: var(--clr-text);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  cursor: default;
}
.chip__logo, .chip__fa {
  display: grid; place-items: center;
  width: 1.9em; height: 1.9em;
  padding: 0.28em;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}
.chip__logo { object-fit: contain; }
.chip__fa { color: var(--brand, var(--clr-primary)); font-size: 1.05em; }
.chip:hover {
  transform: translateY(-3px);
  border-color: var(--brand, var(--clr-primary));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand, var(--clr-primary)) 28%, transparent);
}

/* ============================================================
   Experience timeline
   ============================================================ */
.timeline { position: relative; max-width: 880px; margin-inline: auto; }
.timeline::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(var(--clr-primary), var(--clr-border));
}

.tl-item { position: relative; width: 50%; padding: 0 var(--space-2xl) var(--space-xl) 0; }
.tl-item:nth-child(even) { left: 50%; padding: 0 0 var(--space-xl) var(--space-2xl); }

.tl-dot {
  position: absolute; top: 0.4rem; right: -10px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--gradient-gold);
  color: #fff; font-size: 0.6rem;
  box-shadow: var(--shadow-glow);
  z-index: 2;
}
.tl-item:nth-child(even) .tl-dot { right: auto; left: -10px; }

.tl-card {
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.tl-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--clr-primary); }

.tl-date {
  display: inline-block;
  font-family: var(--ff-heading);
  font-size: 0.78rem; font-weight: var(--fw-semibold);
  color: var(--clr-primary);
  margin-bottom: 0.4rem;
}
.tl-kind {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.7rem; font-weight: var(--fw-semibold);
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--clr-text-muted);
  margin-left: 0.5rem;
}
.tl-title { font-size: var(--fs-base); font-weight: var(--fw-bold); margin-bottom: 0.15rem; }
.tl-org { font-size: var(--fs-sm); color: var(--clr-primary); margin-bottom: 0.5rem; }
.tl-desc { font-size: var(--fs-sm); color: var(--clr-text-muted); }

/* ============================================================
   Achievements
   ============================================================ */
.achv__featured {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-xl);
}
.achv__photo {
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
}
.achv__photo img { width: 100%; height: 100%; object-fit: cover; }
.achv__rank {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.9rem; margin-bottom: var(--space-md);
  font-family: var(--ff-heading); font-weight: var(--fw-semibold); font-size: var(--fs-sm);
  border-radius: var(--radius-pill);
  background: var(--gradient-gold); color: #fff;
  box-shadow: var(--shadow-glow);
}
.achv__title { font-size: var(--fs-xl); font-weight: var(--fw-bold); margin-bottom: 0.35rem; }
.achv__meta { font-size: var(--fs-sm); color: var(--clr-primary); margin-bottom: var(--space-md); font-weight: var(--fw-medium); }
.achv__desc { color: var(--clr-text-muted); font-size: var(--fs-sm); }

.achv__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-md); }
.achv__card {
  display: flex; gap: 0.85rem; align-items: flex-start;
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.achv__card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--clr-primary); }
.achv__card i { font-size: 1.5rem; color: var(--clr-primary); }
.achv__card h4 { font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.achv__card p { font-size: var(--fs-sm); color: var(--clr-text-muted); }

/* ============================================================
   Contact
   ============================================================ */
.contact__panel {
  max-width: 62rem;
  margin-inline: auto;
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
}
.contact__status {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.4rem 0.9rem;
  margin-bottom: var(--space-md);
  font-family: var(--ff-heading); font-size: var(--fs-sm); font-weight: var(--fw-medium);
  color: var(--clr-text);
  background: color-mix(in srgb, #2fbf71 12%, transparent);
  border: 1px solid color-mix(in srgb, #2fbf71 38%, transparent);
  border-radius: var(--radius-pill);
}
.contact__pulse {
  position: relative;
  width: 0.5rem; height: 0.5rem; flex-shrink: 0;
  border-radius: 50%;
  background: #2fbf71;
}
/* Expanding halo, drawn on a pseudo-element so the dot itself stays crisp. */
.contact__pulse::after {
  content: ""; position: absolute; inset: 0;
  border-radius: 50%;
  background: #2fbf71;
  animation: contactPulse 2.4s ease-out infinite;
}
@keyframes contactPulse {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(3.2); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .contact__pulse::after { animation: none; }
}

.contact__lede {
  color: var(--clr-text-muted);
  margin-bottom: var(--space-xl);
  max-width: 48rem;
}

.contact__cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }

.mailcard {
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  color: var(--clr-text);
  transition: all var(--transition);
}
.mailcard:hover {
  border-color: var(--clr-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.mailcard__icon {
  display: grid; place-items: center; flex-shrink: 0;
  width: 2.75rem; height: 2.75rem;
  border-radius: var(--radius-md);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  color: var(--clr-primary);
  font-size: var(--fs-lg);
}
.mailcard__body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.mailcard__label {
  font-size: var(--fs-sm);
  font-family: var(--ff-heading);
  font-weight: var(--fw-medium);
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.mailcard__value {
  font-size: var(--fs-base);
  overflow-wrap: anywhere;
}
.mailcard__go {
  margin-left: auto; flex-shrink: 0;
  color: var(--clr-text-muted);
  transition: transform var(--transition), color var(--transition);
}
.mailcard:hover .mailcard__go { color: var(--clr-primary); transform: translateX(4px); }

.contact__foot {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--space-lg);
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--clr-border);
}
.contact__loc { display: flex; align-items: center; gap: 0.6rem; color: var(--clr-text-muted); }
.contact__loc i { color: var(--clr-primary); }

.contact__socials { display: flex; gap: var(--space-md); }
.contact__socials a {
  display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem;
  font-size: var(--fs-lg);
  color: var(--clr-text-muted);
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-pill);
  transition: all var(--transition);
}
.contact__socials a:hover { color: #fff; background: var(--gradient-gold); border-color: transparent; transform: translateY(-4px); box-shadow: var(--shadow-glow); }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  padding-block: var(--space-xl);
  border-top: 1px solid var(--clr-border);
  background: color-mix(in srgb, var(--clr-bg-soft) 50%, transparent);
}
.footer__inner { display: flex; flex-wrap: wrap; gap: var(--space-md); align-items: center; justify-content: space-between; }
.footer p { font-size: var(--fs-sm); color: var(--clr-text-muted); }
.footer__socials { display: flex; gap: var(--space-md); }
.footer__socials a { color: var(--clr-text-muted); font-size: var(--fs-lg); transition: color var(--transition), transform var(--transition); }
.footer__socials a:hover { color: var(--clr-primary); transform: translateY(-3px); }

/* Scroll-to-top */
.to-top {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 90;
  width: 2.8rem; height: 2.8rem;
  display: grid; place-items: center;
  border: none; cursor: pointer;
  border-radius: var(--radius-pill);
  background: var(--gradient-gold); color: #fff;
  box-shadow: var(--shadow-glow);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { transform: translateY(-3px); }

/* ============================================================
   Decorative background (floating code symbols + fixed side bars)
   ============================================================ */
.bg-decor { position: fixed; inset: 0; z-index: -2; pointer-events: none; }

/* Floating code symbols — faint, neutral, slow up/down drift */
.code-field { position: absolute; inset: 0; overflow: hidden; }
.code-sym {
  position: absolute;
  font-family: 'Consolas', 'SFMono-Regular', 'Courier New', monospace;
  font-weight: 600;
  color: var(--sym-color);
  opacity: var(--op, 0.08);
  font-size: var(--sz, 18px);
  line-height: 1;
  user-select: none;
  animation: floatSym var(--dur, 14s) ease-in-out var(--delay, 0s) infinite alternate;
  will-change: transform;
}
@keyframes floatSym {
  from { transform: translateY(0) rotate(0deg); }
  to   { transform: translateY(var(--amp, 30px)) rotate(var(--rot, 0deg)); }
}

/* Fixed vertical accent bars in the brand colour — softer in the middle */
.bg-bar {
  position: fixed; top: 0; bottom: 0;
  width: 4px; z-index: 70;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    var(--clr-gold) 0%,
    color-mix(in srgb, var(--clr-gold) var(--bar-mid), transparent) 50%,
    var(--clr-gold) 100%);
  box-shadow: 0 0 16px color-mix(in srgb, var(--clr-gold) 40%, transparent);
}
.bg-bar--left  { left: 0; }
.bg-bar--right { right: 0; }

/* ============================================================
   Hero — split layout with framed portrait
   ============================================================ */
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--space-2xl);
  align-items: center;
  width: 100%;
}
.hero__text { text-align: left; }
.hero__text .hero__tagline { margin-inline: 0; }
.hero__text .hero__cta,
.hero__text .hero__cvmeta,
.hero__text .hero__socials { justify-content: flex-start; }

.hero__visual { position: relative; display: grid; place-items: center; min-height: 440px; }
.hero__visual::before {
  content: ""; position: absolute; z-index: 0;
  width: 320px; height: 380px;
  border-radius: 46% 54% 48% 52% / 55% 50% 50% 45%;
  background: var(--gradient-gold);
  filter: blur(50px); opacity: 0.42;
  animation: blob 9s ease-in-out infinite;
}
@keyframes blob { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-16px) scale(1.06); } }

/* Coffee tagline */
.hero__coffee {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: -0.3rem; margin-bottom: var(--space-md);
  font-family: var(--ff-heading); font-weight: var(--fw-semibold); font-size: var(--fs-sm);
}
.hero__coffee i { color: var(--clr-gold); }
.hero__coffee span {
  background: var(--gradient-gold);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Circular animated portrait */
.hero__photo-frame {
  position: relative; z-index: 1;
  display: grid; place-items: center;
  width: min(330px, 78vw);
  aspect-ratio: 1;
}
.hero__photo-frame::before {
  content: ""; position: absolute; inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--clr-amber), var(--clr-gold), var(--clr-brown), var(--clr-gold-light), var(--clr-amber));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px));
  animation: spin 9s linear infinite;
}
.hero__photo {
  position: relative; z-index: 1;
  width: calc(100% - 28px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 5px solid var(--clr-bg);
  box-shadow: var(--shadow-lg);
  animation: floatPhoto 6s ease-in-out infinite;
}
@keyframes floatPhoto { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.hero__photo img { width: 100%; height: 100%; object-fit: cover; }
.hero__photo.is-missing img { display: none; }
.hero__photo-fallback {
  position: absolute; inset: 0; display: none; place-items: center;
  font-family: var(--ff-heading); font-weight: var(--fw-extra); font-size: 5rem;
  color: #fff; background: var(--gradient-gold);
}
.hero__photo.is-missing .hero__photo-fallback { display: grid; }

.hero__badge {
  position: absolute; z-index: 2;
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-family: var(--ff-heading); font-size: 0.78rem; font-weight: var(--fw-semibold);
  white-space: nowrap;
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
}
.hero__badge i { color: var(--clr-primary); }
.hero__badge--1 { top: 7%;    left: -2%;  animation: float 5s ease-in-out infinite; }
.hero__badge--3 { bottom: 1%;  left: 10%;  animation: float 5.5s ease-in-out infinite 0.4s; }
/* Deliberately still — it labels the portrait, so it should not drift. */
.hero__badge--se { top: 6%;   right: -1%; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ============================================================
   Projects — responsive card grid
   Every card shows title, description, tech tags and repo link
   without interaction: a recruiter scanning for ten seconds
   should not have to hover to learn anything.
   ============================================================ */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.pcard {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.pcard:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--clr-primary);
}

/* ---- Cover ---- */
.pcard__cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--gradient-gold);
}
.pcard__cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s ease;
}
.pcard:hover .pcard__cover img { transform: scale(1.05); }

.pcard__cover-fallback {
  position: absolute; inset: 0;
  display: none; place-items: center;
  font-size: 2.4rem; color: #fff;
}
.pcard__cover.is-missing img { display: none; }
.pcard__cover.is-missing .pcard__cover-fallback { display: grid; }

.pcard__badge {
  position: absolute; top: 0.7rem; left: 0.7rem; z-index: 2;
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.28rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.7rem; font-weight: var(--fw-semibold);
  color: #fff;
  background: rgba(20, 16, 10, 0.72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.pcard__badge i { color: var(--clr-primary); }

/* ---- Body ---- */
.pcard__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--space-md);
}
.pcard__title {
  font-family: var(--ff-heading);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--clr-text);
  line-height: 1.25;
  margin-bottom: 0.2rem;
}
.pcard__sub {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--clr-primary);
  margin-bottom: 0.6rem;
}
.pcard__desc {
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
  margin-bottom: var(--space-md);
}

.pcard__tags {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  list-style: none;
  margin: 0 0 var(--space-md);
  padding: 0;
}
.pcard__tags li {
  font-size: 0.7rem;
  font-weight: var(--fw-medium);
  padding: 0.24rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  color: var(--clr-text-muted);
}

/* Foot pinned to the bottom so every card lines up */
.pcard__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-top: auto;
}

/* Contributor avatars — bottom-right, rendered from assets/data/contributors.json.
   Each avatar links to that person's GitHub profile. */
.pcard__team {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}
.pcard__team:empty { display: none; }

.pcard__avatar {
  display: block;
  width: 28px; height: 28px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--clr-surface-2);
  margin-left: -9px;             /* overlap leftwards so the last sits flush right */
  background: var(--clr-surface);
  opacity: 0.8;
  transition: opacity var(--transition), transform var(--transition);
}
.pcard__avatar:first-child { margin-left: 0; }
.pcard__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard__avatar:hover,
.pcard__avatar:focus-visible {
  opacity: 1;
  transform: translateY(-3px);
  border-color: var(--clr-primary);
  z-index: 2;
}
.pcard__team-more {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  margin-left: -9px;
  border: 2px solid var(--clr-surface-2);
  background: var(--clr-surface);
  color: var(--clr-text-muted);
  font-size: 0.62rem; font-weight: var(--fw-semibold);
}

.pcard__link {
  display: inline-flex; align-items: center; gap: 0.45rem;
  flex-shrink: 0;
  font-family: var(--ff-heading);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  color: #fff; background: var(--gradient-gold);
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-pill);
}
.pcard__link:hover { color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-glow); }

/* Private repo — same slot as the link, but clearly not clickable */
.pcard__link--private {
  background: none;
  border: 1px dashed var(--clr-border);
  color: var(--clr-text-muted);
  cursor: default;
}
.pcard__link--private:hover { transform: none; box-shadow: none; color: var(--clr-text-muted); }

/* ============================================================
   My Gallery — bento mosaic
   4 columns: [1][1][hero 2x2] / [wide 2][hero] / [1][1][1][1]
   Auto-placement resolves that from the span rules alone, so the
   HTML stays in chronological order with no explicit coordinates.
   ============================================================ */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: clamp(8rem, 13vw, 11.5rem);
  gap: var(--space-md);
}
.bento__tile {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--clr-border);
  background: var(--clr-surface-2);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.bento__tile--hero { grid-column: span 2; grid-row: span 2; }
.bento__tile--wide { grid-column: span 2; }

.bento__tile:hover {
  transform: translateY(-4px);
  border-color: var(--clr-primary);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--clr-primary) 22%, transparent);
}

.bento__img {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
/* A tall photo in the 3.2:1 wide tile loses roughly 60% of its height to
   object-fit. Centred, that spend goes half on ceiling and half on the people
   at the front. Biasing the window down drops the dead space above instead, so
   the same 184px shows every face rather than a roof. */
.bento__tile--focus-low .bento__img { object-position: center 65%; }

.bento__tile:hover .bento__img { transform: scale(1.06); }
.bento__img.is-missing { display: none; }

/* Sits under the photo; only visible if the image fails to load. */
.bento__ph {
  position: absolute; inset: 0; z-index: 0;
  display: grid; place-items: center;
  color: #fff; font-size: 1.8rem;
  background: var(--gradient-gold);
}

.bento__cap {
  position: absolute; inset: auto 0 0 0; z-index: 2;
  display: flex; flex-direction: column; gap: 0.15rem;
  padding: 1.4rem 0.9rem 0.75rem;
  color: #fff;
  background: linear-gradient(transparent, rgba(15, 12, 8, 0.9));
}
.bento__date {
  font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase;
  opacity: 0.85;
}
.bento__title {
  font-family: var(--ff-heading); font-weight: var(--fw-semibold);
  font-size: 0.85rem; line-height: 1.25;
}
.bento__tile--hero .bento__title { font-size: 1.25rem; }
.bento__tile--hero .bento__date  { font-size: 0.72rem; }
.bento__tile--hero .bento__cap   { padding: 2rem 1.2rem 1.1rem; }

/* ============================================================
   Achievements — certificate card
   ============================================================ */
.achv__cert {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
}
.achv__cert img { width: 100%; height: 100%; object-fit: cover; }
.achv__cert img.is-missing { display: none; }
.achv__cert-ph {
  position: absolute; inset: 0;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem; color: var(--clr-text-muted); background: var(--clr-surface-2);
}
.achv__cert-ph i { font-size: 2.4rem; color: var(--clr-primary); }
.achv__cert.is-missing .achv__cert-ph { display: flex; }

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

/* ============================================================
   Preloader
   ============================================================ */
.preloader {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center; gap: var(--space-lg);
  background: var(--clr-bg);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.preloader.is-hidden { opacity: 0; visibility: hidden; }

.preloader__logo {
  position: relative;
  display: grid; place-items: center;
  width: 120px; height: 120px;
}
.preloader__logo::before {
  content: ""; position: absolute; inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--clr-gold), var(--clr-amber), transparent 72%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  animation: spin 1s linear infinite;
}
.preloader__logo::after {
  content: ""; position: absolute; inset: 14px;
  border-radius: 50%;
  border: 1px dashed var(--glass-border);
  opacity: 0.5;
}
.preloader__text {
  font-family: var(--ff-heading);
  font-weight: var(--fw-extra);
  font-size: 2.4rem;
  letter-spacing: -0.03em;
  background: var(--gradient-gold);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: pulse 1.4s ease-in-out infinite;
}
.preloader__caption {
  font-family: var(--ff-heading);
  font-size: var(--fs-sm);
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--clr-text-muted);
}
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* ============================================================
   Gallery
   ============================================================ */
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-md);
}
.gallery__item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.gallery__item:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--clr-primary); }
.gallery__item img {
  position: absolute; inset: 0; z-index: 2;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery__item:hover img { transform: scale(1.07); }
.gallery__item img.is-missing { display: none; }
.gallery__ph {
  position: absolute; inset: 0; z-index: 1;
  display: grid; place-items: center;
  font-size: 2.4rem; color: rgba(255, 255, 255, 0.92);
  background: var(--gradient-gold);
}
.gallery__ph::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 30% 0%, rgba(255,255,255,0.25), transparent 60%);
}
.gallery__cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 1.6rem 1rem 0.8rem;
  font-family: var(--ff-heading);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  color: #fff;
  background: linear-gradient(transparent, rgba(20, 16, 10, 0.82));
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .about__lower { grid-template-columns: 1fr; }
  .contact__cards { grid-template-columns: 1fr; }
  .contact__panel { padding: var(--space-lg); }
  .achv__featured { grid-template-columns: 1fr; }

  /* Hero stacks: portrait on top, text centered */
  .hero { padding-top: calc(var(--header-h) + 1.5rem); }
  .hero__grid { grid-template-columns: 1fr; gap: var(--space-xl); }
  .hero__visual { order: -1; min-height: 0; }
  .hero__text { text-align: center; }
  .hero__text .hero__coffee { justify-content: center; }
  .hero__text .hero__tagline { margin-inline: auto; }
  .hero__text .hero__cta,
  .hero__text .hero__socials { justify-content: center; }

  /* Project grid drops to two columns */
  .projects__grid { grid-template-columns: repeat(2, 1fr); }
  .about__facts { grid-template-columns: repeat(2, 1fr); }
}

/* My Gallery → vertical timeline on small screens */
@media (max-width: 820px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: clamp(7rem, 22vw, 10rem);
  }
}

@media (max-width: 768px) {
  .nav__list {
    position: fixed;
    top: var(--header-h); right: -100%;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-lg);
    width: min(75%, 320px);
    height: calc(100svh - var(--header-h));
    padding: var(--space-2xl) var(--space-xl);
    background: var(--clr-surface);
    border-left: 1px solid var(--clr-border);
    box-shadow: var(--shadow-lg);
    transition: right var(--transition);
  }
  .nav__list.active { right: 0; }
  .nav__hamburger { display: grid; }

  /* Timeline becomes single-sided */
  .timeline::before { left: 8px; }
  .tl-item,
  .tl-item:nth-child(even) {
    width: 100%; left: 0;
    padding: 0 0 var(--space-xl) 2.25rem;
  }
  .tl-dot,
  .tl-item:nth-child(even) .tl-dot { left: -1px; right: auto; }

  .about__facts { grid-template-columns: repeat(2, 1fr); }
  .projects__grid { grid-template-columns: 1fr; }
}

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

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
