/* Keith Janish Portfolio — static site (Cloudflare Pages friendly) */

:root{
  --bg: #0b0f18;
  --bg2: #0f1626;
  --card: rgba(255,255,255,0.06);
  --card2: rgba(255,255,255,0.08);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.70);
  --muted2: rgba(255,255,255,0.58);
  --border: rgba(255,255,255,0.12);
  --accent: #7dd3fc;
  --accent2: #a78bfa;
  /* Accent variants intended specifically for text on light surfaces.
     In dark mode these match the brand accents; in light mode they are
     darkened to meet contrast expectations without changing the overall palette. */
  --accentText: #7dd3fc;
  --accent2Text: #a78bfa;
  --shadow: 0 18px 60px rgba(0,0,0,0.45);
  --radius: 18px;
  --radius2: 22px;

  --max: 1120px;
}


/* ===== Theme Toggle (Dark default + Light mode) ===== */
html{ color-scheme: dark; }

/* Light theme swaps surface + text values while preserving your accent colors. */
html[data-theme="light"]{
  color-scheme: light;

  --bg: #f6f7fb;
  --bg2: #ffffff;
  --card: rgba(0,0,0,0.05);
  --card2: rgba(0,0,0,0.07);
  --text: rgba(0,0,0,0.90);
  --muted: rgba(0,0,0,0.72);
  --muted2: rgba(0,0,0,0.56);
  --border: rgba(0,0,0,0.14);
  /* Darker accent-for-text variants to keep "accent" headings readable on light backgrounds. */
  --accentText: #06445f;
  --accent2Text: #3b1f96;
  --shadow: 0 18px 60px rgba(0,0,0,0.18);
}


*{ box-sizing: border-box; }
html, body{ height: 100%; }

/* Smooth in-page navigation (anchors / buttons). */
html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
}
body{
  margin: 0;
  color: var(--text);
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  line-height: 1.5;
}

/* Prevent background scroll when overlays are open (mobile menu / modal). */
body.scroll-lock{ overflow: hidden; }

/*
  Fixed ambient glow layer.
  Keeping this as a fixed pseudo-element prevents hard scroll-position bands
  and ensures your section background treatments line up cleanly with content.
*/
body::before{
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(1200px 600px at 10% 0%, rgba(125, 211, 252, 0.16), transparent 60%),
    radial-gradient(900px 500px at 80% 10%, rgba(167, 139, 250, 0.14), transparent 60%),
    radial-gradient(900px 600px at 50% 100%, rgba(56, 189, 248, 0.08), transparent 65%);
}

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: none; }
code{ background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 8px; border: 1px solid var(--border); }

.container{
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

.section{ padding: clamp(56px, 5vw, 76px) 0;
  position: relative;
  isolation: isolate;
}
.section::before{
  /* Divider line between sections without tinting the whole section */
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: min(var(--max), calc(100% - 40px));
  height: 1px;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(90deg, transparent, var(--hairline), transparent);
  opacity: 0.9;
}
.section:first-of-type::before{ display: none; }

.section.alt{
  /* Keep background continuous across page; section separation is handled by dividers/headers */
  background: transparent;
  border-top: 0;
  border-bottom: 0;
}

.section.alt::before{ background: none; }

.section > .container{ position: relative; z-index: 1; }

.section-head{ display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-start; gap: 8px; margin-bottom: 26px; 
  /* Section head divider */
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}
.section-title{ font-size: 28px; margin: 0; letter-spacing: -0.02em; }
.lead{ font-size: 18px; margin: 12px 0; }
.muted{ color: var(--muted); }
.muted.small{ color: var(--muted2); font-size: 13px; }
.mt-12{ margin-top: 12px; }

.skip-link{
  position: absolute;
  left: -999px;
  top: 0;
  background: #fff;
  color: #000;
  padding: 10px 12px;
  border-radius: 10px;
  z-index: 1000;
}
.skip-link:focus{ left: 12px; top: 12px; }

.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(11,15,24,0.65);
  border-bottom: 1px solid var(--border);
}
.header-inner{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  position: relative;
}

.brand{ display:flex; align-items:center; gap: 10px; }
.brand-mark{
  width: 26px; height: 26px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(125,211,252,0.9), rgba(167,139,250,0.85));
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.brand-text{ font-weight: 700; letter-spacing: -0.02em; }

.site-nav{ display:flex; flex-wrap: wrap; gap: 10px; justify-content:flex-end; }

/* Mobile menu trigger (hidden on desktop). */
.nav-toggle{
  display: none;
  align-items:center;
  justify-content:center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.90);
  cursor: pointer;
}
.nav-toggle:hover{ background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.22); }
.nav-toggle-icon{ width: 22px; height: 22px; display:block; }

/* Mobile menu scrim (click/tap outside to close). */
.nav-scrim{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.58);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: 40;
}
body.nav-open .nav-scrim{ opacity: 1; pointer-events: auto; }
.nav-link{
  color: rgba(255,255,255,0.75);
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
}
.nav-link:hover{
  color: rgba(255,255,255,0.95);
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}
.btn:hover{ transform: translateY(-1px); border-color: rgba(255,255,255,0.22); background: rgba(255,255,255,0.08); }
.btn:active{ transform: translateY(0px); }
.btn-primary{
  background: linear-gradient(135deg, rgba(125,211,252,0.55), rgba(167,139,250,0.45));
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  box-shadow: 0 10px 26px rgba(0,0,0,.35);
}
.btn-primary:hover{
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.btn-primary:active{
  transform: translateY(0px);
  filter: brightness(1.02);
}
.btn:disabled,
.btn[disabled]{
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-secondary{
  border-color: rgba(167,139,250,0.30);
}

/* Light theme button tuning:
   - "Primary" needs a stronger surface so white label text remains readable.
   - Neutral buttons should use dark borders/surfaces instead of the dark-theme RGBA values. */
html[data-theme="light"] .btn{
  border-color: rgba(0,0,0,0.14);
  background: rgba(0,0,0,0.04);
}
html[data-theme="light"] .btn:hover{
  border-color: rgba(0,0,0,0.22);
  background: rgba(0,0,0,0.06);
}
html[data-theme="light"] .btn-primary{
  background: linear-gradient(135deg, rgba(6,68,95,0.92), rgba(59,31,150,0.86));
  border-color: rgba(0,0,0,0.12);
  color: rgba(255,255,255,0.96);
  box-shadow: 0 10px 26px rgba(0,0,0,0.14);
}
html[data-theme="light"] .btn-primary:hover{
  background: linear-gradient(135deg, rgba(6,68,95,0.98), rgba(59,31,150,0.92));
}

.chip{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.88);
}
.chip:hover{ background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.18); }
.chip-icon{ gap: 8px; }
.icon{ width: 16px; height: 16px; display:block; opacity: 0.9; }

/* Icon-only chips (social links): square hit area + crisp, unsquashed vector icons */
.chip.icon-only{
  padding: 0;
  width: 38px;
  height: 38px;
  position: relative;
  justify-content: center;
  gap: 0;
}
.icon-svg{
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
}
.sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Hero */
.hero{ padding-top: 70px; }
.hero-grid{
  display:grid;
  grid-template-columns: 1fr minmax(360px, 560px);
  gap: 26px;
  align-items: stretch;
}
.eyebrow{ margin: 0; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; font-size: 12px; }
.headline{ font-size: 44px; line-height: 1.06; letter-spacing: -0.03em; margin: 10px 0 12px; }
.subhead{ margin: 0 0 18px; color: var(--muted); font-size: 16px; max-width: 56ch; }

.cta-row{ display:flex; gap: 12px; flex-wrap: wrap; margin: 16px 0 18px; }

.quick-facts{ list-style:none; padding:0; margin: 0; display:flex; gap: 10px; flex-wrap: wrap; }
.pill{
  border: 1px solid var(--border);
  background: var(--card);
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
}

.inline-note{ margin-top: 18px; display:flex; align-items:center; gap: 10px; }

.hero-card{
  border-radius: var(--radius2);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: var(--shadow);
  overflow: hidden;
  display:flex;
  flex-direction: column;
}

.hero-card{
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.hero-card:hover,
.hero-card:focus-within{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.22);
}
.hero-card-top{ padding: 18px 18px 12px; }
.card-title{ margin: 0; font-size: 18px; letter-spacing: -0.01em; }
.card-subtitle{ margin: 6px 0 0; color: var(--muted); font-size: 13px; }

.featured-media{
  position: relative;
  border-top: 1px solid rgba(255,255,255,0.10);
  border-bottom: 1px solid rgba(255,255,255,0.10);
  aspect-ratio: 16 / 9;
  background: rgba(255,255,255,0.04);
  /* Ensure hover scaling never bleeds outside the media box. */
  overflow: hidden;
  isolation: isolate;
}
.featured-video{ width: 100%; height: 100%; object-fit: cover; display:block; position: relative; z-index: 1; }
.media-overlay{
  position:absolute; inset: 0;
  display:flex; align-items:center; justify-content:center;
  font-size: 38px;
  color: rgba(255,255,255,0.86);
  background: radial-gradient(120px 120px at 50% 50%, rgba(0,0,0,0.30), transparent 60%);
  pointer-events: none;
  opacity: 0.95;
  z-index: 2;
}

.hero-card-bottom{ padding: 14px 18px 18px; display:flex; align-items:center; justify-content:space-between; gap: 10px; flex-wrap: wrap; }
.card-meta{ display:flex; gap: 8px; flex-wrap: wrap; }
.tag{
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.84);
  font-size: 12px;
}
.card-link{ color: rgba(255,255,255,0.86); text-decoration: underline; text-underline-offset: 3px; }

/* Featured card emphasis (make the hero project unmistakable) */
.hero-card.hero-featured{
  position: relative;
  transform: translateY(-4px);
  border-color: rgba(125,211,252,0.28);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 28px 84px rgba(0,0,0,0.55), 0 0 0 1px rgba(167,139,250,0.14);
}
.hero-card.hero-featured::before{
  content:"";
  position:absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(125,211,252,0.55), rgba(167,139,250,0.48), rgba(255,255,255,0.06));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events:none;
  opacity: 0.75;
}
.hero-card.hero-featured:hover,
.hero-card.hero-featured:focus-within{
  transform: translateY(-7px) scale(1.01);
  border-color: rgba(125,211,252,0.42);
  box-shadow: 0 34px 98px rgba(0,0,0,0.62), 0 0 0 1px rgba(167,139,250,0.18);
}

.hero-card.hero-featured .card-title{ font-size: 20px; }
.hero-card.hero-featured .media-overlay{ font-size: 44px; }

.featured-row{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.featured-badge{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(125,211,252,0.32);
  background: rgba(125,211,252,0.14);
  color: rgba(255,255,255,0.92);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.featured-badge::before{
  content:"";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(125,211,252,0.95);
  box-shadow: 0 0 0 4px rgba(125,211,252,0.16);
}

.featured-actions{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-left: auto;
}

.btn-sm{
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
}

html[data-theme="light"] .hero-card.hero-featured{
  background: rgba(255,255,255,0.75);
  border-color: rgba(6,68,95,0.22);
  box-shadow: 0 22px 62px rgba(0,0,0,0.12), 0 0 0 1px rgba(59,31,150,0.10);
}
html[data-theme="light"] .hero-card.hero-featured::before{
  opacity: 0.55;
}
html[data-theme="light"] .featured-badge{
  border-color: rgba(6,68,95,0.22);
  background: rgba(6,68,95,0.08);
  color: rgba(15,23,42,0.92);
}
html[data-theme="light"] .featured-badge::before{
  background: rgba(6,68,95,0.85);
  box-shadow: 0 0 0 4px rgba(6,68,95,0.10);
}

/* About */
.two-col{
  display:grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: start;
}

.about-points{
  margin-top: 18px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.info-card{
  padding: 14px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
}
.info-card h3{ margin: 0 0 10px; font-size: 14px; letter-spacing: -0.01em; color: rgba(255,255,255,0.90); }
.info-card ul{ margin: 0; padding-left: 18px; color: var(--muted); }
.info-card li{ margin: 6px 0; }

.profile-card{
  border-radius: var(--radius2);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.profile-photo{ width: 100%; display:block; aspect-ratio: 1 / 1; object-fit: cover; background: rgba(255,255,255,0.04); }
.profile-body{ padding: 16px; }
.profile-name{ font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.profile-sub{ color: var(--muted); margin-top: 4px; font-size: 13px; }
.profile-links{ display:flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* Projects */
.projects-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.project-card{
  display:block;
  border-radius: var(--radius2);
  overflow:hidden;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  box-shadow: 0 12px 40px rgba(0,0,0,0.32);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}
.project-card:hover{
  transform: translateY(-2px);
  border-color: rgba(125,211,252,0.38);
  background: rgba(255,255,255,0.06);
}
.project-media{
  position: relative;
  aspect-ratio: 16 / 9;
  background: rgba(255,255,255,0.04);
  /* Keep scaled video contained so the overlay always covers it. */
  overflow: hidden;
  isolation: isolate;
}
.project-video{
  width:100%; height:100%;
  object-fit: cover;
  display:block;
  filter: saturate(1.05) contrast(1.02);
  transform: scale(1.02);
  transition: transform 240ms ease, filter 240ms ease;
  position: relative;
  z-index: 1;
}
.project-card:hover .project-video{
  transform: scale(1.06);
  filter: saturate(1.10) contrast(1.05);
}
.project-overlay{
  position:absolute; inset: 0;
  display:flex; align-items:center; justify-content:center;
  font-size: 34px;
  color: rgba(255,255,255,0.92);
  opacity: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.08), rgba(0,0,0,0.38));
  transition: opacity 200ms ease;
  z-index: 2;
}
.project-card:hover .project-overlay{ opacity: 1; }
.project-caption{
  padding: 12px 12px 14px;
}
.project-title{ font-weight: 800; letter-spacing: -0.02em; }
.project-meta{ color: var(--muted); margin-top: 4px; font-size: 13px; }

/* Timeline */
.timeline{ display:grid; gap: 12px; }
.timeline-item{
  padding: 16px;
  border-radius: var(--radius2);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
}
.timeline-top{ display:flex; justify-content:space-between; gap: 12px; align-items: baseline; }
.timeline-role{ font-weight: 800; }
.timeline-org{ color: var(--muted); font-size: 13px; margin-top: 2px; }
.timeline-date{ color: var(--muted2); font-size: 13px; }
.timeline-bullets{ margin: 10px 0 0; padding-left: 18px; color: var(--muted); }
.timeline-bullets li{ margin: 6px 0; }

/* Skills */
.skills-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.skill-card{
  padding: 16px;
  border-radius: var(--radius2);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
}
.skill-card h3{ margin: 0 0 10px; font-size: 16px; letter-spacing: -0.01em; }
.skill-list{ list-style:none; padding:0; margin:0; display:flex; gap: 10px; flex-wrap: wrap; }
.skill-pill{
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.86);
  font-size: 13px;
}

/* Services */
.services-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.panel{
  padding: 16px;
  border-radius: var(--radius2);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
}
.panel h3{ margin:0 0 10px; font-size: 16px; }
.availability-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin: 0 0 10px;
}
.availability-head h3{ margin: 0; }
.bullets{ margin: 0; padding-left: 18px; color: var(--muted); }
.bullets li{ margin: 6px 0; }

/* Cards */
.cards-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.card{
  padding: 16px;
  border-radius: var(--radius2);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
}
.card h3{ margin:0 0 8px; font-size: 16px; }

/* Press kit */
.presskit-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.download-list{ margin: 0; padding-left: 18px; color: rgba(255,255,255,0.86); }
.download-list a{ text-decoration: underline; text-underline-offset: 3px; }

/* Contact */
.contact-form{
  max-width: 760px;
  display:grid;
  gap: 12px;
}

.form{
  display:grid;
  gap: 14px;
}
.form .field{
  display:grid;
  gap: 6px;
}
.form-row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
label{ display:grid; gap: 6px; font-size: 13px; color: rgba(255,255,255,0.86); }
input, textarea{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(11,15,24,0.50);
  color: rgba(255,255,255,0.92);
  outline: none;
}
input:focus, textarea:focus{ border-color: rgba(125,211,252,0.55); box-shadow: 0 0 0 4px rgba(125,211,252,0.14); }

.form-actions{ display:flex; align-items:center; gap: 12px; flex-wrap: wrap; margin-top: 2px; }

/* Modal */
.modal{
  position: fixed;
  inset: 0;
  display: none;
  /* Ensure the modal sits above sticky header, cards, and any other stacking contexts. */
  z-index: 1000;
  isolation: isolate;
}
.modal[aria-hidden="false"]{ display:block; }
.modal-backdrop{
  position:absolute; inset:0;
  background: rgba(0,0,0,0.58);
}
.modal-panel{
  position: relative;
  max-width: 920px;
  margin: 6vh auto;
  background: rgba(15,22,38,0.96);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 22px;
  box-shadow: 0 22px 90px rgba(0,0,0,0.55);
  overflow:hidden;
}
.modal-close{
  position:absolute;
  top: 12px; right: 12px;
  width: 42px; height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.90);
  font-size: 22px;
  cursor: pointer;
}
.modal-close:hover{ background: rgba(255,255,255,0.10); }
.modal-body{ padding: 18px; }
.modal-title{ margin: 0 0 6px; letter-spacing: -0.02em; }
.modal-video{
  width: 100%;
  margin-top: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
}
.modal-links{ display:flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* Availability badge colors (Okabe–Ito palette) */
.badge{
  display:inline-flex;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
}
.badge.badge-sm{
  padding: 6px 9px;
  font-size: 12px;
}
.badge.avail-not{
  border-color: rgba(213, 94, 0, 0.55);
  background: rgba(213, 94, 0, 0.14);
}
.badge.avail-partial{
  border-color: rgba(230, 159, 0, 0.55);
  background: rgba(230, 159, 0, 0.14);
}
.badge.avail-full{
  border-color: rgba(0, 158, 115, 0.55);
  background: rgba(0, 158, 115, 0.14);
}

/* Footer */
.site-footer{
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  padding: 20px 0;
}
.footer-inner{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}
.footer-link{ color: rgba(255,255,255,0.78); text-decoration: underline; text-underline-offset: 3px; }

/* Responsive */
@media (max-width: 980px){
  .hero-grid{ grid-template-columns: 1fr; }
  .two-col{ grid-template-columns: 1fr; }
  .about-points{ grid-template-columns: 1fr; }
  .projects-grid{ grid-template-columns: repeat(2, 1fr); }
  .skills-grid{ grid-template-columns: repeat(2, 1fr); }
  .cards-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px){
  .nav-toggle{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Slightly larger, but still leaves breathing room inside the top bar. */
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  /* No visible background by default (user requested). */
  background: transparent;
  color: rgba(255,255,255,0.92);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  line-height: 0;
  margin: 0;
  align-self: center;
}
  /* Provide a subtle press affordance on touch devices without a persistent background. */
  .nav-toggle:active{ background: rgba(255,255,255,0.06); }
  .nav-toggle-icon{ width: 18px; height: 18px; }

  .header-inner{ padding: 12px 0; }

  /* Mobile menu: dropdown panel that toggles via body.nav-open (set in main.js). */
  .site-nav{
    position: absolute;
    top: calc(100% + 8px);
    right: 10px;
    /* Narrower dropdown panel on mobile. */
    /* Hug content width (menu sizes to its link text + padding). */
    display: inline-grid;
    width: fit-content;
    max-width: calc(100vw - 24px);

    gap: 3px;
    grid-template-columns: max-content;
    padding: 4px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(15,22,38,0.98);
    box-shadow: 0 18px 60px rgba(0,0,0,0.55);
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
    max-height: min(70vh, calc(100vh - 92px));
    overflow: auto;
    z-index: 60;
  }
  body.nav-open .site-nav{
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav-link{
    display:block;
    /* Extra left inset for readability; slightly tighter right side to keep the panel narrow. */
    padding: 10px 10px 10px 14px;
    border-radius: 12px;
  }

  .headline{ font-size: 36px; }
  .projects-grid{ grid-template-columns: 1fr; }
  .skills-grid{ grid-template-columns: 1fr; }
  .services-grid{ grid-template-columns: 1fr; }
  .presskit-grid{ grid-template-columns: 1fr; }
  .cards-grid{ grid-template-columns: 1fr; }
  .form-row{ grid-template-columns: 1fr; }

  /* Modal: fit comfortably on small screens and allow scrolling within the panel. */
  .modal-panel{
    width: calc(100% - 24px);
    margin: 4vh auto;
    max-height: 92vh;
    display:flex;
    flex-direction: column;
  }
  .modal-body{ overflow: auto; }
  .modal-video{ max-height: 45vh; }
}

@media (max-width: 420px){
  .container{ padding: 0 16px; }
  .headline{ font-size: 32px; }
  .hero{ padding-top: 62px; }
  .brand-icon{ width: 24px; height: 24px; }
  .brand-text{ font-size: 14px; }
}

/* Touch devices: avoid hover-only affordances and keep previews readable. */
@media (hover: none) and (pointer: coarse){
  .chip.icon-only{ width: 44px; height: 44px; }
  .project-card:hover{ transform: none; }
  .hero-card:hover{ transform: none; }
  .project-card:hover .project-video{ transform: scale(1.02); }

  .project-overlay{
    opacity: 1;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 10px;
    font-size: 22px;
    background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.42));
  }
  .project-card:hover .project-overlay{ opacity: 1; }
}


.brand-icon{ width: 28px; height: 28px; border-radius: 8px; display:block; }


/* ===== Devlog selector + cards ===== */
.devlog-toolbar{
  display:flex;
  align-items:flex-end;
  justify-content:flex-start;
  margin: 10px 0 18px;
}
.select-label{
  display:grid;
  gap:8px;
  font-size: 12px;
  color: rgba(255,255,255,.72);
}
.select{
  appearance:none;
  -webkit-appearance:none;
  -moz-appearance:none;
  padding: 12px 44px 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.16);
  background:
    radial-gradient(1200px 700px at 20% 10%, rgba(125,211,252,.10), transparent 60%),
    rgba(12,16,24,.55);
  color: rgba(255,255,255,.92);
  outline: none;
  min-width: 240px;
}
.select:focus-visible{
  box-shadow: 0 0 0 4px rgba(125,211,252,.18);
  border-color: rgba(125,211,252,.45);
}
.select-label{
  position: relative;
}
.select-label::after{
  content: "▾";
  position: absolute;
  right: 14px;
  bottom: 12px;
  color: rgba(255,255,255,.55);
  pointer-events: none;
  font-size: 14px;
}
.devlog-grid{
  gap: 14px;
}
.devlog-card h3{
  margin: 0;
  font-size: 16px;
  letter-spacing: .2px;
}
.devlog-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.devlog-tags{
  margin-bottom: 10px;
}

/* ===== Footer (modern) ===== */
.site-footer{
  margin-top: 20px;
  border-top: 1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(1200px 700px at 20% 10%, rgba(125,211,252,.08), transparent 60%),
    radial-gradient(900px 600px at 90% 10%, rgba(167,139,250,.06), transparent 55%),
    rgba(10,12,18,.78);
}
.footer-grid{
  display:grid;
  grid-template-columns: 1.35fr repeat(4, minmax(140px, 1fr));
  gap: 24px;
  padding: 34px 0 18px;
}
.footer-logo{
  display:flex;
  align-items:center;
  gap: 10px;
  text-decoration: none;
}
.footer-blurb{
  margin-top: 10px;
  max-width: 44ch;
}
.footer-social{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  margin-top: 14px;
}
.footer-col{
  display:flex;
  flex-direction:column;
  gap: 10px;
}
.footer-title{
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.70);
  margin: 2px 0 6px;
}
.footer-nav{
  color: rgba(255,255,255,.82);
  text-decoration: none;
  font-size: 14px;
}
.footer-nav:hover{
  color: #fff;
  text-decoration: underline;
}
.footer-bottom{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  padding: 18px 0 26px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.74);
  font-size: 13px;
}
.footer-link{
  color: rgba(255,255,255,.82);
  text-decoration: none;
}
.footer-link:hover{
  color:#fff;
  text-decoration: underline;
}

@media (max-width: 980px){
  .footer-grid{
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px){
  .footer-grid{
    grid-template-columns: 1fr;
  }
  .footer-bottom{
    flex-direction: column;
    align-items: flex-start;
  }
}


/* Lightweight buffering indicator for modal video */
.modal.is-buffering .modal-panel::after{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(0,0,0,0.20);
}
.modal.is-buffering .modal-panel::before{
  content: "";
  position: absolute;
  width: 44px;
  height: 44px;
  left: 50%;
  top: 50%;
  margin-left: -22px;
  margin-top: -22px;
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,0.20);
  border-top-color: rgba(255,255,255,0.90);
  animation: spin 0.9s linear infinite;
  pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }



/* =======================================================================
   Realms-inspired visual refresh (layout + typography + cards)
   Notes:
   - Keeps your existing color tokens (accents stay the same).
   - Uses CSS variables so Light/Dark are consistent.
   ======================================================================= */

:root{
  --hairline: rgba(255,255,255,0.12);
  --panel: rgba(255,255,255,0.04);
  --panel2: rgba(255,255,255,0.06);
  /* Solid panel used for floating UI (menus) so the background can't bleed through. */
  --panelSolid: rgba(10,12,18,0.96);
  --focus: 0 0 0 3px rgba(125,211,252,0.22);
  --hero-media: none; /* set by JS when a featured poster exists */
}

html[data-theme="light"]{
  --hairline: rgba(0,0,0,0.14);
  --panel: rgba(0,0,0,0.03);
  --panel2: rgba(0,0,0,0.05);
  --panelSolid: rgba(255,255,255,0.98);
  --focus: 0 0 0 3px rgba(125,211,252,0.25);
}

body{
  background:
    radial-gradient(1200px 700px at 18% -10%, rgba(125,211,252,0.18), transparent 58%),
    radial-gradient(900px 600px at 92% 6%, rgba(167,139,250,0.16), transparent 58%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
}

body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 96px 96px;
  opacity: 0.06;
  transform: translateZ(0);
  z-index: 0;
}
html[data-theme="light"] body::before{
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.08) 1px, transparent 1px);
  opacity: 0.05;
}

main, .site-header, .site-footer{
  position: relative;
  z-index: 1;
}

/* --- Global typography tweaks (more "publisher" feel) --- */
.hero-eyebrow,
.section-title,
.card-title,
.project-title,
.footer-col h4{
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.section-title{
  font-weight: 900;
}

/* --- Header: tighter, stronger, closer to 3D Realms style --- */
.site-header{
  background: rgba(11,15,24,0.82);
  border-bottom: 1px solid var(--hairline);
}
html[data-theme="light"] .site-header{
  background: rgba(255,255,255,0.86);
}

.header-inner{
  padding: 12px 0;
}

.brand-text{
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.14em;
}

.brand-icon{
  width: 30px;
  height: 30px;
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.35);
}

.header-actions{
  display:flex;
  align-items:center;
  gap: 10px;
}

/* Theme toggle + hamburger: icon-only, no permanent background */
.theme-toggle,
.nav-toggle{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items:center;
  justify-content:center;
  cursor: pointer;
}

.theme-toggle:hover,
.nav-toggle:hover{
  background: rgba(255,255,255,0.06);
}
html[data-theme="light"] .theme-toggle:hover,
html[data-theme="light"] .nav-toggle:hover{
  background: rgba(0,0,0,0.05);
}

.theme-toggle:focus-visible,
.nav-toggle:focus-visible,
.nav-link:focus-visible,
.btn:focus-visible,
.chip:focus-visible,
.card-link:focus-visible{
  outline: none;
  box-shadow: var(--focus);
  border-radius: 14px;
}

/* Show the correct icon via CSS (sun when dark, moon when light) */
.theme-toggle .icon-sun{ display: inline; }
.theme-toggle .icon-moon{ display: none; }
html[data-theme="light"] .theme-toggle .icon-sun{ display: none; }
html[data-theme="light"] .theme-toggle .icon-moon{ display: inline; }

.site-nav{
  gap: 14px;
}

.nav-link{
  color: var(--muted);
  padding: 10px 10px;
  border-radius: 12px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  position: relative;
}

.nav-link:hover{
  color: var(--text);
  background: rgba(255,255,255,0.06);
}
html[data-theme="light"] .nav-link:hover{
  background: rgba(0,0,0,0.05);
}

/* --- Hero: banner treatment + featured-media "spotlight" --- */
.hero{
  padding-top: clamp(64px, 6vw, 92px);
  padding-bottom: clamp(56px, 5vw, 82px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.hero::before{
  content:"";
  position:absolute;
  inset: -80px;
  z-index: 0;
  background-image:
    radial-gradient(1200px 600px at 20% 5%, rgba(125,211,252,0.22), transparent 60%),
    radial-gradient(900px 540px at 85% 18%, rgba(167,139,250,0.18), transparent 62%),
    var(--hero-media);
  /* Keep the featured poster focused behind the featured column */
  background-size: auto, auto, cover;
  background-position: 20% 5%, 85% 18%, 78% 40%;
  filter: blur(28px) saturate(1.14);
  opacity: 0.38;
  transform: scale(1.06);
  pointer-events:none;

  /* Fade the hero poster treatment into the global page background */
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 65%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 65%, rgba(0,0,0,0) 100%);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.hero > .container{ position: relative; z-index: 1; }

html[data-theme="light"] .hero::before{
  opacity: 0.22;
  filter: blur(28px) saturate(1.06);
}

/* Fallback fade for browsers without CSS masks. */
.hero::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height: 220px;
  z-index: 0;
  pointer-events:none;
  background: linear-gradient(to bottom, rgba(0,0,0,0), var(--bg) 85%);
  display:none;
}
html[data-theme="light"] .hero::after{
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--bg) 85%);
}
@supports not ((-webkit-mask-image: linear-gradient(to bottom, #000, transparent)) or (mask-image: linear-gradient(to bottom, #000, transparent))){
  .hero::after{ display:block; }
}


.hero-grid{
  gap: clamp(20px, 3vw, 44px);
}

.hero-eyebrow{
  font-size: 12px;
  color: var(--muted2);
}

.hero-headline{
  font-weight: 950;
  letter-spacing: -0.03em;
  line-height: 1.02;
  font-size: clamp(40px, 4.7vw, 66px);
  margin: 10px 0 12px;
}

.hero-subhead{
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 56ch;
}

/* Replace "pills" in hero with bold tagline words */
.hero .pill-row{
  gap: 12px;
  padding: 0;
}
.hero .pill{
  background: transparent;
  border: 1px solid transparent;
  padding: 0;
  border-radius: 0;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0.92;
}
.hero .pill:nth-child(1){ color: var(--accentText); }
.hero .pill:nth-child(2){ color: var(--text); }
.hero .pill:nth-child(3){ color: var(--accent2Text); }

/* In light mode, avoid any extra fading on the hero skill words so they remain crisp. */
html[data-theme="light"] .hero .pill{ opacity: 1; }

.hero-card{
  border-radius: 18px;
  border: 1px solid var(--hairline);
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  box-shadow: 0 28px 90px rgba(0,0,0,0.45);
  overflow: hidden;
}

html[data-theme="light"] .hero-card{
  box-shadow: 0 22px 70px rgba(0,0,0,0.16);
}

.hero-card-top{
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--hairline);
}
.hero-card .card-title{
  font-size: 14px;
  letter-spacing: 0.14em;
  margin: 0 0 6px;
}
.hero-card .card-subtitle{
  margin: 0;
  color: var(--muted);
}

.featured-media{
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.featured-video{
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}
.media-overlay{
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
}
html[data-theme="light"] .media-overlay{
  background: rgba(255,255,255,0.52);
}

.hero-card-bottom{
  padding: 14px 18px 18px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
}

.tag{
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,0.05);
  padding: 6px 10px;
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
html[data-theme="light"] .tag{
  background: rgba(0,0,0,0.04);
}

.card-link{
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  color: var(--text);
  opacity: 0.92;
}
.card-link:hover{ opacity: 1; }

/* --- Sections + cards: more editorial separation --- */
.section{
  padding: clamp(56px, 5.4vw, 86px) 0;
}

.section.alt{
  /* Keep background continuous across page; section separation is handled by dividers/headers */
  background: transparent;
  border-top: 0;
  border-bottom: 0;
}

html[data-theme="light"] .section.alt{
  background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.00));
}

.section-head{
  margin-bottom: 22px;
}

.section-head .muted{
  max-width: 70ch;
}

/* Cards: flatter corners + strong border */
.card{
  border: 1px solid var(--hairline);
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  box-shadow: none;
}
.card:hover{
  border-color: rgba(125,211,252,0.28);
}

/* Devlogs as "news cards" */
.devlog-card h3{
  margin: 0;
  text-transform: none;
  letter-spacing: -0.01em;
  font-size: 18px;
}
.devlog-head{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 10px;
}
.devlog-tags{
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* --- Projects: game-card treatment (image/video + caption overlay) --- */
.project-card{
  position: relative;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(0,0,0,0.18);
}

.project-media{
  aspect-ratio: 16/9;
}

.project-video{
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 220ms ease;
}

.project-card:hover .project-video{
  transform: scale(1.06);
}

.project-overlay{
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  transition: transform 180ms ease, opacity 180ms ease;
}
html[data-theme="light"] .project-overlay{
  background: rgba(255,255,255,0.52);
}

.project-card:hover .project-overlay{
  transform: scale(1.06);
}

.project-caption{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 16px 14px;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.68) 55%, rgba(0,0,0,0.88) 100%);
  border-top: 1px solid rgba(255,255,255,0.12);
}
html[data-theme="light"] .project-caption{
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.72) 55%, rgba(255,255,255,0.92) 100%);
  border-top: 1px solid rgba(0,0,0,0.10);
}

.project-title{
  font-size: 12px;
  letter-spacing: 0.14em;
  font-weight: 900;
  margin-bottom: 6px;
}
.project-meta{
  color: rgba(255,255,255,0.78);
}
html[data-theme="light"] .project-meta{
  color: rgba(0,0,0,0.70);
}

/* --- Form elements: match the new style --- */
input, textarea, select{
  border: 1px solid var(--hairline);
  background: var(--panel);
}
input:focus, textarea:focus, select:focus{
  outline: none;
  box-shadow: var(--focus);
  border-color: rgba(125,211,252,0.30);
}

.select{
  border-radius: 14px;
  background: var(--panel);
  padding: 12px 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
}

/* --- Footer: heavier separators, more like a publisher site --- */
.site-footer{
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.00));
  border-top: 1px solid var(--hairline);
}

/* --- Mobile: keep the menu narrow (fit-content) and padded left --- */
@media (max-width: 620px){
  .header-inner{
    padding: 10px 0;
  }

  .site-nav{
    position: fixed;
    top: 62px;
    right: 12px;
    width: max-content;
    max-width: calc(100vw - 24px);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 8px;
    border-radius: 16px;
    border: 1px solid var(--hairline);
    background: rgba(15,22,38,0.96);
    box-shadow: 0 24px 90px rgba(0,0,0,0.55);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
    z-index: 60;
  }
  html[data-theme="light"] .site-nav{
    background: rgba(255,255,255,0.96);
    box-shadow: 0 24px 70px rgba(0,0,0,0.18);
  }

  body.nav-open .site-nav{
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-link{
    padding: 11px 16px 11px 18px; /* left buffer to tighten overall menu width */
    border-radius: 14px;
    white-space: nowrap;
  }

  .nav-toggle,
  .theme-toggle{
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  /* Hamburger should only exist on mobile. */
  .nav-toggle{ display: inline-flex; }
}

/* =====================================================================
   Light mode readability + interaction fixes
   - Ensures all common UI surfaces (cards/panels/pills/forms) inherit the
     active theme tokens.
   - Prevents overlay elements from stealing clicks from videos/links.
   - Keeps the hamburger hidden on desktop.
   ===================================================================== */

/* Desktop: hide hamburger menu entirely (nav links are already visible). */
@media (min-width: 621px){
  .nav-toggle{ display: none !important; }
}

/* Sections: account for sticky header when navigating by anchors. */
.section{ scroll-margin-top: 92px; }

/* Theme-aware surface defaults for areas that previously hard-coded dark colors. */
.info-card,
.profile-card,
.timeline-item,
.skill-card,
.panel,
.card{
  border: 1px solid var(--hairline);
  background: linear-gradient(180deg, var(--panel2), var(--panel));
}

/* Buttons / chips: remove remaining dark-mode hard-codes so contrast stays correct in light mode. */
.btn,
.chip{
  border: 1px solid var(--hairline);
  background: var(--panel);
  color: var(--text);
}
.btn:hover,
.chip:hover{
  background: var(--panel2);
  border-color: rgba(125,211,252,0.30);
}

/* Primary stays colorful; ensure text remains readable on both themes.
   Note: defined here (late in the stylesheet) so it overrides the generic .btn surface styles. */
.btn-primary{
  background: linear-gradient(135deg, rgba(125,211,252,0.55), rgba(167,139,250,0.45));
  border-color: rgba(255,255,255,.22);
  color: rgba(255,255,255,0.96);
  box-shadow: 0 10px 26px rgba(0,0,0,.35);
}
.btn-primary:hover{
  background: linear-gradient(135deg, rgba(125,211,252,0.62), rgba(167,139,250,0.52));
  border-color: rgba(255,255,255,.28);
  filter: brightness(1.04);
}
.btn-primary:active{
  filter: brightness(1.01);
}
html[data-theme="light"] .btn-primary{
  background: linear-gradient(135deg, rgba(6,68,95,0.92), rgba(59,31,150,0.86));
  border-color: rgba(0,0,0,0.12);
  box-shadow: 0 10px 26px rgba(0,0,0,0.14);
}
html[data-theme="light"] .btn-primary:hover{
  background: linear-gradient(135deg, rgba(6,68,95,0.98), rgba(59,31,150,0.92));
  border-color: rgba(0,0,0,0.16);
  filter: none;
}

/* Pills / chips */
.skill-pill,
.tag,
.badge{
  border: 1px solid var(--hairline);
  color: var(--text);
}
.skill-pill{
  background: var(--panel);
}

/* About card headings were hard-coded to white, which washed out in light mode. */
.info-card h3{ color: var(--text); }

/* Forms: ensure text/labels/placeholder are readable in both themes. */
label,
.label{ color: var(--text); }
input,
textarea,
select{
  color: var(--text);
}
input::placeholder,
textarea::placeholder{
  color: var(--muted2);
  opacity: 1;
}

/* Project thumbnails: overlays should not steal clicks; clicks should land on the card. */
.project-overlay,
.media-overlay{ pointer-events: none; }
.project-video,
.featured-video{ pointer-events: none; }

/* Modern play affordance: a centered, glassy circle (instead of a full overlay). */
.project-overlay,
.media-overlay{
  position: absolute;
  inset: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(0,0,0,0.42);
  backdrop-filter: blur(8px);

  font-size: 26px;
  line-height: 1;
  color: rgba(255,255,255,0.92);
  opacity: 0.92;
  transition: transform 180ms ease, opacity 180ms ease;
}
html[data-theme="light"] .project-overlay,
html[data-theme="light"] .media-overlay{
  background: rgba(255,255,255,0.62);
  color: rgba(0,0,0,0.86);
}

.project-card:hover .project-overlay,
.hero-card:hover .media-overlay{
  transform: translate(-50%, -50%) scale(1.06);
  opacity: 1;
}

/* Modal stacking: make sure backdrop can never cover the panel/video controls. */
.modal-backdrop{ z-index: 1; }
.modal-panel{ z-index: 2; }

/* Footer: provide a true light-theme treatment so text never "disappears". */
html[data-theme="light"] .site-footer{
  background:
    radial-gradient(1200px 700px at 20% 10%, rgba(125,211,252,.08), transparent 60%),
    radial-gradient(900px 600px at 90% 10%, rgba(167,139,250,.06), transparent 55%),
    rgba(255,255,255,.82);
}
html[data-theme="light"] .footer-title{ color: rgba(0,0,0,.62); }
html[data-theme="light"] .footer-nav,
html[data-theme="light"] .footer-bottom,
html[data-theme="light"] .footer-link{
  color: rgba(0,0,0,.78);
}
html[data-theme="light"] .footer-nav:hover,
html[data-theme="light"] .footer-link:hover{ color: rgba(0,0,0,.95); }
html[data-theme="light"] .footer-bottom{ border-top: 1px solid var(--hairline); }

/* Featured card CTA: make "See all projects" feel like a modern control. */
.card-link{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--panel);
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}
.card-link:hover{
  transform: translateY(-1px);
  background: var(--panel2);
  border-color: rgba(125,211,252,0.30);
  opacity: 1;
}




/* ===== Patch: Light mode parity + continuous background (2026-01-09) ===== */


/* 1) Continuous background: remove section striping while keeping clear headings. */
.section.alt{
  /* Keep background continuous across page; section separation is handled by dividers/headers */
  background: transparent;
  border-top: 0;
  border-bottom: 0;
}

.section-title{ position: relative; }
.section-title::after{
  content: "";
  display: block;
  width: 92px;
  height: 4px;
  border-radius: 999px;
  margin-top: 12px;
  background: linear-gradient(90deg, rgba(125,211,252,0.80), rgba(167,139,250,0.72));
  opacity: 0.85;
}
html[data-theme="light"] .section-title::after{ opacity: 0.62; }

/* 2) Disable the heavy grid texture (we use a fixed ambient background instead). */
body::before{
  background-image: none;
  opacity: 0;
}

/* 3) Hero quick-fact pills: restore chip styling for readability in light mode. */
.hero .quick-facts .pill{
  background: var(--panel2);
  border: 1px solid var(--hairline);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: none;
  opacity: 1;
}

/* 4) Video play affordance: ensure it is truly centered regardless of card size.
      (We use an overlay that fills the media and a centered .play-icon button.) */
.project-overlay,
.media-overlay{
  position: absolute;
  inset: 0 !important;
  display: grid !important;
  place-items: center !important;
  transform: none !important;
  width: auto !important;
  height: auto !important;
  border: 0 !important;
  background: transparent !important;
  backdrop-filter: none !important;
  pointer-events: none;
}

.play-icon{
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(0,0,0,0.42);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,0.92);
  font-size: 26px;
  line-height: 1;
  transform: translateX(1px);
  transition: transform 180ms ease, opacity 180ms ease;
}

html[data-theme="light"] .play-icon{
  background: rgba(255,255,255,0.66);
  color: rgba(0,0,0,0.86);
}

.project-card:hover .play-icon,
.hero-card:hover .play-icon{
  transform: translateX(1px) scale(1.06);
}

@media (hover: none) and (pointer: coarse){
  .project-overlay{ place-items: end; padding: 10px; }
  .project-overlay .play-icon{ width: 56px; height: 56px; font-size: 22px; }
}

/* 5) Modal light/dark parity + guarantee topmost stacking. */
:root{
  --modal-surface: rgba(15,22,38,0.96);
  --modal-surface-border: rgba(255,255,255,0.14);
  --modal-close-surface: rgba(255,255,255,0.06);
  --modal-shadow: 0 24px 80px rgba(0,0,0,0.55);
}
html[data-theme="light"]{
  --modal-surface: rgba(255,255,255,0.94);
  --modal-surface-border: rgba(0,0,0,0.14);
  --modal-close-surface: rgba(0,0,0,0.06);
  --modal-shadow: 0 22px 60px rgba(0,0,0,0.18);
}

.modal{ z-index: 5000; }
.modal-panel{
  background: var(--modal-surface);
  border-color: var(--modal-surface-border);
  box-shadow: var(--modal-shadow);
}
html[data-theme="light"] .modal-panel{ color-scheme: light; }
html[data-theme="dark"] .modal-panel{ color-scheme: dark; }

.modal-close{
  background: var(--modal-close-surface);
  border-color: var(--modal-surface-border);
  color: var(--text);
}
.modal-close:hover{ border-color: rgba(125,211,252,0.42); }

.modal-video{
  background: rgba(0,0,0,0.06);
  border-color: var(--modal-surface-border);
}

/* 6) Devlog grid + select styling that works in both themes. */
.devlog-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.select-label{ color: var(--muted2); }
.select{
  background: var(--panel2);
  border-color: var(--hairline);
  color: var(--text);
}
.select-label::after{ color: var(--muted2); }

/* 7) Light theme: make key surfaces slightly more opaque so backgrounds never show “through” cards. */
html[data-theme="light"] .project-card,
html[data-theme="light"] .hero-card,
html[data-theme="light"] .info-card,
html[data-theme="light"] .profile-card,
html[data-theme="light"] .panel,
html[data-theme="light"] .card{
  background: rgba(255,255,255,0.92);
  border-color: rgba(0,0,0,0.14);
  box-shadow: 0 14px 44px rgba(0,0,0,0.12);
}


/* ===== Patch: Truly continuous background + tighter section spacing (2026-01-09 v3) =====
   Goal:
   - The background should not “restart” or appear stripy between sections.
   - Sections should still feel distinct via dividers/typography, not different section backgrounds.
   - Reduce excess vertical whitespace above/below section headings.
*/

/* Continuous background: paint on a fixed layer so it does not vary by scroll position.
   (More reliable than a body-scrolling gradient when using large radial glows.) */
body{
  background: var(--bg);
}

/* Ambient glow layer */
body::before{
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background:
    radial-gradient(1400px 800px at 18% 12%, rgba(125,211,252,0.20), transparent 60%),
    radial-gradient(1200px 760px at 82% 18%, rgba(167,139,250,0.18), transparent 62%),
    radial-gradient(900px 640px at 50% 88%, rgba(56,189,248,0.10), transparent 64%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  transform: translateZ(0);
}

/* Subtle vignette to keep edges controlled */
body::after{
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(1200px 900px at 50% 50%, transparent 55%, rgba(0,0,0,0.35) 100%);
  opacity: 0.72;
}
html[data-theme="light"] body::after{
  background: radial-gradient(1200px 900px at 50% 50%, transparent 55%, rgba(0,0,0,0.10) 100%);
  opacity: 1;
}

/* Ensure sections never introduce their own “stripe” backgrounds in either theme. */
.section.alt,
html[data-theme="light"] .section.alt{
  background: transparent;
}

/* Tighter vertical rhythm (reduces the large empty bands above headings). */
.section{
  padding: clamp(38px, 3.8vw, 60px) 0;
}

.section-head{
  margin-bottom: 18px;
  padding-bottom: 10px;
  gap: 10px;
}

.section-head p{
  margin: 0;
}

/* Updates selector spacing was reading a bit tall. */
.devlog-toolbar{
  margin: 10px 0 14px;
}

@media (max-width: 620px){
  .section{ padding: 36px 0; }
  .section-head{ margin-bottom: 16px; }
}

/* ===== Themed dropdown picker (custom selectbox) =====
   Rationale: Native <select> option menus are inconsistently themeable across OS/browser.
   This provides a consistent, on-brand dropdown while keeping the underlying select as the data source. */

.select-label.has-custom-select::after{ display: none; }

.select-label.has-custom-select > .select{
  position: absolute;
  inset: auto;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.selectbox{
  position: relative;
  min-width: 260px;
}

.selectbox-btn{
  width: 100%;
  appearance: none;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: var(--panel2);
  color: var(--text);
  padding: 12px 44px 12px 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  line-height: 1.1;
  cursor: pointer;
}

.selectbox-btn:focus-visible{
  outline: none;
  box-shadow: var(--focus);
}

.selectbox-btn::after{
  content: "▾";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted2);
  pointer-events: none;
  font-size: 14px;
}

.selectbox.open .selectbox-btn::after{
  transform: translateY(-50%) rotate(180deg);
}

.selectbox-menu{
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 50;
  background: var(--panelSolid);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 8px;
  max-height: 320px;
  overflow: auto;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

.selectbox.open .selectbox-menu{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.selectbox-option{
  width: 100%;
  display: block;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
}

.selectbox-option:hover,
.selectbox-option:focus-visible{
  outline: none;
  background: rgba(255,255,255,0.06);
}
html[data-theme="light"] .selectbox-option:hover,
html[data-theme="light"] .selectbox-option:focus-visible{
  background: rgba(0,0,0,0.06);
}

.selectbox-option[aria-selected="true"]{
  background: rgba(125,211,252,0.12);
  border: 1px solid rgba(125,211,252,0.22);
}

.selectbox-option:disabled{
  opacity: 0.55;
  cursor: not-allowed;
}
