/* ===================================================================
   Design tokens
=================================================================== */
:root {
  --bg: #0a0a0c;
  --bg-raised: #131318;
  --bg-raised-hover: #17171d;
  --border: #232329;
  --border-hover: #33333c;

  --text-primary: #e7e7ee;
  --text-secondary: #9a9ba8;
  --text-tertiary: #65666f;

  --accent: #ffb454;
  --accent-dim: rgba(255, 180, 84, 0.12);
  --accent-glow: rgba(255, 180, 84, 0.35);

  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --sidebar-width: 400px;
  --max-content-width: 640px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===================================================================
   Reset
=================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::selection { background: var(--accent-glow); color: #14140f; }

/* thin accent scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
* { scrollbar-color: var(--border-hover) var(--bg); scrollbar-width: thin; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #14140f;
  padding: 0.75rem 1.25rem;
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus { left: 1rem; top: 1rem; }

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

/* ===================================================================
   Ambient background glow
=================================================================== */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(600px circle at 15% 20%, var(--accent-dim), transparent 60%),
    radial-gradient(500px circle at 85% 75%, rgba(120, 140, 255, 0.06), transparent 60%);
  animation: driftGlow 22s ease-in-out infinite alternate;
}
@keyframes driftGlow {
  from { opacity: 0.7; transform: translateY(0); }
  to   { opacity: 1;   transform: translateY(20px); }
}

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, rgba(255, 180, 84, 0.05) 40%, transparent 70%);
  opacity: 0;
  transform: translate3d(-50%, -50%, 0);
  transition: opacity 0.5s var(--ease);
}
.cursor-glow.is-active { opacity: 0.55; }

/* ===================================================================
   Custom cursor
=================================================================== */
html.custom-cursor-active,
html.custom-cursor-active * {
  cursor: none !important;
}

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  z-index: 300;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-100px, -100px, 0);
  transition: opacity 0.3s var(--ease);
}
.custom-cursor.is-active { opacity: 1; }

.cc-line {
  position: absolute;
  background: var(--accent);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.cc-line-x { width: 16px; height: 1px; top: 0; left: -8px; }
.cc-line-y { width: 1px; height: 16px; top: -8px; left: 0; }

.cc-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  top: -2.5px;
  left: -2.5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  transition: width 0.25s var(--ease), height 0.25s var(--ease), top 0.25s var(--ease), left 0.25s var(--ease),
    background 0.25s var(--ease), border 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.custom-cursor.is-hover .cc-line {
  opacity: 0;
  transform: scale(0.3);
}
.custom-cursor.is-hover .cc-dot {
  width: 32px;
  height: 32px;
  top: -16px;
  left: -16px;
  background: transparent;
  border: 1.5px solid var(--accent);
  box-shadow: none;
}

/* ===================================================================
   Layout
=================================================================== */
.layout {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 6vw;
  display: flex;
  gap: clamp(2rem, 6vw, 6rem);
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6rem 0 3rem;
}

/* ---------- Sidebar entrance animation ---------- */
@keyframes introUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.identity,
.tagline,
.lede,
.resume-button,
.side-nav,
.social-list {
  animation: introUp 0.7s var(--ease) both;
}
.identity      { animation-delay: 0.05s; }
.tagline       { animation-delay: 0.15s; }
.lede          { animation-delay: 0.25s; }
.resume-button { animation-delay: 0.35s; }
.side-nav      { animation-delay: 0.45s; }
.social-list   { animation-delay: 0.55s; }

.identity a {
  font-size: clamp(2rem, 3vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-primary);
}
.tagline {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
}
.lede {
  margin-top: 1.1rem;
  max-width: 32ch;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

.resume-button {
  margin-top: 1.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--border-hover);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease), background 0.3s var(--ease);
}
.resume-button svg { transition: transform 0.3s var(--ease); }
.resume-button:hover,
.resume-button:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-2px);
}
.resume-button:hover svg { transform: translateY(2px); }

.side-nav ul { display: flex; flex-direction: column; gap: 0.2rem; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0.6rem 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  transition: color 0.3s var(--ease);
}
.nav-line {
  width: 24px;
  height: 1px;
  background: var(--text-tertiary);
  margin-right: 0.9rem;
  transition: width 0.3s var(--ease), background 0.3s var(--ease);
}
.side-nav a:hover,
.side-nav a:focus-visible { color: var(--text-primary); }
.side-nav a:hover .nav-line,
.side-nav a:focus-visible .nav-line { width: 40px; background: var(--accent); }

.side-nav a.active { color: var(--text-primary); }
.side-nav a.active .nav-line { width: 48px; background: var(--accent); }

.social-list {
  display: flex;
  gap: 1.3rem;
}
.social-list a {
  color: var(--text-tertiary);
  transition: color 0.25s var(--ease), transform 0.25s var(--ease);
  display: inline-flex;
}
.social-list a:hover,
.social-list a:focus-visible {
  color: var(--accent);
  transform: translateY(-3px);
}

/* ---------- Main content ---------- */
main {
  flex: 1;
  min-width: 0;
  padding-top: 6rem;
  padding-bottom: 4rem;
}

.section {
  max-width: var(--max-content-width);
  padding-top: 2rem;
  margin-top: -2rem;
  scroll-margin-top: 2rem;
}
.section + .section { margin-top: 5rem; }

.section-heading {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 1.8rem;
}
.section-heading .num {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
}

.section-body p + p { margin-top: 1rem; }
.section-body { color: var(--text-secondary); }

.inline-link {
  color: var(--text-primary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-hover);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.inline-link:hover,
.inline-link:focus-visible { color: var(--accent); border-color: var(--accent); }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ===================================================================
   About — skills grid
=================================================================== */
.skills-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem 2rem;
}
.skill-group h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 0.4rem;
}
.skill-group p {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.about-note {
  margin-top: 1.8rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* ===================================================================
   Education & Certifications
=================================================================== */
.edu-cert-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem 2rem;
}
.edu-cert-col h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 0.6rem;
}
.edu-cert-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}
.edu-cert-title + .edu-cert-title { margin-top: 0.45rem; }
.edu-cert-sub {
  margin-top: 0.3rem;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

/* ===================================================================
   Experience
=================================================================== */
.exp-item {
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease), transform 0.35s var(--ease);
  margin-inline: -1.5rem;
}
.exp-item:hover {
  background: var(--bg-raised);
  border-color: var(--border);
  transform: translateY(-2px);
}
.exp-item + .exp-item { margin-top: 0.5rem; }

.exp-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem 1rem;
  margin-bottom: 0.9rem;
}
.exp-head h3 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
}
.exp-company { font-weight: 500; color: var(--text-secondary); }
.exp-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.exp-bullets { display: flex; flex-direction: column; gap: 0.6rem; }
.exp-bullets li {
  position: relative;
  padding-left: 1.3rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
}
.exp-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--accent);
  transform: rotate(45deg);
}

/* ===================================================================
   Projects
=================================================================== */
.project-list { display: flex; flex-direction: column; gap: 1.4rem; }

.project-card {
  padding: 1.75rem;
  border-radius: 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--accent-dim);
}
.project-card.featured {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent-dim);
}
.project-card.featured:hover {
  border-color: var(--accent);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--accent);
}

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.project-top h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.flagship-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}
.project-links { display: flex; gap: 0.9rem; }
.project-links a {
  color: var(--text-tertiary);
  transition: color 0.25s var(--ease), transform 0.25s var(--ease);
  display: inline-flex;
}
.project-links a:hover,
.project-links a:focus-visible { color: var(--accent); transform: translateY(-2px); }

.project-tagline {
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--accent);
}
.project-desc {
  margin-top: 0.8rem;
  font-size: 0.94rem;
  color: var(--text-secondary);
}

.project-bullets {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.project-bullets li {
  position: relative;
  padding-left: 1.3rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.project-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-hover);
}

.tech-tags {
  margin-top: 1.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tech-tags li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
}

/* ===================================================================
   Contact
=================================================================== */
.contact-body p { max-width: 46ch; }

.cta-button {
  margin-top: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.7rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.cta-button svg { transition: transform 0.3s var(--ease); }
.cta-button:hover,
.cta-button:focus-visible {
  background: var(--accent);
  color: #14140f;
  transform: translateY(-3px);
  box-shadow: 0 12px 24px -8px var(--accent-glow);
}
.cta-button:hover svg { transform: translateX(4px); }

.site-footer {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-tertiary);
}
.site-footer p + p { margin-top: 0.35rem; }

/* ===================================================================
   Mobile nav toggle (hidden on desktop)
=================================================================== */
.nav-toggle { display: none; }

/* ===================================================================
   Responsive
=================================================================== */
@media (max-width: 1000px) {
  .layout { flex-direction: column; gap: 0; padding: 0 7vw; }

  .sidebar {
    position: relative;
    height: auto;
    width: 100%;
    padding: 4rem 0 2.5rem;
    justify-content: flex-start;
    gap: 2.5rem;
  }
  .side-nav ul { flex-direction: row; flex-wrap: wrap; gap: 0 1.5rem; }
  .nav-line { display: none; }
  .side-nav a { padding: 0.3rem 0; }

  main { padding-top: 1rem; }
  .section { scroll-margin-top: 1rem; }
}

@media (max-width: 640px) {
  .layout { padding: 0 6vw; }
  .skills-grid,
  .edu-cert-grid { grid-template-columns: 1fr; }
  .exp-item { margin-inline: -1rem; padding: 1rem; }
  .project-card { padding: 1.4rem; }
  .section + .section { margin-top: 3.5rem; }
}

/* ===================================================================
   Reduced motion
=================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg-glow { animation: none; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
