/*
  styles.css: the whole look of the site.
  Change colors/fonts in :root and they update everywhere.
*/

:root {
  --bg: #fbfbf8;                          /* page background (warm paper white) */
  --surface: rgba(20, 24, 32, 0.035);     /* card hover background */
  --line: rgba(20, 24, 32, 0.1);          /* borders and dividers */
  --text: #3a404a;                        /* body text (dark graphite) */
  --heading: #14181f;                     /* headings and names (ink) */
  --accent: #2547d0;                      /* cobalt ink blue */
  --accent-hover: #1b36a8;
  --accent-soft: rgba(37, 71, 208, 0.08);
  --dot: rgba(20, 24, 32, 0.2);           /* background dot grid (read by main.js) */
  /* Fonts: Archivo (wide "expanded" cuts for headlines, like aircraft livery lettering)
     and IBM Plex Mono for small labels, like readouts on engineering drawings. */
  --font: 'Archivo', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --wide: 112%;      /* headline width (100% = normal, 125% = widest) */
  --radius: 8px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
/* Scroll snapping: the page "clicks" into place at the opening screen and at each page,
   instead of stopping anywhere. Pages taller than the screen still scroll freely inside. */
html { scroll-snap-type: y mandatory; }
.splash-spacer, .page { scroll-snap-align: start; }
.footer { scroll-snap-align: end; } /* phones: lets the page rest at the very bottom so the footer stays visible */
@media (max-width: 1023px) { .sidebar { scroll-snap-align: start; } } /* phone: header is its own stop */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 10;
  padding: 8px 14px; background: var(--accent); color: #fff; border-radius: 6px; font-weight: 600;
}
.skip-link:focus { top: 16px; }

/* ---------- Opening screen ---------- */
/* The name starts big in the middle. Scrolling through .splash-spacer (one screen tall)
   shrinks it into the sidebar name while the site slides up underneath (main.js). */
#splash { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
#splash.is-done { visibility: hidden; }
.splash-spacer { height: 100vh; height: 100svh; }
.splash-name {
  position: absolute; left: 0; top: 0; transform-origin: 0 0; white-space: nowrap;
  color: var(--heading); font-size: clamp(2.6rem, 11vw, 9rem); font-weight: 800; font-stretch: var(--wide);
  line-height: 1; letter-spacing: 0.01em; will-change: transform, opacity;
}
.splash-name span {
  display: inline-block; animation: letter-in 1s var(--ease) both;
  animation-delay: calc(0.15s + var(--i) * 0.07s);
}
.splash-name .letter { display: inline-block; transform-origin: 50% 85%; will-change: transform; }
@keyframes letter-in {
  from { opacity: 0; transform: translateY(45%) rotate(6deg); filter: blur(10px); }
}
.splash-hint {
  position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--text); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
  animation: hint-in 1s 1.2s var(--ease) both;
}
/* Heads-up display: viewfinder corners, telemetry readouts, and an orbit around the name */
.hud { position: absolute; inset: 0; opacity: var(--hud, 1); animation: hud-in 1.4s 0.9s var(--ease) both; }
@keyframes hud-in { from { opacity: 0; transform: scale(1.03); } }
.hud-corner { position: absolute; width: 22px; height: 22px; border: 0 solid var(--heading); opacity: 0.55; }
.hud-corner.tl { top: 20px; left: 20px; border-top-width: 1.5px; border-left-width: 1.5px; }
.hud-corner.tr { top: 20px; right: 20px; border-top-width: 1.5px; border-right-width: 1.5px; }
.hud-corner.bl { bottom: 20px; left: 20px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.hud-corner.br { bottom: 20px; right: 20px; border-bottom-width: 1.5px; border-right-width: 1.5px; }
.hud-read {
  position: absolute; display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.12em; color: var(--text); opacity: 0.8;
  font-variant-numeric: tabular-nums;
}
.hud-read.tl { top: 30px; left: 52px; }
.hud-read.tr { top: 30px; right: 52px; }
.hud-read.bl { bottom: 30px; left: 52px; }
.hud-read.br { bottom: 30px; right: 52px; }
.hud-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: hud-blink 2s steps(1) infinite; }
@keyframes hud-blink { 50% { opacity: 0.2; } }
.orbit {
  position: absolute; left: 50%; top: 50%; width: min(1000px, 94vw); aspect-ratio: 32 / 10;
  transform: translate(-50%, -50%) rotate(-7deg); color: var(--heading); opacity: 0.4; overflow: visible;
}
@media (max-width: 640px) {
  .hud-read { font-size: 0.58rem; letter-spacing: 0.08em; }
  .hud-read.tl, .hud-read.bl { left: 44px; } .hud-read.tr, .hud-read.br { right: 44px; }
  .hud-read.bl, .hud-read.br { display: none; } /* keeps the bottom clear for the scroll hint */
}
@media (prefers-reduced-motion: reduce) { .orbit circle { display: none; } }

/* Glowing up arrow: floats upward and pulses its glow */
.splash-arrow {
  color: var(--accent);
  animation: arrow-float 1.8s ease-in-out infinite, arrow-glow 1.8s ease-in-out infinite;
}
@keyframes hint-in { from { opacity: 0; transform: translate(-50%, 10px); } }
@keyframes arrow-float { 0%, 100% { transform: translateY(4px); } 50% { transform: translateY(-4px); } }
@keyframes arrow-glow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(37, 71, 208, 0.35)); opacity: 0.75; }
  50% { filter: drop-shadow(0 0 8px rgba(37, 71, 208, 0.9)) drop-shadow(0 0 16px rgba(37, 71, 208, 0.45)); opacity: 1; }
}
/* Everything except the sidebar name fades in as the opening screen hands off */
.sidebar-top > :not(.name), .sidebar-bottom, .main { opacity: var(--reveal, 1); }

/* Interactive dot grid behind everything (drawn by main.js) */
#dots { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }

/* ---------- Layout: one column on mobile, two on desktop ---------- */

.layout {
  position: relative; z-index: 1;
  max-width: 1200px; margin: 0 auto; padding: 0 16px;
}
.sidebar { padding: 48px 0 24px; }
.main { padding-bottom: 48px; }

/* Each "page" (Home, About, ...) is a block on one long page */
.page { padding: 48px 0; }
.page-inner { transform-origin: 50% 50%; will-change: transform, opacity; }

@media (min-width: 640px) {
  .layout { padding: 0 48px; }
}

@media (min-width: 1024px) {
  .layout { display: flex; gap: 64px; padding: 0 64px; }
  .sidebar {
    position: sticky; top: 0; height: 100vh; width: 44%; flex-shrink: 0;
    padding: 96px 0; display: flex; flex-direction: column; justify-content: space-between;
  }
  .main { width: 56%; padding: 0 0 64px; }
  /* Full-screen pages, content centered vertically */
  .page { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 96px 0; }
}

/* ---------- Sidebar ---------- */

.name { color: var(--heading); font-size: clamp(2rem, 4.4vw, 2.75rem); font-weight: 800; font-stretch: var(--wide); line-height: 1.1; letter-spacing: 0.01em; text-transform: uppercase; }
.subtitle {
  margin-top: 12px; color: var(--heading);
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
}
.tagline { margin-top: 16px; max-width: 380px; }

/* Main menu: page links. On desktop each has a line that grows when active. */
.nav { margin-top: 32px; }
.nav > ul { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 16px; padding: 6px 0;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  transition: color 0.2s;
}
.nav-link:hover, .nav-link.is-active { color: var(--heading); }
.nav-line { display: none; }
.subnav { display: none; }

@media (min-width: 1024px) {
  .nav { margin-top: 56px; }
  .nav > ul { flex-direction: column; gap: 0; }
  .nav-link { padding: 10px 0; }
  .nav-line {
    display: block; width: 32px; height: 1px; background: var(--text);
    transition: width 0.3s var(--ease), background 0.3s;
  }
  .nav-link:hover .nav-line, .nav-link.is-active .nav-line { width: 64px; background: var(--heading); }
  .nav-link.is-active .nav-line { background: var(--accent); }

  /* Current page's sections, highlighted by scroll-spy */
  .subnav { display: none; margin: 0 0 8px 80px; border-left: 1px solid var(--line); }
  [data-nav].is-current .subnav { display: block; }
  .subnav a {
    display: block; padding: 4px 0 4px 14px; margin-left: -1px; border-left: 1px solid transparent;
    font-size: 0.8rem; transition: color 0.2s, border-color 0.2s;
  }
  .subnav a:hover { color: var(--heading); }
  .subnav a.is-active { color: var(--accent); border-color: var(--accent); }
}

.socials { display: flex; gap: 20px; margin-top: 32px; }
.social { display: block; transition: color 0.2s, transform 0.2s; }
a.social:hover { color: var(--heading); transform: translateY(-2px); }
.social.is-missing { opacity: 0.3; cursor: help; }

/* ---------- Sections ---------- */

.section { padding: 48px 0; scroll-margin-top: 24px; }
@media (min-width: 1024px) { .section { padding: 0 0 80px; scroll-margin-top: 96px; } }
.section:last-child { padding-bottom: 0; }

/* Small uppercase label with a line before it: "━━ LABEL" */
.label {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
  color: var(--accent); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase;
}
.label::before { content: ''; width: 32px; height: 2px; background: currentColor; }

.display {
  color: var(--heading); font-size: clamp(2.25rem, 6vw, 3.5rem); font-weight: 700;
  line-height: 1.05; letter-spacing: -0.01em; font-weight: 800; font-stretch: var(--wide);
}
.accent { color: var(--accent); }
.section-heading { color: var(--heading); font-size: clamp(1.5rem, 3.5vw, 2rem); font-weight: 700; font-stretch: var(--wide); line-height: 1.2; letter-spacing: -0.01em; }
.lead + .lead { margin-top: 12px; }
.lead { margin-top: 20px; font-size: 1.05rem; max-width: 560px; }

.arrow-r, .arrow { display: inline-block; transition: transform 0.25s var(--ease); }
.more-link:hover .arrow-r { transform: translateX(4px); }


/* ---------- Cards (experience, projects, numbered, split) ---------- */

.cards { display: grid; gap: 12px; }
.card {
  position: relative; padding: 20px; border-radius: var(--radius);
  transition: background 0.3s, box-shadow 0.3s, opacity 0.3s;
}
.card p + p, .card .card-title + p { margin-top: 8px; }
.card-title { color: var(--heading); font-size: 1.05rem; font-weight: 700; font-stretch: 105%; line-height: 1.35; }
.card-tag, .card-num, .card-date, .card-meta {
  color: var(--text); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
}
.card-tag, .card-num { color: var(--accent); margin-bottom: 8px; }
.card-meta { margin-top: 4px; }
.card-date { margin-bottom: 8px; padding-top: 3px; }

/* Make the whole card clickable when its title is a link */
.card-link { transition: color 0.2s; }
.card-link::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); }

/* Hover-to-focus: the hovered card lights up, its siblings fade back */
@media (hover: hover) and (pointer: fine) {
  .card:hover { background: var(--surface); box-shadow: 0 10px 30px -14px rgba(20, 24, 32, 0.18); }
  .card:hover .card-link { color: var(--accent); }
  .card:hover .arrow { transform: translate(3px, -3px); }
  .cards:hover > .card:not(:hover) { opacity: 0.5; }
}

/* Date/thumbnail on the left, content on the right */
@media (min-width: 640px) {
  .card-row { display: grid; grid-template-columns: 140px 1fr; gap: 24px; }
  .card-date { margin-bottom: 0; }
}

.numbered { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 24px; }
.numbered .card, .split .card { border: 1px solid var(--line); }
.split { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.split .card { padding: 28px; }

.thumb { width: 100%; max-width: 140px; aspect-ratio: 4 / 5; object-fit: cover; background: #fff; border: 2px solid var(--line); border-radius: 4px; margin-bottom: 12px; }
.placeholder { display: grid; place-items: center; text-align: center; padding: 8px; font-size: 0.7rem; border-style: dashed; }

/* Company logo tile (experience cards) */
.logo {
  display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 12px;
  border-radius: 10px; overflow: hidden; border: 1px solid var(--line);
}
.logo img { width: 100%; height: 100%; object-fit: cover; }
.logo-fallback {
  background: var(--accent-soft); border: 1px solid var(--line);
  color: var(--accent); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em;
}

/* Tiles: a section shows its box only while the cursor is over it, like the experience cards */
.tile {
  padding: 24px 20px; border-radius: 12px;
  transition: background 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .tile:hover { background: var(--surface); box-shadow: 0 10px 30px -14px rgba(20, 24, 32, 0.18); }
}
@media (min-width: 640px) { .tile { padding: 36px 32px; } }

/* Small rounded skill tags */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tags li {
  padding: 4px 12px; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent); font-size: 0.75rem; font-weight: 500; line-height: 1.6;
}

.more-link { display: inline-flex; align-items: center; gap: 8px; margin: 24px 0 0 20px; color: var(--heading); font-weight: 600; }
.more-link:hover { color: var(--accent); }
.more-links { display: flex; flex-wrap: wrap; gap: 8px 32px; margin-top: 8px; }
.more-links .more-link { margin-left: 0; }

/* ---------- Other section types ---------- */

.prose { margin-top: 24px; }
.prose p + p { margin-top: 16px; }
.portrait { width: 160px; aspect-ratio: 1; border-radius: var(--radius); border: 2px solid var(--line); object-fit: cover; margin-bottom: 20px; }
@media (min-width: 640px) { .portrait { float: right; margin: 4px 0 16px 24px; } }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stats li { padding: 20px 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.stat-value { display: block; color: var(--heading); font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 700; line-height: 1.1; }
.stat-label { display: block; margin-top: 6px; font-size: 0.8rem; line-height: 1.4; }

.link-groups { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.link-list { margin-top: 4px; border-top: 1px solid var(--line); }
.link-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0;
  border-bottom: 1px solid var(--line); color: var(--heading); font-weight: 500; transition: color 0.2s;
}
a.link-row:hover { color: var(--accent); }
a.link-row:hover .arrow { transform: translate(3px, -3px); }

/* Big icon buttons (Contact page) */
.icon-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 32px; }
.icon-link {
  display: grid; place-items: center; width: 64px; height: 64px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--bg); color: var(--heading);
  transition: color 0.25s, border-color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s;
}
.icon-link svg { width: 28px; height: 28px; }
.icon-link:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 24px -12px rgba(37, 71, 208, 0.45); }

/* Placeholder for content Dev hasn't filled in yet */
.todo {
  padding: 0 6px; border: 1px dashed var(--accent); border-radius: 4px;
  color: var(--accent-hover); font-size: 0.85em; font-weight: 500; white-space: normal;
}
.is-missing { cursor: help; }

.footer { padding-top: 24px; border-top: 1px solid var(--line); font-size: 0.8rem; }

/* Scroll transitions between pages are driven by main.js */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Small confirmation popup (used when an email link is clicked) */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 20; max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 10px; background: var(--heading); color: #fff;
  font-size: 0.85rem; box-shadow: 0 12px 30px -12px rgba(20, 24, 32, 0.45);
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
  transition: opacity 0.3s, transform 0.3s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }


/* Small technical labels use the monospace font */
.subtitle, .nav-link, .subnav a, .label, .card-date, .card-tag, .card-num, .card-meta,
.tags li, .splash-hint, .footer, .copyright, .logo-fallback {
  font-family: var(--font-mono); letter-spacing: 0.06em;
}
.label, .nav-link, .subtitle { font-weight: 500; }
.tags li { font-size: 0.72rem; letter-spacing: 0.02em; }

/* ---------- Small personal details ---------- */

/* Label row: section label on the left, optional detail (flight path) on the right */
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.label-row .label { margin-bottom: 0; }

/* "INDIA ··✈·· WICHITA" */
.route {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); opacity: 0.8;
}
.route-path {
  position: relative; width: 64px; height: 14px;
  background: radial-gradient(circle, var(--accent) 1px, transparent 1.4px) 0 50% / 6px 6px repeat-x;
  opacity: 0.8;
}
.route-plane { position: absolute; top: 0; right: -2px; color: var(--accent); }
.tile:hover .route-plane, .route:hover .route-plane { animation: fly 1.6s var(--ease); }
@keyframes fly { from { right: 100%; } to { right: -2px; } }

/* Bullet-journal goal log */
.log-title {
  display: flex; align-items: center; gap: 10px; margin-top: 28px;
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
}
.log-title::after { content: ''; flex: 1; max-width: 120px; border-top: 1px dashed rgba(37, 71, 208, 0.4); }
.log-title + .log { margin-top: 12px; }
.log { margin-top: 24px; display: grid; gap: 8px; font-family: var(--font-mono); font-size: 0.8rem; color: var(--heading); }
.log li { display: flex; align-items: baseline; gap: 12px; }
.log-mark { width: 14px; color: var(--accent); text-align: center; }
.log-state { font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); opacity: 0.7; }
.log-state::before { content: '— '; }
.log-done .log-text { text-decoration: line-through; text-decoration-color: rgba(37, 71, 208, 0.45); }


/* Copyright line: under the social icons on desktop, page footer on phones */
.copyright { display: none; margin-top: 16px; font-size: 0.68rem; color: var(--text); opacity: 0.8; }
@media (min-width: 1024px) {
  .copyright { display: block; }
  .footer-mobile { display: none; }
  .main { padding-bottom: 0; }
}

/* Status line under the social icons: pulsing dot + days until graduation */
.status {
  display: flex; align-items: center; gap: 8px; margin-top: 18px;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--heading);
}
.status + .copyright { margin-top: 8px; }
.status-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.status-dot::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--accent);
  animation: status-ping 2.4s ease-out infinite;
}
@keyframes status-ping { 0% { transform: scale(1); opacity: 0.6; } 80%, 100% { transform: scale(3); opacity: 0; } }
