/* ==========================================================================
   PORTFOLIO TEMPLATE — style.css
   Layout, design tokens and components. Motion lives in animations.css.

   Table of contents
   01. Design tokens (colours, type, spacing)
   02. Reset & base
   03. Utilities
   04. Buttons, tags, chips
   05. Navbar & mobile drawer
   06. Hero
   07. Section shell
   08. About
   09. Skills
   10. Résumé timeline
   11. Projects (cards)
   12. Project modals (:target)
   13. Contact form
   14. Footer
   15. README-mirror components (accordions, badges, handles, stat cards)
   16. Responsive
   ========================================================================== */


/* ==========================================================================
   01. DESIGN TOKENS
   Change these six colours and the whole site re-themes itself.
   ========================================================================== */

:root {
  /* --- Brand --- */
  --accent:        #7c5cff;   /* primary purple  */
  --accent-2:      #22d3ee;   /* cyan            */
  --accent-3:      #f472b6;   /* pink            */

  /* --- Dark theme (default) --- */
  --bg:            #0b0b12;
  --bg-alt:        #101019;
  --surface:       #16162200;
  --card:          rgba(255, 255, 255, 0.035);
  --card-hover:    rgba(255, 255, 255, 0.06);
  --border:        rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text:          #eceaf5;
  --text-muted:    #a3a1b5;
  --shadow:        0 20px 50px -20px rgba(0, 0, 0, 0.75);

  /* --- Type --- */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono",
               Menlo, monospace;

  /* Fluid type scale — grows with the viewport, no media queries needed */
  --fs-xs:   0.78rem;
  --fs-sm:   0.9rem;
  --fs-base: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  --fs-lg:   clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  --fs-h3:   clamp(1.2rem, 1.05rem + 0.7vw, 1.5rem);
  --fs-h2:   clamp(1.9rem, 1.4rem + 2.2vw, 3rem);
  --fs-h1:   clamp(2.5rem, 1.6rem + 4.2vw, 4.6rem);

  /* --- Space & shape --- */
  --container: 1160px;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --section-y: clamp(4.5rem, 9vw, 8rem);
  --radius-sm: 10px;
  --radius:    18px;
  --radius-lg: 28px;

  /* --- Motion --- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur:  0.35s;

  color-scheme: dark;
}

/* --- Light theme: activated by the #theme-toggle checkbox --- */
:root:has(#theme-toggle:checked) {
  --bg:            #f7f6fb;
  --bg-alt:        #ffffff;
  --card:          rgba(12, 10, 30, 0.028);
  --card-hover:    rgba(12, 10, 30, 0.055);
  --border:        rgba(12, 10, 30, 0.1);
  --border-strong: rgba(12, 10, 30, 0.2);
  --text:          #161327;
  --text-muted:    #5c5873;
  --shadow:        0 20px 45px -22px rgba(30, 20, 80, 0.28);

  color-scheme: light;
}


/* ==========================================================================
   02. RESET & BASE
   ========================================================================== */

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

* { margin: 0; }

html {
  scroll-behavior: smooth;
  /* keeps anchored sections clear of the sticky navbar */
  scroll-padding-top: 6rem;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

/* Lock scrolling while a project modal is open */
html:has(.modal:target) { overflow: hidden; }

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

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

h1, h2, h3, h4 {
  line-height: 1.12;
  letter-spacing: -0.022em;
  font-weight: 700;
  text-wrap: balance;
}

p { text-wrap: pretty; }

ul, ol { list-style: none; padding: 0; }

button, input, textarea { font: inherit; color: inherit; }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--card-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.4em;
}

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

/* Focus ring — visible, consistent, never removed */
:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 3px solid var(--bg);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }


/* ==========================================================================
   03. UTILITIES
   ========================================================================== */

.container {
  width: min(100% - (var(--gutter) * 2), var(--container));
  margin-inline: auto;
}

/* Visually hidden but readable by screen readers */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The two state checkboxes: off-screen but still keyboard-focusable */
.state-input {
  position: fixed;
  top: 0; left: 0;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.skip-link {
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -150%);
  z-index: 200;
  background: var(--accent);
  color: #fff;
  padding: 0.65rem 1.2rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
  transition: transform 0.25s var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

.gradient-text {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-3) 45%, var(--accent-2) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.honeypot {
  position: absolute !important;
  left: -9999px;
  opacity: 0;
}


/* ==========================================================================
   04. BUTTONS, TAGS, CHIPS
   ========================================================================== */

.btn {
  --btn-bg: var(--accent);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: 0.01em;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.25s var(--ease),
              box-shadow 0.25s var(--ease),
              background-color 0.25s var(--ease),
              border-color 0.25s var(--ease);
}
.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-3));
  background-size: 180% 100%;
  color: #fff;
  box-shadow: 0 10px 26px -12px color-mix(in oklab, var(--accent) 85%, transparent);
}
.btn--primary:hover {
  background-position: 100% 0;
  box-shadow: 0 16px 34px -12px color-mix(in oklab, var(--accent) 90%, transparent);
}

.btn--ghost {
  background: var(--card);
  border-color: var(--border-strong);
  color: var(--text);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover {
  background: var(--card-hover);
  border-color: var(--accent);
}

.btn--full { width: 100%; }

.icon {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.icon--fill { fill: currentColor; stroke: none; }

.tag {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
}
.tag--accent {
  border-color: color-mix(in oklab, var(--accent) 45%, transparent);
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  color: color-mix(in oklab, var(--accent) 70%, var(--text));
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chips li {
  font-size: var(--fs-sm);
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  transition: transform 0.2s var(--ease), color 0.2s, border-color 0.2s, background-color 0.2s;
}
.chips li:hover {
  transform: translateY(-3px);
  color: var(--text);
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 12%, transparent);
}
.chips--sm li { font-size: var(--fs-xs); padding: 0.25rem 0.65rem; }


/* ==========================================================================
   05. NAVBAR & MOBILE DRAWER
   ========================================================================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 4.5rem;
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.nav__logo-mark {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1.15rem;
}
.nav__logo-text { font-size: 1.05rem; }

.nav__links {
  display: flex;
  gap: clamp(0.8rem, 2.2vw, 2rem);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.nav__links a {
  position: relative;
  color: var(--text-muted);
  padding: 0.35rem 0;
  transition: color 0.22s var(--ease);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

/* --- Theme switch --- */
.theme-switch { cursor: pointer; display: inline-flex; }
.theme-switch__track {
  position: relative;
  display: block;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.theme-switch__thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--accent-2), var(--accent));
  box-shadow: 0 2px 10px -2px var(--accent);
  transition: transform 0.4s var(--ease), background 0.4s var(--ease);
}
:root:has(#theme-toggle:checked) .theme-switch__thumb {
  transform: translateX(24px);
  background: linear-gradient(140deg, #ffd479, #ff9f45);
  box-shadow: 0 2px 10px -2px #ffb347;
}
/* Focus ring for the visually-hidden checkbox */
#theme-toggle:focus-visible ~ .nav .theme-switch__track,
#nav-toggle:focus-visible   ~ .nav .burger {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

/* --- Hamburger --- */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px; height: 38px;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--card);
  cursor: pointer;
}
.burger span:not(.sr-only) {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.32s var(--ease), opacity 0.2s linear;
}
:root:has(#nav-toggle:checked) .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
:root:has(#nav-toggle:checked) .burger span:nth-child(2) { opacity: 0; transform: scaleX(0.2); }
:root:has(#nav-toggle:checked) .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Drawer --- */
.drawer {
  position: fixed;
  inset: 4.5rem 0 auto 0;
  z-index: 99;
  display: grid;
  gap: 0.25rem;
  padding: 1rem var(--gutter) 1.6rem;
  background: color-mix(in oklab, var(--bg) 94%, transparent);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: translateY(-130%);
  visibility: hidden;
  transition: transform 0.42s var(--ease), visibility 0.42s;
}
.drawer a {
  padding: 0.85rem 0.4rem;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s, padding-left 0.25s var(--ease);
}
.drawer a:hover { color: var(--accent); padding-left: 0.9rem; }
:root:has(#nav-toggle:checked) .drawer {
  transform: translateY(0);
  visibility: visible;
}


/* ==========================================================================
   06. HERO
   ========================================================================== */

.hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(3rem, 7vw, 6rem) clamp(5rem, 10vw, 8rem);
  overflow: hidden;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  min-height: min(80vh, 720px);
}

/* Decorative background */
.blob {
  position: absolute;
  z-index: -2;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
}
.blob--1 {
  width: 42vw; height: 42vw;
  max-width: 620px; max-height: 620px;
  top: -12%; right: -8%;
  background: radial-gradient(circle at 30% 30%, var(--accent), transparent 65%);
}
.blob--2 {
  width: 34vw; height: 34vw;
  max-width: 520px; max-height: 520px;
  bottom: -18%; left: -10%;
  background: radial-gradient(circle at 60% 40%, var(--accent-2), transparent 62%);
}
.grid-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(ellipse 75% 60% at 50% 40%, #000 20%, transparent 75%);
  opacity: 0.6;
  pointer-events: none;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.4rem 0.95rem 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  margin-bottom: 1.5rem;
}
.status-dot {
  position: relative;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #34d399;
  flex: none;
}

.hero__title {
  font-size: var(--fs-h1);
  margin-bottom: 0.6rem;
}

/* --- Rotating role list --- */
.hero__roles {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1.6rem;
}
.hero__roles-static { flex: none; }
.roles {
  display: block;
  height: 1.55em;
  overflow: hidden;
}
.roles__list { line-height: 1.55em; }
.roles__list li {
  height: 1.55em;
  color: var(--accent-2);
  white-space: nowrap;
}
.caret {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  background: var(--accent-2);
  border-radius: 1px;
}

.hero__bio {
  color: var(--text-muted);
  max-width: 56ch;
  margin-bottom: 2.2rem;
}
.hero__bio strong { color: var(--text); font-weight: 600; }
.hero__points { text-align: left; }

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 2.2rem;
}

.socials { display: flex; gap: 0.75rem; }
.socials a {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  transition: transform 0.28s var(--ease), color 0.25s, border-color 0.25s, background-color 0.25s;
}
.socials a:hover {
  transform: translateY(-4px) rotate(-6deg);
  color: var(--text);
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 16%, transparent);
}
.socials .icon { width: 1.25rem; height: 1.25rem; }

/* --- Avatar --- */
.hero__photo {
  position: relative;
  display: grid;
  place-items: center;
}
.avatar {
  position: relative;
  width: min(340px, 74vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.avatar__ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  /* ring, not disc */
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  filter: blur(0.3px);
}
.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg);
  background: var(--bg-alt);
  box-shadow: var(--shadow);
}

.badge {
  position: absolute;
  bottom: 4%;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: color-mix(in oklab, var(--bg-alt) 88%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.badge__emoji { font-size: 1rem; }

/* --- Scroll hint --- */
.scroll-hint {
  position: absolute;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.scroll-hint__mouse {
  position: relative;
  width: 24px; height: 38px;
  border: 2px solid var(--border-strong);
  border-radius: 14px;
}
.scroll-hint__mouse::after {
  content: "";
  position: absolute;
  left: 50%; top: 7px;
  width: 3px; height: 7px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--accent);
}
.scroll-hint:hover { color: var(--text); }


/* ==========================================================================
   07. SECTION SHELL
   ========================================================================== */

.section { padding-block: var(--section-y); position: relative; }
.section--alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}

.section__head {
  max-width: 62ch;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section__kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
}
.section__title {
  font-size: var(--fs-h2);
  margin-bottom: 0.8rem;
}
.section__sub { color: var(--text-muted); }


/* ==========================================================================
   08. ABOUT
   ========================================================================== */

.about {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.about__text {
  display: grid;
  gap: 1.15rem;
  color: var(--text-muted);
  font-size: var(--fs-lg);
  line-height: 1.75;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.fact {
  padding: 1.5rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  text-align: center;
  transition: transform 0.3s var(--ease), border-color 0.3s, background-color 0.3s;
}
.fact:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  background: var(--card-hover);
}
.fact__num {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.4rem;
}
.fact__label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}


/* ==========================================================================
   09. SKILLS
   ========================================================================== */

.skills {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
}

.skills__groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 1.2rem;
}
.skill-group {
  padding: 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  transition: transform 0.3s var(--ease), border-color 0.3s, background-color 0.3s;
}
.skill-group:hover {
  transform: translateY(-5px);
  border-color: var(--border-strong);
  background: var(--card-hover);
}
.skill-group h3 {
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
  margin-bottom: 0.95rem;
}

/* --- Marquee --- */
.marquee {
  margin-top: clamp(3rem, 6vw, 5rem);
  overflow: hidden;
  border-block: 1px solid var(--border);
  padding-block: 1rem;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  user-select: none;
}
.marquee__track {
  display: flex;
  gap: 2rem;
  width: max-content;
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2vw, 1.4rem);
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.marquee__track span:nth-child(even) { color: var(--accent); }


/* ==========================================================================
   10. EDUCATION TIMELINE
   ========================================================================== */

.timeline {
  position: relative;
  display: grid;
  gap: 1.6rem;
  padding-left: clamp(1.6rem, 4vw, 2.6rem);
}
/* the vertical rail */
.timeline::before {
  content: "";
  position: absolute;
  left: 0; top: 0.5rem; bottom: 0.5rem;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), transparent);
  transform-origin: top;
}

.timeline__item { position: relative; }

.timeline__dot {
  position: absolute;
  left: calc(clamp(1.6rem, 4vw, 2.6rem) * -1 - 6px);
  top: 1.9rem;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  z-index: 1;
}

.timeline__card {
  position: relative;
  padding: 1.6rem clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  transition: transform 0.32s var(--ease), border-color 0.3s, background-color 0.3s, box-shadow 0.3s;
}
.timeline__card:hover {
  transform: translateX(8px);
  border-color: var(--border-strong);
  background: var(--card-hover);
  box-shadow: var(--shadow);
}
.timeline__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.timeline__card h3 { font-size: var(--fs-h3); margin-bottom: 0.25rem; }
.timeline__org {
  color: var(--accent-2);
  font-weight: 600;
  font-size: var(--fs-sm);
  margin-bottom: 0.75rem;
}
.timeline__card > p:not(.timeline__org) {
  color: var(--text-muted);
  margin-bottom: 1rem;
}


/* ==========================================================================
   11. PROJECTS
   ========================================================================== */

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(310px, 100%), 1fr));
  gap: clamp(1.2rem, 2.5vw, 2rem);
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.35s, box-shadow 0.4s, background-color 0.35s;
}
.card:hover {
  transform: translateY(-10px);
  border-color: color-mix(in oklab, var(--accent) 55%, transparent);
  background: var(--card-hover);
  box-shadow: var(--shadow);
}

.card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), filter 0.4s;
}
.card:hover .card__media img { transform: scale(1.07); }

/* diagonal light sweep on hover */
.card__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%,
              rgba(255, 255, 255, 0.22) 50%, transparent 65%);
  transform: translateX(-110%);
  pointer-events: none;
}
.card:hover .card__shine { animation: shine 0.85s var(--ease) forwards; }

.card__body {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1.4rem clamp(1.2rem, 2.5vw, 1.7rem) 1.6rem;
  flex: 1;
}
.card__meta { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.card__title { font-size: var(--fs-h3); }
.card__desc { color: var(--text-muted); font-size: var(--fs-sm); flex: 1; }
.card__cta {
  margin-top: 0.4rem;
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--accent);
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
}
.card__cta span { transition: transform 0.3s var(--ease); }
.card:hover .card__cta span { transform: translateX(6px); }
.card__note {
  font-size: var(--fs-xs, 0.78rem);
  color: var(--text-muted);
  margin-top: -0.3rem;
}

.projects__more {
  margin-top: 2.5rem;
  text-align: center;
  color: var(--text-muted);
}
.projects__more a {
  color: var(--accent);
  font-weight: 600;
  border-bottom: 1px solid currentColor;
}


/* ==========================================================================
   12. PROJECT MODALS — opened with :target, no JavaScript
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: clamp(0.5rem, 3vw, 2.5rem);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
}
.modal:target { opacity: 1; visibility: visible; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 3, 12, 0.72);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
}

.modal__panel {
  position: relative;
  width: min(880px, 100%);
  max-height: min(90vh, 900px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-alt);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.8);
  transform: translateY(26px) scale(0.97);
  opacity: 0;
  transition: transform 0.42s var(--ease), opacity 0.35s var(--ease);
}
.modal:target .modal__panel { transform: translateY(0) scale(1); opacity: 1; }

.modal__close {
  position: sticky;
  top: 0;
  float: right;
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  margin: -0.5rem -0.5rem 0 0;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  z-index: 2;
  transition: transform 0.28s var(--ease), background-color 0.25s, color 0.25s;
}
.modal__close:hover {
  transform: rotate(90deg);
  background: var(--accent);
  color: #fff;
}

.modal__head { margin-bottom: 1.6rem; }
.modal__head h2 {
  font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem);
  margin: 0.8rem 0 0.6rem;
}
.modal__lede {
  color: var(--text-muted);
  font-size: var(--fs-lg);
  max-width: 60ch;
}

.modal__hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}

.modal__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 1.5rem;
  margin-bottom: 2.2rem;
}
/* An odd last card (the "Result") spans the row instead of sitting alone */
.modal__grid > .qa:last-child:nth-child(odd) { grid-column: 1 / -1; }
.qa {
  padding: 1.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  transition: border-color 0.3s, background-color 0.3s;
}
.qa:hover { border-color: var(--border-strong); background: var(--card-hover); }
.qa h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--fs-base);
  margin-bottom: 0.6rem;
}
.qa__num {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--accent);
  border: 1px solid color-mix(in oklab, var(--accent) 45%, transparent);
  background: color-mix(in oklab, var(--accent) 12%, transparent);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
}
.qa p { color: var(--text-muted); font-size: var(--fs-sm); }

.modal__subhead {
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.9rem;
}
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 0.85rem;
  margin-bottom: 2.2rem;
}
.shots img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: transform 0.35s var(--ease), border-color 0.3s;
}
.shots img:hover { transform: scale(1.04); border-color: var(--accent); }

.modal__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}


/* ==========================================================================
   13. CONTACT FORM
   ========================================================================== */

.contact {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.form {
  display: grid;
  gap: 1.1rem;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

/* Floating-label field */
.field { position: relative; }
.field input,
.field textarea {
  width: 100%;
  padding: 1.35rem 1rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.field label {
  position: absolute;
  left: 1rem;
  top: 1rem;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  pointer-events: none;
  transition: transform 0.22s var(--ease), font-size 0.22s var(--ease), color 0.22s;
}
/* `placeholder=" "` on the inputs makes :placeholder-shown reliable */
.field input:focus + label,
.field textarea:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:not(:placeholder-shown) + label {
  transform: translateY(-0.7rem);
  font-size: var(--fs-xs);
  color: var(--accent);
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
}
/* Only flag invalid fields the user has actually typed in */
.field input:not(:placeholder-shown):invalid,
.field textarea:not(:placeholder-shown):invalid {
  border-color: #f87171;
}

.form__note {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-align: center;
}

.contact__aside {
  display: grid;
  gap: 1.1rem;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.contact__item { display: grid; gap: 0.2rem; }
.contact__label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.contact__item a {
  font-weight: 600;
  color: var(--text);
  width: fit-content;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.contact__item a:hover { color: var(--accent); border-color: var(--accent); }


/* ==========================================================================
   14. FOOTER
   ========================================================================== */

.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding-block: 2rem;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.footer__links { display: flex; gap: 1.4rem; }
.footer__links a { transition: color 0.2s; }
.footer__links a:hover { color: var(--accent); }


/* ==========================================================================
   15. README-MIRROR COMPONENTS
   These match the collapsible sections of the GitHub profile README:
   accordions, shields.io badge walls, coding handles, stat cards.
   ========================================================================== */

/* --- Accordion: native <details>/<summary>, no JavaScript --- */
.acc {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  margin-bottom: 1rem;
  overflow: hidden;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.acc[open] { border-color: var(--border-strong); }
.acc:last-child { margin-bottom: 0; }

.acc__summary {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.05rem clamp(1rem, 2.5vw, 1.4rem);
  cursor: pointer;
  list-style: none;                     /* Firefox */
  transition: background-color 0.25s var(--ease);
}
.acc__summary::-webkit-details-marker { display: none; }   /* Safari/Chrome */
.acc__summary:hover { background: var(--card-hover); }
.acc__summary:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: -2px;
}

.acc__icon  { font-size: 1.3rem; line-height: 1; flex: none; }
.acc__title { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.015em; }
.acc__hint  {
  margin-left: auto;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-align: right;
}
.acc__chevron {
  flex: none;
  width: 9px; height: 9px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.32s var(--ease), border-color 0.25s;
}
.acc[open] .acc__chevron { transform: rotate(-135deg); }
.acc__summary:hover .acc__chevron { border-color: var(--accent); }

.acc__body {
  padding: 0 clamp(1rem, 2.5vw, 1.4rem) clamp(1.2rem, 3vw, 1.6rem);
}
.acc__body > .badges { margin-bottom: 1.3rem; }
.acc__note {
  margin-top: 1rem;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.acc__note a { color: var(--accent); border-bottom: 1px solid currentColor; }

/* --- shields.io badge wall --- */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.badges img {
  height: 28px;
  width: auto;
  border-radius: 5px;
  transition: transform 0.25s var(--ease), filter 0.25s;
}
.badges img:hover { transform: translateY(-4px) scale(1.04); filter: brightness(1.15); }
.badges--tight img { height: 26px; }

/* --- Coding handles --- */
.handles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 1rem;
}
.handle {
  display: grid;
  justify-items: start;
  gap: 0.55rem;
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition: transform 0.3s var(--ease), border-color 0.3s, background-color 0.3s, box-shadow 0.3s;
}
.handle:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  background: var(--card-hover);
  box-shadow: var(--shadow);
}
.handle img { height: 28px; width: auto; border-radius: 5px; }
.handle__name { font-weight: 700; }
.handle__stat { font-size: var(--fs-sm); color: var(--text-muted); }

/* --- Experience bullets --- */
.bullets {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}
.bullets li {
  position: relative;
  padding-left: 1.25rem;
  font-size: var(--fs-sm);
}
.bullets li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
}
.bullets strong { color: var(--text); font-weight: 600; }
.timeline__at { color: var(--text-muted); font-weight: 400; }

/* --- Live stat cards (GitHub / LeetCode / jokes) --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 1rem;
  margin-bottom: 1.6rem;
}
.stats-grid--two { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }

.stat-card {
  display: grid;
  gap: 0.8rem;
  place-items: center;
  margin: 0;
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  transition: transform 0.3s var(--ease), border-color 0.3s, background-color 0.3s;
}
.stat-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-strong);
  background: var(--card-hover);
}
.stat-card img {
  width: 100%;
  /* keeps the frame looking deliberate while the remote card loads —
     or if it never does, because the username hasn't been set yet */
  min-height: 90px;
  object-fit: contain;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.stat-card figcaption {
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}
.stat-card--wide { grid-column: 1 / -1; }
.acc__body > .stat-card { margin-bottom: 1rem; }

/* --- Recent activity list --- */
.activity { display: grid; gap: 0.55rem; }
.activity li {
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  transition: border-color 0.25s, transform 0.25s var(--ease);
}
.activity li:hover { border-color: var(--border-strong); transform: translateX(5px); }
.activity a { color: var(--accent); font-weight: 600; }
.activity a:hover { text-decoration: underline; }

/* --- Joke + quote --- */
.fun {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 1rem;
  margin-top: 1.6rem;
}


/* ==========================================================================
   16. RESPONSIVE
   ========================================================================== */

@media (max-width: 980px) {
  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 1rem;
  }
  .hero__photo { order: -1; }
  .hero__roles,
  .hero__cta,
  .socials { justify-content: center; }
  .hero__bio { margin-inline: auto; }
  .hero__eyebrow { margin-inline: auto; }
  .scroll-hint { display: none; }

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

@media (max-width: 780px) {
  .nav__links { display: none; }
  .burger { display: flex; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .modal__foot .btn { flex: 1 1 100%; }
}

@media (max-width: 460px) {
  .hero__title { font-size: clamp(2.1rem, 10vw, 2.8rem); }
  .footer__inner { flex-direction: column; text-align: center; }
  .shots { grid-template-columns: 1fr 1fr; }
}

/* Print: a portfolio that survives being printed to PDF */
@media print {
  .nav, .drawer, .scroll-hint, .marquee, .blob, .grid-overlay, .modal { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding-block: 1.5rem; page-break-inside: avoid; }
}
