/* ───────────────────────────────────────────
   DESIGN TOKENS
   Change the accent colors here to re-theme the whole site.
─────────────────────────────────────────── */
:root {
  --base: #0A0A0C;
  --surface: #141417;
  --surface-2: #1C1C20;
  --border: #26262B;
  --border-soft: rgba(255, 255, 255, 0.06);
  --ink: #EDEDEF;
  --muted: #8C8C94;

  --accent: #6E7BF2;
  --accent-2: #9B7BF2;
  --accent-soft: rgba(110, 123, 242, 0.14);
  --accent-glow: rgba(110, 123, 242, 0.35);

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

  --max-width: 1200px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ───────────────────────────────────────────
   RESET & BASE
─────────────────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  background:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(110, 123, 242, 0.10), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 10%, rgba(155, 123, 242, 0.07), transparent 60%),
    var(--base);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* faint grain for a less flat, more graded surface */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

::selection {
  background: var(--accent);
  color: var(--base);
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.section-pad {
  position: relative;
  padding-left: 24px;
  padding-right: 24px;
}

.section-divide {
  border-top: 1px solid var(--border-soft);
  padding-top: 96px;
  padding-bottom: 96px;
}

.label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.body-text {
  color: var(--muted);
  line-height: 1.7;
  max-width: 34rem;
}

.section-sub {
  color: var(--muted);
  max-width: 30rem;
  margin-bottom: 48px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  transition: border-color 0.25s var(--ease-out), background-color 0.25s var(--ease-out), transform 0.25s var(--ease-out), color 0.25s var(--ease-out);
}

.tag:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
  transform: translateY(-2px);
}

.tag-sm {
  font-size: 0.75rem;
  padding: 4px 12px;
  color: var(--muted);
}

/* ───────────────────────────────────────────
   BUTTONS — shine-sweep hover
─────────────────────────────────────────── */
.btn {
  position: relative;
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: 999px;
  overflow: hidden;
  isolation: isolate;
  transition: background-color 0.3s var(--ease-out), border-color 0.3s var(--ease-out), color 0.3s var(--ease-out), transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, 0.25) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform 0.6s var(--ease-out);
}

.btn:hover::before {
  transform: translateX(120%);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--ink);
  color: var(--base);
}

.btn-primary:hover {
  background: var(--accent);
  color: var(--ink);
  box-shadow: 0 8px 30px -8px var(--accent-glow);
  transform: translateY(-2px);
}

.btn-secondary {
  border: 1px solid var(--border);
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px -10px var(--accent-glow);
  transform: translateY(-2px);
}

/* ───────────────────────────────────────────
   NAVBAR
─────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 20px 24px;
}

.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.navbar-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(20, 20, 23, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 20px;
  transition: box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}

.navbar-bar:hover {
  border-color: rgba(110, 123, 242, 0.3);
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  background: linear-gradient(120deg, var(--ink), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a:not(.nav-cta) {
  position: relative;
  font-size: 0.9rem;
  color: var(--muted);
  transition: color 0.25s var(--ease-out);
  padding-bottom: 3px;
}

.nav-links a:not(.nav-cta)::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease-out);
}

.nav-links a:not(.nav-cta):hover {
  color: var(--ink);
}

.nav-links a:not(.nav-cta):hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-cta {
  background: var(--ink);
  color: var(--base) !important;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 500;
  transition: background-color 0.25s var(--ease-out), transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.nav-cta:hover {
  background: var(--accent) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -6px var(--accent-glow);
}

.nav-toggle,
.nav-toggle-label {
  display: none;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
  }

  .nav-links a:not(.nav-cta) {
    padding: 12px 10px;
    border-radius: 10px;
    color: var(--ink);
  }

  .nav-links a:not(.nav-cta)::after {
    display: none;
  }

  .nav-links a:not(.nav-cta):hover {
    background: var(--surface-2);
  }

  .nav-cta {
    text-align: center;
    margin-top: 4px;
  }

  .nav-toggle-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    cursor: pointer;
  }

  .nav-toggle-label span {
    display: block;
    width: 20px;
    height: 1px;
    background: var(--ink);
    transition: transform 0.25s var(--ease-out);
  }

  .nav-toggle:checked ~ .nav-links {
    display: flex;
  }

  .nav-toggle:checked ~ .nav-toggle-label span:first-child {
    transform: translateY(3px) rotate(45deg);
  }

  .nav-toggle:checked ~ .nav-toggle-label span:last-child {
    transform: translateY(-3px) rotate(-45deg);
  }
}

/* ───────────────────────────────────────────
   HERO
─────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 120px;
  padding-bottom: 64px;
}

/* subtle dot-grid field, referencing the brief's "abstract geometric system" */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 20%, transparent 75%);
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 64px;
  align-items: center;
  width: 100%;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 24px;
  animation: fadeUp 0.7s var(--ease-out) both;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  line-height: 1.08;
  background: linear-gradient(115deg, var(--ink) 40%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: fadeUp 0.7s var(--ease-out) 0.1s both;
}

.hero-sub {
  margin-top: 24px;
  max-width: 32rem;
  color: var(--muted);
  line-height: 1.7;
  animation: fadeUp 0.7s var(--ease-out) 0.2s both;
}

.hero-actions {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  animation: fadeUp 0.7s var(--ease-out) 0.3s both;
}

.hero-visual {
  display: flex;
  justify-content: center;
  animation: fadeUp 0.7s var(--ease-out) 0.3s both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Terminal — glowing ambient border */
.terminal {
  position: relative;
  width: 100%;
  max-width: 380px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  transition: border-color 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.terminal:hover {
  border-color: rgba(110, 123, 242, 0.45);
  box-shadow: 0 24px 70px -18px rgba(0, 0, 0, 0.65), 0 0 40px -8px var(--accent-soft);
  transform: translateY(-3px);
}

.terminal-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.terminal-head span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #3a3a3f;
}

.terminal-title {
  width: auto !important;
  height: auto !important;
  border-radius: 0 !important;
  background: none !important;
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.terminal-body {
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  min-height: 132px;
}

.terminal-line {
  color: var(--ink);
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  animation: typing 1s steps(24, end) forwards;
}

.terminal-line .prompt {
  color: var(--accent);
}

.line1 { animation-delay: 0.4s; }
.line2 { animation-delay: 1.6s; }
.line3 { animation-delay: 2.8s; }

@keyframes typing {
  to { width: 100%; }
}

.cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 1s step-start infinite;
  animation-delay: 4s;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ───────────────────────────────────────────
   ABOUT
─────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
}

.about-grid h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: 1.2;
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 32px;
}

.info-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  transition: border-color 0.3s var(--ease-out), transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), background-color 0.3s var(--ease-out);
}

.info-card:hover {
  border-color: rgba(110, 123, 242, 0.45);
  background: var(--surface-2);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.5), 0 0 30px -10px var(--accent-soft);
}

.info-card .value {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
}

.exploring {
  margin-top: 32px;
}

/* ───────────────────────────────────────────
   SKILLS
─────────────────────────────────────────── */
h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: 8px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.skill-item {
  position: relative;
  border-radius: 10px;
  padding: 10px 8px 10px 18px;
  margin: 0 -8px;
  cursor: default;
  transition: background-color 0.25s var(--ease-out);
}

.skill-item::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s var(--ease-out);
}

.skill-item:hover,
.skill-item:focus {
  background: var(--surface);
}

.skill-item:hover::before,
.skill-item:focus::before {
  transform: scaleY(1);
}

.skill-name {
  font-weight: 500;
  transition: color 0.25s var(--ease-out);
}

.skill-item:hover .skill-name,
.skill-item:focus .skill-name {
  color: var(--accent-2);
}

.skill-note {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.25s var(--ease-out), opacity 0.25s var(--ease-out), margin-top 0.25s var(--ease-out);
}

.skill-item:hover .skill-note,
.skill-item:focus .skill-note {
  max-height: 60px;
  opacity: 1;
  margin-top: 6px;
}

/* ───────────────────────────────────────────
   PROJECTS
─────────────────────────────────────────── */
.project-list {
  display: grid;
  gap: 16px;
}

.project-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 16px;
  padding: 28px 32px;
  overflow: hidden;
  transition: border-color 0.35s var(--ease-out), transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(500px circle at 0% 0%, var(--accent-soft), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  pointer-events: none;
}

.project-card:hover {
  border-color: rgba(110, 123, 242, 0.55);
  transform: translateY(-4px);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card:hover .project-arrow {
  transform: translate(4px, -4px);
  color: var(--accent-2);
}

.project-card:hover h3 {
  color: var(--accent-2);
}

.project-card h3 {
  font-size: 1.35rem;
  margin-bottom: 10px;
  transition: color 0.3s var(--ease-out);
}

.project-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 34rem;
  margin-bottom: 16px;
}

.project-desc em {
  font-style: normal;
  opacity: 0.75;
}

.project-arrow {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  margin-top: 4px;
  font-size: 1.1rem;
  transition: transform 0.3s var(--ease-out), color 0.3s var(--ease-out);
}

/* ───────────────────────────────────────────
   JOURNEY
─────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 32px;
  border-left: 1px solid var(--border);
  display: grid;
  gap: 40px;
}

.timeline-item {
  position: relative;
}

.dot {
  position: absolute;
  left: -37px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--base);
}

.dot-filled {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 10px rgba(110, 123, 242, 0); }
  100% { box-shadow: 0 0 0 0 rgba(110, 123, 242, 0); }
}

.timeline-item h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.next-list li {
  font-size: 0.9rem;
  padding-left: 18px;
  position: relative;
  margin-bottom: 8px;
  transition: color 0.25s var(--ease-out), padding-left 0.25s var(--ease-out);
}

.next-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--muted);
  transition: color 0.25s var(--ease-out);
}

.next-list li:hover {
  color: var(--ink);
  padding-left: 22px;
}

.next-list li:hover::before {
  color: var(--accent);
}

/* ───────────────────────────────────────────
   CONTACT
─────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.contact-grid h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.2;
}

.contact-intro {
  margin-bottom: 32px;
}

.contact-links {
  display: grid;
  gap: 12px;
  margin-bottom: 32px;
}

.contact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 16px 20px;
  transition: border-color 0.3s var(--ease-out), transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.contact-link:hover {
  border-color: rgba(110, 123, 242, 0.55);
  transform: translateX(4px);
  box-shadow: 0 12px 30px -16px rgba(0, 0, 0, 0.5), 0 0 24px -10px var(--accent-soft);
}

.contact-link:hover span[aria-hidden] {
  transform: translateX(3px);
  color: var(--accent-2);
}

.contact-link span[aria-hidden] {
  transition: transform 0.25s var(--ease-out), color 0.25s var(--ease-out);
}

.contact-link .label {
  margin-bottom: 4px;
}

.contact-link .value {
  font-size: 0.9rem;
}

/* ───────────────────────────────────────────
   FOOTER
─────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border-soft);
  padding-top: 40px;
  padding-bottom: 40px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-name {
  color: var(--ink);
  font-weight: 500;
}

.footer-role {
  font-size: 0.8rem;
  margin-top: 2px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  position: relative;
  transition: color 0.25s var(--ease-out);
}

.footer-links a:hover {
  color: var(--ink);
}

/* ───────────────────────────────────────────
   SCROLL-DRIVEN REVEALS (progressive enhancement)
   Supported in modern Chromium browsers. Where unsupported,
   content is simply shown as normal — nothing breaks.
─────────────────────────────────────────── */
@supports (animation-timeline: view()) {
  #about h2,
  #skills h2,
  #projects h2,
  #journey h2,
  #contact h2,
  .info-card,
  .project-card,
  .timeline-item,
  .contact-link {
    animation: revealItem linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 25%;
  }

  @keyframes revealItem {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* ───────────────────────────────────────────
   RESPONSIVE
─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    order: -1;
  }
}

@media (max-width: 900px) {
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .section-pad {
    padding-left: 20px;
    padding-right: 20px;
  }

  .section-divide {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .info-cards {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .project-card {
    flex-direction: column;
    padding: 22px;
  }

  .project-arrow {
    align-self: flex-end;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

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

  .terminal-line {
    width: 100% !important;
  }

  .eyebrow, .hero h1, .hero-sub, .hero-actions, .hero-visual {
    opacity: 1 !important;
    transform: none !important;
  }
}
