/* =========================================================
   TOKENS — LinkedIn-Style Light Theme
========================================================= */
:root{
  /* backgrounds — LinkedIn gray palette */
  --bg:            #F3F2EF;
  --bg-alt:        #EEF3F8;
  --surface:       #FFFFFF;
  --border:        #E0DFDC;

  /* text */
  --text:          #191919;
  --text-muted:    #666666;
  --text-faint:    #767676;

  /* primary blue — LinkedIn */
  --primary:       #0A66C2;
  --primary-hover: #004182;
  --primary-soft:  #EAF4FE;
  --primary-border: #B9D7F1;

  /* accent colors */
  --gold:          #C37D16;
  --gold-text:     #915907;
  --success:       #057642;

  /* terminal — keep dark */
  --term-bg:       #1B1F23;
  --term-text:     #E6E9EC;
  --term-prompt:   #7FC15E;
  --term-link:     #70B5F9;

  /* shadows — minimal */
  --shadow-card:   0 0 0 1px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.06);

  /* radius */
  --radius-card:   8px;
  --radius-pill:   999px;

  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --sidebar-w: 260px;

  transition: background-color .2s, color .2s, border-color .2s;
}

/* Dark theme override */
[data-theme="dark"]{
  --bg:            #000000;
  --bg-alt:        #0D1114;
  --surface:       #1B1F23;
  --border:        #38434F;
  --text:          rgba(255,255,255,.9);
  --text-muted:    rgba(255,255,255,.6);
  --text-faint:    rgba(255,255,255,.5);
  --primary:       #71B7FB;
  --primary-hover: #A8D4FF;
  --primary-soft:  #1B2A38;
  --primary-border: #2F4B66;
  --gold-text:     #E7A33E;
  --term-bg:       #0D1114;
}

*{ box-sizing:border-box; margin:0; padding:0; }
html{ scroll-behavior:smooth; }
body{
  background:var(--bg);
  color:var(--text);
  font-family:var(--font-body);
  font-size:15px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
a{ color:inherit; text-decoration:none; }
ul{ list-style:none; }
img{ max-width:100%; display:block; }

::selection{ background:var(--primary-soft); color:var(--primary); }

::-webkit-scrollbar{ width:10px; height:10px; }
::-webkit-scrollbar-track{ background:var(--bg); }
::-webkit-scrollbar-thumb{ background:var(--border); border-radius:5px; }
::-webkit-scrollbar-thumb:hover{ background:var(--text-muted); }

:focus-visible{
  outline:2px solid var(--primary);
  outline-offset:2px;
  border-radius:2px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; scroll-behavior:auto !important; }
}

/* =========================================================
   BOOT OVERLAY
========================================================= */
.boot-overlay{
  position:fixed; inset:0; z-index:999;
  background:var(--bg);
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-mono);
  animation: bootFade 1.4s ease forwards;
  animation-delay:.9s;
}
.boot-text{ display:flex; flex-direction:column; gap:8px; }
.boot-line{
  color:var(--text-dim); font-size:13px; opacity:0;
  animation: bootLine .4s ease forwards;
}
.boot-line:nth-child(1){ animation-delay:.05s; }
.boot-line:nth-child(2){ animation-delay:.35s; }
.boot-line:nth-child(3){ animation-delay:.65s; }
.boot-ok{ color:var(--mono-green); font-weight:600; }
@keyframes bootLine{ from{opacity:0; transform:translateY(4px);} to{opacity:1; transform:translateY(0);} }
@keyframes bootFade{ 0%,80%{opacity:1; visibility:visible;} 100%{opacity:0; visibility:hidden; pointer-events:none;} }

/* =========================================================
   LAYOUT SHELL
========================================================= */
.app{
  display:flex;
  min-height:100vh;
}

/* ---------- Sidebar ---------- */
.sidebar{
  width:var(--sidebar-w);
  flex-shrink:0;
  background:var(--panel);
  border-right:1px solid var(--border);
  position:sticky;
  top:0;
  height:100vh;
  display:flex;
  flex-direction:column;
  padding:22px 0 16px;
}
.sidebar-brand{
  display:flex; align-items:center; gap:9px;
  padding:0 20px 22px;
  font-family:var(--font-mono);
  font-weight:700;
  font-size:16px;
  border-bottom:1px solid var(--border-soft);
  margin-bottom:18px;
}
.brand-dot{
  width:9px; height:9px; border-radius:50%;
  background:var(--accent);
  box-shadow:0 0 8px var(--accent);
}
.accent{ color:var(--accent); }

.explorer-label{
  font-family:var(--font-mono);
  font-size:11px;
  letter-spacing:.12em;
  color:var(--text-faint);
  padding:0 20px 10px;
}
.file-tree{ display:flex; flex-direction:column; }
.file-item{
  display:flex; align-items:center; gap:8px;
  padding:8px 20px;
  font-family:var(--font-mono);
  font-size:13.5px;
  color:var(--text-dim);
  border-left:2px solid transparent;
  transition:.15s ease;
}
.file-icon{ font-size:10px; color:var(--text-faint); transition:.15s ease; }
.file-item:hover{ background:var(--panel-hover); color:var(--text); }
.file-item.active{
  color:var(--accent);
  background:var(--accent-soft);
  border-left-color:var(--accent);
}
.file-item.active .file-icon{ color:var(--accent); transform:rotate(90deg); }

.sidebar-footer{
  margin-top:auto;
  padding:16px 20px 0;
  border-top:1px solid var(--border-soft);
  display:flex; align-items:center; gap:8px;
  font-family:var(--font-mono);
  font-size:12px;
  color:var(--text-dim);
}
.status-dot{
  width:8px; height:8px; border-radius:50%;
  background:var(--mono-green);
  box-shadow:0 0 6px var(--mono-green);
  flex-shrink:0;
  animation:pulse 2s ease-in-out infinite;
}
@keyframes pulse{ 0%,100%{opacity:1;} 50%{opacity:.4;} }

/* ---------- Mobile topbar ---------- */
.topbar{
  display:none;
  position:sticky; top:0; z-index:50;
  background:var(--panel);
  border-bottom:1px solid var(--border);
  align-items:center;
  gap:14px;
  padding:14px 16px;
}
.menu-btn{
  background:none; border:none; cursor:pointer;
  width:22px; height:16px;
  display:flex; flex-direction:column; justify-content:space-between;
}
.menu-btn span{ display:block; height:2px; background:var(--text); border-radius:2px; }
.topbar-title{ font-family:var(--font-mono); font-weight:700; font-size:15px; flex:1; }
.topbar-cta{
  font-family:var(--font-mono); font-size:12.5px;
  color:var(--accent); border:1px solid var(--accent); border-radius:5px;
  padding:6px 12px;
}

/* =========================================================
   EDITOR / MAIN
========================================================= */
.editor{ flex:1; min-width:0; }

.tabbar{
  display:flex;
  background:transparent;
  border-bottom:1px solid var(--border);
  position:sticky; top:0; z-index:40;
  overflow-x:auto;
  scrollbar-width:none;
  box-shadow:0 2px 6px -2px rgba(0,0,0,.10);
  min-height:46px;
  transition: background-color .2s ease;
}
.tabbar.scrolled{
  background:#F0F8FF;
}
.tabbar::-webkit-scrollbar{ display:none; }
.tab{
  font-family:var(--font-mono);
  font-size:12.5px;
  color:var(--text-muted);
  background:transparent;
  border:none;
  padding:12px 18px;
  cursor:pointer;
  white-space:nowrap;
  border-bottom:2px solid transparent;
  transition:.15s ease;
}
.tab:hover{ color:var(--text); }
.tab.active{
  color:var(--primary);
  border-bottom-color:var(--primary);
}

/* Theme toggle button */
.theme-toggle {
  margin-left: auto;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.theme-toggle:hover {
  color: var(--text);
}
.theme-toggle .theme-icon-light {
  display: block;
}
.theme-toggle .theme-icon-dark {
  display: none;
}
[data-theme="dark"] .theme-toggle .theme-icon-light {
  display: none;
}
[data-theme="dark"] .theme-toggle .theme-icon-dark {
  display: block;
}

.editor-body{ 
  background:var(--bg);
  display:flex;
  flex-direction:column;
}

/* =========================================================
   SECTION SHARED BACKGROUND — matches hero dot-grid style
========================================================= */
.section{
  display:flex;
  border-bottom:1px solid var(--border);
  scroll-margin-top:60px;
  position:relative;
  overflow:hidden;
  box-shadow:var(--shadow-card);
}

/* per-section radial accent glows */
#about::before,
#skills::before,
#experience::before,
#projects::before,
#education::before,
#contact::before{
  content:'';
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:0;
  background-size: 28px 28px;
  background-image:
    radial-gradient(ellipse 1px 1px at center, rgba(0,0,0,.04) 1px, transparent 0);
}
#about::before{
  background-image:
    radial-gradient(ellipse 1px 1px at center, rgba(0,0,0,.04) 1px, transparent 0);
}
#skills::before{
  background-image:
    radial-gradient(ellipse 1px 1px at center, rgba(0,0,0,.04) 1px, transparent 0);
}
#experience::before{
  background-image:
    radial-gradient(ellipse 1px 1px at center, rgba(0,0,0,.04) 1px, transparent 0);
}
#projects::before{
  background-image:
    radial-gradient(ellipse 1px 1px at center, rgba(0,0,0,.04) 1px, transparent 0);
}
#education::before{
  background-image:
    radial-gradient(ellipse 1px 1px at center, rgba(0,0,0,.04) 1px, transparent 0);
}
#contact::before{
  background-image:
    radial-gradient(ellipse 1px 1px at center, rgba(0,0,0,.04) 1px, transparent 0);
}

/* push section content above the pseudo bg */
.section > .gutter,
.section > .section-content{
  position:relative;
  z-index:1;
}

.hero-section{ border-bottom:1px solid var(--border); }

/* ---- Section title — gradient + underline bar like hero name ---- */
.section-eyebrow{
  font-family:var(--font-mono);
  font-size:12px;
  color:var(--accent-2);
  margin-bottom:10px;
  letter-spacing:.04em;
  display:flex;
  align-items:center;
  gap:8px;
}
.section-eyebrow::before{
  content:'';
  display:inline-block;
  width:16px; height:1px;
  background:var(--accent-2);
  opacity:.5;
}

.section-title{
  font-family:var(--font-mono);
  font-weight:800;
  font-size:clamp(20px, 2.8vw, 28px);
  letter-spacing:-.02em;
  margin-bottom:32px;
  color:var(--text);
  display:inline-block;
}
.section-title::after{
  content:'';
  display:block;
  width:32px;
  height:2px;
  background:var(--primary);
  border-radius:2px;
  margin-top:8px;
}

.gutter{
  width:52px;
  flex-shrink:0;
  padding-top:56px;
  text-align:right;
  font-family:var(--font-mono);
  font-size:11.5px;
  color:var(--text-faint);
  user-select:none;
  display:none;
}
@media (min-width: 860px){ .gutter{ display:block; } }
.gutter::before{
  content: attr(data-lines);
  display:none;
}
.gutter{
  counter-reset: line;
}
.gutter{
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 27px,
    var(--border-soft) 27px,
    var(--border-soft) 28px
  );
}

.section-content{
  flex:1;
  min-width:0;
  padding:56px 40px 64px;
}

.prose{
  color:var(--text-dim);
  font-size:15.5px;
  line-height:1.9;
}

/* =========================================================
   HERO
========================================================= */
.hero-section{
  position:relative;
  overflow:hidden;
  border-bottom:1px solid var(--border);
}

/* Dot-grid background */
.hero-bg-grid{
  position:absolute;
  inset:0;
  background-image:
    radial-gradient(circle at 70% 50%, rgba(227,165,60,.06) 0%, transparent 60%),
    radial-gradient(circle at 10% 80%, rgba(79,209,197,.05) 0%, transparent 50%),
    radial-gradient(ellipse 1px 1px at center, var(--border) 1px, transparent 0);
  background-size: auto, auto, 28px 28px;
  pointer-events:none;
  z-index:0;
}

.hero-section .section-content{
  position:relative;
  z-index:1;
  display:grid;
  grid-template-columns:1fr 1.05fr;
  gap:56px;
  align-items:center;
  padding-top:120px;
  padding-bottom:80px;
}

/* ---- Hero meta (left col) ---- */
.hero-eyebrow{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:20px;
}
.hero-eyebrow-dot{
  width:7px; height:7px; border-radius:50%;
  background:var(--mono-green);
  box-shadow:0 0 8px var(--mono-green);
  animation:pulse 2s ease-in-out infinite;
  flex-shrink:0;
}
.hero-eyebrow-text{
  font-family:var(--font-mono);
  font-size:12px;
  color:var(--text-faint);
  letter-spacing:.04em;
}

.hero-name{
  font-family:var(--font-mono);
  font-weight:800;
  font-size:clamp(32px, 4.8vw, 52px);
  letter-spacing:-.025em;
  line-height:1.1;
  margin-bottom:6px;
  color:var(--text);
}

/* animated underline accent */
.hero-name::after{
  content:'';
  display:block;
  width:56px;
  height:3px;
  background:var(--gold);
  border-radius:2px;
  margin-top:10px;
  animation:slideIn .6s ease forwards;
}
@keyframes slideIn{
  from{ width:0; opacity:0; }
  to{ width:56px; opacity:1; }
}

.hero-title{
  font-family:var(--font-mono);
  font-size:16px;
  color:var(--text-muted);
  font-weight:500;
  margin-bottom:22px;
  margin-top:4px;
}

.hero-tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:32px;
}
.hero-tags .tag{
  font-family:var(--font-mono);
  font-size:11.5px;
  color:var(--primary);
  background:var(--primary-soft);
  border:1px solid var(--primary-border);
  border-radius:var(--radius-pill);
  padding:5px 11px;
  transition:.15s ease;
}
.hero-tags .tag:hover{
  background:rgba(10,102,194,.15);
  border-color:var(--primary);
}

.hero-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:28px;
}

.btn{
  font-family:var(--font-mono);
  font-size:13px;
  font-weight:600;
  padding:11px 22px;
  border-radius:var(--radius);
  transition:.18s ease;
  border:1px solid transparent;
  display:inline-flex;
  align-items:center;
  gap:6px;
  position:relative;
  overflow:hidden;
}
.btn::before{
  content:'';
  position:absolute;
  inset:0;
  background:rgba(255,255,255,.06);
  opacity:0;
  transition:.18s ease;
}
.btn:hover::before{ opacity:1; }

.btn-primary{
  background:var(--primary);
  color:#FFFFFF;
  box-shadow:none;
}
.btn-primary:hover{
  background:var(--primary-hover);
  transform:translateY(-1px);
}
.btn-primary:active{ transform:translateY(0); }

.btn-ghost{
  border-color:var(--primary);
  color:var(--primary);
  background:transparent;
  box-shadow:none;
}
.btn-ghost:hover{
  border-color:var(--primary);
  color:var(--primary);
  background:var(--primary-soft);
  transform:translateY(-1px);
}
.btn-ghost:active{ transform:translateY(0); }

.btn-download{
  border-color:var(--primary);
  color:var(--primary);
  background:transparent;
  gap:7px;
}
.btn-download svg{ flex-shrink:0; transition:.18s ease; }
.btn-download:hover{
  border-color:var(--primary-hover);
  color:var(--primary-hover);
  background:var(--primary-soft);
  transform:translateY(-1px);
}
.btn-download:hover svg{ transform:translateY(1px); }
.btn-download:active{ transform:translateY(0); }

.hero-meta-row{
  font-family:var(--font-mono);
  font-size:12.5px;
  color:var(--text-muted);
  display:flex;
  gap:10px;
  align-items:center;
}
.sep{ color:var(--border); }

/* ---- Terminal (right col) ---- */
.hero-terminal-wrap{
  position:relative;
}
.terminal-glow{
  position:absolute;
  inset:-1px;
  border-radius:calc(var(--radius-lg) + 2px);
  background:transparent;
  box-shadow:
    0 0 0 1px rgba(227,165,60,.08),
    0 30px 60px -20px rgba(0,0,0,.7),
    0 0 80px -30px rgba(227,165,60,.12);
  pointer-events:none;
  z-index:0;
}
.terminal-window{
  position:relative;
  z-index:1;
  background:var(--term-bg);
  border:1px solid rgba(255,255,255,.1);
  border-radius:var(--radius-card);
  overflow:hidden;
  box-shadow:var(--shadow-card);
}
.terminal-titlebar{
  display:flex;
  align-items:center;
  gap:7px;
  padding:11px 16px;
  background:rgba(0,0,0,.3);
  border-bottom:1px solid rgba(255,255,255,.1);
  user-select:none;
}
.dot{ width:10px; height:10px; border-radius:50%; }
.dot.red{ background:#ff5f57; }
.dot.yellow{ background:#ffbd2e; }
.dot.green{ background:#28c940; }
.terminal-name{
  margin-left:8px;
  font-family:var(--font-mono);
  font-size:11.5px;
  color:rgba(255,255,255,.6);
  flex:1;
}
.terminal-tab-indicator{
  font-family:var(--font-mono);
  font-size:10.5px;
  color:rgba(255,255,255,.5);
  background:rgba(0,0,0,.2);
  border:1px solid rgba(255,255,255,.1);
  border-radius:3px;
  padding:2px 8px;
  opacity:.7;
}

.terminal-body{
  padding:22px 22px 28px;
  font-family:var(--font-mono);
  font-size:13.5px;
  line-height:2;
  min-height:200px;
  background:var(--term-bg);
  color:var(--term-text);
  /* subtle scanline */
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 31px,
    rgba(255,255,255,.015) 31px,
    rgba(255,255,255,.015) 32px
  );
}
.term-line{ color:var(--term-text); white-space:pre-wrap; word-break:break-word; }
.term-prompt{ color:#4ADE80; }
.term-cursor{
  display:inline-block;
  width:8px; height:15px;
  background:#4ADE80;
  margin-left:2px;
  animation:blink 1s step-end infinite;
  vertical-align:middle;
  border-radius:1px;
}
@keyframes blink{ 50%{ opacity:0; } }


/* =========================================================
   SKILLS (config block)
========================================================= */
.config-block{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-card);
  overflow:hidden;
  font-family:var(--font-mono);
  font-size:13.5px;
  box-shadow:var(--shadow-card);
}
.config-block-header{
  padding:11px 22px;
  background:var(--bg-alt);
  border-bottom:1px solid var(--border);
  font-size:11.5px;
  color:var(--text-faint);
  display:flex;
  align-items:center;
  gap:8px;
}
.config-block-header::before{
  content:'{}';
  color:var(--primary);
  font-weight:700;
}
.config-row{
  display:flex;
  gap:18px;
  padding:13px 22px;
  border-bottom:1px solid rgba(0,0,0,.04);
  align-items:flex-start;
  transition:background .15s;
}
.config-row:last-child{ border-bottom:none; }
.config-row:hover{ background:var(--bg-alt); }
.config-key{
  color:var(--primary);
  min-width:150px;
  flex-shrink:0;
  font-size:13px;
}
.config-key::after{ content:':'; color:var(--text-faint); margin-left:1px; }
.config-values{ display:flex; flex-wrap:wrap; gap:7px; }
.config-values .chip{
  color:var(--text);
  background:var(--bg-alt);
  border:1px solid var(--border);
  border-radius:var(--radius-card);
  padding:4px 11px;
  font-size:12px;
  white-space:nowrap;
  transition:.15s;
}
.config-values .chip:hover{
  border-color:var(--primary);
  color:var(--primary);
  background:var(--primary-soft);
}
  background:var(--accent-2-soft);
}

/* =========================================================
   EXPERIENCE (timeline)
========================================================= */
.timeline{ position:relative; padding-left:32px; }
.timeline::before{
  content:'';
  position:absolute; left:7px; top:8px; bottom:8px;
  width:1px;
  background:linear-gradient(to bottom, var(--accent) 0%, var(--border) 30%, var(--border) 100%);
}
.timeline-item{
  position:relative;
  padding-bottom:44px;
}
.timeline-item:last-child{ padding-bottom:0; }

.timeline-dot{
  position:absolute; left:-32px; top:5px;
  width:15px; height:15px; border-radius:50%;
  background:var(--panel);
  border:2px solid var(--border);
  transition:.2s;
}
.timeline-item.current .timeline-dot{
  border-color:var(--accent-5);
  background:var(--accent-5);
  box-shadow:0 0 0 5px rgba(21,128,61,.1), 0 0 12px rgba(21,128,61,.2);
}

.timeline-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-card);
  padding:22px 24px;
  transition:.2s ease;
  box-shadow:var(--shadow-card);
}
.timeline-card:hover{
  border-color:rgba(10,102,194,.3);
  box-shadow:var(--shadow-card);
  transform:translateY(-1px);
}
.timeline-item.current .timeline-card{
  border-left:3px solid var(--primary);
}

.timeline-header{
  display:flex; flex-wrap:wrap; align-items:center; gap:10px;
  margin-bottom:4px;
}
.timeline-role{
  font-family:var(--font-mono);
  font-weight:700;
  font-size:16px;
  color:var(--text);
}
.timeline-badge{
  font-family:var(--font-mono);
  font-size:10px;
  color:var(--primary);
  background:var(--primary-soft);
  border:1px solid var(--primary-border);
  border-radius:var(--radius-pill);
  padding:2px 9px;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.timeline-company{
  color:var(--primary);
  font-weight:600;
  font-size:14px;
  margin-bottom:3px;
}
.timeline-sub{
  font-family:var(--font-mono);
  font-size:11.5px;
  color:var(--text-muted);
  margin-bottom:16px;
  display:flex;
  align-items:center;
  gap:6px;
}
.timeline-sub::before{
  content:'';
  display:inline-block;
  width:14px; height:1px;
  background:var(--border);
}
.timeline-points{ display:flex; flex-direction:column; gap:9px; }
.timeline-points li{
  color:var(--text-dim);
  font-size:14px;
  line-height:1.72;
  padding-left:20px;
  position:relative;
}
.timeline-points li::before{
  content:'▸';
  position:absolute; left:0; top:1px;
  color:var(--primary);
  font-size:11px;
}

/* =========================================================
   PROJECTS — HORIZONTAL CAROUSEL
========================================================= */
.projects-section-content{
  padding-right:40px;
  overflow:visible;
}
@media (max-width:480px){ .projects-section-content{ padding-right:16px; } }

.projects-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:0;
}

/* nav controls */
.carousel-nav{
  display:flex;
  align-items:center;
  gap:10px;
  flex-shrink:0;
}
.carousel-btn{
  width:32px; height:32px;
  border-radius:var(--radius-card);
  border:1px solid var(--border);
  background:var(--surface);
  color:var(--text-muted);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  transition:.15s ease;
  flex-shrink:0;
  box-shadow:var(--shadow-card);
}
.carousel-btn:hover{
  border-color:var(--primary);
  color:var(--primary);
  background:var(--primary-soft);
  box-shadow:var(--shadow-card);
  transform:translateY(-1px);
}
.carousel-count{
  font-family:var(--font-mono);
  font-size:12px;
  color:var(--text-faint);
  min-width:40px;
  text-align:center;
}

/* scroll track */
.carousel-track-outer{
  margin-top:28px;
  overflow:hidden;
}
.project-carousel{
  display:flex;
  gap:20px;
  overflow-x:auto;
  scroll-snap-type:x mandatory;
  scroll-padding: 0;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
  padding-bottom:6px;
}
.project-carousel::-webkit-scrollbar{ display:none; }

/* dots */
.carousel-dots{
  display:flex;
  gap:7px;
  margin-top:20px;
  flex-wrap:wrap;
}
.carousel-dot{
  width:7px; height:7px; border-radius:50%;
  background:var(--border);
  border:none; cursor:pointer;
  padding:0;
  transition:.2s ease;
}
.carousel-dot.active{
  background:var(--primary);
  width:20px;
  border-radius:4px;
  box-shadow:0 0 0 3px var(--primary-soft);
}

/* ---- Project Card ---- */
.pcard{
  flex:0 0 360px;
  scroll-snap-align:start;
  scroll-snap-stop: always;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-card);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  transition:.22s ease;
  position:relative;
  box-shadow:var(--shadow-card);
}
.pcard::before{
  content:'';
  position:absolute;
  top:0; left:0; right:0;
  height:2px;
  background:var(--primary);
  opacity:0;
  transition:.22s ease;
}
.pcard:hover{
  border-color:rgba(10,102,194,.3);
  transform:translateY(-2px);
  box-shadow:var(--shadow-card);
}
.pcard:hover::before{ opacity:1; }

/* image / placeholder */
.pcard-img{
  width:100%;
  height:180px;
  object-fit:cover;
  display:block;
  border-bottom:1px solid var(--border-soft);
  background:var(--panel-alt);
}
.pcard-img-placeholder{
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg, var(--bg-alt) 0%, var(--bg) 100%);
  border-bottom:1px solid var(--border);
}
.pcard-img-label{
  font-family:var(--font-mono);
  font-weight:800;
  font-size:42px;
  color:var(--text-faint);
  letter-spacing:-.02em;
  user-select:none;
}

/* body */
.pcard-body{
  display:flex;
  flex-direction:column;
  flex:1;
  padding:20px;
  gap:14px;
}
.pcard-head{ display:flex; flex-direction:column; gap:8px; }
.pcard-title-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.pcard-name{
  font-family:var(--font-mono);
  font-weight:700;
  font-size:15px;
  color:var(--text);
  line-height:1.3;
}
.pcard-ext{
  font-family:var(--font-mono);
  font-size:10px;
  border-radius:20px;
  padding:3px 9px;
  text-transform:uppercase;
  flex-shrink:0;
  letter-spacing:.04em;
  font-weight:600;
  border:1px solid transparent;
}
.pcard-desc{
  font-size:13px;
  color:var(--text-dim);
  line-height:1.65;
}

/* bullet points */
.pcard-points{
  display:flex;
  flex-direction:column;
  gap:7px;
  flex:1;
}
.pcard-points li{
  font-size:12.5px;
  color:var(--text-faint);
  line-height:1.6;
  padding-left:14px;
  position:relative;
}
.pcard-points li::before{
  content:'▸';
  position:absolute; left:0; top:1px;
  color:var(--accent-2);
  font-size:9px;
}

/* stack chips */
.pcard-stack{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  padding-top:12px;
  border-top:1px solid var(--border);
}
.pcard-stack span{
  font-family:var(--font-mono);
  font-size:10px;
  color:var(--primary);
  border:1px solid var(--primary-border);
  border-radius:var(--radius-card);
  padding:3px 8px;
  background:var(--primary-soft);
}

/* links row */
.pcard-links{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding-top:4px;
}
.pcard-link{
  display:inline-flex;
  align-items:center;
  gap:5px;
  font-family:var(--font-mono);
  font-size:11px;
  font-weight:600;
  padding:6px 12px;
  border-radius:var(--radius);
  border:1px solid;
  transition:.15s ease;
  text-decoration:none;
}
.pcard-link-web{
  color:var(--primary);
  border-color:var(--primary-border);
  background:var(--primary-soft);
}
.pcard-link-web:hover{
  background:var(--primary);
  color:#FFFFFF;
  border-color:var(--primary);
}
.pcard-link-play{
  color:var(--success);
  border-color:rgba(5,118,66,.3);
  background:rgba(5,118,66,.08);
}
.pcard-link-play:hover{
  background:var(--success);
  color:#FFFFFF;
  border-color:var(--success);
}
.pcard-link-apple{
  color:var(--text-muted);
  border-color:var(--border);
  background:var(--bg-alt);
}
.pcard-link-apple:hover{
  color:var(--text);
  border-color:var(--text-muted);
  background:var(--bg);
}

/* =========================================================
   ABOUT
========================================================= */
.about-inner{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:32px;
  align-items:start;
}

.prose strong{ color:var(--text); font-weight:600; }

.about-stats{
  display:flex;
  flex-direction:column;
  gap:12px;
  min-width:160px;
}
.stat-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-card);
  padding:16px 20px;
  text-align:center;
  transition:.15s ease;
  box-shadow:var(--shadow-card);
}
.stat-card:hover{ 
  border-color:rgba(10,102,194,.3);
  box-shadow:var(--shadow-card);
  transform:translateY(-1px);
}
.stat-num{
  font-family:var(--font-mono);
  font-weight:800;
  font-size:26px;
  color:var(--primary);
  line-height:1;
  margin-bottom:4px;
}
.stat-label{
  font-family:var(--font-mono);
  font-size:10.5px;
  color:var(--text-faint);
  text-transform:uppercase;
  letter-spacing:.06em;
}

/* =========================================================
   EDUCATION + CERTS
========================================================= */
.edu-cert-grid{
  display:grid;
  grid-template-columns:1fr 1.1fr;
  gap:24px;
  align-items:start;
}

.edu-block{
  background:var(--surface);
  border:1px solid var(--border);
  border-left:3px solid var(--primary);
  border-radius:var(--radius-card);
  padding:24px;
  box-shadow:var(--shadow-card);
}
.edu-degree{
  font-family:var(--font-mono);
  font-weight:700;
  color:var(--text);
  font-size:15px;
  margin-bottom:8px;
  line-height:1.4;
}
.edu-institute{
  color:var(--primary);
  font-size:13.5px;
  margin-bottom:8px;
  font-weight:500;
}
.edu-duration{
  font-family:var(--font-mono);
  font-size:11.5px;
  color:var(--text-faint);
  margin-bottom:10px;
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.edu-duration::before{
  content:'';
  display:inline-block;
  width:10px; height:1px;
  background:var(--border);
}
.edu-detail{
  font-size:13px;
  color:var(--accent-5);
  font-family:var(--font-mono);
  font-weight:600;
}

.cert-block{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-card);
  overflow:hidden;
  box-shadow:var(--shadow-card);
}
.cert-heading{
  font-family:var(--font-mono);
  font-size:12px;
  color:var(--success);
  padding:12px 20px;
  background:var(--bg-alt);
  border-bottom:1px solid var(--border);
}
.cert-list{ display:flex; flex-direction:column; padding:8px 0; }
.cert-list li{
  font-size:13px;
  color:var(--text-dim);
  padding:9px 20px 9px 42px;
  position:relative;
  line-height:1.5;
  border-bottom:1px solid var(--border-soft);
  transition:.15s;
}
.cert-list li:last-child{ border-bottom:none; }
.cert-list li:hover{ background:var(--panel-hover); color:var(--text); }
.cert-list li::before{
  content:'✓';
  position:absolute; left:20px; top:10px;
  color:var(--success);
  font-size:11px;
  font-family:var(--font-mono);
}

/* =========================================================
   CONTACT
========================================================= */
.contact-section .section-content{ max-width:100%; }
#about .section-content{ max-width:100%; }

.contact-intro{
  font-family:var(--font-mono);
  font-size:13px;
  color:var(--text-faint);
  margin-bottom:32px;
  display:flex;
  align-items:center;
  gap:10px;
}
.contact-intro::before{
  content:'>';
  color:var(--accent-2);
  font-weight:700;
}

.contact-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(240px, 1fr));
  gap:14px;
}
.contact-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-card);
  padding:18px 20px;
  transition:.18s ease;
  display:flex;
  align-items:center;
  gap:14px;
  position:relative;
  overflow:hidden;
  box-shadow:var(--shadow-card);
}
.contact-card::after{
  content:'';
  position:absolute;
  bottom:0; left:0; right:0;
  height:2px;
  background:linear-gradient(90deg, var(--accent), transparent);
  transform:scaleX(0);
  transform-origin:left;
  transition:.2s ease;
}
.contact-card:hover{
  border-color:rgba(10,102,194,.3);
  background:var(--bg-alt);
  transform:translateY(-1px);
  box-shadow:var(--shadow-card);
}
.contact-card:hover::after{ transform:scaleX(1); }

.contact-icon{
  font-family:var(--font-mono);
  font-size:16px;
  width:40px; height:40px;
  display:flex; align-items:center; justify-content:center;
  background:var(--primary-soft);
  color:var(--primary);
  border-radius:var(--radius-card);
  flex-shrink:0;
  border:1px solid var(--primary-border);
  transition:.18s;
}
.contact-card:hover .contact-icon{
  background:var(--primary);
  color:#FFFFFF;
  border-color:var(--primary);
}
.contact-label{
  font-family:var(--font-mono);
  font-size:10.5px;
  color:var(--text-muted);
  margin-bottom:3px;
  text-transform:uppercase;
  letter-spacing:.07em;
}
.contact-value{
  font-size:13.5px;
  color:var(--text);
  word-break:break-word;
  font-weight:500;
}

.site-footer{
  padding:32px 40px 48px;
  font-family:var(--font-mono);
  font-size:12px;
  color:var(--text-faint);
  text-align:center;
  border-top:1px solid var(--border-soft);
}
.site-footer code{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:3px;
  padding:1px 6px;
  color:var(--accent-2);
}

/* =========================================================
   RESPONSIVE — full mobile / tablet / desktop
========================================================= */

/* ---- DESKTOP baseline sidebar drawer ---- */
@media (max-width: 860px){
  .app{ display:block; }
  .topbar{ display:flex; }
  .sidebar{
    position:fixed;
    top:0; left:0; bottom:0;
    z-index:60;
    transform:translateX(-100%);
    transition:transform .25s ease;
    box-shadow:20px 0 40px rgba(0,0,0,.4);
  }
  .sidebar.open{ transform:translateX(0); }
  .editor{ width:100%; }

  /* tabbar — hide on mobile, shown as drawer only */
  .tabbar{ top:53px; } /* below topbar */
}

/* ---- TABLET  481px – 860px ---- */
@media (min-width:481px) and (max-width:860px){
  .section-content{ padding:44px 28px 56px; }

  /* hero */
  .hero-section .section-content{
    grid-template-columns:1fr;
    padding-top:44px;
    padding-bottom:56px;
    gap:36px;
  }
  .hero-name{ font-size:clamp(28px, 5vw, 40px); }
  .hero-actions{ flex-wrap:wrap; gap:10px; }
  .btn{ font-size:12.5px; padding:10px 18px; }

  /* about */
  .about-inner{ grid-template-columns:1fr; gap:24px; }
  .about-stats{ flex-direction:row; min-width:0; }
  .stat-card{ flex:1; }

  /* skills */
  .config-row{ flex-direction:column; gap:10px; }
  .config-key{ min-width:0; }

  /* experience */
  .timeline{ padding-left:24px; }
  .timeline-dot{ left:-24px; }
  .timeline-card{ padding:18px 20px; }
  .timeline-role{ font-size:15px; }

  /* projects carousel */
  .projects-header{ flex-wrap:wrap; gap:12px; }
  .pcard{ flex:0 0 320px; }
  .carousel-dots{ margin-top:14px; }

  /* edu + certs */
  .edu-cert-grid{ grid-template-columns:1fr; }

  /* contact */
  .contact-grid{ grid-template-columns:1fr 1fr; }
}

/* ---- MOBILE  ≤480px ---- */
@media (max-width:480px){
  :root{ --radius-lg: 8px; }

  .section-content{ padding:32px 16px 44px; }

  /* tabbar scroll on small screens */
  .tab{ padding:10px 14px; font-size:11.5px; }

  /* hero */
  .hero-section .section-content{
    grid-template-columns:1fr;
    padding-top:32px;
    padding-bottom:44px;
    gap:32px;
  }
  .hero-name{ font-size:clamp(26px, 8vw, 36px); }
  .hero-title{ font-size:14px; }
  .hero-tags{ gap:6px; }
  .hero-tags .tag{ font-size:11px; padding:4px 9px; }
  .hero-actions{
    flex-direction:column;
    align-items:stretch;
    gap:10px;
  }
  .btn{
    font-size:12.5px;
    padding:12px 16px;
    justify-content:center;
    width:100%;
  }
  .hero-meta-row{ flex-wrap:wrap; gap:6px; font-size:11.5px; }

  /* terminal */
  .terminal-body{ padding:16px; font-size:12.5px; min-height:160px; }
  .terminal-name{ font-size:10.5px; }
  .terminal-tab-indicator{ display:none; }

  /* section titles */
  .section-title{ font-size:clamp(18px, 5.5vw, 24px); margin-bottom:24px; }
  .section-eyebrow{ font-size:11px; }

  /* about */
  .about-inner{ grid-template-columns:1fr; gap:20px; }
  .about-stats{ flex-direction:row; flex-wrap:wrap; min-width:0; gap:10px; }
  .stat-card{ flex:1; min-width:100px; padding:14px 12px; }
  .stat-num{ font-size:22px; }
  .prose{ font-size:14.5px; }

  /* skills */
  .config-row{ flex-direction:column; gap:10px; padding:12px 16px; }
  .config-key{ min-width:0; }
  .config-block-header{ padding:10px 16px; font-size:11px; }

  /* experience */
  .timeline{ padding-left:20px; }
  .timeline::before{ left:5px; }
  .timeline-dot{ left:-20px; width:12px; height:12px; top:6px; }
  .timeline-card{ padding:16px; }
  .timeline-role{ font-size:14.5px; }
  .timeline-company{ font-size:13px; }
  .timeline-sub{ font-size:11px; flex-wrap:wrap; }
  .timeline-points li{ font-size:13px; }
  .timeline-item{ padding-bottom:32px; }

  /* projects carousel */
  .projects-header{ flex-wrap:wrap; gap:12px; }
  .pcard{ flex:0 0 calc(100vw - 52px); }
  .carousel-track-outer{ margin-top:20px; }
  .carousel-dots{ margin-top:14px; }
  .pcard-body{ padding:16px; gap:12px; }
  .pcard-name{ font-size:14px; }
  .pcard-desc{ font-size:12.5px; }
  .pcard-img{ height:150px; }
  .pcard-img-label{ font-size:34px; }
  .pcard-links{ gap:6px; }
  .pcard-link{ font-size:10.5px; padding:5px 10px; }
  .carousel-btn{ width:28px; height:28px; }

  /* education + certs */
  .edu-cert-grid{ grid-template-columns:1fr; gap:16px; }
  .edu-block{ padding:18px; }
  .edu-degree{ font-size:14px; }
  .cert-list li{ padding:8px 16px 8px 36px; font-size:12.5px; }
  .cert-list li::before{ left:16px; }

  /* contact */
  .contact-grid{ grid-template-columns:1fr; gap:10px; }
  .contact-card{ padding:14px 16px; }
  .contact-intro{ font-size:12px; }

  /* footer */
  .site-footer{ padding:24px 16px 36px; font-size:11px; }
}

/* body scroll lock when drawer open */
body.no-scroll{ overflow:hidden; }
.sidebar-scrim{
  display:none;
  position:fixed; inset:0; z-index:55;
  background:rgba(0,0,0,.5);
}
.sidebar-scrim.show{ display:block; }

/* ---- record links ---- */
.record-link{
  color:inherit;
  text-decoration:none;
  border-bottom:1px dashed var(--accent);
  transition:color .2s,border-color .2s;
}
.record-link:hover{
  color:var(--accent);
  border-bottom-style:solid;
}
a.project-name.record-link{
  font-size:inherit;
  font-weight:inherit;
  letter-spacing:inherit;
}

/* =========================================================
   CHATBOT
========================================================= */

/* ---- FAB ---- */
.chat-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform .2s ease, box-shadow .2s ease;
  user-select: none;
}
.chat-fab:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 20px rgba(10,102,194,.25);
}
.chat-fab:active { transform: scale(.97); }

.chat-fab-icon { position: absolute; transition: opacity .2s ease, transform .2s ease; }
.chat-fab-icon-open  { opacity: 1; transform: scale(1); }
.chat-fab-icon-close { opacity: 0; transform: scale(.6) rotate(-45deg); }

.chat-fab.active .chat-fab-icon-open  { opacity: 0; transform: scale(.6) rotate(45deg); }
.chat-fab.active .chat-fab-icon-close { opacity: 1; transform: scale(1) rotate(0deg); }

.chat-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-3);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
  animation: pulse 2s ease-in-out infinite;
}

/* ---- Chat window ---- */
.chat-window {
  position: fixed;
  bottom: 92px;
  right: 28px;
  z-index: 199;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transform: translateY(12px) scale(.97);
  opacity: 0;
  pointer-events: none;
  transition: transform .22s ease, opacity .22s ease;
}
.chat-window.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

/* ---- Header ---- */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-header-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 7px var(--success);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
.chat-header-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.chat-header-status {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 1px;
}
.chat-close-btn {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 5px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .15s ease;
}
.chat-close-btn:hover { color: var(--text); background: var(--panel-hover); }

/* ---- Suggestions ---- */
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-alt);
}
.chat-suggestion {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  cursor: pointer;
  transition: .15s ease;
  white-space: nowrap;
}
.chat-suggestion:hover {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

/* ---- Messages ---- */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.chat-msg { display: flex; }
.chat-msg-bot  { justify-content: flex-start; }
.chat-msg-user { justify-content: flex-end; }

.chat-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.65;
  word-break: break-word;
  animation: bubbleIn .18s ease;
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-msg-bot .chat-bubble {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
  font-family: var(--font-body);
}
.chat-msg-user .chat-bubble {
  background: var(--primary);
  color: #FFFFFF;
  font-weight: 500;
  border-bottom-right-radius: 4px;
  font-family: var(--font-body);
}

/* ---- Input row ---- */
.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13.5px;
  padding: 9px 13px;
  outline: none;
  transition: border-color .15s;
}
.chat-input::placeholder { color: var(--text-muted); }
.chat-input:focus { border-color: var(--primary); }

.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  border: none;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: .15s ease;
}
.chat-send-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}
.chat-send-btn:active { transform: scale(.95); }

/* ---- Mobile adjustments ---- */
@media (max-width: 480px) {
  .chat-fab    { bottom: 20px; right: 16px; }
  .chat-window { bottom: 82px; right: 8px; left: 8px; width: auto; }
}

/* =========================================================
   CERTIFICATE MODAL
========================================================= */
.timeline-cert-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(227,165,60,.28);
  border-radius: 20px;
  padding: 2px 9px;
  letter-spacing: .04em;
  cursor: pointer;
  transition: .15s ease;
  white-space: nowrap;
}
.timeline-card.has-cert:hover .timeline-cert-badge {
  background: rgba(227,165,60,.2);
  border-color: var(--accent);
}

.cert-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.cert-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.cert-modal-overlay.open .cert-modal-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.cert-modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 32px 80px -20px rgba(0,0,0,.9), 0 0 0 1px rgba(227,165,60,.1);
  transform: translateY(16px) scale(.97);
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
}

.cert-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--panel-alt);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cert-modal-title {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
}
.cert-modal-close {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 5px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  transition: .15s ease;
}
.cert-modal-close:hover { color: var(--text); background: var(--panel-hover); }

.cert-modal-body {
  overflow-y: auto;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cert-modal-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  display: block;
}
