/* ===================================================================
   MENTOR404 — design tokens
   =================================================================== */
:root{
  --bg:        #0B0E14;
  --surface:   #11161F;
  --surface-2: #151B26;
  --border:    #232B38;
  --text:      #EDEFF2;
  --muted:     #8B94A3;
  --gold:      #E3A83B;
  --gold-soft: #E3A83B33;
  --teal:      #4FD1AE;
  --red:       #E3573C;

  --font-head: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  --sidebar-w: 300px;
  --maxw: 780px;
}

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

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

body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.grid-overlay{
  position: fixed; inset:0; z-index:0; pointer-events:none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: .12;
  mask-image: radial-gradient(circle at 20% 10%, black, transparent 75%);
}

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

/* ===================================================================
   LAYOUT
   =================================================================== */
.layout{
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar{
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface), var(--bg));
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-inner{ padding: 40px 28px; display:flex; flex-direction:column; gap:36px; }

.brand-mark{ margin-bottom: 14px; }
.brand-mark img{
  width: 40px; height: 40px; object-fit: contain; border-radius: 6px;
}
.brand-text{ display:flex; align-items:center; gap:8px; }
.brand-name{ font-family: var(--font-head); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; }
.status-dot{
  width:8px; height:8px; border-radius:50%; background: var(--teal);
  box-shadow: 0 0 0 0 var(--teal);
  animation: pulse 2.4s infinite;
}
@keyframes pulse{
  0%{ box-shadow: 0 0 0 0 rgba(79,209,174,.55); }
  70%{ box-shadow: 0 0 0 7px rgba(79,209,174,0); }
  100%{ box-shadow: 0 0 0 0 rgba(79,209,174,0); }
}
.brand-role{ color: var(--muted); font-size: .85rem; margin: 6px 0 0; }

.side-nav{ display:flex; flex-direction:column; gap:2px; }
.side-nav a{
  color: var(--muted); font-size: .88rem; padding: 8px 10px; border-radius: 6px;
  border-left: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.side-nav a:hover, .side-nav a.active{
  color: var(--text); border-left-color: var(--gold);
  background: var(--surface-2);
}

.block-label{
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .04em;
  color: var(--muted); margin: 0 0 14px; font-weight: 500;
}

.skillbars{ display:flex; flex-direction:column; gap:14px; }
.skillbar-head{ display:flex; justify-content: space-between; font-size: .82rem; margin-bottom: 6px; }
.skillbar-num{ color: var(--gold); font-family: var(--font-mono); font-size: .75rem; }
.skillbar-track{ height: 5px; background: var(--surface-2); border-radius: 3px; overflow:hidden; }
.skillbar-fill{
  height:100%; width:0%; border-radius:3px;
  background: linear-gradient(90deg, var(--gold), var(--teal));
  transition: width 1.1s cubic-bezier(.2,.8,.2,1);
}

.lang-row{ display:flex; gap: 8px; margin-top: 16px; }
.lang-chip{
  font-family: var(--font-mono); font-size: .72rem; font-weight: 500;
  padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border);
  color: var(--text); background: var(--surface-2);
  animation: chip-glow 3.2s ease-in-out infinite;
}
.lang-chip[data-lang="js"]{ animation-delay: 0s; }
.lang-chip[data-lang="py"]{ animation-delay: .5s; }
.lang-chip[data-lang="php"]{ animation-delay: 1s; }
@keyframes chip-glow{
  0%, 100%{ box-shadow: 0 0 0 rgba(79,209,174,0); border-color: var(--border); }
  50%{ box-shadow: 0 0 12px rgba(79,209,174,.35); border-color: var(--teal); }
}

.social-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px; }
.social-list a{
  display:flex; align-items:center; gap:10px; font-size:.85rem; color: var(--muted);
  transition: color .15s, transform .15s;
}
.social-list a:hover{ color: var(--gold); transform: translateX(3px); }
.social-icon{ width:16px; height:16px; display:inline-flex; color: inherit; }
.social-icon svg{ width:100%; height:100%; }

/* ===================================================================
   MAIN
   =================================================================== */
.main{ padding: 64px 56px 40px; }
section{ max-width: var(--maxw); margin: 0 auto; padding: 90px 0; border-top: 1px solid var(--border); }
section:first-of-type{ border-top:none; padding-top: 20px; }

.section-title{
  font-family: var(--font-head); font-size: 1.7rem; font-weight: 600; margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.section-sub{ color: var(--muted); margin: 0 0 40px; max-width: 60ch; }

/* ---- hero ---- */
.eyebrow-free{ font-family: var(--font-mono); color: var(--teal); font-size: .8rem; margin: 0 0 18px; }
.hero-title{
  font-family: var(--font-head); font-weight: 700; font-size: clamp(2.1rem, 4.4vw, 3.1rem);
  line-height: 1.12; margin: 0 0 26px; letter-spacing: -0.015em; max-width: 15ch;
}
.hero-code{
  font-family: var(--font-mono); font-size: .95rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 18px; margin: 0 0 26px; display:inline-block; min-height: 1.4em;
}
.hero-code .prompt{ color: var(--gold); }
#typed{ color: var(--teal); }
.cursor{ color: var(--teal); animation: blink 1s steps(1) infinite; }
@keyframes blink{ 50%{ opacity: 0; } }

.hero-sub{ color: var(--muted); max-width: 58ch; margin: 0 0 34px; font-size: 1.02rem; }

.hero-actions{ display:flex; gap:14px; margin-bottom: 60px; flex-wrap: wrap; }
.btn{
  font-family: var(--font-body); font-weight: 600; font-size: .92rem;
  padding: 12px 22px; border-radius: 8px; border: 1px solid transparent;
  transition: transform .15s, border-color .15s, background .15s;
}
.btn-primary{ background: var(--gold); color: #16110a; }
.btn-primary:hover{ transform: translateY(-2px); }
.btn-ghost{ border-color: var(--border); color: var(--text); }
.btn-ghost:hover{ border-color: var(--gold); color: var(--gold); }

.hero-stats{ display:grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.stat-num{
  display:block; font-family: var(--font-head); font-size: 2.1rem; font-weight: 700; color: var(--gold);
}
.stat-label{ display:block; color: var(--muted); font-size: .82rem; margin-top: 4px; line-height:1.4; }

/* ---- focus cards ---- */
.cards{ display:grid; gap: 18px; }
.card{
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 26px 28px; position: relative;
}
.card-index{
  font-family: var(--font-mono); color: var(--gold); font-size: .78rem; display:block; margin-bottom: 10px;
}
.card h3{ font-family: var(--font-head); font-size: 1.12rem; margin: 0 0 10px; }
.card p{ color: var(--muted); margin:0; font-size: .95rem; }

/* ---- stack (languages) ---- */
.stack-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stack-card{
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 26px 24px; text-align: left;
  transform-style: preserve-3d; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  will-change: transform;
}
.stack-card:hover{
  border-color: var(--gold-soft); box-shadow: 0 18px 40px -22px rgba(227,168,59,.35);
}
.stack-icon{ width: 30px; height: 30px; display:inline-flex; color: var(--gold); margin-bottom: 16px; }
.stack-icon svg{ width:100%; height:100%; }
.stack-card h3{ font-family: var(--font-head); font-size: 1.05rem; margin: 0 0 8px; }
.stack-card p{ color: var(--muted); font-size: .9rem; margin: 0; }

/* ---- project ---- */
.project-frame{ display:grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start; }
.tag{
  font-family: var(--font-mono); font-size: .74rem; color: var(--teal);
  text-transform: none; display:inline-block; margin-bottom: 14px;
}
.project-copy h2{ font-family: var(--font-head); font-size: 1.9rem; margin: 0 0 12px; }
.project-lede{ font-size: 1.05rem; color: var(--text); margin: 0 0 14px; }
.project-copy p{ color: var(--muted); }
.project-facts{ list-style:none; margin: 18px 0; padding:0; display:flex; flex-direction:column; gap:9px; }
.project-facts li{ font-size: .92rem; padding-left: 18px; position:relative; color: var(--text); }
.project-facts li::before{
  content:''; position:absolute; left:0; top: 9px; width:6px; height:6px; border-radius:50%;
  background: var(--teal);
}
.project-status{ font-size: .85rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 16px; }

.term-window{
  background: #0D1117; border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,.6);
}
.term-bar{ display:flex; gap:6px; padding: 10px 14px; background: var(--surface-2); }
.term-bar span{ width:9px; height:9px; border-radius:50%; background: var(--border); }
.term-body{ padding: 18px 18px 20px; font-family: var(--font-mono); font-size: .8rem; }
.term-body p{ margin: 0 0 10px; color: var(--text); }
.t-muted{ color: var(--muted); }
.t-ok{ color: var(--teal); }
.t-warn{ color: var(--gold); }
.t-bad{ color: var(--red); }
.t-cursor-line{ margin-top: 16px !important; }
.blink{ color: var(--teal); animation: blink 1s steps(1) infinite; }

/* ---- log ---- */
.log-list{ display:grid; gap: 2px; }
.log-entry{
  padding: 18px 0; border-bottom: 1px solid var(--border);
  display:grid; grid-template-columns: 200px 1fr; gap: 20px;
}
.log-entry:last-child{ border-bottom:none; }
.log-target{ font-family: var(--font-mono); color: var(--gold); font-size: .85rem; padding-top: 2px; }
.log-entry p{ margin:0; color: var(--muted); font-size: .93rem; }
.log-entry code{ font-family: var(--font-mono); color: var(--teal); font-size: .85em; }

/* ---- experience timeline ---- */
.timeline{ position: relative; padding-left: 26px; }
.timeline::before{
  content:''; position:absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--border);
}
.tl-item{ position: relative; padding-bottom: 34px; }
.tl-item:last-child{ padding-bottom: 0; }
.tl-dot{
  position:absolute; left: -26px; top: 5px; width: 9px; height: 9px; border-radius:50%;
  background: var(--bg); border: 2px solid var(--gold);
}
.tl-head{ display:flex; justify-content: space-between; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.tl-head h3{ font-family: var(--font-head); font-size: 1.05rem; margin:0; }
.tl-date{ font-family: var(--font-mono); font-size: .78rem; color: var(--muted); white-space: nowrap; }
.tl-org{ font-size: .88rem; color: var(--gold); margin: 4px 0 8px; }
.tl-org a{ color: var(--gold); border-bottom: 1px solid var(--gold-soft); }
.tl-org a:hover{ border-bottom-color: var(--gold); }
.tl-content p:last-child{ color: var(--muted); margin: 0; font-size: .93rem; }

/* ---- learning ---- */
.learning-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.learning-card{
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px;
}
.learning-icon{ width: 26px; height: 26px; display:inline-flex; color: var(--teal); margin-bottom: 14px; }
.learning-icon svg{ width:100%; height:100%; }
.learning-card h3{ font-family: var(--font-head); font-size: 1rem; margin: 0 0 8px; }
.learning-card p{ color: var(--muted); font-size: .88rem; margin:0; }

/* ---- contact ---- */
.contact-row{
  display:flex; justify-content: space-between; align-items:center; flex-wrap: wrap; gap: 20px;
  padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.contact-email{ font-family: var(--font-head); font-size: 1.2rem; font-weight: 600; color: var(--gold); }
.contact-socials{ display:flex; gap: 16px; }
.contact-socials .social-icon{ width:20px; height:20px; color: var(--muted); }
.contact-socials a:hover .social-icon{ color: var(--gold); }
.footer-line{ text-align:center; color: var(--muted); font-size: .82rem; margin: 40px 0 0; }

/* ---- scroll reveal (one orchestrated pass per section, not per card) ---- */
section{ opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
section.in-view{ opacity: 1; transform: translateY(0); }

/* cards fade/lift in, staggered, the moment their section arrives */
.card, .stack-card, .learning-card{
  opacity: 0; transform: translateY(10px);
  transition: opacity .5s ease, transform .5s ease;
}
.card.card-in, .stack-card.card-in, .learning-card.card-in{
  opacity: 1; transform: translateY(0);
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
  .sidebar{ position: relative; height: auto; border-right:none; border-bottom: 1px solid var(--border); }
  .main{ padding: 48px 24px; }
  .project-frame{ grid-template-columns: 1fr; }
  .hero-stats{ grid-template-columns: 1fr 1fr; }
  .learning-grid{ grid-template-columns: 1fr; }
  .log-entry{ grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 560px){
  .hero-stats{ grid-template-columns: 1fr; }
  .contact-row{ flex-direction: column; align-items: flex-start; }
}
