/* ============================================================
   DROP-IN REPLACEMENT (Tokenized Glass Theme)
   Based on your working style.css, with:
   - Full tokenization in :root (theme + component sizing tokens)
   - Body background image /assets/bg.jpg with blur (non-invasive)
   - Keeps your existing layout + selectors working
   ============================================================ */

/* ---------------------------
   TOKENS
----------------------------*/
:root{
  /* Assets */
  --asset-bg-image: url("../assets/bg.jpg");

  /* Typography */
  --font-sans: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --fs-k: .92rem;
  --fs-big: 1.04rem;
  --lh: 1.6;

  /* Core palette */
  --bg: #070b17;
  --text: #f2f6ff;
  --textcontrast: #0a0d17;
  --muted: #b8c4ee;

  /* Accents */
  --accent: #7aa2ff;
  --accent2: #42ffd2;

  /* Surfaces */
  --panel: rgba(255,255,255,.06);
  --panel2: rgba(255,255,255,.04);
  --panel3: rgba(255,255,255,.1);
  --panel-strong: rgba(255,255,255,.2);

  /* Lines / borders */
  --line: rgba(255,255,255,.12);
  --line-soft: var(--glass-panel-override);
  --line-softer: var(--lightbox-close-bg);
  --line-accent: rgba(122,162,255,.45);
  --line-accent-strong: rgba(122,162,255,.65);

  /* Shadows */
  --shadow: 0 18px 60px rgba(0,0,0,.55);
  --shadow-md: 0 12px 30px rgba(0,0,0,.45);
  --shadow-sm: 0 18px 50px rgba(0,0,0,.35);

  /* Radius */
  --radius-xs: 5px;
  --radius-sm: 14px;
  --radius: 18px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* Layout knobs (unchanged behavior) */
  --topbar-h: 64px;
  --gap: 14px;
  --topPad: 5px;
  --left-w: 320px;
  --right-w: 320px;

  /* Background effects */
  --bg-glow-1: var(--chip-active-bg);
  --bg-glow-2: rgba(66,255,210,.10);

  /* Blurred image layer */
  --bg-img-opacity: .20;
  --bg-img-blur: 40px;
  --bg-img-scale: 1.06;
  --bg-vignette: rgba(0,0,0,.35);

  /* Backdrop / glass */
  --glass-blur: 14px;
  --glass-sat: 140%;
  --glass-contrast: 110%;

  /* Buttons */
  --btn-bg: rgba(122,162,255,.14);
  --btn-bg-hover: rgba(122,162,255,.20);

  /* Skill bars */
  --skill-track: rgba(255,255,255,.12);
  --skill-track-border: rgba(255,255,255,.06);
  --skill-fill: #2563eb; /* keep your current fill color */
  --skill-row-h: 18px;

  /* Misc sizes */
  --logo-size: 42px;
  --chip-pad-y: 8px;
  --chip-pad-x: 12px;
  /* Extra theme tokens (converted from literals) */
  --text-soft: var(--text-soft);
  --text-softer: var(--text-softer);

  --shadow-text: var(--shadow-text);
  --shadow-float: 0 10px 30px rgba(0,0,0,.35);
  --shadow-glass-inset-top: inset 0 1px 0 rgba(255,255,255,.45);
  --shadow-glass-inset-bot: inset 0 -1px 0 rgba(255,255,255,.12);

  --overlay-profile-mid: var(--overlay-profile-mid);
  --overlay-profile-clear: var(--overlay-profile-clear);

  --cover-bg: var(--cover-bg);

  --modal-backdrop: var(--modal-backdrop);
  --lightbox-close-bg: var(--lightbox-close-bg);

  --glass-border-strong: var(--glass-border-strong);
  --glass-panel-override: var(--glass-panel-override);

  --dot-bg: var(--dot-bg);
  --dot-ring: var(--dot-ring);

  --chip-active-bg: var(--chip-active-bg);
  --tab-hover-bg: var(--tab-hover-bg);
  --tab-active-bg: var(--tab-active-bg);

  --card-bg: var(--card-bg);

  --modal-card-bg: var(--modal-card-bg);

}
/* ============================================================
   FLUID DESKTOP SHRINK (1920 -> 1280)  ✅ NO division in calc()
   ============================================================ */
:root{
  /* Sidebars: 280 @1280 -> 320 @1920  */
  --left-w:  clamp(280px, calc(200px + 6.25vw), 320px);
  --right-w: clamp(280px, calc(200px + 6.25vw), 320px);

  /* Gaps: 10 @1280 -> 14 @1920 */
  --gap: clamp(10px, calc(2px + 0.625vw), 14px);

  /* Topbar height: 56 @1280 -> 64 @1920 */
  --topbar-h: clamp(56px, calc(40px + 1.25vw), 64px);

  /* Logo: 36 @1280 -> 42 @1920 */
  --logo-size: clamp(36px, calc(24px + 0.9375vw), 42px);

  /* Content max width: 980 @1280 -> 1120 @1920 */
  --content-max: clamp(980px, calc(700px + 21.875vw), 1120px);
}

/* Your file already has .container width: min(1120px, ...) at L40,
   override it to use the fluid content max. :contentReference[oaicite:0]{index=0} */
.container{
  width: min(var(--content-max), calc(100% - 44px));
  margin: 0 auto;
}



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

/* keep scrolling behavior stable */
html, body{
  height: 100%;
  overflow-y: auto;
}

body{
  margin:0;
  font-family: var(--font-sans);
  color: var(--text);
  line-height: var(--lh);

  /* IMAGE is the base */
  background-image: var(--asset-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;

  position: relative;
  overflow-x: hidden;
}

/* Blurred background image layer (does not affect layout) */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  background-image: var(--asset-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(var(--bg-img-blur));
  transform: scale(var(--bg-img-scale));
  opacity: var(--bg-img-opacity);
  z-index: -2;
  pointer-events: none;
}

/* Soft vignette to keep text readable */
body::after{
  content:"";
  position: fixed;
  inset: 0;
  background: radial-gradient(1200px 900px at 50% 60%, transparent 40%, var(--bg-vignette) 100%);
  z-index: -1;
  pointer-events: none;
}

/* optional: apply glass only where you already use panels */
.card, .section, .topbar, .app-sidebar, .profile, .modal-card, .tag, .chip, .pill{
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)) contrast(var(--glass-contrast));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)) contrast(var(--glass-contrast));
}

a{ color: var(--text); text-decoration:none; }
a:hover{ text-decoration: underline; }

.container{ width: min(1120px, calc(100% - 44px)); margin: 0 auto; }
.muted{ color: var(--muted); }
.k{ color: var(--muted); font-size: var(--fs-k); }
.big{ font-size: var(--fs-big); }

[hidden]{display:none !important; }

/* ---------------------------
   Topbar (sticky in center)
----------------------------*/
.topbar{
  position: fixed !important;
  top: var(--topPad) !important;
  z-index: 999 !important;
  background: var(--panel-strong) !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow-md) !important;
  border-radius: var(--radius-sm);
}

.topbar-inner{
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 0;
  gap: var(--gap);
  min-height: var(--topbar-h);
}

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

.logo-mark{
  width: var(--logo-size);
  height: var(--logo-size);
  aspect-ratio: 1 / 1;
  display:grid;
  place-items:center;

  border-radius: var(--radius-xs);
  overflow: hidden;

  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: transparent;
  padding: 0;
}

.logo-text{ font-weight: 800; letter-spacing:.2px; }

/* Desktop nav */
.nav{ display:flex; align-items:center; gap: var(--gap); }
.nav a{
  color: var(--muted);
  padding: 10px 10px;
  border-radius: var(--radius-sm);
}
.nav a:hover{
  background: var(--panel);
  color: var(--text);
  text-decoration:none;
}

/* Buttons */
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-accent);
  background: var(--btn-bg);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  cursor:pointer;
  font-weight: 700;
  text-decoration:none !important;
}
.btn:hover{ background: var(--btn-bg-hover); }
.btn.ghost{
  border-color: var(--line);
  background: var(--panel);
}
.btn.small{ padding: 10px 14px; }

/* Mobile menu button: hidden on desktop */
.menu-btn{
  display:none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor:pointer;
}

/* Mobile nav (only shown when [hidden] removed by JS) */
.mobile-nav{
  padding: 10px 0 14px;
  display:grid;
  gap:8px;
}
.mobile-nav a{
  padding: 12px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--muted);
}
.mobile-nav a:hover{ color: var(--text); text-decoration:none; }

/* ---------------------------
   Window layout (fixed sidebars)
----------------------------*/
.app-shell{
  display:block;
  min-height:100vh;
}

.app-sidebar{
  position: fixed;
  top: var(--topPad);
  bottom: var(--topPad);
  overflow: hidden;
  z-index: 40;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
}

.app-left{
  left: var(--gap);
  width: var(--left-w);
}
.app-right{
  right: var(--gap);
  width: var(--right-w);
}

/* One scroll container definition (removed conflicting duplicate) */
.sidebar-scroll{
  height: 100%;
  overflow: auto;
  padding: var(--gap);
}

/* center column in normal flow */
.app-center{
  margin-left: calc(var(--left-w) + (var(--gap) * 2));
  margin-right: calc(var(--right-w) + (var(--gap) * 2));
  width: 100%;
  padding-top: var(--topPad);
  background: var(--panel3);
  min-width: 0;
}
.center-scroll{
  overflow: visible; /* page scroll is on body */
  padding-top: calc(var(--topPad) + var(--topbar-h) + 10px) !important;
}

/* right sidebar full height fix without breaking your inset layout 
.app-sidebar.app-right{
  display: flex;
  flex-direction: column;
}*/
.sidebar-card{
  height: 100%;
  display: flex;
  flex-direction: column;
}
.skillbars{
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* ---------------------------
   Sidebar content
----------------------------*/
.sidebar-card{ padding:16px; }

.profile{
  position: relative;
  display: block;
  margin-bottom: 12px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel3);
}

.profile-img{
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  border: 0 !important;
  border-radius: 0 !important;
}

.profile-meta{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 12px 10px;
  display: grid;
  gap: 2px;
  background: linear-gradient(
    to top,
    var(--panel-strong),
    var(--overlay-profile-mid),
    var(--overlay-profile-clear)
  );
}

.profile-name{
  margin: 0;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--textcontrast);
  text-shadow: var(--shadow-text);
}

.profile-role{
  margin: 0;
  font-size: 12.5px;
  line-height: 1.25;
  color: var(--textcontrast);
  text-shadow: var(--shadow-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sidebar-block{ margin-top:14px; padding-top:12px; border-top:1px solid var(--line-softer); }
.sidebar-title{ margin:0 0 8px; font-weight:800; font-size:13px; letter-spacing:.01em; }

.contact-list{ display:flex; flex-direction:column; gap:6px; font-size:13px; }
.contact-list a{ color:var(--muted); }
.contact-list a:hover{ color:var(--text); }

.pill-row{ display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.pill{
  font-size:13px;
  padding:4px 8px;
  border:1px solid var(--line);
  border-radius:var(--radius-pill);
  line-height:1;
  background: var(--panel2);
}

/* compact bullets in sidebars */
.bullets{ margin:12px 0 0; padding-left:18px; color: var(--muted); }
.bullets.compact{ padding-left:12px; margin-top:8px; }
.bullets.compact li{
  margin:6px 0;
  font-size: 14px;
}

/* ---------------------------
   Sections / cards
----------------------------*/
.overview{ padding: 16px 0 6px; }

.hero-main.card{
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 16px;
}

.kicker{ margin:0 0 6px; color: var(--muted); font-size:13px; }
.headline{
  margin:0 0 10px;
  font-size: clamp(1.7rem, 2.2vw, 2.3rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.subhead{ margin:0 0 14px; color: var(--muted); }

.cta-row{ display:flex; gap:12px; flex-wrap:wrap; }

.section{ padding: 46px 0; }
.section.alt{
  border-top: 1px solid var(--line-softer);
  border-bottom: 1px solid var(--line-softer);
  background: var(--panel3);
}
.section-head{ margin-bottom: 18px; padding: 26px; }
.section-head.row{ display:flex; justify-content:space-between; align-items:flex-end; gap:14px; flex-wrap:wrap; }
.section h2{ margin:0 0 6px; font-size: 1.75rem; }
.section p{ margin:0; color: var(--muted); }

.card{
  border: 1px solid var(--line-soft);
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.grid.cards{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

/* Projects */
.projects-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.project-card{
  padding:0;
  overflow:hidden;
  cursor:pointer;
  transition: transform .15s ease, border-color .15s ease;
}

.project-card:hover{
  transform: translateY(-3px);
  border-color: var(--line-accent);
}

.project-cover{
  aspect-ratio: 16/10;
  background: var(--cover-bg);
  border-bottom: 1px solid var(--line-soft);
}
.project-cover img{ width:100%; height:100%; object-fit: cover; display:block; }
.project-body{ padding: 14px; }
.project-title{ margin:0 0 8px; font-weight: 900; }
.project-sub{ margin:0 0 10px; color: var(--muted); }

.tags{ display:flex; gap:5px; flex-wrap:wrap; }
.tag{
  border: 1px solid var(--line);
  background: var(--panel2);
  border-radius: var(--radius-pill);
  padding: 6px 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: .65rem;
}

/* ==============================
   Experience Timeline
   ============================== */
.timeline{
  position: relative;
  display: grid;
  gap: 18px;
  padding-left: 26px; /* room for the line + dot */
}

/* vertical line */
.timeline::before{
  content:"";
  position:absolute;
  left: 10px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line);
  border-radius: var(--radius-pill);
}

/* each item */
.timeline .card{
  position: relative;
}

/* dot */
.timeline .card::before{
  content:"";
  position:absolute;
  left: -22px;
  top: 22px;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-pill);
  background: var(--dot-bg);
  box-shadow: 0 0 0 4px var(--dot-ring);
}

/* top row layout */
.tl-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* title spacing */
.tl-top h3{
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

/* date/location badge look */
.tl-top .muted{
  margin-top: 2px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--panel2);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  white-space: nowrap;
}

/* tighten bullets */
.timeline ul{ margin: 10px 0 0 18px; }
.timeline li{ margin: 8px 0; }

/* Skill filters */
.chip-row{ display:flex; gap:10px; flex-wrap:wrap; }
.chip{
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--muted);
  padding: var(--chip-pad-y) var(--chip-pad-x);
  border-radius: var(--radius-pill);
  cursor:pointer;
  font-weight: 800;
}
.chip.is-active{
  background: var(--chip-active-bg);
  border-color: var(--line-accent);
  color: var(--text);
}

/* Contact */
.contact-card{ padding: 18px; }
.contact-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

/* ---------------------------
   MODAL + LIGHTBOX
----------------------------*/
.modal, .lightbox{ position:fixed; inset:0; display:none; z-index: 200; }
.modal.is-open, .lightbox.is-open{ display:block; }

.modal-backdrop, .lightbox-backdrop{
  position:absolute; inset:0;
  background: var(--modal-backdrop);
  backdrop-filter: blur(10px);
}

.modal-card{
  position:relative;
  width: min(980px, calc(100% - 28px));
  margin: 28px auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--modal-card-bg);
  box-shadow: var(--shadow);
  max-height: calc(100vh - 56px);
  overflow:auto;
}

.modal-close{
  position:absolute; right:14px; top:14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor:pointer;
}
.modal-body{ padding: 18px; }

.m-two{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin: 14px 0 6px;
}
.m-two ul{ margin: 0 0 0 18px; }

.gallery{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.gimg{
  border-radius: 16px;
  overflow:hidden;
  border: 1px solid var(--line);
  background: var(--cover-bg);
  cursor:pointer;
  aspect-ratio: 16/10;
}
.gimg img{ width:100%; height:100%; object-fit: cover; display:block; }

.lightbox img{
  display:block;
  width: min(1100px, calc(100% - 30px));
  margin: 60px auto 0;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.lightbox-close{
  position:absolute;
  right: 18px; top: 18px;
  border: 1px solid var(--line);
  background: var(--lightbox-close-bg);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor:pointer;
}

/* ---------------------------
   Skill bars (right sidebar)
----------------------------*/
.skill-group{ margin-bottom: 16px; }

/* single definition (removed duplicates) */
.skill-group-title{
  font-size: 14px;
  font-weight: 800;
  color: var(--text-soft);
  background: var(--accent);
  border: 1px solid rgba(122,162,255,.35);
  display: inline-block;
  padding: 4px 10px;
  border-radius: 10px;
  margin: 12px 0 6px;
}

.skillbar{
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 8px;
  min-height: var(--skill-row-h);
}
.skillbar.child{ padding-left: 16px; }

.skillbar-name{
  width: 110px;
  font-weight: 500;
  font-size: 12px;
  display:flex;
  align-items:center;
}
.skillbar-min,
.skillbar-max{
  font-size: 12px;
  color: var(--muted);
  display:flex;
  align-items:center;
}

.skillbar-track{
  flex: 1;
  background: var(--skill-track);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--skill-track-border);
}

.skillbar-fill{
  height: 100%;
  background: var(--skill-fill);
  border-radius: 6px;
}

/* ==============================
   Projects: tabs (left) + details (right)
   ============================== */
.proj-split{
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--gap);
  padding: var(--gap);
}

.proj-tabs{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.proj-tab{
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel2);
  border-radius: 16px;
  padding: 12px 12px;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 4px;
}

.proj-tab .pt-title{
  font-weight: 900;
  letter-spacing: -0.01em;
}

.proj-tab .pt-meta{
  color: var(--muted);
  font-size: 12.5px;
}

.proj-tab:hover{
  border-color: var(--line-accent);
  background: var(--tab-hover-bg);
}

.proj-tab.is-active{
  border-color: var(--line-accent-strong);
  background: var(--tab-active-bg);
}

.proj-details{ min-width: 0; }
.proj-panel{ display: none; }
.proj-panel.is-active{ display: block; }

.pd-head{
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.pd-head h3{
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.pd-tags{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pd-grid{
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.pd-block h4{
  margin: 0 0 6px;
  font-weight: 900;
}

.pd-block ul{
  font-size: 11px;
  line-height: 1.2;
  margin: 8px 0 0;
  padding-left: 14px;
}

.pd-block ul li{
  margin:2px 0;
  font-size: 14px;
}

/* ==============================
   Contact modal tabs layout
   ============================== */
.modal{
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;

  align-items: center;
  justify-content: center;
  padding: 14px;
}

/* When open */
.modal.is-open{ display: flex; }

/* Remove margin-based positioning */
.modal-card{
  margin: 0 !important;
  max-height: calc(100vh - 28px);
}

.contact-modal-card{
  width: min(980px, calc(100% - 28px));
}

.contact-split{
  margin-top: 14px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--gap);
}

.contact-tabs{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-tab{
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel2);
  border-radius: 16px;
  padding: 12px;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 4px;
}

.contact-tab .pt-title{ font-weight: 900; letter-spacing: -0.01em; }
.contact-tab .pt-meta{ color: var(--muted); font-size: 12.5px; }

.contact-tab:hover{
  border-color: var(--line-accent);
  background: var(--tab-hover-bg);
}

.contact-tab.is-active{
  border-color: var(--line-accent-strong);
  background: var(--tab-active-bg);
}

.contact-panel{ display: none; }
.contact-panel.is-active{ display: block; }

.contact-panel h4{
  margin: 0 0 6px;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.contact-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ---------------------------
   Responsive
----------------------------*/
@media (max-width: 900px){
  .contact-split{ grid-template-columns: 1fr; }
  .contact-tabs{
    flex-direction: row;
    overflow: auto;
    padding-bottom: 6px;
  }
  .contact-tab{ min-width: 210px; }
}

@media (max-width: 1100px){
  .app-sidebar{
    position: static;
    width: auto;
    top:auto; bottom:auto;
    border-radius: var(--radius);
    margin: 12px var(--gap);
  }
  .sidebar-scroll{ height:auto; overflow:visible; }

  .app-center{
    margin-left: var(--gap);
    margin-right: var(--gap);
  }
  .grid.cards{ grid-template-columns: repeat(2, 1fr); }
  .projects-grid{ grid-template-columns: repeat(2, 1fr); }
  .contact-grid{ grid-template-columns: 1fr; }
  .m-two{ grid-template-columns: 1fr; }
}

@media (max-width: 900px){
  .proj-split{ grid-template-columns: 1fr; }
  .proj-tabs{
    flex-direction: row;
    overflow: auto;
    padding-bottom: 6px;
  }
  .proj-tab{ min-width: 220px; }
  .pd-grid{ grid-template-columns: 1fr; }
}

@media (max-width: 720px){
  .nav{ display:none; }
  .menu-btn{ display:inline-flex; }
  .grid.cards{ grid-template-columns: 1fr; }
  .projects-grid{ grid-template-columns: 1fr; }
  .gallery{ grid-template-columns: repeat(2, 1fr); }
}

/* small screens */
@media (max-width: 720px){
  .timeline{ padding-left: 22px; }
  .timeline::before{ left: 8px; }
  .timeline .card::before{ left: -20px; }
  .tl-top .muted{ white-space: normal; }
}

/* =========================
   LAYOUT FIX OVERRIDES
   ========================= */

/* Sidebars stay fixed with consistent spacing */
.app-sidebar{
  position: fixed;
  top: var(--topPad);
  bottom: var(--topPad);
}

.app-left{
  left: var(--gap);
  width: var(--left-w);
}
.app-right{
  right: var(--gap);
  width: var(--right-w);
}

/* ✅ KEY FIX: remove width:100% so margins don't overflow */
.app-center{
  margin-left: calc(var(--left-w) + (var(--gap) * 2));
  margin-right: calc(var(--right-w) + (var(--gap) * 2));
  width: auto !important;          /* overrides width:100% */
  min-width: 0;
  padding-top: var(--topPad);
  background: transparent !important; /* optional: prevents grey overlay */
}

/* Center content spacing under the fixed topbar */
.center-scroll{
  padding-top: calc(var(--topPad) + var(--topbar-h) + 10px) !important;
}

/* Topbar width locked to the same center area */
.topbar{
  left: calc(var(--left-w) + (var(--gap) * 2)) !important;
  right: calc(var(--right-w) + (var(--gap) * 2)) !important;
}

/* If your right sidebar content needs full height scrolling */
.app-sidebar.app-right{
  display: flex;
  flex-direction: column;
}
.app-sidebar.app-right .sidebar-scroll{
  flex: 1;
  min-height: 0;
}

@media (min-width: 1279px) and (max-height: 820px){
  .app-left .profile-img{
    aspect-ratio: 16 / 11;   /* was 1/1, makes it shorter */
  }

  .app-left .profile-meta{
    padding: 10px 12px 8px;  /* tiny tightening to match */
  }
}

@media (min-width: 768px) and (max-width: 1279px){

  /* ===== Layout ===== */

  /* hide right sidebar (skills) */
  .app-right{
    display: none !important;
  }

  /* center takes freed space */
  .app-center{
    margin-right: calc(var(--gap) * 2) !important;
  }

  /* topbar aligns with new layout */
  .topbar{
    right: calc(var(--gap) * 2) !important;
  }

  /* topbar: show menu only (hide nav links) */
  .topbar .nav,
  .topbar .nav-links{
    display: none !important;
  }

  .topbar .menu-btn{
    display: inline-flex !important;
  }

  /* ===== Projects ===== */

  .proj-split{
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .proj-tabs{
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .proj-tab{
    flex: 0 0 auto;
    padding: 10px 14px;
    border-radius: 999px;
  }

  .proj-tab .pt-title{
    white-space: nowrap;
  }

  .proj-tab .pt-meta{
    display: none;
  }

  /* ===== Skills (2 equal cards per row) ===== */

  #skills .grid.cards{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  #skills .card.skill{
    width: 100%;
    height: 100%;
    padding: 14px 16px;
  }

  #skills .card.skill h3{
    font-size: 16px;
    margin-bottom: 6px;
  }

  #skills .card.skill p{
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  /* ===== Contact modal (compact centered pills) ===== */

  .modal-body{
    padding: 14px !important;
  }

  .contact-tabs{
    display: flex !important;
    flex-wrap: nowrap !important;     /* force single line */
    justify-content: space-between;   /* spread evenly */
    width: 100% !important;
    gap: 8px !important;
  }

  .contact-tab{
    flex: 1 1 auto !important;        /* share available width */
    width: auto !important;           /* remove fixed width */
    padding: 6px 8px !important;      /* smaller height */
    border-radius: 999px;
    text-align: center;
    min-width: 0;                     /* allow shrinking */
  }

  .contact-tab .pt-title{
    font-size: 13px;                  /* smaller text */
    white-space: nowrap;              /* keep single line */
  }

  .contact-tab .pt-meta{
    display: none !important;         /* hide muted text */
  }
}


/* ============================================================
   MOBILE (< 768px): single column, center full width
   ============================================================ */
@media (max-width: 767px){
  .app-sidebar.app-left,
  .app-sidebar.app-right{
    display: none;
  }

  .app-center{
    margin-left: var(--gap);
    margin-right: var(--gap);
    width: auto;
  }

  /* ---------------------------------------------------------
     Projects: make tabs NOT clipped + fit iPhone width
     --------------------------------------------------------- */
  .topbar{
    position: fixed;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    border-radius: 0;      /* optional: edge-to-edge mobile look */
    padding-left: 16px;    /* match container padding */
    padding-right: 16px;
  }
  /* stack projects into: tabs row (top) + details (below) */
  .proj-split{
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* vertical tabs */
  .proj-tabs{
    flex-direction: column;
    gap: 8px;
  }

  /* full-width compact tab buttons */
  .proj-tab{
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
  }

  /* smaller title */
  .proj-tab .pt-title{
    font-size: 14px;
  }

  /* hide meta line under tab title */
  .proj-tab .pt-meta{
    display: none;
  }

  /* hide muted intro line inside panel */
  .proj-panel > p.muted{
    display: none;
  }

  .container,
  .grid.cards,
  .card{
    max-width: 100%;
    min-width: 0;
  }

  /* Skills grid should be one column and not overflow */
  #skills .grid.cards{
    grid-template-columns: 1fr !important;
    width: 100%;
  }

  /* Force long text inside skill cards to wrap */
  #skills .card.skill p{
    overflow-wrap: anywhere;   /* best for long comma-separated text */
    word-break: break-word;
  }

  /* Also make headings safe */
  #skills .card.skill h3{
    overflow-wrap: anywhere;
  }

    /* modal card should fit the screen nicely */
  .modal{
    padding: 10px;
    align-items: center;
    justify-content: center;
  }

  .modal-card.contact-modal-card{
    width: calc(100% - 20px) !important;
    max-height: calc(100vh - 20px) !important;
    border-radius: 18px;
  }

  .modal-body{
    padding: 14px; /* less padding on mobile */
  }

  /* close button stays reachable */
  .modal-close{
    right: 10px;
    top: 10px;
    padding: 8px 10px;
  }

  /* force contact layout into 1 column */
  .contact-split{
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* IMPORTANT: override the <=900px rule that makes tabs horizontal */
  .contact-tabs{
    flex-direction: column !important;
    overflow: visible !important;
    padding-bottom: 0 !important;
  }

  /* tabs should be full width (no min-width) */
  .contact-tab{
    min-width: 0 !important;  /* overrides min-width:210px :contentReference[oaicite:1]{index=1} */
    width: 100%;
  }

  /* if WhatsApp meta is long, wrap nicely */
  .contact-tab .pt-meta{
    white-space: normal;
    overflow-wrap: anywhere;
  }

  /* buttons inside panel should stack full width */
  .contact-actions{
    flex-direction: column;
  }
  .contact-actions .btn{
    width: 100%;
    justify-content: center;
  }
}
