/* ---------- Tokens ---------- */
:root {
  --paper: #0A0B0A;
  --paper-dim: #101210;
  --ink: #E9F2E9;
  --ink-soft: #92A192;
  --ink-faint: #5B655B;
  --accent: #39FF14;
  --accent-dim: #22C40C;
  --line: rgba(57, 255, 20, 0.16);
  --line-strong: rgba(57, 255, 20, 0.32);
  --code-bg: #0F150F;

  --font-display: "JetBrains Mono", monospace;
  --font-body: "JetBrains Mono", monospace;
  --font-mono: "JetBrains Mono", monospace;

  --container: 1080px;
  --gutter: 6vw;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  overflow-y: visible;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { list-style: none; margin: 0; padding: 0; }

::selection {
  background: var(--accent);
  color: #0A0B0A;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* subtle paper texture */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.05;
  mix-blend-mode: screen;
  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");
}

/* ---------- Boot loader (terminal intro) ---------- */
html.boot-lock,
html.boot-lock body {
  overflow: hidden;
  height: 100%;
}

.boot-loader {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8vw;
  cursor: pointer;
  overflow: hidden;
}

.boot-panel {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  background: var(--paper);
  transition: transform 0.75s cubic-bezier(0.76, 0, 0.24, 1);
}

.boot-panel-top {
  top: 0;
}

.boot-panel-bottom {
  bottom: 0;
}

.boot-loader.is-hidden {
  pointer-events: none;
}

.boot-loader.is-hidden .boot-panel-top {
  transform: translateY(-100%);
}

.boot-loader.is-hidden .boot-panel-bottom {
  transform: translateY(100%);
}

.boot-loader.is-hidden .boot-loader-inner {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.boot-loader-inner {
  position: relative;
  z-index: 2;
  max-width: 640px;
  width: 100%;
  text-align: left;
}

.boot-lines {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.8vw, 1.05rem);
  color: var(--accent);
  line-height: 2;
  white-space: pre-wrap;
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
  text-align: left;
}

.boot-line {
  min-height: 1.2em;
}

/* ---------- Hero (mac-style window) ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px var(--gutter);
}

.hero-window {
  max-width: 900px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--paper-dim);
  box-shadow:
    0 0 0 1px rgba(57, 255, 20, 0.06),
    0 30px 70px rgba(0, 0, 0, 0.65),
    0 0 60px rgba(57, 255, 20, 0.06);
  overflow: hidden;
}

.hero-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  background: #0D0F0D;
  border-bottom: 1px solid var(--line);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-red { background: #FF5F57; }
.dot-yellow { background: #FEBC2E; }
.dot-green { background: #28C840; }

.hero-titlebar-label {
  margin: 0 auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  transform: translateX(-19px);
}

.hero-window-body {
  padding: 52px 44px 48px;
  text-align: left;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  margin: 0 0 10px;
  text-shadow: 0 0 12px rgba(57, 255, 20, 0.4);
}

.hero-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5.4vw, 3rem);
  line-height: 1.1;
  margin: 0 0 0px;
  letter-spacing: -0.02em;
  padding-bottom: 5px;
}

.cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
  margin-left: 2px;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-role {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.6vw, 1rem);
  color: var(--ink-soft);
  margin: 0 0 18px;
}

.hero-cmd {
  margin: 0 0 20px;
}

.hero-cmd-label {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
  margin: 0 0 10px;
  text-shadow: 0 0 12px rgba(57, 255, 20, 0.4);
}

.hero-edu-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  margin: 0 0 4px;
}

.hero-edu-meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-faint);
  margin: 0;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.btn {
  font-family: var(--font-mono);
  font-size: 13.5px;
  padding: 12px 22px;
  border-radius: 3px;
  border: 1px solid var(--accent);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  display: inline-block;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #0A0B0A;
  font-weight: 500;
}

.btn-primary:hover {
  box-shadow: 0 0 24px rgba(57, 255, 20, 0.7), 0 0 60px rgba(57, 255, 20, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.35);
}

/* ---------- Scroll-to-explore indicator ---------- */
.scroll-indicator {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--ink-faint);
  transition: color 0.2s ease, opacity 0.2s ease;
}

.scroll-indicator:hover {
  color: var(--accent);
  opacity: 1;
}

.scroll-indicator-text {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scroll-indicator-arrows {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 16px;
}

.scroll-indicator-arrows .arrow {
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.2;
  animation: arrow-flow 1.8s ease-in-out infinite;
}

.scroll-indicator-arrows .arrow:first-child {
  margin-bottom: -4px;
  animation-delay: 0s;
}

.scroll-indicator-arrows .arrow:last-child {
  animation-delay: 0.3s;
}

@keyframes arrow-flow {
  0% {
    opacity: 0.15;
    transform: translateY(-5px) rotate(45deg);
  }
  50% {
    opacity: 1;
    transform: translateY(1px) rotate(45deg);
  }
  100% {
    opacity: 0.15;
    transform: translateY(6px) rotate(45deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-indicator-arrows .arrow {
    animation: none;
    opacity: 0.6;
  }
}

/* ---------- Hero skills marquee ---------- */
.hero-marquee {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--code-bg);
  overflow: hidden;
  padding: 14px 0;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.marquee-track {
  display: flex;
  gap: 12px;
  width: max-content;
  animation: marquee-scroll 16s linear infinite;
}

.hero-marquee:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Sections ---------- */
.section {
  padding: 100px var(--gutter);
  border-top: 1px solid var(--line);
}

.section-inner {
  max-width: var(--container);
  margin: 0 auto;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-faint);
  margin: 0 0 10px;
  text-align: center;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  margin: 0 0 16px;
  text-align: center;
}

.section-subtitle {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--ink-soft);
  text-align: center;
  margin: 0 0 56px;
}

/* ---------- Timeline (alternating cards) ---------- */
.timeline {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 60px;
  row-gap: 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line-strong);
  transform: translateX(-50%);
}

.timeline-entry {
  position: relative;
  padding-top: 6px;
  padding-bottom: 64px;
  display: flex;
  align-items: flex-start;
}

.timeline-entry:last-child {
  padding-bottom: 0;
}

.timeline-entry::after {
  content: "";
  position: absolute;
  top: 34px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--paper-dim);
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
}

.timeline-entry:nth-child(odd) {
  grid-column: 1;
}

.timeline-entry:nth-child(odd)::after {
  right: -35.5px;
}

.timeline-entry:nth-child(1) { grid-row: 1; }
.timeline-entry:nth-child(2) { grid-row: 2; }
.timeline-entry:nth-child(3) { grid-row: 3; }
.timeline-entry:nth-child(4) { grid-row: 4; }
.timeline-entry:nth-child(5) { grid-row: 5; }
.timeline-entry:nth-child(6) { grid-row: 6; }

.timeline-entry:nth-child(even) {
  grid-column: 2;
}

.timeline-entry:nth-child(even)::after {
  left: -35.5px;
}

.timeline-card {
  width: 100%;
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px 32px;
  text-align: left;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 0 34px rgba(57, 255, 20, 0.35), 0 0 70px rgba(57, 255, 20, 0.15);
}

.timeline-year {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-align: right;
  margin: 0 0 16px;
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.35);
}

.timeline-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  margin: 0 0 6px;
}

.timeline-org {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
  margin: 0 0 16px;
}

.timeline-desc {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 0;
}

/* ---------- Shared tag styles (used by marquee + project cards) ---------- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.tag {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 6px 12px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink);
}

.tag-muted {
  color: var(--ink-faint);
  border-style: dashed;
}

.tag-list-sm .tag {
  font-size: 11.5px;
  padding: 4px 9px;
}

/* ---------- Projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.project-card {
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.project-thumb {
  aspect-ratio: 16 / 10;
  background: radial-gradient(circle at 30% 20%, rgba(57, 255, 20, 0.16), transparent 60%),
              linear-gradient(155deg, #0F1F0D 0%, #050605 65%, #000000 100%);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 2rem;
  color: var(--accent);
  text-shadow: 0 0 16px rgba(57, 255, 20, 0.45);
  margin: -26px -26px 4px;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 0 34px rgba(57, 255, 20, 0.35), 0 0 70px rgba(57, 255, 20, 0.15);
}

.project-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tag-list-sm {
  justify-content: center;
}

.project-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
}

.project-links {
  display: flex;
  gap: 14px;
}

.project-link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.project-link:hover {
  border-color: var(--accent);
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.6);
}

.project-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0;
}

.project-desc {
  color: var(--ink-soft);
  font-size: 0.93rem;
  margin: 0;
  flex-grow: 1;
}

/* ---------- Contact (terminal window) ---------- */
.term-window {
  max-width: 900px;
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--paper-dim);
  box-shadow:
    0 0 0 1px rgba(57, 255, 20, 0.06),
    0 30px 70px rgba(0, 0, 0, 0.65),
    0 0 60px rgba(57, 255, 20, 0.06);
  overflow: hidden;
}

.term-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  background: #0D0F0D;
  border-bottom: 1px solid var(--line);
}

#contact.section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 60px;
  padding-bottom: 0;
}

.contact-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

#contact.section .section-inner {
  width: 100%;
}

.term-window-body {
  padding: 36px 40px 40px;
  text-align: left;
}

.term-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.6vw, 2.1rem);
  margin: 0 0 24px;
}

.cmd-label {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
  margin: 0 0 10px;
  text-shadow: 0 0 12px rgba(57, 255, 20, 0.4);
}

.cmd-block {
  margin: 0 0 22px;
}

.cmd-block:last-child {
  margin-bottom: 0;
}

.cmd-value-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.98rem;
  color: var(--ink);
  margin: 0;
}

.pin {
  font-size: 15px;
}

.cmd-value-box {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 20px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cmd-value-box:hover {
  border-color: var(--accent);
  box-shadow: 0 0 28px rgba(57, 255, 20, 0.35), 0 0 55px rgba(57, 255, 20, 0.15);
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.social-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.social-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 0 30px rgba(57, 255, 20, 0.35), 0 0 60px rgba(57, 255, 20, 0.15);
}

.social-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(57, 255, 20, 0.08);
  border: 1px solid var(--line-strong);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
}

.social-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.social-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
}

.social-handle {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 20px var(--gutter) 32px;
  text-align: center;
}

.site-footer p {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  margin: 0;
}

/* ---------- Scroll-triggered reveal (CSS-only) ---------- */
@keyframes reveal-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  animation: reveal-in linear both;
  animation-timeline: view();
  animation-range: entry 0% cover 30%;
}

/* Same reveal, timed to trigger near viewport middle (used on journey cards) */
.reveal-mid {
  animation: reveal-in linear both;
  animation-timeline: view();
  animation-range: cover 32% cover 58%;
}

/* Graceful fallback for browsers without scroll-driven animations */
@supports not (animation-timeline: view()) {
  .reveal,
  .reveal-mid {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .boot-loader {
    padding: 0 7vw;
  }

  .boot-loader-inner {
    max-width: 100%;
  }

  .boot-lines {
    font-size: 0.8rem;
    line-height: 1.75;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .timeline {
    grid-template-columns: 1fr;
    column-gap: 0;
    padding-left: 34px;
  }

  .timeline::before {
    left: 0;
    transform: none;
  }

  .timeline-entry:nth-child(odd),
  .timeline-entry:nth-child(even) {
    grid-column: 1;
    text-align: left;
  }

  .timeline-entry:nth-child(odd)::after,
  .timeline-entry:nth-child(even)::after {
    left: -34px;
    right: auto;
  }

  .section {
    padding: 72px var(--gutter);
  }

  .hero {
    min-height: auto;
    padding-top: 40px;
  }

  .scroll-indicator {
    display: none;
  }

  #contact.section {
    min-height: auto;
  }

  .hero-window-body {
    padding: 40px 24px 36px;
  }

  .social-grid {
    grid-template-columns: 1fr;
  }

  .term-window-body {
    padding: 36px 24px 40px;
  }
}

@media (max-width: 620px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 721px) and (max-width: 920px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Projects scroll-pin (desktop only) ---------- */
@media (min-width: 921px) {
  .projects-scroll {
    height: 340vh;
    padding: 0 var(--gutter);
  }

  .projects-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
  }

  .projects-sticky .section-inner {
    width: 100%;
  }

  #projects .project-card[data-dir] {
    animation: none;
    opacity: 0;
    will-change: transform, opacity;
  }
}
