/* ============================================================
   Alexander Ager — Portfolio
   Vercel-inspired: pure black canvas, Geist type, high contrast
   ============================================================ */

/* Geist and Geist Mono, self-hosted (SIL OFL, see fonts/OFL.txt) */
@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #000000;
  --bg-elev: #0a0a0a;
  --panel: rgba(255, 255, 255, 0.02);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --fg: #ededed;
  --fg-muted: #a1a1a1;
  --fg-dim: #6b6b6b;
  --accent: #ffffff;
  --radius: 12px;
  --radius-lg: 16px;
  --maxw: 1080px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
html { overflow-x: clip; }

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

::selection { background: rgba(255, 255, 255, 0.85); color: #000; }

/* Subtle film grain + vignette over everything */
.page-grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(120% 80% at 50% 0%, transparent 55%, rgba(0,0,0,0.55) 100%);
  mix-blend-mode: normal;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s var(--ease), background .18s var(--ease),
              border-color .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease);
  white-space: nowrap;
}
.btn-lg { padding: 12px 22px; font-size: 15px; border-radius: 10px; }
.btn-solid {
  background: #fff;
  color: #000;
  border-color: #fff;
}
.btn-solid:hover {
  background: #e6e6e6;
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(255,255,255,0.12);
}
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.35);
  transform: translateY(-1px);
}
.btn svg { transition: transform .2s var(--ease); }
.btn-solid:hover svg { transform: translate(2px, -2px); }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: background .3s var(--ease), border-color .3s var(--ease), backdrop-filter .3s var(--ease);
  border-bottom: 1px solid transparent;
  animation: fadeIn .8s var(--ease) 1.3s both;
}
.nav.scrolled {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: var(--bg-elev);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.brand:hover .brand-mark { border-color: rgba(255,255,255,0.4); background: #111; }
.brand-name {
  font-weight: 500; font-size: 15px; letter-spacing: -0.01em;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.nav.scrolled .brand-name { opacity: 1; transform: none; }
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-size: 14px;
  color: var(--fg-muted);
  transition: color .18s var(--ease);
  position: relative;
}
.nav-links a:hover { color: var(--fg); }
.nav-cta { display: flex; gap: 10px; }

@media (max-width: 860px) {
  .brand-name { display: none; }
  .nav-links { display: none; }
}
@media (max-width: 520px) {
  .nav-cta .btn-ghost { display: none; }
}

/* ============================================================
   HERO - isometric cube field + name. Load-in is one sequence:
   cubes assemble outward from the centre (main.js), the name
   rises out of a mask, then the role, then the nav and scroll cue.
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 140px;
  overflow: hidden;
  isolation: isolate;
}

.hero-grid { position: absolute; inset: 0; z-index: -1; }

/* interactive cube field, drawn in main.js */
.cube-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* fade the field out toward the edges / bottom, and dim it behind the name */
.hero-fade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(38% 26% at 50% 46%, rgba(0,0,0,0.55), transparent 100%),
    radial-gradient(78% 68% at 50% 42%, transparent 45%, rgba(0,0,0,0.6) 78%, var(--bg) 100%),
    linear-gradient(to bottom, transparent 55%, var(--bg) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-name {
  font-size: clamp(3.4rem, 15vw, 9rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.05em;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: default;
  transition: filter .4s var(--ease);
}
.hero-name.lit { filter: drop-shadow(0 6px 34px rgba(150,175,255,0.4)); }

/* each line is a mask; the word slides up into it. The word itself carries
   the padding: background-clip:text only paints inside the element's box,
   so the descender on "Ager" needs room there, not just on the mask */
.hero-line {
  display: block;
  overflow: hidden;
}
.hero-line + .hero-line { margin-top: -0.22em; }   /* pull the lines back together */
.hero-line > span {
  display: block;
  padding: 0.04em 0.06em 0.22em;
  background: linear-gradient(180deg, #ffffff 0%, #d6d6d6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: lineUp 1.1s cubic-bezier(0.16, 1, 0.3, 1) .25s both;
}
.hero-line + .hero-line > span {
  background-image: linear-gradient(180deg, #cfcfcf 0%, #7d7d7d 100%);
  animation-delay: .37s;
}

.hero-role {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 1.5vw, 1.05rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-muted);
  animation: fadeUp .9s var(--ease) .85s both;
}
@media (max-width: 520px) {
  .hero-role { letter-spacing: 0.14em; }
}

.scroll-hint {
  position: absolute;
  bottom: 32px; left: 0; right: 0;
  margin: 0 auto;
  width: 40px; height: 40px;
  z-index: 2;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--fg-dim);
  transition: color .2s var(--ease);
  animation: fadeIn .8s var(--ease) 1.5s both;
}
.scroll-hint:hover { color: var(--fg); }
.scroll-hint svg { animation: bob 1.8s var(--ease) infinite; }

/* ============================================================
   SECTIONS
   ============================================================ */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.section { padding: 96px 0; position: relative; z-index: 2; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}
.section-index {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-dim);
}
.section-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}

/* Cards */
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color .25s var(--ease), background .25s var(--ease), transform .25s var(--ease);
}
/* cursor-following spotlight inside each card */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, -40%),
    rgba(255,255,255,0.09), transparent 62%);
  opacity: 0;
  transition: opacity .35s var(--ease);
  pointer-events: none;
  z-index: 0;
}
.card:hover::before, .card:focus-within::before { opacity: 1; }
.card > * { position: relative; z-index: 1; }
.card:hover, .card:focus-visible {
  border-color: var(--border-strong);
  background: rgba(255,255,255,0.035);
  transform: translateY(-2px);
  outline: none;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.about-lead {
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: var(--fg);
}
.about-body { color: var(--fg-muted); font-size: 1rem; }

@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* Experience timeline */
.timeline { display: flex; flex-direction: column; gap: 20px; }
.xp { padding: 30px 30px; }
.xp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.xp-role { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; }
.xp-org { color: var(--fg-muted); font-size: 0.95rem; margin-top: 2px; }
.xp-date {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg-dim);
  white-space: nowrap;
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  flex-shrink: 0;
}
.xp-points { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.xp-points li {
  position: relative;
  padding-left: 22px;
  color: var(--fg-muted);
  font-size: 0.97rem;
  line-height: 1.55;
}
.xp-points li::before {
  content: "";
  position: absolute;
  left: 2px; top: 10px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--fg-dim);
  transition: background .25s var(--ease);
}
.xp:hover .xp-points li::before { background: #fff; }
.xp-points strong { color: var(--fg); font-weight: 600; }
.xp-note {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--fg-dim);
  font-style: italic;
  line-height: 1.55;
}

@media (max-width: 620px) {
  .xp { padding: 24px 20px; }
  .xp-head { flex-direction: column; gap: 12px; }
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.project { display: block; padding: 28px 28px; color: inherit; }
.project-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.project-name { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; }
.project-type {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg-dim);
  margin-top: 4px;
}
.project-arrow {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--fg-muted);
  flex-shrink: 0;
  transition: transform .22s var(--ease), color .22s var(--ease), border-color .22s var(--ease);
}
.project:hover .project-arrow {
  color: #fff;
  border-color: rgba(150,175,255,0.5);
  transform: translate(2px, -2px);
}
.project-desc { margin-top: 16px; color: var(--fg-muted); font-size: 0.97rem; line-height: 1.55; }
.project-foot {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.project-tags { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.project-url { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg-dim); }

/* Skills */
.certs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}
.cert {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.cert::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: #fff;
}
.cert:hover { border-color: rgba(255,255,255,0.4); transform: translateY(-2px); }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.skill-group { padding: 24px 24px; }

/* Full-width AI stack highlight box */
.skill-feature {
  grid-column: 1 / -1;
  padding: 28px 28px;
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(120,150,255,0.09), transparent 55%),
    var(--panel);
  border-color: rgba(150,175,255,0.22);
}
.skill-feature .skill-title { color: #b9c6ff; margin-bottom: 20px; }
.skill-feature-rows { display: flex; flex-direction: column; gap: 18px; }
.skill-feature-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  align-items: start;
}
.skill-feature-row + .skill-feature-row { padding-top: 18px; border-top: 1px solid var(--border); }
.skill-feature-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg);
  padding-top: 6px;
}
@media (max-width: 620px) {
  .skill-feature-row { grid-template-columns: 1fr; gap: 10px; }
  .skill-feature-label { padding-top: 0; color: var(--fg-dim); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; }
}
.skill-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 16px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  background: rgba(255,255,255,0.02);
  transition: border-color .18s var(--ease), background .18s var(--ease), color .18s var(--ease);
}
.chip:hover { border-color: var(--border-strong); background: rgba(255,255,255,0.06); }
.chip-muted { color: var(--fg-dim); }

@media (max-width: 900px) { .skills-grid { grid-template-columns: 1fr; } }

/* Education */
.edu { padding: 30px; }
.edu-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.edu-degree { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; }
.edu-school { color: var(--fg-muted); margin-top: 2px; }
.edu-meta { text-align: right; display: flex; flex-direction: column; gap: 6px; }
.edu-grade {
  font-weight: 600;
  font-size: 0.95rem;
  background: linear-gradient(180deg, #fff, #9a9a9a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.edu-date { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg-dim); }
.edu-modules-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 14px;
}
@media (max-width: 560px) {
  .edu-head { flex-direction: column; }
  .edu-meta { text-align: left; }
}

/* Contact */
.contact { padding-bottom: 120px; }
.contact-card {
  padding: 64px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  background:
    radial-gradient(120% 140% at 50% 0%, rgba(255,255,255,0.06), transparent 60%),
    var(--panel);
}
.contact-title {
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, #fff, #8a8a8a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.contact-sub { margin-top: 16px; max-width: 480px; color: var(--fg-muted); }
.contact-card .hero-actions { margin-top: 32px; }

/* rotating gradient border on the CTA card */
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.contact-card { overflow: hidden; }
.contact-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--angle),
    transparent 0deg 55%,
    rgba(150,175,255,0.55) 74%,
    rgba(255,255,255,0.9) 82%,
    rgba(150,175,255,0.55) 90%,
    transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  animation: borderSpin 7s linear infinite;
  pointer-events: none;
  z-index: 2;
}
@keyframes borderSpin { to { --angle: 360deg; } }

/* Footer */
.footer { border-top: 1px solid var(--border); position: relative; z-index: 2; }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 28px; padding-bottom: 28px;
  font-size: 13px;
  color: var(--fg-dim);
}
.footer-built { font-family: var(--font-mono); }

/* ---------- Reveal on scroll ---------- */
.reveal-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: calc(var(--i, 0) * 80ms);
  will-change: opacity, transform;
}
.reveal-up.in { opacity: 1; transform: none; }
/* section headers slide in from the left for variety */
.section-head.reveal-up { transform: translateX(-24px); }
.section-head.reveal-up.in { transform: none; }

/* cards: stronger 3D tilt-in with a glow "power-on" as they land */
.reveal-card {
  opacity: 0;
  transform: perspective(1100px) translateY(46px) rotateX(9deg) scale(0.965);
  transform-origin: center bottom;
  transition: opacity .75s var(--ease), transform .75s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
  will-change: opacity, transform;
}
.reveal-card.in {
  opacity: 1;
  transform: none;
  animation: cardGlow .85s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}
@keyframes cardGlow {
  0%   { box-shadow: 0 0 0 rgba(120,150,255,0);    border-color: var(--border); }
  45%  { box-shadow: 0 12px 46px rgba(120,150,255,0.28); border-color: rgba(150,175,255,0.65); }
  100% { box-shadow: 0 0 0 rgba(120,150,255,0);    border-color: var(--border); }
}

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 60;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(to right, #6f8bff, #ffffff);
  box-shadow: 0 0 12px rgba(120,150,255,0.6);
  pointer-events: none;
}

/* ---------- Keyframes ---------- */
@keyframes lineUp {
  from { transform: translateY(105%); }
  to   { transform: none; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .reveal-up, .reveal-card { opacity: 1; transform: none; transition: none; }
}
