/* ---------- Font ----------
   Drop your Constantine font file into a "fonts" folder next to this file
   (Constantine.ttf or .otf). If it's missing, Cinzel (loaded from Google Fonts)
   is used — same Roman-capital, medieval feel. */
@font-face {
  font-family: "Constantine";
  src: url("fonts/Constantine.ttf") format("truetype"),
       url("fonts/Constantine.otf") format("opentype");
  font-display: swap;
}

/* ---------- Base ---------- */
:root {
  --font: "Constantine", "Cinzel", "Constantia", "Times New Roman", serif;
  --bg: #0a0a0a;
  --ink: #f2f2f2;
  --muted: #ffffff;      /* small labels: white, bolded below */
  --line: #3a3a3a;
  --accent: #63efdd;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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



body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ---------- Preload screen ---------- */
#preload {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #0a0a0a;
  transition: opacity 0.9s var(--ease), visibility 0.9s;
}

#preload.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pl-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  animation: plIn 1.1s var(--ease) both;
}

.pl-logo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: block;
  animation: plBreathe 3.4s ease-in-out infinite;
}

.pl-bar {
  width: 180px;
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.pl-bar i {
  display: block;
  height: 100%;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
}

.pl-word {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.55;
  margin-right: -0.4em;
}

#preload.is-done .pl-inner {
  transform: translateY(-14px);
  transition: transform 0.9s var(--ease);
}

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

@keyframes plBreathe {
  0%, 100% { transform: scale(1); opacity: 0.92; }
  50%      { transform: scale(1.04); opacity: 1; }
}

/* nothing scrolls while the curtain is up */
html.loading, html.loading body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .pl-logo { animation: none; }
}

/* Page-wide WebGL atmosphere (bg.js) */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  pointer-events: none;
}

main, footer, .nav { position: relative; z-index: 1; }
.nav { position: fixed; }

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

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 5vw;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  mix-blend-mode: difference;
}

.logo { font-weight: 700; letter-spacing: 0.15em; }

.nav nav a {
  margin-left: 28px;
  color: var(--muted);
  font-weight: 700;
  transition: opacity 0.3s;
  opacity: 0.75;
}

.nav nav a:hover { opacity: 1; }



/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;          /* stable: ignores the mobile URL bar sliding */
  min-height: 560px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
}

.hero-title {
  position: absolute;
  top: 9vh;
  text-align: center;
  z-index: 1;
  pointer-events: none;
}

h1 {
  font-size: clamp(2.2rem, 7.6vw, 7.6rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.sub {
  margin-top: 10px;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Figure + canvas */
.hero-figure {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(78vh, 92vw);
  aspect-ratio: 1042 / 1024;
  z-index: 2;
  pointer-events: none;
}

.hero { cursor: default; }

.hero-figure .base {
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  /* Only visible if WebGL is unavailable — matched to the shader's shadow so the
     fallback never shows a brightly lit face. */
  filter: brightness(0.72);
}

@media (hover: none) {
  .hero-figure .base { filter: brightness(0.58); }
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

.hero.gl .hero-title h1 { opacity: 0; }
.hero.gl .hero-figure .base { opacity: 0; }

.hero-meta {
  position: absolute;
  bottom: 32px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
}

.hero-meta.left { left: 5vw; }
.hero-meta.right { right: 5vw; text-align: right; }

.hint::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 10px;
  vertical-align: middle;
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ---------- Sections ---------- */
.section {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  padding: 14vh 5vw;
  border-top: 1px solid var(--line);
}

.index {
  position: absolute;
  top: 14vh;
  right: 5vw;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.section-head { margin-bottom: 56px; }

.eyebrow {
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--muted);
  margin-bottom: 14px;
}

h2.heading {
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* words are wrapped in spans by anim.js for the reveal */
h2.heading .w { display: inline-block; overflow: hidden; vertical-align: top; }
h2.heading .w > span { display: inline-block; }

/* reveal defaults (anim.js animates these in) */
.js [data-reveal], .js .grid .card { opacity: 0; }

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

.section p {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 400;
  max-width: 680px;
  color: #ffffff;
}

.section .lead { margin-bottom: 40px; }

/* Facts row (about) */
.facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin-top: 48px;
  font-size: 0.95rem;
}
.facts li span {
  display: block;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

/* Skills grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 36px 48px;
}
.card {
  padding-top: 20px;
  border-top: 1px solid var(--ink);
}
.card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}
.card p, .timeline p {
  font-size: 1.02rem;
  font-weight: 500;
  color: #ededed;
  max-width: none;
}

/* Experience timeline */
.timeline { list-style: none; }
.timeline li {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.when {
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 6px;
}
.timeline h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.at {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* Education list */
.list { list-style: none; }
.list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.list strong { display: block; font-size: 1.25rem; font-weight: 700; }
.list small { display: block; color: var(--muted); font-weight: 700; font-size: 0.88rem; margin-top: 6px; opacity: 0.85; }
.year {
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  white-space: nowrap;
}

/* Languages */
.langs { list-style: none; max-width: 560px; }
.langs li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  padding: 16px 0 14px;
  font-size: 1.15rem;
}
.langs em {
  font-style: normal;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.langs i {
  grid-column: 1 / -1;
  display: block;
  height: 1px;
  margin-top: 12px;
  background: linear-gradient(to right, var(--ink) var(--lvl), var(--line) var(--lvl));
}

/* Contact */
.contact { list-style: none; }
.contact li {
  padding: 18px 0;
  border-top: 1px solid var(--line);
  font-size: 1.2rem;
}
.contact li span {
  display: block;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.big-link {
  border-bottom: 1px solid var(--ink);
  transition: color 0.3s, border-color 0.3s;
}
.big-link:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Footer ---------- */
footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 40px 5vw;
  border-top: 1px solid var(--line);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============================================================
   Responsive
   ============================================================ */

/* --- Laptops / small desktops --- */
@media (max-width: 1100px) {
  .section { padding: 12vh 6vw; }
  .index { right: 6vw; }
}

/* --- Tablets --- */
@media (max-width: 900px) {
  .nav { padding: 20px 6vw; }
  .nav nav a { margin-left: 20px; font-size: 0.72rem; }

  .hero-figure { width: min(72vh, 96vw); }
  .hero-title { top: 10vh; }

  .section { padding: 11vh 6vw; }
  .index { top: 11vh; }
  .section-head { margin-bottom: 44px; }

  .grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 30px 36px; }
  .timeline li { grid-template-columns: 140px 1fr; gap: 20px; }
  .facts { gap: 28px; }
}

/* --- Large phones / portrait tablets --- */
@media (max-width: 720px) {
  .nav {
    padding: 16px 5vw;
    gap: 12px;
  }
  .nav nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px 13px;
  }
  .nav nav a { margin-left: 0; font-size: 0.6rem; letter-spacing: 0.08em; }
  .logo { font-size: 0.9rem; }

  .hero { min-height: 520px; }
  .hero-title { top: 11vh; padding: 0 5vw; }
  /* the same weight reads much heavier at phone sizes — step it down to medium */
  h1 { font-weight: 500; }
  .hero-figure { width: 116vw; max-width: none; }
  .hero-meta { bottom: 22px; font-size: 0.6rem; letter-spacing: 0.18em; }
  .hero-meta.left { left: 5vw; }
  .hero-meta.right { right: 5vw; }
  .sub { font-size: 0.62rem; letter-spacing: 0.2em; }

  .section { padding: 10vh 6vw; }
  .section-head { margin-bottom: 36px; }
  .index { position: static; display: block; margin-bottom: 10px; }
  .eyebrow { font-size: 0.62rem; letter-spacing: 0.22em; }
  .section p { font-size: 1.12rem; }

  .grid { grid-template-columns: 1fr; gap: 28px; }
  .card h3 { font-size: 1.05rem; }

  .timeline li { grid-template-columns: 1fr; gap: 10px; padding: 26px 0; }
  .when { padding-top: 0; }
  .timeline h3 { font-size: 1.15rem; }

  .facts { gap: 22px 30px; margin-top: 34px; }

  .list li { flex-direction: column; align-items: flex-start; gap: 8px; }
  .list strong { font-size: 1.1rem; }

  .langs li { font-size: 1.02rem; }
  .contact li { font-size: 1.05rem; }

  footer {
    flex-direction: column;
    gap: 10px;
    text-align: left;
    padding: 32px 6vw;
  }
}

/* --- Small phones --- */
@media (max-width: 430px) {
  .nav { padding: 14px 4.5vw; }
  .nav nav { gap: 5px 9px; }
  .nav nav a { font-size: 0.53rem; letter-spacing: 0.02em; }

  .hero-figure { width: 128vw; }
  .hero-meta.left { display: none; }

  .section { padding: 9vh 6vw; }
  .section p { font-size: 1.05rem; }
  .card p, .timeline p { font-size: 0.95rem; }

  .pl-logo { width: 92px; height: 92px; }
  .pl-bar { width: 140px; }
}

/* --- Short/landscape phones: keep the hero from swallowing the screen --- */
@media (max-height: 560px) and (orientation: landscape) {
  .hero { min-height: 420px; }
  .hero-title { top: 6vh; }
  .hero-figure { width: min(96vh, 70vw); }
  .hero-meta { display: none; }
}

/* --- Touch devices: no hover, so the hint reads differently --- */
.hint b { font-weight: inherit; }
.on-touch { display: none; }

@media (hover: none) {
  .on-hover { display: none; }
  .on-touch { display: inline; }
  .list li a:hover, .big-link:hover { color: inherit; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal], .js .grid .card { opacity: 1 !important; transform: none !important; }
  .pl-inner { animation: none; }
  * { scroll-behavior: auto !important; }
}
