/* =========================================================
   TOKENS
========================================================= */
:root{
  --bg:            #0a0a0a;
  --bg-panel:      #121212;
  --bg-panel-alt:  #171717;
  --border:        #2a2a28;
  --border-soft:   #1e1e1c;

  --orange:        #ff6a1a;
  --orange-dim:    #b8501a;
  --amber:         #ffb347;

  --text:          #ededea;
  --text-dim:      #b8b6ae;
  --text-mute:     #77756e;

  --success:       #4fd67a;

  --font-display:  'Space Grotesk', sans-serif;
  --font-body:     'Inter', sans-serif;
  --font-mono:     'JetBrains Mono', monospace;

  --radius:        6px;
  --max-w:         1120px;
}

*{ box-sizing: border-box; margin:0; padding:0; }
html{ scroll-behavior:smooth; }

body{
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a{ color:inherit; text-decoration:none; }
ul{ list-style:none; }
img{ max-width:100%; display:block; }

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

::selection{ background: var(--orange); color:#0a0a0a; }

/* =========================================================
   BACKGROUND ATMOSPHERE
========================================================= */
.bg-grid{
  position: fixed; inset:0; z-index:0; pointer-events:none;
  background-image:
    linear-gradient(rgba(255,106,26,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,106,26,0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 90%);
}
.bg-glow{
  position: fixed; top:-20%; left:50%; transform:translateX(-50%);
  width: 900px; height: 700px; z-index:0; pointer-events:none;
  background: radial-gradient(circle, rgba(255,106,26,0.14) 0%, transparent 65%);
}

/* =========================================================
   TABBAR / NAV
========================================================= */
.tabbar{
  position: sticky; top:0; z-index:50;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.tabbar-inner{
  max-width: var(--max-w); margin:0 auto;
  padding: 14px 20px;
  display:flex; align-items:center; gap:20px;
}
.tab-brand{
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  display:flex; align-items:center; gap:8px;
  white-space: nowrap;
  min-width:0;
  overflow:hidden;
  text-overflow: ellipsis;
}
.tab-brand .dot{
  width:8px; height:8px; border-radius:50%;
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange);
  flex-shrink:0;
}
.cursor-blink{ color:var(--orange); animation: blink 1.1s step-end infinite; }

.tabs{
  display:flex; gap:4px; flex:1;
  font-family: var(--font-mono);
  font-size: 13px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar{ display:none; }
.tab{
  padding: 6px 12px;
  color: var(--text-mute);
  border-radius: 4px 4px 0 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.tab:hover{ color: var(--text); background: rgba(255,255,255,0.03); }
.tab.active{ color: var(--orange); border-bottom-color: var(--orange); }

.resume-btn{
  font-family: var(--font-mono);
  font-size: 12.5px;
  display:flex; align-items:center; gap:6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink:0;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.resume-btn:hover{ border-color: var(--orange); color: var(--orange); background: rgba(255,106,26,0.06); }

.nav-toggle{
  display:none;
  background:none; border:none; cursor:pointer;
  width: 36px; height: 36px;
  flex-shrink:0;
  flex-direction:column; align-items:center; justify-content:center; gap:5px;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle span{
  width: 20px; height: 2px; background: var(--text);
  transition: transform .2s ease, opacity .2s ease;
}
.tabbar.menu-open .nav-toggle span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.tabbar.menu-open .nav-toggle span:nth-child(2){ opacity:0; }
.tabbar.menu-open .nav-toggle span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   HERO
========================================================= */
.hero{
  position:relative; z-index:1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 64px 24px 40px;
  display:flex; flex-direction:column; align-items:center;
}
.hero-inner{
  width:100%;
  display:grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items:start;
}
.hero-side{ order:-1; }
.terminal{ order:0; }

.terminal{
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: 0 30px 60px -25px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,106,26,0.03);
}
.terminal-titlebar{
  display:flex; align-items:center; gap:10px;
  padding: 10px 14px;
  background: var(--bg-panel-alt);
  border-bottom: 1px solid var(--border-soft);
}
.tl-dots{ display:flex; gap:6px; }
.tl-dots span{ width:10px; height:10px; border-radius:50%; background:#3a3a38; }
.tl-dots span:nth-child(1){ background:#4a2e24; }
.tl-dots span:nth-child(2){ background: var(--orange-dim); }
.tl-dots span:nth-child(3){ background: var(--amber); }
.tl-title{
  flex:1; text-align:center;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-mute);
}
.tl-status{
  display:flex; align-items:center; gap:6px;
  font-family: var(--font-mono); font-size: 11px; color: var(--success);
}
.status-dot{
  width:6px; height:6px; border-radius:50%; background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: pulse 2s ease-in-out infinite;
}

.terminal-body{
  padding: 22px 20px 26px;
  font-family: var(--font-mono);
  font-size: 14px;
}
.term-line{ color: var(--text-dim); margin-top: 14px; }
.term-line:first-child{ margin-top:0; }
.prompt{ color: var(--orange); }
.path{ color: var(--amber); margin: 0 4px; }
.dollar{ color: var(--text-mute); margin-right: 8px; }
.term-out{
  color: var(--text);
  padding-left: 2px;
  margin-top: 4px;
  font-size: 15px;
  word-break: break-word;
}
#typedRole{ color: var(--orange); font-weight: 500; }
.type-cursor{ color: var(--orange); animation: blink 0.9s step-end infinite; }
.blink-caret{ color: var(--orange); animation: blink 1s step-end infinite; }

.hero-side{
  display:flex; flex-direction:column; align-items:center; gap:16px;
  width: 168px;
}
.hero-photo-frame{
  position:relative;
  width: 132px; height: 132px;
  border-radius: 50%;
  overflow:hidden;
  background: var(--bg-panel);
  box-shadow: 0 12px 28px -12px rgba(0,0,0,0.6), 0 0 0 3px var(--bg), 0 0 0 4px var(--border);
}
.hero-photo{
  width:100%; height:100%; object-fit:cover;
  object-position: center 25%;
  filter: grayscale(1) contrast(1.08);
}
.frame-corner{ display:none; }

.hero-tags{
  display:flex; flex-wrap:wrap; justify-content:center; gap:8px;
}
.hero-tag{
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-dim);
  background: var(--bg-panel);
}

.scroll-cue{
  margin-top: 48px;
  display:flex; flex-direction:column; align-items:center; gap:6px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing:0.12em;
  color: var(--text-mute);
  text-transform:uppercase;
  animation: floaty 2.4s ease-in-out infinite;
}

/* =========================================================
   SECTIONS — SHARED
========================================================= */
.section{
  position:relative; z-index:1;
  padding: 96px 24px;
}
.section-alt{
  background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg) 100%);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.section-inner{ max-width: var(--max-w); margin:0 auto; }

.cmd-label{
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--orange);
  margin-bottom: 14px;
}
.cmd-label::before{ content:"› "; color: var(--text-mute); }

.section-title{
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  line-height: 1.2;
  max-width: 780px;
  margin-bottom: 48px;
}
.accent{ color: var(--orange); }

/* =========================================================
   ABOUT
========================================================= */
.about-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items:start;
}
.about-text{
  color: var(--text-dim);
  font-size: 16px;
  margin-bottom: 18px;
}
.about-text strong{ color: var(--text); font-weight:600; }

.about-stats{
  display:flex; gap:28px;
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
}
.stat{ display:flex; flex-direction:column; gap:4px; }
.stat-num{
  font-family: var(--font-display);
  font-size: 32px; font-weight:700; color: var(--orange);
}
.stat-label{
  font-family: var(--font-mono);
  font-size: 11.5px; color: var(--text-mute);
  text-transform:uppercase; letter-spacing:0.08em;
}

/* =========================================================
   PROJECTS
========================================================= */
.projects-list{ display:flex; flex-direction:column; gap:1px; background: var(--border-soft); }
.project-card{
  background: var(--bg);
  display:grid;
  grid-template-columns: 90px 1fr;
  gap: 28px;
  padding: 36px 28px;
  transition: background .2s ease;
}
.section-alt .project-card{ background: var(--bg-panel); }
.project-card:hover{ background: rgba(255,106,26,0.035); }

.project-num{
  font-family: var(--font-display);
  font-size: 15px; font-weight:600;
  color: var(--text-mute);
  padding-top: 4px;
}
.project-card:hover .project-num{ color: var(--orange); }

.project-head{
  display:flex; align-items:baseline; gap:12px; flex-wrap:wrap;
  margin-bottom: 10px;
}
.project-head h3{
  font-family: var(--font-display);
  font-size: 21px; font-weight:600;
}
.project-sub{
  font-family: var(--font-mono);
  font-size: 12px; color: var(--text-mute);
}
.project-desc{ color: var(--text-dim); margin-bottom: 14px; max-width: 720px; }
.project-highlights{ margin-bottom: 16px; }
.project-highlights li{
  position:relative; padding-left: 18px;
  color: var(--text-dim); font-size: 14.5px;
  margin-bottom: 6px;
}
.project-highlights li::before{
  content:"▸"; position:absolute; left:0; color: var(--orange);
}
.project-stack{ display:flex; flex-wrap:wrap; gap:8px; }
.project-stack span{
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 4px;
  background: rgba(255,106,26,0.08);
  color: var(--amber);
  border: 1px solid rgba(255,106,26,0.16);
}

/* =========================================================
   SKILLS
========================================================= */
.skills-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.skill-block{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  background: var(--bg-panel);
}
.skill-key{
  font-family: var(--font-mono);
  font-size: 13px; color: var(--orange);
  margin-bottom: 14px;
}
.skill-chips{ display:flex; flex-wrap:wrap; gap:8px; }
.skill-chips span{
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 6px 11px;
  border-radius: 4px;
  background: var(--bg-panel-alt);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

/* =========================================================
   TIMELINE / CERTS
========================================================= */
.timeline{ position:relative; padding-left: 28px; }
.timeline::before{
  content:""; position:absolute; left:5px; top:6px; bottom:6px;
  width:1px; background: var(--border);
}
.timeline-item{
  position:relative; padding-bottom: 34px;
  display:grid; grid-template-columns: 90px 1fr; gap:24px;
}
.timeline-item:last-child{ padding-bottom:0; }
.timeline-item::before{
  content:""; position:absolute; left:-28px; top:4px;
  width:11px; height:11px; border-radius:50%;
  background: var(--bg); border:2px solid var(--orange);
}
.tl-date{
  font-family: var(--font-mono); font-size: 13px; color: var(--text-mute);
  padding-top: 1px;
}
.tl-content h4{
  font-family: var(--font-display); font-size: 17px; font-weight:600;
  margin-bottom: 4px;
}
.tl-content p{ color: var(--text-dim); font-size: 14.5px; }

/* =========================================================
   CERTIFICATES (LOCAL FILES)
========================================================= */
.certs-lead{
  color: var(--text-dim);
  margin-top: -30px;
  margin-bottom: 32px;
  max-width: 620px;
}
.certs-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.cert-card{
  display:flex; flex-direction:column; gap:16px;
  padding: 22px 22px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.cert-card:hover{
  border-color: var(--orange);
  background: rgba(255,106,26,0.05);
  transform: translateY(-2px);
}
.cert-card-icon{
  width: 42px; height: 42px;
  display:flex; align-items:center; justify-content:center;
  border-radius: 8px;
  background: rgba(255,106,26,0.1);
  color: var(--orange);
  flex-shrink:0;
}
.cert-card-body{ display:flex; flex-direction:column; gap:4px; }
.cert-card-title{
  font-family: var(--font-display);
  font-size: 16px; font-weight:600; color: var(--text);
}
.cert-card-sub{
  font-family: var(--font-mono);
  font-size: 12px; color: var(--text-mute);
}
.cert-card-actions{ display:flex; gap:8px; margin-top:auto; }
.cert-card-btn{
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 5px;
  text-align:center;
  flex:1;
  background: var(--orange);
  color: #0a0a0a;
  font-weight: 600;
  transition: background .15s ease, opacity .15s ease;
}
.cert-card-btn:hover{ background: var(--amber); }
.cert-card-btn-ghost{
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-weight: 500;
}
.cert-card-btn-ghost:hover{ border-color: var(--orange); color: var(--orange); background: rgba(255,106,26,0.06); }

/* =========================================================
   CONTACT
========================================================= */
.contact-section{ padding-bottom: 120px; }
.contact-lead{ color: var(--text-dim); margin-top:-30px; margin-bottom: 40px; max-width: 560px; }

.contact-terminal .terminal-body{ padding-bottom: 22px; }
.contact-links{
  display:grid; grid-template-columns: 1fr 1fr; gap:10px;
  margin: 16px 0 6px;
}
.contact-link{
  display:flex; flex-direction:column; gap:3px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-panel-alt);
  min-width:0;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.contact-link:hover{
  border-color: var(--orange);
  background: rgba(255,106,26,0.06);
  transform: translateY(-2px);
}
.cl-key{ font-family: var(--font-mono); font-size: 11px; color: var(--orange); }
.cl-val{
  font-family: var(--font-mono); font-size: 13px; color: var(--text);
  overflow-wrap: break-word;
}

/* =========================================================
   FOOTER
========================================================= */
.site-footer{
  position:relative; z-index:1;
  border-top: 1px solid var(--border-soft);
  padding: 26px 24px;
}
.footer-inner{
  max-width: var(--max-w); margin:0 auto;
  display:flex; align-items:center; justify-content:center; gap:10px;
  flex-wrap:wrap;
  font-family: var(--font-mono);
  font-size: 12px; color: var(--text-mute);
}
.footer-dot{ color: var(--border); }

/* =========================================================
   ANIMATIONS
========================================================= */
@keyframes blink{ 50%{ opacity:0; } }
@keyframes pulse{ 0%,100%{ opacity:1; } 50%{ opacity:0.4; } }
@keyframes floaty{ 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(6px); } }

.reveal{ opacity:0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in-view{ opacity:1; transform:none; }

/* =========================================================
   RESPONSIVE
========================================================= */

/* ---- Tablet / narrow desktop ---- */
@media (max-width: 1024px){
  .hero-inner{ grid-template-columns: auto 1fr; gap:28px; }
  .section{ padding: 84px 22px; }
}

/* ---- Small tablet / large phone (landscape) ---- */
@media (max-width: 880px){
  .hero-inner{ grid-template-columns: 1fr; justify-items:center; }
  .hero-side{ flex-direction: row; width:auto; gap:14px; align-items:center; }
  .hero-photo-frame{ width: 84px; height: 84px; }
  .hero-tags{ justify-content:flex-start; }
  .about-grid{ grid-template-columns: 1fr; }
  .about-text{ font-size: 15.5px; }
  .contact-links{ grid-template-columns: 1fr; }
  .skills-grid{ grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

/* ---- Mobile ---- */
@media (max-width: 760px){
  .tabbar-inner{ padding: 12px 18px; gap:14px; }
  .tabs{ display:none; }
  .resume-btn{ display:none; }
  .nav-toggle{ display:flex; margin-left:auto; }
  .tabbar.menu-open .tabs{
    display:flex; flex-direction:column;
    position:absolute; top:100%; left:0; right:0;
    background: var(--bg-panel); border-bottom:1px solid var(--border);
    padding: 8px 20px 16px;
    max-height: calc(100vh - 60px);
    overflow-y:auto;
  }
  .tabbar.menu-open .tab{
    padding:14px 4px; font-size:14px;
    border-bottom:1px solid var(--border-soft); border-radius:0;
  }

  .hero{ padding: 40px 18px 24px; }
  .hero-side{ flex-direction: row; justify-content:center; }
  .hero-photo-frame{ width: 72px; height: 72px; }
  .hero-tags{ gap:6px; }
  .terminal-body{ padding: 18px 16px 20px; }

  .section{ padding: 64px 18px; }
  .section-title{ margin-bottom: 36px; }
  .cmd-label{ margin-bottom: 10px; }

  .project-card{ grid-template-columns: 1fr; padding: 28px 20px; gap:12px; }
  .project-num{ padding-top:0; }

  .about-stats{ gap:22px; flex-wrap:wrap; }

  .timeline{ padding-left: 22px; }
  .timeline::before{ left: 4px; }
  .timeline-item{ grid-template-columns: 1fr; gap:6px; padding-bottom:28px; }
  .timeline-item::before{ left:-22px; top:4px; }
  .tl-date{ font-size:12px; color: var(--orange); }

  .certs-lead{ margin-top:-24px; }
  .certs-grid{ grid-template-columns: 1fr; }
  .cert-card{ padding: 18px; }

  .contact-lead{ margin-top:-24px; }
  .contact-links{ grid-template-columns: 1fr; }

  .footer-inner{ flex-direction:column; gap:4px; text-align:center; }
  .footer-dot{ display:none; }
}

/* ---- Small phone ---- */
@media (max-width: 480px){
  .tab-brand{ font-size:13px; max-width: 150px; }
  .resume-btn{ font-size:11.5px; padding:6px 11px; }

  .terminal-titlebar{ padding: 9px 10px; }
  .tl-title{ font-size: 10.5px; }
  .tl-status{ display:none; }

  .terminal-body{ font-size: 12px; padding: 16px 14px 18px; }
  .term-line{ margin-top: 12px; word-break: break-word; }
  .term-out{ font-size: 13px; }

  .hero-photo-frame{ width: 60px; height: 60px; }
  .cert-card-actions{ flex-direction:column; }
  .hero-tag{ font-size: 10.5px; padding: 5px 9px; }

  .section-title{ font-size: clamp(24px, 7vw, 30px); }
  .about-stats{ gap:18px; }
  .stat-num{ font-size: 26px; }

  .project-head h3{ font-size: 18px; }
  .project-desc, .project-highlights li{ font-size: 13.5px; }

  .skills-grid{ grid-template-columns: 1fr; }
  .skill-block{ padding: 18px 18px 16px; }


  .contact-link{ padding: 11px 12px; }
}

/* ---- Very small phone ---- */
@media (max-width: 360px){
  .hero-inner{ gap:20px; }
  .terminal-body{ font-size: 11.5px; }
  .section{ padding: 52px 16px; }
  .hero-tags{ display:none; }
}