/* ==========================================================================
   Ameer Khan S — portfolio, dark edition
   Colours and display font follow the reference the owner chose: near-black
   page, periwinkle → light-blue gradient, slate borders, Clash Grotesk for
   display and DM Sans for reading. Glows are static radial gradients (no blur
   filters, no animation). Motion: transform/opacity only, ease-out, under 300ms;
   the hero enters once on load. Hover effects only on a fine pointer.
   ========================================================================== */

@font-face {
  font-family: 'ClashGrotesk-Variable';
  src: url('assets/fonts/ClashGrotesk-Variable.woff2') format('woff2');
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0A0A13;
  --fg: #F8FAFC;
  --muted: #94A3B8;
  --line: #1E293B;
  --glass: rgba(255, 255, 255, 0.04);
  --glass-2: rgba(255, 255, 255, 0.07);
  --primary: #7B82FE;
  --secondary: #7DB4FE;
  --on-primary: #000000;
  --danger: #F87171;

  --font-display: 'ClashGrotesk-Variable', 'DM Sans', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r-s: 10px;
  --r-m: 20px;
  --r-l: 28px;
  --max-w: 1120px;
  --measure: 62ch;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --grad: linear-gradient(135deg, var(--primary), var(--secondary));
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  color-scheme: dark;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

::selection { background: rgba(123, 130, 254, 0.4); color: #fff; }
main { flex: 1 0 auto; outline: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, a, summary { touch-action: manipulation; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-left: max(clamp(20px, 5vw, 40px), env(safe-area-inset-left));
  padding-right: max(clamp(20px, 5vw, 40px), env(safe-area-inset-right));
}
.section { position: relative; padding-block: clamp(72px, 10vw, 128px); }
.glow::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 100%;
  background: radial-gradient(45% 50% at 88% 45%, rgba(123, 130, 254, 0.12), transparent 70%);
  pointer-events: none;
}
.section > .wrap { position: relative; }
#contact.section { padding-block: clamp(48px, 6vw, 80px) clamp(64px, 8vw, 104px); }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; margin-bottom: clamp(28px, 4vw, 48px); }

/* ---------- Type ---------- */

h1, h2, h3, .btn, .section-tag, .logo { font-family: var(--font-display); }
h1 { font-weight: 600; font-size: clamp(2.5rem, 7vw, 5.25rem); line-height: 1.02; letter-spacing: -0.04em; text-wrap: balance; }
h2 { font-weight: 600; font-size: clamp(2rem, 4.6vw, 3.5rem); line-height: 1.06; letter-spacing: -0.035em; text-wrap: balance; }
h3 { font-weight: 500; font-size: 1.375rem; line-height: 1.25; letter-spacing: -0.02em; }

.grad { color: var(--primary); background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.section-tag, .eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--primary);
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lead { font-size: clamp(1.0625rem, 1.6vw, 1.25rem); line-height: 1.65; color: var(--muted); max-width: 56ch; text-wrap: pretty; }
.measure { max-width: var(--measure); }
.muted { color: var(--muted); }

/* ---------- Links & buttons ---------- */

.link {
  text-decoration: none;
  font-weight: 500;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  padding-bottom: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--r-s);
  border: 1px solid transparent;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-secondary { background: transparent; color: var(--fg); border-color: var(--line); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-small { min-height: 44px; padding: 0 18px; font-size: 0.875rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

:focus-visible { outline: 2px solid var(--secondary); outline-offset: 3px; border-radius: 4px; }
.btn:focus-visible { border-radius: var(--r-s); }

@media (hover: hover) and (pointer: fine) {
  .link { background-size: 0 1px; transition: background-size 220ms var(--ease-out), color 160ms ease; }
  .link:hover { background-size: 100% 1px; color: var(--secondary); }
  .btn-primary:hover { background: #8E94FF; }
  .btn-secondary:hover { background: var(--glass-2); border-color: #334155; }
  .btn-ghost:hover { color: var(--fg); border-color: #334155; }
}

/* ---------- Skip link, floating nav ---------- */

.skip { position: fixed; left: 16px; top: 8px; z-index: 100; padding: 10px 16px; background: var(--primary); color: var(--on-primary); border-radius: var(--r-s); font-weight: 600; text-decoration: none; transform: translateY(-200%); }
.skip:focus { transform: none; }

.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; justify-content: center; padding: calc(14px + env(safe-area-inset-top)) 16px 0; pointer-events: none; }
.nav {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  background: rgba(10, 10, 19, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
.logo { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--grad); color: var(--on-primary); font-weight: 700; font-size: 1.0625rem; text-decoration: none; margin-right: 4px; }
.site-nav { display: flex; align-items: center; gap: 2px; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 0.9375rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease;
}
.site-nav a[aria-current="page"] { color: var(--fg); background: rgba(255, 255, 255, 0.09); }
@media (hover: hover) and (pointer: fine) { .site-nav a:hover { color: var(--fg); background: rgba(255, 255, 255, 0.06); } }

.menu-btn { display: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; position: relative; color: var(--fg); }
.menu-btn span { position: absolute; left: 13px; right: 13px; height: 2px; background: currentColor; border-radius: 2px; transition: transform 200ms var(--ease-out); }
.menu-btn span:nth-child(1) { top: 17px; }
.menu-btn span:nth-child(2) { top: 25px; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

@media (max-width: 760px) {
  .site-header { justify-content: stretch; }
  .nav { width: 100%; justify-content: space-between; }
  .menu-btn { display: block; }
  .site-nav {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 8px;
    background: rgba(10, 10, 19, 0.94); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border: 1px solid var(--line); border-radius: var(--r-m);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s linear 200ms;
  }
  .site-nav.open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .site-nav a { min-height: 52px; font-size: 1.0625rem; border-radius: 14px; }
}

/* ---------- Hero (the one entrance, on load) ---------- */

.hero { position: relative; overflow: hidden; min-height: 100svh; display: flex; align-items: center; padding: 120px 0 72px; }
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(50% 55% at 78% 0%, rgba(123, 130, 254, 0.30), transparent 70%),
    radial-gradient(40% 45% at 12% 28%, rgba(125, 180, 254, 0.14), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.hero-center { display: flex; flex-direction: column; align-items: center; text-align: center; }
.avatar { width: 128px; height: 128px; padding: 3px; border-radius: 50%; background: var(--grad); margin-bottom: 18px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; border-radius: 50%; border: 3px solid var(--bg); }
.hero .eyebrow { margin-bottom: 22px; }
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 28px; }
.pills li { border: 1px solid var(--line); background: rgba(10, 10, 19, 0.6); color: var(--secondary); font-size: 0.8125rem; padding: 6px 14px; border-radius: 999px; }
.hero h1 { max-width: 17ch; margin-bottom: 24px; }
.hero .lead { margin-bottom: 36px; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 24px; }
.hero-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 24px; }
.hero-links .link { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; color: var(--muted); font-size: 0.9375rem; }

@keyframes enter { from { opacity: 0; transform: translateY(14px); } }
@keyframes enter-fade { from { opacity: 0; } }
[data-e] { animation: enter 560ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }
@media (max-width: 640px) { .hero-actions .btn { flex: 1 1 100%; } }

/* ---------- Chips ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--secondary); font-size: 0.8125rem; font-weight: 500; }
.chip-plain { color: var(--fg); }

/* ---------- Cards (home) ---------- */

.project-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
.project-grid > .card { grid-column: span 6; }
.card {
  display: flex; flex-direction: column; gap: 14px;
  padding: clamp(24px, 3.2vw, 36px);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  text-decoration: none; color: inherit;
  transition: transform 200ms var(--ease-out), border-color 200ms ease, background-color 200ms ease;
}
.card h3 { font-size: 1.75rem; letter-spacing: -0.03em; }
.card p { color: var(--muted); text-wrap: pretty; }
.card .chips { margin-top: auto; padding-top: 10px; }
.card-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-top: 4px; }
.card-more { font-weight: 500; color: var(--primary); }
.card:active { transform: scale(0.99); }
@media (hover: hover) and (pointer: fine) { a.card:hover { transform: translateY(-3px); border-color: rgba(123, 130, 254, 0.55); background: var(--glass-2); } }
@media (max-width: 760px) { .project-grid > .card { grid-column: 1 / -1; } }
.project-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.empty-state { color: var(--muted); padding: 24px 0; }

/* ---------- Skills bento ---------- */

.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
.tile { grid-column: span 6; padding: 28px; background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-m); display: flex; flex-direction: column; gap: 18px; }
.tile.t5 { grid-column: span 5; } .tile.t7 { grid-column: span 7; }
.tile h3 { font-size: 1.0625rem; font-weight: 500; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.tile h3::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--grad); }
@media (max-width: 860px) { .tile, .tile.t5, .tile.t7 { grid-column: 1 / -1; } }

/* ---------- Split section + timeline ---------- */

.split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 32px; }
.split-head { grid-column: 1 / span 4; align-self: start; position: sticky; top: 112px; }
.split-body { grid-column: 6 / -1; min-width: 0; }
@media (max-width: 860px) { .split-head { grid-column: 1 / -1; position: static; } .split-body { grid-column: 1 / -1; } }

.tl { position: relative; display: grid; gap: 44px; padding-left: 34px; }
.tl::before { content: ''; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(var(--primary), rgba(125, 180, 254, 0.08)); }
.entry { position: relative; }
.entry::before { content: ''; position: absolute; left: -34px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 5px rgba(123, 130, 254, 0.18); }
.entry-date { font-size: 0.8125rem; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.entry-org { color: var(--secondary); font-weight: 500; margin: 4px 0 14px; }
.entry-list { display: grid; gap: 10px; max-width: var(--measure); color: #CBD5E1; }
.entry-list li { position: relative; padding-left: 20px; text-wrap: pretty; }
.entry-list li::before { content: ''; position: absolute; left: 0; top: 0.72em; width: 8px; height: 2px; background: var(--grad); }
.subhead { margin: clamp(40px, 5vw, 56px) 0 16px; font-size: 1.125rem; font-weight: 500; color: var(--muted); }
.cert-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 20px; padding: 18px 22px; background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-m); color: #CBD5E1; }
#education.section { padding-top: 0; }
.cert { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; color: #CBD5E1; }

/* ---------- Closing panel ---------- */

.cta {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(48px, 7vw, 88px) clamp(24px, 5vw, 64px);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: linear-gradient(135deg, rgba(123, 130, 254, 0.16), rgba(255, 255, 255, 0.03));
}
.cta h2 { margin-bottom: 14px; max-width: 16ch; }
.cta .lead { margin-bottom: 28px; }
.cta-mail { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.0625rem, 3.6vw, 1.75rem); color: var(--fg); text-decoration: none; overflow-wrap: anywhere; margin-top: 20px; min-height: 44px; display: inline-flex; align-items: center; }
.close-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 24px; margin-top: 12px; }
.close-links a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; color: var(--muted); }

/* ---------- Footer ---------- */

.site-footer { padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); font-size: 0.875rem; color: var(--muted); }
.footer-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 4px; align-items: center; padding-top: 24px; background: linear-gradient(var(--line), var(--line)) center top / calc(100% - 2 * clamp(20px, 5vw, 40px)) 1px no-repeat; }
.footer-row > p { grid-column: 1 / span 6; }
.footer-links { grid-column: 9 / -1; display: flex; flex-wrap: wrap; gap: 0 20px; }
@media (max-width: 760px) { .footer-row > p, .footer-links { grid-column: 1 / -1; } }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }

/* ---------- Inner pages ---------- */

.page-intro { padding-block: 150px clamp(24px, 3vw, 40px); position: relative; }
.page-intro::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 100%; background: radial-gradient(45% 80% at 82% 20%, rgba(123, 130, 254, 0.16), transparent 70%); pointer-events: none; }
.page-intro .wrap { position: relative; }
.page-intro h1 { margin-bottom: 16px; font-size: clamp(2.25rem, 5.2vw, 4rem); }
.page-body { padding-bottom: clamp(72px, 10vw, 128px); }
.section-title { font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; margin-bottom: 20px; letter-spacing: -0.02em; }

/* project cards (projects page) */
.project-list { display: grid; gap: clamp(24px, 3vw, 36px); }
.project { display: flex; flex-direction: column; gap: 28px; padding: clamp(18px, 3vw, 32px); background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-l); scroll-margin-top: 110px; }
.project:not(.has-media) { border-top-color: rgba(123, 130, 254, 0.5); }
.media-main { aspect-ratio: 16 / 9; border-radius: var(--r-m); overflow: hidden; border: 1px solid var(--line); background: #06060C; }
.media-main img { width: 100%; height: 100%; object-fit: contain; transition: transform 400ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .media-main:hover img { transform: scale(1.015); } }
.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.thumb { height: 52px; min-width: 44px; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #06060C; cursor: pointer; opacity: 0.6; transition: opacity 160ms ease, border-color 160ms ease, transform 160ms var(--ease-out); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:active { transform: scale(0.97); }
.thumb[aria-pressed="true"] { opacity: 1; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
@media (hover: hover) and (pointer: fine) { .thumb:hover { opacity: 1; } }
.project-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px 40px; }
.project-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.project h3 { font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: -0.03em; font-weight: 600; }
.project-summary { font-size: 1.125rem; font-weight: 500; margin-bottom: 14px; text-wrap: pretty; }
.project-desc { color: var(--muted); max-width: var(--measure); text-wrap: pretty; }
.project-side { display: flex; flex-direction: column; gap: 24px; align-items: flex-start; }
.project-links { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 860px) { .project-body { grid-template-columns: 1fr; } }

/* contact page */
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.contact-card { display: flex; flex-direction: column; gap: 6px; padding: 28px; background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-m); text-decoration: none; transition: transform 200ms var(--ease-out), border-color 200ms ease, background-color 200ms ease; }
.contact-card:active { transform: scale(0.99); }
.contact-icon { width: 44px; height: 44px; border-radius: 12px; background: rgba(123, 130, 254, 0.14); color: var(--primary); display: grid; place-items: center; margin-bottom: 14px; }
.contact-icon svg { width: 20px; height: 20px; }
.contact-label { font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.contact-value { font-family: var(--font-display); font-weight: 500; font-size: 1.125rem; overflow-wrap: anywhere; }
@media (hover: hover) and (pointer: fine) { .contact-card:hover { transform: translateY(-3px); border-color: rgba(123, 130, 254, 0.55); background: var(--glass-2); } }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.cv-line { margin-top: 28px; }

/* work diary + reading */
.pdf-list, .review-list { display: grid; gap: 12px; }
.pdf-item { display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-m); }
.pdf-icon { width: 24px; height: 24px; color: var(--primary); flex: none; }
.pdf-info { flex: 1; min-width: 0; }
.pdf-name { font-weight: 500; overflow-wrap: anywhere; }
.pdf-meta { font-size: 0.875rem; color: var(--muted); }
.pdf-actions { display: flex; gap: 8px; flex: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; background: transparent; border: 1px solid var(--line); border-radius: var(--r-s); color: var(--fg); font: 500 0.875rem/1 var(--font-body); text-decoration: none; cursor: pointer; transition: transform 160ms var(--ease-out), background-color 160ms ease, border-color 160ms ease; }
.icon-btn:active { transform: scale(0.97); }
.icon-btn.danger { color: var(--danger); }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--glass-2); border-color: #334155; } .icon-btn.danger:hover { background: rgba(248, 113, 113, 0.1); border-color: var(--danger); } }
.pdf-preview-section { margin-top: 48px; }
.pdf-frame-wrap { border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; background: var(--glass); }
.pdf-frame { width: 100%; height: min(80vh, 900px); border: 0; display: block; background: #fff; }
.review-card { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-m); padding: 24px 28px; }
.review-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 8px; }
.review-author { color: var(--muted); font-size: 0.9375rem; }
.review-stars { color: var(--secondary); letter-spacing: 2px; white-space: nowrap; font-size: 1.0625rem; }
.review-date { font-size: 0.8125rem; color: var(--muted); margin-bottom: 12px; }
.review-text { color: #CBD5E1; max-width: var(--measure); white-space: pre-line; text-wrap: pretty; }
.review-delete { margin-top: 16px; min-height: 44px; padding: 0 16px; background: transparent; border: 1px solid var(--line); border-radius: var(--r-s); color: var(--danger); font: 500 0.875rem/1 var(--font-body); cursor: pointer; }

/* admin + forms */
.review-form { display: grid; gap: 18px; max-width: 760px; }
.review-form > .btn { justify-self: start; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-field { display: grid; gap: 6px; }
.form-field label, .field-label { font-size: 0.875rem; font-weight: 500; }
.form-hint { font-size: 0.8125rem; color: var(--muted); font-weight: 400; }
input[type="text"], input[type="url"], input[type="password"], input[type="date"], input[type="number"], select, textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: var(--r-s);
  font: 400 16px/1.4 var(--font-body); color: var(--fg);
}
select option { background: #0F172A; color: var(--fg); }
textarea { resize: vertical; min-height: 110px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--secondary); outline-offset: 1px; border-color: var(--secondary); }
code { font-size: 0.85em; background: rgba(255, 255, 255, 0.08); padding: 1px 6px; border-radius: 6px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 500; font-size: 0.9375rem; }
.check input { width: 22px; height: 22px; accent-color: var(--primary); }
.link-rows { display: grid; gap: 10px; }
.link-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1.6fr) auto; gap: 10px; align-items: center; }
@media (max-width: 760px) { .form-row { grid-template-columns: 1fr; } .link-row { grid-template-columns: 1fr 1fr; } .link-row .link-url { grid-column: 1 / -1; } }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.admin-block { padding-top: 48px; margin-top: 48px; border-top: 1px solid var(--line); }
.admin-block:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dropzone { border: 1.5px dashed #334155; border-radius: var(--r-m); background: var(--glass); padding: 36px 24px; text-align: center; max-width: 760px; transition: border-color 160ms ease, background-color 160ms ease; }
.dropzone.dragover { border-color: var(--primary); background: rgba(123, 130, 254, 0.1); }
.upload-icon { width: 36px; height: 36px; color: var(--primary); margin: 0 auto 8px; }
.dropzone-title { font-weight: 500; }
.dropzone-sub, .dropzone-hint { font-size: 0.875rem; color: var(--muted); margin: 6px 0 12px; }
.upload-status { min-height: 1.5em; margin-top: 12px; font-size: 0.9375rem; }
.upload-status.error { color: var(--danger); }
.upload-status.success { color: var(--secondary); }
.admin-list { display: grid; gap: 12px; margin-top: 20px; max-width: 760px; }
.admin-item { display: flex; align-items: center; gap: 16px; padding: 14px 18px; background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-m); }
.admin-item-info { flex: 1; min-width: 0; }
.admin-item-title { font-weight: 500; overflow-wrap: anywhere; }
[hidden] { display: none !important; }

/* ---------- Reduced motion: gentler, not zero ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-e] { animation-name: enter-fade; animation-duration: 200ms; animation-delay: 0ms; }
  .media-main img { transition: none; }
  .media-main:hover img { transform: none; }
  .btn:active, .icon-btn:active, .card:active, .thumb:active, .contact-card:active { transform: none; }
  a.card:hover, .contact-card:hover { transform: none; }
  .site-nav, .menu-btn span { transition-duration: 1ms; }
}

/* ---------- Theme toggle ---------- */
.theme-btn { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; margin-left: 2px; transition: color 160ms ease, background-color 160ms ease, transform 160ms var(--ease-out); }
.theme-btn:active { transform: scale(0.94); }
.theme-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .icon-sun { display: none; }
html[data-theme="dark"] .theme-btn .icon-sun { display: block; }
html[data-theme="dark"] .theme-btn .icon-moon { display: none; }
@media (hover: hover) and (pointer: fine) { .theme-btn:hover { color: var(--fg); background: rgba(127, 127, 170, 0.16); } }
@media (max-width: 760px) { .theme-btn { margin-left: auto; } }
html.theme-swap *, html.theme-swap *::before, html.theme-swap *::after { transition: none !important; }
.hero .lead { max-width: 72ch; font-size: clamp(1rem, 1.25vw, 1.125rem); line-height: 1.6; margin-bottom: 28px; }
.hero h1 { max-width: 22ch; font-size: clamp(2.5rem, 6.2vw, 4.5rem); margin-bottom: 20px; }
.hero { padding-top: 104px; }
.hero .avatar { margin-bottom: 14px; }
.hero .eyebrow { margin-bottom: 16px; }
.pills { margin-bottom: 22px; }
@media (prefers-reduced-motion: reduce) { .theme-btn:active { transform: none; } }

/* ---------- Hero: intro on the left, large round photo on the right ---------- */
.hero-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 32px; align-items: center; }
.hero-text { grid-column: 1 / span 8; display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding-right: clamp(0px, 3vw, 40px); }
.hero-grid > .avatar { grid-column: 9 / span 4; width: 100%; height: auto; aspect-ratio: 1; padding: 4px; margin: 0; }
.hero .eyebrow { margin-bottom: 18px; }
.hero .pills { justify-content: flex-start; margin-bottom: 22px; }
.hero h1 { max-width: none; font-size: clamp(2.5rem, 5.2vw, 4.25rem); margin-bottom: 20px; }
.hero .lead { max-width: 60ch; font-size: 1.0625rem; line-height: 1.65; margin-bottom: 30px; }
.hero .hero-actions, .hero .hero-links { justify-content: flex-start; }
.hero .hero-links { gap: 4px 20px; }
@media (max-width: 860px) {
  .hero-text { grid-column: 1 / -1; padding-right: 0; }
  .hero-grid > .avatar { grid-column: 1 / -1; width: 148px; order: -1; }
}

/* ==========================================================================
   Light theme (default). Dark is the base above; the light values below apply
   unless <html data-theme="dark"> is set by the toggle.
   ========================================================================== */
html:not([data-theme="dark"]) {
  --bg: #F2F4FF;
  --fg: #0F172A;
  --muted: #475569;
  --line: #DDE2F7;
  --glass: #FFFFFF;
  --glass-2: #F8FAFC;
  --primary-text: #3E46E0;
  --secondary-text: #1664CA;
  --danger: #DC2626;
  --grad-text: linear-gradient(135deg, #3E46E0, #2378E7); }
html:not([data-theme="dark"]) { color-scheme: light; }
html:not([data-theme="dark"]) ::selection { background: rgba(123, 130, 254, 0.3); color: #0F172A; }
html:not([data-theme="dark"]) :focus-visible { outline-color: var(--primary-text); }
html:not([data-theme="dark"]) .grad { color: var(--primary-text); background: var(--grad-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
html:not([data-theme="dark"]) .section-tag,
html:not([data-theme="dark"]) .eyebrow { color: var(--primary-text); background: none; -webkit-background-clip: border-box; background-clip: border-box; -webkit-text-fill-color: var(--primary-text); }
html:not([data-theme="dark"]) .card-more,
html:not([data-theme="dark"]) .contact-icon { color: var(--primary-text); }
html:not([data-theme="dark"]) .entry-org,
html:not([data-theme="dark"]) .review-stars,
html:not([data-theme="dark"]) .upload-status.success { color: var(--secondary-text); }
html:not([data-theme="dark"]) .pills li { background: #FFFFFF; color: var(--secondary-text); }
html:not([data-theme="dark"]) .chip { background: var(--bg); color: var(--secondary-text); }
html:not([data-theme="dark"]) .chip-plain { color: var(--fg); }
html:not([data-theme="dark"]) .entry-list,
html:not([data-theme="dark"]) .cert,
html:not([data-theme="dark"]) .cert-item,
html:not([data-theme="dark"]) .review-text { color: #334155; }
html:not([data-theme="dark"]) .nav { background: rgba(255, 255, 255, 0.82); box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08); }
html:not([data-theme="dark"]) .site-nav a[aria-current="page"] { background: rgba(123, 130, 254, 0.16); }
@media (max-width: 760px) {
html:not([data-theme="dark"]) .site-nav { background: rgba(255, 255, 255, 0.97); }
}
html:not([data-theme="dark"]) .hero::before { background: radial-gradient(50% 55% at 78% 0%, rgba(123, 130, 254, 0.22), transparent 70%), radial-gradient(40% 45% at 12% 28%, rgba(125, 180, 254, 0.18), transparent 70%); }
html:not([data-theme="dark"]) .glow::before { background: radial-gradient(45% 50% at 88% 45%, rgba(123, 130, 254, 0.10), transparent 70%); }
html:not([data-theme="dark"]) .page-intro::before { background: radial-gradient(45% 80% at 82% 20%, rgba(123, 130, 254, 0.14), transparent 70%); }
html:not([data-theme="dark"]) .card,
html:not([data-theme="dark"]) .tile,
html:not([data-theme="dark"]) .project,
html:not([data-theme="dark"]) .contact-card,
html:not([data-theme="dark"]) .pdf-item,
html:not([data-theme="dark"]) .review-card,
html:not([data-theme="dark"]) .admin-item { box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
html:not([data-theme="dark"]) .media-main,
html:not([data-theme="dark"]) .thumb { background: var(--bg); }
html:not([data-theme="dark"]) .cta { background: linear-gradient(135deg, rgba(123, 130, 254, 0.18), rgba(125, 180, 254, 0.10)); }
html:not([data-theme="dark"]) code { background: rgba(15, 23, 42, 0.06); }
html:not([data-theme="dark"]) .dropzone { border-color: #CBD5E1; }
html:not([data-theme="dark"]) input[type="text"],
html:not([data-theme="dark"]) input[type="url"],
html:not([data-theme="dark"]) input[type="password"],
html:not([data-theme="dark"]) input[type="date"],
html:not([data-theme="dark"]) input[type="number"],
html:not([data-theme="dark"]) select,
html:not([data-theme="dark"]) textarea { background: #FFFFFF; }
html:not([data-theme="dark"]) input:focus-visible,
html:not([data-theme="dark"]) select:focus-visible,
html:not([data-theme="dark"]) textarea:focus-visible { outline-color: var(--primary-text); border-color: var(--primary-text); }
html:not([data-theme="dark"]) select option { background: #FFFFFF; color: var(--fg); }
html:not([data-theme="dark"]) .icon-btn.danger:hover { background: rgba(220, 38, 38, 0.08); }
@media (hover: hover) and (pointer: fine) {
html:not([data-theme="dark"]) .link:hover { color: var(--primary-text); }
html:not([data-theme="dark"]) .site-nav a:hover { background: rgba(15, 23, 42, 0.05); }
html:not([data-theme="dark"]) .btn-primary:hover { background: #6B72F6; }
html:not([data-theme="dark"]) .btn-secondary:hover { background: var(--glass-2); border-color: #CBD5E1; }
html:not([data-theme="dark"]) .btn-ghost:hover { border-color: #CBD5E1; }
html:not([data-theme="dark"]) .icon-btn:hover { border-color: #CBD5E1; }
}
