/* ================== Design Tokens (Dark as base) ================== */
:root{
  --bg: #0b0f17;
  --surface: #0f172a;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --line: #1f2a3b;
  --accent: #60a5fa;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(2,6,23,.35);
  --wrap: 75rem;
  --blur: 8px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Space Grotesk", var(--font-body);
  --top-glow: rgba(255,255,255,.08);
  --btn-primary: #87a6f3;
  --btn-primary-ink: #0f172a;
  --btn-dark: #121827;
  --btn-dark-border: #1e2a3d;
  --btn-glow: 0 14px 38px rgba(110,140,255,.22), 0 4px 12px rgba(110,140,255,.12);
}

/* Light theme overrides */
:root[data-theme="light"]{
  --bg: #f7f9fc;
  --surface: #ffffff;
  --text: #0b1220;
  --muted: #5b6b7f;
  --line: #e5e9f0;
  --accent: #2563eb;
  --shadow: 0 18px 50px rgba(2,6,23,.08);
  --top-glow: rgba(255,255,255,.55);
  --btn-dark: #0f1729;
  --btn-dark-border: #1f2a3b;
}

/* ================== Base ================== */
*{
  box-sizing: border-box;
}

html,
body{
  height: 100%;
}

body{
  margin: 0;
  background: var(--bg, #0b0f17);
  color: var(--text, #e5e7eb);
  font: 1rem/1.6 var(--font-body, Arial);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background .35s ease, color .25s ease;
}

/* Stop the glow from widening the page */
body::before{
  content: "";
  position: fixed;
  inset: -25dvh 0 -35dvh 0;   /* ← remove the -10dvw left/right */
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60vw 40vw at 20% -10%, color-mix(in oklab, var(--accent) 28%, transparent), transparent 60%),
    radial-gradient(50vw 30vw at 80% -10%, color-mix(in oklab, var(--accent) 16%, transparent), transparent 60%);
  filter: blur(28px);
  opacity: .9;

  /* keep the glow wide without affecting layout width */
  left: 50%;
  width: 120vw;
  transform: translateX(-50%);
}


body::after{
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 36dvh;
  z-index: 10;
  pointer-events: none;
  background: linear-gradient(to bottom, var(--top-glow), rgba(255,255,255,0) 65%);
}

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

.wrap{
  max-width: var(--wrap, 1200px);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ================== Nav ================== */
.nav{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(120%) blur(var(--blur, 8px));
  background: color-mix(in oklab, var(--bg) 65%, transparent);
  border-bottom: 1px solid color-mix(in oklab, var(--line) 70%, transparent);
}

.nav-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.brand{
  display: flex;
  align-items: center;
  gap: .625rem;
  font: 600 1rem/1 var(--font-display);
  letter-spacing: .2px;
}

.brand-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 24px color-mix(in oklab, var(--accent) 80%, transparent);
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse{
  0%{
    transform: scale(1);
    opacity: 1;
  }
  50%{
    transform: scale(1.12);
    opacity: .85;
  }
  100%{
    transform: scale(1);
    opacity: 1;
  }
}

.links{
  display: flex;
  gap: 22px;
  align-items: center;
  /* ========== Modern nesting demo ========== */
  & a{
    color: var(--muted);
  }
  & a:hover{
    color: var(--text);
  }
}

/* Toggle button (disabled to satisfy "no JS") */
.toggle{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: .5rem .75rem;
  border-radius: 999px;
  cursor: not-allowed;
  border: 1px solid color-mix(in oklab, var(--line) 70%, transparent);
  background: var(--surface);
  color: var(--text);
  opacity: .6;
}

.toggle .icon{
  width: 18px;
  height: 18px;
  display: inline-block;
}

.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: 6rem 0 2.25rem;
}

h1{
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.06;
  letter-spacing: -.02em;
  margin: 0 0 .75rem;
}

.lead{
  color: var(--muted);
  max-width: 45rem;
  font-size: clamp(16px, 2.2vw, 20px);
}

/* ================== CTA Buttons (light + dark pair) ================== */
.cta{
  margin-top: 1.375rem;
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

.btn{
  --pad-y: .875rem;
  --pad-x: 1.375rem;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad-y) var(--pad-x);
  border-radius: 999px;
  border: none;
  outline: none;
  font-weight: 600;
  letter-spacing: .2px;
  font-size: 1.125rem;
  text-decoration: none;
  background:
    radial-gradient(140px 140px at var(--mx,50%) var(--my,50%), rgba(255,255,255,.08), transparent 46%),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.10) 60%),
    var(--btn-dark);
  box-shadow: inset 0 0 0 1px var(--btn-dark-border);
  transition: transform .18s ease, box-shadow .22s ease, background .2s ease;
}

.btn:hover{
  transform: translateY(-1px);
}

.btn:not(.primary):hover{
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}

.btn:active{
  transform: translateY(0) scale(.995);
}

.btn:focus-visible{
  box-shadow: 0 0 0 3px rgba(255,255,255,.10), 0 0 0 6px rgba(120,150,255,.35);
}

.btn.primary{
  color: var(--btn-primary-ink);
  background:
    radial-gradient(140px 140px at var(--mx,50%) var(--my,50%), rgba(255,255,255,.18), transparent 46%),
    linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0) 55%),
    var(--btn-primary);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
  text-shadow: 0 1px 0 rgba(255,255,255,.45);
}

.btn .shine{
  pointer-events: none;
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  overflow: hidden;
}

.btn .shine::before{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(to bottom, rgba(255,255,255,.14), rgba(255,255,255,0) 42%);
  mix-blend-mode: screen;
}

/* ================== Hero Media with <picture> (fixed aspect + crop) ================== */
.hero-media{
  margin-top: 2.625rem;
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius, 16px) + 8px);
  aspect-ratio: 16 / 9;
  min-height: 360px;
  box-shadow: var(--shadow, 0 18px 50px rgba(2,6,23,.35));
  border: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
}

.hero-media picture,
.hero-media img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-media::after{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  pointer-events: none;
}

/* ================== Projects v2 ================== */
#projects{
  margin-top: .5rem;
}

.projects-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: .625rem;
}

.controls{
  display: flex;
  gap: .625rem;
  align-items: center;
}

.filters{
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.filter{
  border: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  background: var(--surface);
  color: var(--text);
  padding: .5rem .75rem;
  border-radius: 999px;
  font-size: .875rem;
  cursor: default;
  transition: background .2s ease, border-color .2s ease, transform .15s ease;
  &[aria-pressed="true"]{
    background: color-mix(in oklab, var(--accent) 22%, transparent);
    border-color: color-mix(in oklab, var(--accent) 45%, var(--line));
  }
}

.layout{
  display: flex;
  gap: 6px;
  border: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  border-radius: 999px;
  padding: 4px;
  background: var(--surface);
  & button{
    border: none;
    background: transparent;
    color: var(--muted);
    padding: .5rem .625rem;
    border-radius: 999px;
  }
  & button[aria-pressed="true"]{
    background: color-mix(in oklab, var(--accent) 18%, transparent);
    color: var(--text);
  }
}

.featured{
  margin-top: 1.125rem;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.125rem;
}

/* Allow grid children to shrink instead of pushing the row wider */
.featured > * { min-width: 0; }


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

.featured .visual{
  min-height: 280px;
  border-radius: calc(var(--radius) + 8px);
  overflow: hidden;
  position: relative;
  border: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

.featured .visual img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.featured .panel{
  background: var(--surface);
  border: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  border-radius: var(--radius);
  padding: 1.125rem;
  box-shadow: var(--shadow);
}

.panel h3{
  margin: 0 0 .375rem;
}

.kpis{
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin: .625rem 0 .375rem;
}

.kpi{
  border: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  background: color-mix(in oklab, var(--surface) 85%, transparent);
  padding: .5rem .75rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: .875rem;
}

.kpi small{
  display: block;
  color: var(--muted);
  font-weight: 500;
  font-size: .75rem;
}

.proj-grid{
  margin-top: 1.125rem;
  display: grid;
  gap: 1.125rem;
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 980px){
  .proj-grid{
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.proj{
  background: var(--surface);
  border: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.proj figure.thumb{
  margin: 0;
  padding: 0;
  display: block;
}

.proj .thumb{
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  overflow: hidden;
}

.proj .thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.proj .body{
  padding: .875rem;
}

.proj .title{
  font-size: 1.125rem;
  margin: .5rem 0 .375rem;
}

.proj .meta{
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin: .375rem 0 .5rem;
}

.badge{
  font-size: .75rem;
  color: var(--muted);
  border: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  padding: .25rem .625rem;
  border-radius: 999px;
}

.impact{
  font-weight: 600;
  font-size: .875rem;
}

.proj .row{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: .625rem;
  gap: .625rem;
}

.quick{
  font-size: .875rem;
  color: var(--text);
  border: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  background: var(--surface);
  border-radius: 999px;
  padding: .5rem .75rem;
  cursor: default;
}

/* ================== About (scoped demo) & Footer ================== */
section h2{
  font-size: 1.75rem;
  margin: 0 0 .75rem;
}

.muted{
  color: var(--muted);
}

.about{
  margin-top: 4rem;
  padding: 1.75rem;
  border: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
}

/* @scope demo */
@scope (.about){
  h2{
    font-size: 1.75rem;
  }
  p.muted{
    color: var(--muted);
  }
}

.contact{
  margin-top: 3rem;
}

footer{
  border-top: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  margin-top: 4rem;
  padding: 1.375rem 0;
  color: var(--muted);
}

/* Motion care */
@media (prefers-reduced-motion: reduce){
  *{
    animation: none !important;
    transition: none !important;
  }
}

/* ================== Extra Credit: Wider-gamut color() ==================
   Uses display-p3 to override --accent when supported.
   Fallback remains the sRGB hex you already set earlier. */
@supports (color: color(display-p3 1 1 1)) {
  :root{
    /* vivid blue in display-p3 space */
    --accent: color(display-p3 0.42 0.62 1);
  }
  :root[data-theme="light"]{
    /* slightly deeper accent for light theme */
    --accent: color(display-p3 0.24 0.52 1);
  }
}

/*  Extra Credit: :has() container styling
   Highlights the filter bar when any filter is active.
   (Gracefully ignored where :has() isn’t supported.) */
@supports selector(:has(*)) {
  .filters:has(button[aria-pressed="true"]){
    box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent) 30%, transparent);
    border-radius: 12px;
  }

  /* Bonus: give the layout switch a subtle “armed” state */
  .layout:has(button[aria-pressed="true"]){
    box-shadow: 0 6px 22px rgba(0, 0, 0, .18);
  }
}

/* STYLING FOR THE ABOUT PAGE */

/* Bio split (portrait + card) */
.bio{
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.125rem;
  margin-top: 1.25rem;
}

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

.portrait{
  border-radius: calc(var(--radius) + 8px);
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 5;
  position: relative;
}

.portrait img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bio-card{
  background: var(--surface);
  border: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  border-radius: var(--radius);
  padding: 1.125rem;
  box-shadow: var(--shadow);
}

.bio-title{
  margin: 0 0 .5rem;
}

.stats{
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin: .75rem 0 .5rem;
  padding: 0;
  list-style: none;
}

.stat{
  border: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  background: color-mix(in oklab, var(--surface) 85%, transparent);
  padding: .5rem .75rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: .875rem;
}

/* Skills */
.skills{
  margin-top: 2.25rem;
}

.skills-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}

.skills-grid{
  margin-top: 1rem;
  display: grid;
  gap: 1.125rem;
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 980px){
  .skills-grid{
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.skill{
  background: var(--surface);
  border: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.skill h3{
  margin: 0 0 .375rem;
}

.chips{
  margin: .5rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.chips li{
  font-size: .75rem;
  color: var(--muted);
  border: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  padding: .25rem .625rem;
  border-radius: 999px;
}

/* Timeline */
.timeline{
  margin-top: 2.5rem;
}

.timeline h2{
  margin-bottom: .75rem;
}

.tl{
  position: relative;
  list-style: none;
  padding: 0;
  margin: 0;
}

.tl::before{
  content: "";
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: color-mix(in oklab, var(--line) 70%, transparent);
}

.tl li{
  position: relative;
  padding-left: 2.25rem;
  margin: 0 0 1rem;
}

.tl .dot{
  position: absolute;
  left: 4px;
  top: .25rem;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 18px color-mix(in oklab, var(--accent) 70%, transparent);
}

.tl .card{
  background: var(--surface);
  border: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  border-radius: 12px;
  padding: .875rem;
  box-shadow: var(--shadow);
}

/* Values */
.values{
  margin-top: 2.5rem;
}

.val-grid{
  list-style: none;
  padding: 0;
  margin: .75rem 0 0;
  display: grid;
  gap: 1.125rem;
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 980px){
  .val-grid{
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.val{
  background: var(--surface);
  border: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.val h3{
  margin: 0 0 .375rem;
}

/* CONTACT PAGE STYLE CSS */

.contact-main{
  margin-top: .25rem;
}

/* hero tweaks for contact */
.contact-hero{
  padding-bottom: 1.5rem;
}
.contact-hero .hero-media{
  margin-top: 1.25rem;
  min-height: 32dvh; /* dynamic viewport unit */
}

/* Reusable card (matches panels/sections on other pages) */
.card{
  background: var(--surface, #0f172a);
  border: 1px solid color-mix(in oklab, var(--line, #1f2a3b) 60%, transparent);
  border-radius: var(--radius, 16px);
  box-shadow: var(--shadow, 0 18px 50px rgba(2,6,23,.35));
  padding: 1.125rem;
}

/* Grid layout */
.contact-grid{
  display: grid;
  gap: 1.125rem;
  grid-template-columns: 1.15fr 1fr;
  margin-top: 1.125rem;
}
@media (max-width: 900px){
  .contact-grid{ grid-template-columns: 1fr; }
}

/* Info card */
.info-card h2{
  margin: 0 0 .5rem;
}
.contact-list{
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  gap: .5rem;
}
.contact-list li{
  display: grid;
  grid-template-columns: 7rem 1fr;
  align-items: baseline;
  gap: .75rem;
  padding: .5rem .625rem;
  border: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  border-radius: 12px;
  background: color-mix(in oklab, var(--surface) 90%, transparent);
}
.contact-list .label{
  color: var(--muted);
}

/* iframe preview (accessible ratio) */
.mini-frame{ margin-top: .75rem; }
.mini-title{ margin: 0 0 .375rem; }
.ratio{
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  aspect-ratio: 16 / 9;
}
.ratio iframe{
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

/* Form card */
.form-card h2{
  margin: 0 0 .5rem;
}

/* field styles + variables */
:root{
  --field-bg: color-mix(in oklab, var(--surface) 85%, transparent);
  --field-border: color-mix(in oklab, var(--line) 70%, transparent);
  --field-focus: color-mix(in oklab, var(--accent) 45%, transparent);
}

/* @scope keeps form styles local */
@scope (.form-card){
  .fields{
    display: grid;
    gap: .875rem;
    margin: .75rem 0 1rem;
  }
  .field{
    display: grid;
    gap: .375rem;
  }
  .field label{
    font-weight: 600;
    font-size: .95rem;
  }
  .field input,
  .field textarea{
    background: var(--field-bg);
    color: var(--text);
    border: 1px solid var(--field-border);
    border-radius: 12px;
    padding: .75rem .875rem;
    font: inherit;
    outline: none;
    transition: border-color .18s ease, transform .12s ease, box-shadow .18s ease;
  }
  .field input:focus-visible,
  .field textarea:focus-visible{
    border-color: var(--field-focus);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 24%, transparent);
    transform: translateY(-1px);
  }
  .hint{
    color: var(--muted);
    margin: 0;
    font-size: .85rem;
  }
  .req{
    color: color-mix(in oklab, var(--accent) 85%, white);
  }
  .consent{
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .25rem;
    font-size: .95rem;
  }
  .form-actions{
    display: flex;
    gap: .625rem;
    flex-wrap: wrap;
  }
}

/* Baseline feature demo: :has() highlights invalid fields/groups */
.form-card:has(:invalid){
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent) 26%, transparent);
}
.field:has(:invalid) input,
.field:has(:invalid) textarea{
  border-color: color(display-p3 0.95 0.45 0.45 / .85); /* wider-gamut accent */
}

/* Motion care already global; buttons share existing .btn styles */

/* Extra small refinements */
.link:hover{ color: var(--text); }

/* Keep contrast strong in light theme */
:root[data-theme="light"] .contact-list li{
  background: color-mix(in oklab, var(--surface) 96%, white);
}

/* Mobile responsive design (≤ 420px) */
@media (max-width: 420px){
  .wrap{ padding-inline: .875rem; }

  /* Nav: stack and shrink */
  .nav-inner{
    height: auto;
    padding-block: .5rem;
    flex-wrap: wrap;
    row-gap: .5rem;
  }
  .brand{ font-size: .9rem; }
  .links{
    flex: 1 1 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
  }
  .links a{ font-size: .9rem; }

  /* Hero */
  .hero{ padding-top: 4.25rem; }
  h1{ font-size: clamp(28px, 8.5vw, 40px); }
  .hero-media{ min-height: 210px; border-radius: 14px; }

  /* “Highlighted Projects” header row */
  .projects-head{
    flex-direction: column;
    align-items: stretch;
    gap: .5rem;
  }
  .controls{ flex-wrap: wrap; }
  .filters{ width: 100%; justify-content: flex-start; }
  .filter{ padding: .45rem .6rem; font-size: .85rem; }

  /* Featured block spacing */
  .featured{ gap: .75rem; }
  .panel{ padding: .9rem; }
  .kpis{ gap: .5rem; }
  .kpi{ font-size: .8rem; }

  /* Project cards grid + spacing */
  .proj-grid{ gap: .9rem; }
  .proj .body{ padding: .75rem; }
  .proj .title{ font-size: 1rem; }

  /* About + footer spacing on landing */
  .about{ margin-top: 2.75rem; padding: 1.25rem; }
  footer{ margin-top: 2.5rem; }

  /* one issue i found: image still overflows, so adding this to ensure/overrides safely that the image will not overflows*/

    /* Let grid children shrink instead of forcing the row wider */
    .featured > * { min-width: 0; }

    /* Belt & suspenders: keep the featured visual strictly inside */
    .featured .visual,
    .featured .visual picture,
    .featured .visual img {
    width: 100%;
    max-width: 100%;
    }

    /* Optional: slightly tighter radii on tiny screens prevents 1px peeking */
    @media (max-width: 420px){
    .featured { gap: .75rem; }
    .featured .visual { border-radius: 14px; }
    }

}

/* ================== Small phones safety (≤ 340px) ================== */
@media (max-width: 340px){
  .links{ gap: 10px; }
  .links a{ font-size: .85rem; }
  .filter{ font-size: .8rem; }
  .btn{ --pad-y: .7rem; --pad-x: 1.1rem; font-size: 1rem; }
}
