/* =============================
   Theme tokens
============================= */
:root{
  --bg:#ffffff;
  --text:#0b0b0b;
  --muted:#666;
  --card:rgba(255,255,255,.8);
  --border:rgba(0,0,0,.12);
  --brand-grad:linear-gradient(90deg,#93c5fd,#60a5fa);
  --btn-border:rgba(0,0,0,.2);
  --btn-hover:rgba(0,0,0,.05);
  --accent:#3b82f6;
}
:root.dark{
  --bg:#020202;
  --text:#ffffff;
  --muted:#c9c9c9;
  --card:rgba(0,0,0,.7);
  --border:rgba(255,255,255,.1);
  --btn-border:rgba(255,255,255,.12);
  --btn-hover:rgba(255,255,255,.06);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font:16px/1.6 system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}

/* =============================
   Layout
============================= */
.container{max-width:1120px;margin:0 auto;padding:0 24px}
.section{padding:64px 0}
.lead{font-size:18px;color:var(--muted)}

/* =============================
   Header
============================= */
.header{
  position:sticky; top:0; z-index:50;
  backdrop-filter:blur(8px);
  background:var(--card);
  border-bottom:1px solid var(--border);
  box-shadow:inset 0 -1px 0 0 rgba(59,130,246,.35);
  height:64px;
}
.brand{
  position:absolute; left:0; top:50%; transform:translateY(-50%);
  padding-left:20px;
  text-decoration:none;
  font-weight:700; font-size:22px; letter-spacing:.02em;
  background:var(--brand-grad); -webkit-background-clip:text; color:transparent;
  white-space:nowrap;
}
.nav-row{
  display:flex; align-items:center; justify-content:flex-end;
  height:100%; gap:16px; padding-right:24px;
}
.right-group{display:flex; align-items:center; gap:16px}
.icon-btn{
  width:32px; height:32px; border-radius:999px;
  border:1px solid var(--btn-border);
  background:transparent; display:grid; place-items:center;
  cursor:pointer; transition:160ms ease; outline-offset:2px;
}
.icon-btn:hover{background:var(--btn-hover); border-color:var(--accent)}
.icon-btn svg{width:18px; height:18px; fill:currentColor; color:var(--text)}
.nav{display:flex; align-items:center; gap:14px; flex-wrap:wrap}
.btn{
  text-decoration:none; color:var(--text);
  padding:6px 12px; border-radius:999px;
  border:1px solid var(--btn-border);
  transition:160ms ease; font-size:14px; line-height:1.2;
}
.btn:hover{background:var(--btn-hover); border-color:var(--accent)}
.btn.active{border-color:var(--accent); background:color-mix(in oklab,var(--accent) 15%, transparent)}

/* =============================
   Backgrounds
============================= */
.bg-aurora{
  position:fixed; inset:0; z-index:-2;
  background:
    radial-gradient(60vmax 60vmax at 10% 20%, #4f46e5 0%, transparent 60%),
    radial-gradient(50vmax 50vmax at 80% 10%, #06b6d4 0%, transparent 60%),
    radial-gradient(50vmax 50vmax at 50% 90%, #22c55e 0%, transparent 60%);
  filter:blur(30px) saturate(120%);
  animation:auroraShift 18s ease-in-out infinite alternate;
  opacity:.28;
}
@keyframes auroraShift{
  0%{transform:translate3d(0,0,0) scale(1)}
  50%{transform:translate3d(2%,-1%,0) scale(1.05)}
  100%{transform:translate3d(-2%,1%,0) scale(1.02)}
}
#bg-particles{
  position:fixed; inset:0; z-index:-1; background:transparent;
  -webkit-mask-image:linear-gradient(to bottom, transparent 0, black 56px, black calc(100% - 80px), transparent 100%);
          mask-image:linear-gradient(to bottom, transparent 0, black 56px, black calc(100% - 80px), transparent 100%);
}

/* =============================
   Hero
============================= */
.hero-grid{
  display:grid;
  grid-template-columns:minmax(320px,520px) 1fr;
  align-items:center;
  gap:clamp(24px,6vw,72px);
}
.hero-photo{
  position:relative;
  width:min(42vw,520px);
  aspect-ratio:1/1;
  border-radius:999px;
  padding:12px;
  background:
    radial-gradient(60% 60% at 30% 30%, rgba(255,255,255,.18), transparent),
    linear-gradient(180deg, rgba(255,255,255,.18), transparent);
  box-shadow:0 18px 60px rgba(0,0,0,.45);
}
.hero-photo::after{
  content:"";
  position:absolute; inset:-6px;
  border-radius:999px;
  border:4px solid rgba(255,255,255,.18);
}
.hero-photo img{
  width:100%; height:100%; display:block;
  border-radius:999px;
  border:6px solid rgba(255,255,255,.12);
  object-fit:cover;
  object-position: var(--face-x,50%) var(--face-y,38%);
}
.hero-kicker{ margin:0 0 6px; font-weight:800; font-size:clamp(28px,3.2vw,52px) }
.hero-name{
  margin:0 0 12px; font-weight:800; line-height:1.06;
  font-size:clamp(38px,6.2vw,84px); letter-spacing:.01em;
}
.caret{
  display:inline-block; width:.12em; height:.9em; background:var(--accent);
  margin-left:.14em; border-radius:2px; animation:blink 1s steps(1,end) infinite;
}
@keyframes blink{ 50%{opacity:0} }
.hero-cred{ margin:6px 0 0; font-size:16px; color:var(--muted) }

@media (max-width:900px){
  .hero-grid{ grid-template-columns:1fr; text-align:center }
  .hero-photo{ margin-inline:auto; width:min(70vw,520px) }
  .hero-cred{ font-size:15px }
}

/* =============================
   Chat widget
============================= */
.chatbot{ position: fixed; right: 24px; bottom: 24px; z-index: 400; font-size: 14px; }
.chat-fab{
  width: 52px; height: 52px; border-radius: 999px;
  border: 1px solid var(--btn-border);
  background: color-mix(in oklab, var(--accent) 18%, transparent);
  color: var(--text); display:grid; place-items:center;
  cursor:pointer; transition:160ms ease; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.chat-fab:hover{ border-color: var(--accent); transform: translateY(-1px) }
.chat-window{
  position: absolute; right: 0; bottom: 64px;
  width: min(360px, 90vw); height: 480px;
  display:grid; grid-template-rows: auto 1fr auto;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.35);
  backdrop-filter: blur(10px); overflow: hidden;
  transform: translateY(8px) scale(.98); opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
}
.chat-window.open{ transform: translateY(0) scale(1); opacity: 1; }
.chat-header{ position: relative; display:flex; align-items:center; justify-content:space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 30%, transparent);
}
.chat-close{
  position: relative; z-index: 2; pointer-events: auto;
  width:32px; height:32px; display:grid; place-items:center;
  border-radius:10px; border:1px solid var(--btn-border);
  background: color-mix(in oklab, var(--bg) 65%, transparent);
  color: var(--text); font-size:16px; line-height:1;
  cursor:pointer; transition:160ms ease;
}
.chat-close:hover{ background: color-mix(in oklab, var(--accent) 18%, var(--bg) 70%); color:#fff; border-color: var(--accent) }
.chat-log{ padding: 12px; overflow-y: auto; display: grid; gap: 10px; }
.msg{ max-width: 80%; padding: 8px 12px; border-radius: 14px; line-height: 1.35; word-wrap: break-word; }
.msg.user{ margin-left: auto; background: color-mix(in oklab, var(--accent) 18%, transparent); border: 1px solid var(--btn-border); }
.msg.bot{  background: color-mix(in oklab, var(--bg) 70%, transparent); border: 1px solid var(--border); }
.chat-form{ display:flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.chat-input{ flex: 1; min-width: 0; border: 1px solid var(--btn-border); background: transparent; color: var(--text);
  border-radius: 12px; padding: 10px 12px; }
.chat-input::placeholder{ color: var(--muted) }
.chat-send{ padding: 10px 14px; border-radius: 12px; border: 1px solid var(--btn-border); background: var(--btn-hover); cursor: pointer; }
.chat-send:hover{ border-color: var(--accent) }

/* =============================
   Footer
============================= */
.site-footer{
  margin-top:96px;
  background: color-mix(in oklab, var(--bg) 80%, #000 20%);
  border-top:1px solid var(--border);
}
.footer-grid{
  display:grid; grid-template-columns: 1.3fr 1fr 1fr;
  gap:32px; padding:48px 24px;
}
.footer-brand h3{ margin:0 0 8px; font-size:22px; }
.footer-brand p{ margin:0; color:var(--muted) }
.footer-head{ margin:0 0 8px; font-weight:700; font-size:18px; }
.footer-ul{ list-style:none; padding:0; margin:0; display:grid; gap:10px; }
.footer-ul a{ color:var(--text); text-decoration:none; display:inline-flex; gap:8px; align-items:center; }
.footer-ul a:hover{ color:var(--accent) }
.footer-bar{
  border-top:1px solid var(--border);
  padding:14px 24px; display:flex; justify-content:space-between; align-items:center;
  color:var(--muted); font-size:14px;
}
.footer-head + .underline{
  width:110px; height:3px; border-radius:999px; background:var(--accent);
  margin-bottom:14px;
}
.icon{ width:18px; height:18px; flex:0 0 18px; fill:currentColor; }

@media (max-width:900px){
  .footer-grid{ grid-template-columns:1fr; }
  .btn{padding:6px 10px; font-size:13.5px}
}
@media (max-width:640px){
  .header{height:56px}
  .nav-row{padding-right:12px; gap:10px}
  .nav{gap:8px}
  .btn{padding:5px 10px; font-size:13px}
  .icon-btn{width:30px; height:30px}
}

/* =============================
   About tabs
============================= */
.about-tabs{
  display:flex; gap:10px; margin:18px 0 12px;
  flex-wrap:wrap;
}
.tab-btn{
  border:1px solid var(--btn-border);
  background:transparent;
  color:var(--text);
  padding:10px 14px; border-radius:999px; cursor:pointer;
  transition:160ms ease; font-weight:600;
}
.tab-btn:hover{ background:var(--btn-hover); border-color:var(--accent) }
.tab-btn.active{
  border-color:var(--accent);
  background: color-mix(in oklab, var(--accent) 16%, transparent);
}

.tab-panels{ margin-top:6px }
.tab-panel[hidden]{ display:none }
.tab-panel.active{ display:block }

/* headings + bullets inside panels */
.h2{ font-size:22px; font-weight:800; margin:30px 0 50px }
.bullets{ padding-left:18px; margin:0 }
.lead.small{ font-size:15.5px }

/* Honor the HTML hidden attribute */
[hidden]{ display:none !important; }

/* =============================
   Skills
============================= */
.skill-grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(160px,1fr));
  gap:12px; margin:10px 0 18px;
}
.chip{
  display:inline-flex; align-items:center; justify-content:center;
  border:1px solid var(--btn-border); border-radius:12px;
  padding:10px 12px; background: color-mix(in oklab, var(--bg) 70%, transparent);
  font-weight:600;
}

/* Skills page polish (larger auto-fit) */
.skill-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.chip{
  font-weight: 700;
  text-align: center;
  box-shadow: 0 8px 22px rgba(0,0,0,.20);
  transform: translateY(2px);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.chip:hover{
  transform: translateY(-4px);
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 10%, var(--bg) 70%);
  box-shadow: 0 16px 36px rgba(0,0,0,.28);
}

/* =============================
   Resume
============================= */
.resume-grid{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(260px,1fr));
  gap:16px; margin-top:6px;
}
.resume-card{
  border:1px solid var(--border); border-radius:16px;
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  box-shadow:0 10px 28px rgba(0,0,0,.22);
  padding:18px; transition:160ms ease; transform:translateY(4px);
}
.resume-card:hover{
  transform:translateY(-4px);
  border-color:var(--accent);
  background: color-mix(in oklab, var(--accent) 10%, var(--bg) 70%);
  box-shadow:0 16px 36px rgba(0,0,0,.28);
}
.resume-title{ margin:0 0 6px; font-weight:800 }
.resume-actions{ display:flex; gap:10px; margin-top:10px }
.btn-link{
  text-decoration:none; padding:8px 12px; border-radius:10px;
  border:1px solid var(--btn-border); color:var(--text);
  background:var(--btn-hover);
}
.btn-link:hover{ border-color:var(--accent) }

/* =============================
   Section header (shared)
============================= */
.section-head{ text-align:center; margin-bottom:24px }
.section-head .title{ margin:0; font-weight:800; font-size:clamp(32px,5vw,46px) }
.section-head .title-underline{
  width:140px; height:3px; border-radius:999px; background:var(--accent);
  margin:8px auto 84px;
}
.section-head .title-underline.small{ width:110px; margin:6px auto 0 }
.section-head .subtitle{ margin:0 auto; max-width:860px; color:var(--muted) }

/* =============================
   Social / link cards row
============================= */
.social-grid{
  display:grid;
  grid-template-columns:repeat(5, minmax(160px,1fr));
  gap:18px;
  margin:24px auto 28px;
  max-width:1120px;
}
@media (max-width:1100px){
  .social-grid{ grid-template-columns:repeat(3, minmax(180px,1fr)); }
}
@media (max-width:680px){
  .social-grid{ grid-template-columns:repeat(2, minmax(160px,1fr)); }
}
@media (max-width:420px){
  .social-grid{ grid-template-columns:1fr; }
}
.social-card{
  position:relative;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px;
  min-height:128px; padding:20px;
  border-radius:16px;
  border:1px solid var(--btn-border);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  box-shadow:0 10px 28px rgba(0,0,0,.22);
  text-decoration:none; color:var(--text);
  transform: translateY(6px) scale(.985); opacity:0;
  animation: cardIn .5s ease forwards; animation-delay: var(--d, 0ms);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.social-card:hover{
  transform: translateY(-6px);
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 12%, var(--bg) 70%);
  box-shadow:0 16px 38px rgba(0,0,0,.28);
}
.social-card:focus-visible{ outline:2px solid var(--accent); outline-offset:3px; border-color:var(--accent) }
@keyframes cardIn{ to{ transform:translateY(0) scale(1); opacity:1 } }
.social-icon{
  width:44px; height:44px; border-radius:12px;
  display:grid; place-items:center;
  background: color-mix(in oklab, var(--accent) 16%, transparent);
  border:1px solid var(--btn-border);
}
.social-icon svg{ width:22px; height:22px; fill:currentColor; color:var(--text) }
.social-label{ font-weight:700 }

/* =============================
   Availability card (Contacts)
============================= */
.avail-card{
  margin:28px auto 0; max-width:1120px;
  border:1px solid var(--border); border-radius:18px;
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
  padding:22px;
  transform: translateY(6px) scale(.98);
  opacity:0; animation: cardIn .55s ease forwards; animation-delay: var(--d, 0ms);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.avail-card:hover{
  transform: translateY(-6px);
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 12%, var(--bg) 70%);
  box-shadow: 0 16px 38px rgba(0,0,0,.28);
}
.avail-head{ display:flex; align-items:center; justify-content:center; gap:12px; margin-bottom:16px; text-align:center }
.avail-head svg{ width:26px; height:26px }
.avail-title{ font-weight:800; font-size:20px }
.avail-grid{ display:grid; grid-template-columns:1fr 1fr; gap:24px; text-align:center }
@media (max-width:700px){
  .avail-grid{ grid-template-columns: 1fr; }
}

/* =============================
   Page menus & utilities
============================= */
.menu-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(220px,1fr));
  gap:18px;
  max-width:900px;
  margin:24px auto 28px;
}
.back-link{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 14px; border:1px solid var(--btn-border);
  border-radius:999px; text-decoration:none; color:var(--text);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  transition: 160ms ease; box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.back-link:hover{
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 12%, var(--bg) 70%);
  transform: translateY(-1px);
}
.back-link:focus-visible{ outline:2px solid var(--accent); outline-offset:3px }
.back-link svg{ width:18px; height:18px }

/* =============================
   Centered grids
============================= */
.about-grid,
.professional-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(200px, 1fr));
  gap: 18px;
  justify-content: center;
  max-width: 940px;
  margin: 24px auto 28px;
}
@media (max-width:900px){
  .about-grid, .professional-grid{
    grid-template-columns: repeat(2, minmax(200px, 1fr));
    max-width: 460px;
  }
}
@media (max-width:480px){
  .about-grid, .professional-grid{
    grid-template-columns: 1fr;
    max-width: 320px;
  }
}
.study-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(220px,1fr));
  gap:18px;
  justify-content:center;
  max-width: 980px;
  margin:24px auto 28px;
}
@media (max-width:900px){ .study-grid{ grid-template-columns: 1fr 1fr; max-width: 640px; } }
@media (max-width:520px){ .study-grid{ grid-template-columns: 1fr; max-width: 360px; } }

/* two-card grid for Professional page */
.duo-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap:18px;
  max-width:680px;
  margin:24px auto 28px;
  justify-content:center;
}
@media (max-width:640px){
  .duo-grid{ grid-template-columns:1fr; max-width:360px; }
}

/* =============================
   Projects: compact cards ("cubes")
============================= */
.projects-grid{
	
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap:16px;
  margin-top:12px;
}
.project-card{
  height:100%;
  display:flex; flex-direction:column;
  border:1px solid var(--border); border-radius:16px;
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  box-shadow:0 12px 28px rgba(0,0,0,.22);
  overflow:hidden; transform: translateY(4px);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
  cursor:pointer; outline-offset:4px;
}
.project-card:hover{
  transform: translateY(-4px);
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 8%, var(--bg) 70%);
  box-shadow:0 18px 40px rgba(0,0,0,.28);
}
.project-media{ aspect-ratio:16/9; background:#0b0b0b; }
.project-media img{ width:100%; height:100%; object-fit:cover; display:block; }
.project-body{ padding:14px; display:flex; flex-direction:column; gap:10px; }
.project-title{ margin:0; font-weight:800; font-size:18px; }
.tags{ display:flex; flex-wrap:wrap; gap:8px; }
.tag{
  padding:6px 10px; border:1px solid var(--btn-border); border-radius:999px;
  font-weight:700; font-size:13px;
  background: color-mix(in oklab, var(--bg) 70%, transparent);
}
.project-desc{ color:var(--muted); display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.project-bar{ display:flex; justify-content:space-between; align-items:center; padding-top:8px; border-top:1px solid var(--border); }
.hint{ color:var(--muted); font-size:12px; }

/* icon buttons (GitHub / YouTube) */
.project-links{ display:flex; gap:10px; flex-wrap:wrap; }
.project-links .btn-link{
  display:inline-flex; align-items:center; gap:8px;
  white-space:nowrap;
}
.project-links .btn-link svg{ width:18px; height:18px; flex:0 0 18px; }

/* =============================
   Modal (smaller, close button always visible)
============================= */
.modal-overlay{
  position:fixed; inset:0; z-index:999;
  display:grid; place-items:center;
  padding:24px;
  background:rgba(0,0,0,.6);
  backdrop-filter:blur(4px);
}
.modal{
  position:relative;
  width:min(760px, 92vw);
  max-height:80vh;
  overflow:auto;
  border:1px solid var(--border); border-radius:16px;
  background:var(--card);
  box-shadow:0 30px 80px rgba(0,0,0,.45);
  padding:18px;
}
.modal-hero{ max-height:200px; overflow:hidden; border-radius:12px; margin:0 0 10px; }
.modal-hero img{ width:100%; height:100%; object-fit:cover; display:block; }
.modal-title{ margin:0 0 6px; font-size:24px; font-weight:800; }
.modal-h3{ margin:14px 0 8px; font-weight:800; }
.modal-section{ margin-bottom:12px; }
.modal-close{
  position:absolute; top:10px; right:10px;
  width:36px; height:36px; display:grid; place-items:center;
  border:1px solid var(--btn-border); border-radius:10px;
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  cursor:pointer; z-index:2;
  box-shadow:0 6px 16px rgba(0,0,0,.25);
}
.modal-close:hover{ border-color:var(--accent); background:var(--btn-hover); }

/* clickable card */
.project-card[data-modal]{ cursor:pointer; }
/* ===== Projects page — compact, centered cards ===== */
.projects-grid{
  /* keep cards small even when there’s only 1 */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 340px));
  justify-content: center;                 /* center the tiles */
  gap: 18px;
  max-width: 1100px;
  margin: 14px auto 0;
}

/* card polish */
.project-card{
  transform: translateY(2px);
}

/* slightly shorter media so the card feels tighter */
.project-media{
  aspect-ratio: 16/10;                     /* a bit shorter than 16/9 */
  background:#0b0b0b;
}

/* optional: make title a touch smaller in the compact layout */
.project-title{ font-size: 17px; }

/* buttons with icons never overlap text */
.project-links .btn-link{
  display:inline-flex; align-items:center; gap:8px; white-space:nowrap;
}
.project-links .btn-link .icon{ width:18px; height:18px; flex:0 0 18px; }


/* Modal container */
.modal{
  position: relative;                 /* anchor the X */
  width: min(760px, 92vw);
  max-height: 80vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  padding: 18px;
  padding-top: 56px;                  /* space for the X */
}

/* Close button – always visible */
.modal-close{
  position: absolute;                 /* fixed inside the modal */
  top: 10px;                          /* matches the padding-top above */
  right: 10px;
  z-index: 3;                         /* above images/content */
  width: 40px; height: 40px;
  display: grid; place-items: center;
  color: var(--text);
  border: 1px solid var(--btn-border);
  border-radius: 12px;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  cursor: pointer;
}
.modal-close:hover{ border-color: var(--accent); background: var(--btn-hover); }
.modal-close:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; }
/* ---------- Professional pages polish ---------- */

/* A soft surface so text doesn't fight the background */
.page-panel{
  margin: 16px 0 28px;
  padding: 24px;
  border:1px solid var(--border);
  border-radius: 22px;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(6px);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
@media (max-width:640px){ .page-panel{ padding:16px } }

/* Timeline */
.xp-timeline{ display:grid; gap:18px; position:relative }
.xp-item{ position:relative; padding-left:28px }
.xp-item::before{
  content:""; position:absolute; left:11px; top:0; bottom:0; width:2px;
  background: linear-gradient(to bottom,
              color-mix(in oklab, var(--accent) 80%, transparent) 0%,
              transparent 65%);
}
.xp-item::after{
  content:""; position:absolute; left:7px; top:14px; width:10px; height:10px;
  border-radius:50%; background:var(--accent);
  box-shadow:0 0 0 4px color-mix(in oklab, var(--accent) 22%, transparent);
}

/* The “cube” */
.xp-card{
  border:1px solid var(--border);
  border-radius:20px;
  padding:18px 18px 16px;
  background:
    radial-gradient(120% 100% at 10% 0%,
      color-mix(in oklab, var(--accent) 12%, transparent) 0%,
      transparent 40%)
    ,color-mix(in oklab, var(--bg) 86%, transparent);
  box-shadow:0 14px 38px rgba(0,0,0,.28), inset 0 0 0 1px rgba(255,255,255,.03);
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.xp-card:hover{
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow:0 22px 60px rgba(0,0,0,.36);
  background:
    radial-gradient(120% 100% at 10% 0%,
      color-mix(in oklab, var(--accent) 18%, transparent) 0%,
      transparent 45%)
    ,color-mix(in oklab, var(--bg) 88%, transparent);
}

/* Text inside the card */
.xp-title{ margin:0 0 8px; font-weight:800; font-size:clamp(18px,2.7vw,24px) }
.xp-meta{ margin:0 0 10px; color:var(--muted) }
.xp-list{ margin:0; padding-left:18px; display:grid; gap:8px }
.center{ text-align:center }


.page-panel{
  background: color-mix(in oklab, var(--bg) 90%, transparent); /* 82% → 90% = more solid */
}
/* --- Work xp header w/ logo & chips --- */
.role-header{display:flex;align-items:center;gap:.9rem;margin-bottom:.4rem}
.role-logo{width:44px;height:44px;border-radius:12px;object-fit:cover;border:1px solid var(--border);background:#fff}
.role-org{display:block;opacity:.9;margin-top:.1rem}
.meta-chips{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.35rem}
.meta-chip{display:inline-flex;align-items:center;gap:.35rem;padding:.25rem .6rem;border:1px solid var(--border);
  border-radius:9999px;background:var(--card);font-size:.9rem;line-height:1}
.meta-chip svg{width:16px;height:16px;opacity:.85}
/* chips + details */
.tech-chips{display:flex;flex-wrap:wrap;gap:.5rem;margin:.5rem 0 .25rem}
.tech-chip{padding:.25rem .6rem;border:1px solid var(--border);border-radius:9999px;
  font-size:.85rem;background:rgba(59,130,246,.08)}
details.xp-details{margin-top:.6rem;border-top:1px dashed var(--border);padding-top:.6rem}
details.xp-details summary{cursor:pointer;list-style:none;font-weight:700;opacity:.95;
  display:flex;align-items:center;gap:.4rem}
details.xp-details summary::-webkit-details-marker{display:none}
.xp-detail-grid{display:grid;gap:.75rem;margin-top:.6rem}
@media(min-width:820px){.xp-detail-grid{grid-template-columns:1fr 1fr}}
.xp-subhead{font-weight:700;margin-bottom:.25rem}
.tight{margin-left:1rem}
.link-row{display:flex;gap:.5rem;flex-wrap:wrap;margin-top:.5rem}
.link-btn{display:inline-flex;align-items:center;gap:.35rem;padding:.35rem .7rem;
  border:1px solid var(--border);border-radius:9999px;background:var(--card);text-decoration:none}
.link-btn:hover{transform:translateY(-1px)}
/* --- toggle text: Show project details / Show less --- */
details.xp-details summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 700;
  opacity: .95;
}
details.xp-details summary::-webkit-details-marker{display:none}

/* chevron */
details.xp-details summary::before{
  content:"";
  width: .75rem; height: .75rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .2s ease;
  opacity:.85;
}
details.xp-details[open] summary::before{ transform: rotate(135deg); }

/* dynamic label via attributes */
details.xp-details summary::after{
  content: attr(data-closed);         /* default text */
}
details.xp-details[open] summary::after{
  content: attr(data-open);           /* "Show less" when open */
}

/* --- highlight the buttons --- */
.link-row{display:flex;gap:.6rem;flex-wrap:wrap;margin-top:.75rem}
.link-btn{
  display:inline-flex; align-items:center; gap:.4rem;
  padding:.5rem .9rem;
  border-radius:9999px;
  font-weight:600;
  text-decoration:none;
  border: 1px solid transparent;
  background: var(--accent, #3b82f6);
  color: #fff;
  box-shadow: 0 8px 18px rgba(59,130,246,.25);
  transition: transform .12s ease, box-shadow .12s ease, opacity .2s;
}
.link-btn svg{width:18px;height:18px}
.link-btn:hover{ transform: translateY(-1px); box-shadow:0 10px 22px rgba(59,130,246,.32); }
.link-btn:active{ transform: translateY(0); box-shadow:0 6px 14px rgba(59,130,246,.25); }
.link-btn:focus-visible{ outline:2px solid var(--accent, #3b82f6); outline-offset:2px; }
.meta-chip svg{width:16px;height:16px;opacity:.85}
.meta-chip:nth-child(2){ /* award chip */
  background: rgba(234,179,8,.12);
  border-color: rgba(234,179,8,.35);
}
/* Sticky header */
.header { position: sticky; top: 0; z-index: 1000; }

/* Mobile menu: button hidden on desktop */
.menu-btn { display: none; }

/* Drawer */
.mobile-drawer[hidden] { display: none; }
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
}
.drawer-panel {
  position: fixed; top: 0; right: 0;
  width: 280px; height: 100vh;
  background: var(--bg, #fff); color: var(--text, #0b0b0b);
  box-shadow: -2px 0 14px rgba(0,0,0,.2);
  padding: 20px; display: flex; flex-direction: column; gap: 14px;
  transform: translateX(100%); transition: transform .25s ease;
}
.mobile-drawer.open .drawer-panel { transform: translateX(0); }
.drawer-close { align-self: flex-end; background: none; border: 0; font-size: 20px; cursor: pointer; }
.drawer-link { display:block; padding:10px 6px; border-radius:10px; }

/* Responsive: show hamburger, hide desktop links on small screens */
@media (max-width: 900px) {
  .desktop-nav { display: none; }
  .menu-btn { display: inline-flex; align-items:center; justify-content:center; width: 40px; height: 40px; }
}



/* ---- Chat polish (small, drop-in override) ---- */
.chat-window{
  background: color-mix(in oklab, var(--bg) 92%, transparent);  /* more solid for contrast */
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
  border-radius: 18px;
}

.chat-log{
  padding: 14px;                 /* a bit roomier */
}

.chat-form{
  gap: 10px;
  padding: 12px;
  background: color-mix(in oklab, var(--bg) 85%, transparent); /* separate from page */
  border-top: 1px solid var(--border);
}

.chat-input{
  border: 1px solid var(--btn-border);
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 14px;
}

.chat-send{
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--accent);     /* make the button visible */
  color: #fff; font-weight: 700;
  box-shadow: 0 10px 24px rgba(59,130,246,.35);
  cursor: pointer;
}
.chat-send:hover{ transform: translateY(-1px); }
.chat-send:active{ transform: translateY(0); }
.chat-send:disabled{ opacity: .55; cursor: not-allowed; }









/* =========================
   MOBILE FIXES (<= 768px)
   ========================= */
@media (max-width: 768px) {

  /* 1) Keep header clean: brand + tabs don’t collide */
  header .brand {
    font-size: 20px;
    letter-spacing: .2px;
    margin-right: 8px;
    flex: 0 0 auto;
  }
  /* make the nav “pills” horizontally scrollable instead of wrapping/overlapping */
  .nav-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-pills::-webkit-scrollbar { display: none; }

  /* give the header a tiny bit more padding so content doesn't tuck under it */
  header {
    padding-inline: 10px;
  }

  /* 2) Hero area: shrink title and portrait so they don’t overlap */
  .hero {
    display: block;               /* stack instead of side-by-side */
    text-align: center;
    padding-top: 18px;
  }
  .hero-title {
    font-size: clamp(28px, 6vw, 40px);
    line-height: 1.15;
    margin: 8px auto 10px;
    max-width: 12ch;
  }
  .hero-subtitle {
    font-size: clamp(14px, 3.6vw, 16px);
    line-height: 1.4;
    margin: 0 auto 16px;
    max-width: 36ch;
    opacity: .9;
  }
  /* portrait ring */
  .hero-photo {
    width: min(64vw, 300px);
    height: auto;
    margin: 0 auto 16px;
  }

  /* if you have a left/right gradient slice in the hero, hide it on mobile */
  .hero-split,
  .hero-slice {
    display: none;
  }

  /* 3) Section titles / cards—tighten spacing so nothing pushes into each other */
  .section-title {
    font-size: clamp(22px, 5.2vw, 30px);
    line-height: 1.2;
    margin: 26px 0 14px;
  }
  .section-lead {
    font-size: clamp(14px, 3.6vw, 16px);
    margin-bottom: 18px;
  }

  /* grids -> single column on small screens */
  .grid-2, .grid-3, .cards-grid {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  /* 4) Work Experience items: reduce badges size & padding */
  .badges { gap: 6px; }
  .badge { padding: 6px 10px; font-size: 12px; }

  /* 5) Ensure the chat bubble clears iOS bottom bar */
  .chat-fab, .chat-toggle {
    bottom: calc(16px + env(safe-area-inset-bottom));
    right: 16px;
  }
  .chat-window {
    bottom: calc(84px + env(safe-area-inset-bottom)); /* above iOS toolbar */
  }
}


/* Mobile drawer fix */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 1100;                 /* <-- above page */
}

.drawer {
  position: fixed;
  top: 0;
  right: -280px;                 /* hidden off-screen */
  height: 100vh;
  width: 280px;
  background: #0f1115;           /* readable on dark */
  color: #fff;
  padding: 16px;
  overflow-y: auto;
  border-left: 1px solid rgba(255,255,255,.08);
  box-shadow: -12px 0 28px rgba(0,0,0,.45);
  transition: right .25s ease;
  z-index: 1200;                 /* <-- above backdrop & hero */
}

/* When open */
.drawer-open .drawer       { right: 0; }
.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }

/* Prevent background scrolling when drawer is open */
body.drawer-open { overflow: hidden; }

/* Make sure hero overlays never cover the drawer */
.hero, .hero * { z-index: auto; }
.hero::before, .hero::after { z-index: 0 !important; }



/* Ensure mobile drawer sits above header/content */
.mobile-drawer { z-index: 1200; }            /* container itself */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease;
  z-index: 1200;
}
.mobile-drawer.open .drawer-backdrop {
  opacity: 1; pointer-events: auto;
}

/* TOP-SHEET drawer panel (full width) */
.drawer-panel{
  position: fixed; left: 0; right: 0; top: 0;
  width: 100%; max-height: 60vh;             /* nice “sheet” height */
  background: var(--bg, #fff);
  color: var(--text, #0b0b0b);
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
  border-bottom: 1px solid var(--border, rgba(0,0,0,.12));
  padding: 14px 18px 18px;
  display: flex; flex-direction: column; gap: 12px;
  transform: translateY(-100%);              /* slide from TOP */
  transition: transform .25s ease;
  z-index: 1210;                             /* above backdrop */
}
.mobile-drawer.open .drawer-panel { transform: translateY(0); }

/* Close (✕) button stays visible */
.drawer-close{
  align-self: flex-end;
  background: none; border: 0; font-size: 20px; cursor: pointer;
}

/* Links look like a menu list */
.drawer-link{
  display: block; padding: 12px 6px; border-radius: 10px;
}
.drawer-link:hover{ background: var(--btn-hover); }








/* === Drawer text only (no white pills) === */

/* Make the menu items text white (in dark theme) and stop default blue links */
.drawer-link,
.drawer-link:link,
.drawer-link:visited{
  color: var(--text) !important;     /* white in dark mode, black in light */
  text-decoration: none;
}
.drawer-link:hover{
  background: var(--btn-hover);
  color: var(--text) !important;
}

/* Make the close “✕” just white text, transparent background */
.drawer-close{
  background: transparent !important;
  color: var(--text) !important;      /* white in dark mode */
  border: 0 !important;
  width: auto; height: auto;          /* keep it as text */
  line-height: 1;
}

/* Return the header hamburger to normal (no white pill) */
.menu-btn{
  background: transparent !important;
  color: var(--text) !important;      /* icon uses this color */
  border: 1px solid var(--btn-border) !important;
  box-shadow: none !important;
}
.menu-btn svg{
  color: currentColor !important;
  fill: currentColor !important;
}






/* Professional page – make the menu tiles stack on small screens */
@media (max-width: 900px){
  .menu-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));  /* 2 across on tablets */
    max-width: 640px;
  }
}
@media (max-width: 560px){
  .menu-grid{
    grid-template-columns: 1fr;                        /* 1 per row on phones */
    max-width: 420px;
  }
}

/* Prevent any child from forcing overflow */
.menu-grid > *{ min-width: 0; width: 100%; }
















