/* ============ RED · 720pixel — bio site ============ */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("/assets/inter.woff2") format("woff2");
}

:root {
  --maroon: #a31f3e;
  --maroon-bright: #c8324f;
  --maroon-deep: #6f1428;
  --radius: 16px;
  --maxw: 720px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Dark (default) ---- */
:root, :root[data-theme="dark"] {
  --bg: #0a0a0c;
  --bg-2: #101013;
  --surface: rgba(255, 255, 255, 0.025);
  --surface-2: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --text: #ececf0;
  --text-strong: #ffffff;
  --muted: #8a8a93;
  --accent: var(--maroon-bright);
  --accent-soft: rgba(200, 50, 79, 0.14);
  --ring: rgba(200, 50, 79, 0.45);
  --particle: 200, 50, 79;
  --glow: rgba(163, 31, 62, 0.22);
}

/* ---- Light ---- */
:root[data-theme="light"] {
  --bg: #f7f6f5;
  --bg-2: #efeeec;
  --surface: rgba(0, 0, 0, 0.02);
  --surface-2: rgba(0, 0, 0, 0.035);
  --border: rgba(0, 0, 0, 0.1);
  --text: #1d1b1c;
  --text-strong: #0c0b0b;
  --muted: #6b6a6c;
  --accent: var(--maroon);
  --accent-soft: rgba(163, 31, 62, 0.1);
  --ring: rgba(163, 31, 62, 0.32);
  --particle: 130, 22, 44;
  --glow: rgba(163, 31, 62, 0.12);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  letter-spacing: -0.011em;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.5s var(--ease), color 0.4s var(--ease);
}

/* atmospheric radial glow behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 500px at 78% -8%, var(--glow), transparent 60%),
    radial-gradient(700px 500px at 12% 108%, var(--glow), transparent 60%);
  z-index: -2;
  pointer-events: none;
}

#particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px 96px;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 24px;
  backdrop-filter: blur(8px);
}
.brand {
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  color: var(--text-strong);
}
.brand .dot { color: var(--accent); }

.toggle {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.4s var(--ease), border-color 0.3s, background 0.3s;
}
.toggle:hover { transform: rotate(20deg) scale(1.06); border-color: var(--ring); }
.toggle svg { width: 18px; height: 18px; }
.toggle .sun { display: none; }
:root[data-theme="light"] .toggle .sun { display: block; }
:root[data-theme="light"] .toggle .moon { display: none; }

/* ---------- hero ---------- */
.hero {
  padding: 56px 0 28px;
  text-align: center;
  animation: rise 0.8s var(--ease) both;
}
.avatar {
  width: 132px; height: 132px;
  border-radius: 50%;
  margin: 0 auto 26px;
  position: relative;
  padding: 4px;
  background: conic-gradient(from 140deg, var(--maroon-deep), var(--accent), var(--maroon-bright), var(--maroon-deep));
  box-shadow: 0 0 0 1px var(--border), 0 18px 50px -16px var(--ring);
}
.avatar img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: var(--bg-2);
}
.avatar::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid var(--ring);
  opacity: 0.5;
  animation: pulse 3.6s ease-in-out infinite;
}

.name {
  font-size: clamp(3.2rem, 12vw, 5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--text-strong);
  background: linear-gradient(180deg, var(--text-strong), var(--accent) 220%);
  -webkit-background-clip: text;
  background-clip: text;
}
.name .glyph {
  background: linear-gradient(135deg, var(--accent), var(--maroon-bright));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.handle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.82rem;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--ring);
  padding: 5px 13px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.handle::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.role {
  margin-top: 18px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-strong);
}
.tagline {
  margin: 10px auto 0;
  max-width: 30em;
  color: var(--muted);
  font-size: 1rem;
}

/* ---------- sections ---------- */
section { padding: 40px 0 8px; animation: rise 0.8s var(--ease) both; }
.sec-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 26px;
}
.sec-num {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
}
.sec-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.sec-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

.prose p { color: var(--text); margin-bottom: 16px; font-size: 1.05rem; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--text-strong); }

/* skills */
.skill-group { margin-bottom: 22px; }
.skill-group:last-child { margin-bottom: 0; }
.skill-group h3 {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 12px;
}
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  font-size: 0.84rem;
  padding: 7px 13px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  transition: transform 0.3s var(--ease), border-color 0.3s, color 0.3s, background 0.3s;
  cursor: default;
}
.chip:hover {
  transform: translateY(-3px);
  border-color: var(--ring);
  color: var(--accent);
  background: var(--accent-soft);
}

/* experience */
.xp { position: relative; padding-left: 26px; }
.xp::before {
  content: "";
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 1px;
  background: linear-gradient(var(--border), transparent);
}
.xp-item { position: relative; padding-bottom: 30px; }
.xp-item:last-child { padding-bottom: 0; }
.xp-item::before {
  content: "";
  position: absolute;
  left: -25px; top: 7px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.xp-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px; }
.xp-role { font-size: 1.05rem; font-weight: 700; color: var(--text-strong); }
.xp-period { font-family: ui-monospace, monospace; font-size: 0.76rem; color: var(--muted); }
.xp-org { color: var(--accent); font-size: 0.9rem; font-weight: 500; margin-bottom: 10px; }
.xp-points { list-style: none; display: grid; gap: 7px; }
.xp-points li { position: relative; padding-left: 18px; color: var(--text); font-size: 0.97rem; }
.xp-points li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }

/* education */
.edu-item { padding: 16px 0; border-bottom: 1px solid var(--border); }
.edu-item:last-child { border-bottom: 0; }
.edu-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; align-items: baseline; }
.edu-title { font-weight: 700; color: var(--text-strong); }
.edu-period { font-family: ui-monospace, monospace; font-size: 0.76rem; color: var(--muted); }
.edu-detail { color: var(--muted); font-size: 0.96rem; margin-top: 4px; }

/* contact */
.contact-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 26px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.contact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px 200px at 0% 0%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.qr {
  width: 132px; height: 132px;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  box-shadow: 0 10px 30px -12px var(--ring);
}
.qr img { width: 100%; height: 100%; display: block; }
.qr-cap { text-align: center; font-size: 0.7rem; color: var(--muted); margin-top: 6px; letter-spacing: 0.04em; }
.contact-meta { display: flex; flex-direction: column; gap: 12px; }
.contact-meta .lead { color: var(--muted); font-size: 0.96rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-strong);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
  width: fit-content;
}
.btn:hover { transform: translateY(-2px); border-color: var(--ring); background: var(--accent-soft); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn .tg { color: #29a9eb; }
.btn .mono { font-family: ui-monospace, monospace; font-weight: 500; }

/* footer */
footer {
  margin-top: 64px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 0.84rem;
}
footer .sig { font-style: italic; opacity: 0.8; margin-top: 6px; display: block; }
footer a { color: var(--accent); text-decoration: none; }

/* animations */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 0.5; } 50% { transform: scale(1.05); opacity: 0.15; } }

@media (max-width: 540px) {
  .contact-card { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .contact-meta { align-items: center; }
  .xp-top, .edu-top { gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero, section { animation: none; }
  .avatar::after { display: none; }
}

/* ============ below section: favorites + quotes + watery hover ============ */
.below { position: relative; margin-top: 70px; padding: 56px 0 10px; overflow: hidden; --mx: 50%; --my: 0%; }
.below-inner { position: relative; z-index: 1; }
.below .water {
  position: absolute; inset: -1px; z-index: 0; pointer-events: none; opacity: .85; transition: opacity .5s var(--ease);
  background:
    radial-gradient(360px 360px at var(--mx) var(--my), rgba(var(--particle), .20), transparent 62%),
    radial-gradient(130% 90% at 50% 128%, var(--accent-soft), transparent 70%);
}
.below .water::before, .below .water::after {
  content: ""; position: absolute; left: -30%; right: -30%; height: 260px; pointer-events: none;
  background: radial-gradient(50% 100% at 50% 0, rgba(var(--particle), .12), transparent 72%);
  filter: blur(10px); animation: wave 11s ease-in-out infinite;
}
.below .water::before { top: -40px; }
.below .water::after { bottom: -60px; animation-duration: 15s; animation-direction: reverse; opacity: .65; }
.below.wet .water { opacity: 1; }
@keyframes wave { 0%, 100% { transform: translateX(-5%) skewX(-2.5deg); } 50% { transform: translateX(5%) skewX(2.5deg); } }

/* marquee slider */
.marquee { position: relative; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.marquee-track { display: flex; width: max-content; animation: scroll 42s linear infinite; will-change: transform; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.poster { position: relative; flex: 0 0 auto; width: 140px; margin: 0 18px 0 0; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-2); box-shadow: 0 12px 30px -18px var(--ring);
  transition: transform .35s var(--ease), box-shadow .35s, border-color .35s; }
.poster img { width: 140px; height: 210px; object-fit: cover; display: block;
  filter: grayscale(.45) brightness(.82) contrast(1.02); transition: filter .45s var(--ease); background: var(--bg-2); }
.poster::after { content: ""; position: absolute; inset: 0; pointer-events: none; transition: opacity .4s;
  background: linear-gradient(180deg, transparent 38%, rgba(111, 20, 40, .6)); mix-blend-mode: multiply; opacity: .55; }
.poster figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 10px 9px;
  display: flex; flex-direction: column; gap: 2px; background: linear-gradient(transparent, rgba(0,0,0,.85)); }
.p-title { font-size: .72rem; font-weight: 700; color: #fff; line-height: 1.15; }
.p-cat { font-family: ui-monospace, monospace; font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.poster:hover { transform: translateY(-8px) scale(1.03); border-color: var(--ring); box-shadow: 0 26px 52px -22px var(--ring); }
.poster:hover img { filter: grayscale(0) brightness(1) contrast(1); }
.poster:hover::after { opacity: .15; }

/* live quotes */
.quotes { position: relative; height: 2.6em; margin-top: 40px; text-align: center; }
.quote { position: absolute; left: 0; right: 0; top: 0; font-family: ui-monospace, monospace; font-size: 1.02rem;
  color: var(--accent); opacity: 0; transform: translateY(8px); transition: opacity .8s var(--ease), transform .8s var(--ease); pointer-events: none; }
.quote.on { opacity: 1; transform: none; }
.quote::before { content: "\201C"; opacity: .55; } .quote::after { content: "\201D"; opacity: .55; }

/* mobile */
@media (max-width: 480px) {
  .wrap { padding: 0 18px 72px; }
  .topbar { padding: 14px 18px; }
  .hero { padding: 40px 0 18px; }
  .name { font-size: clamp(2.7rem, 17vw, 4rem); }
  .role { font-size: 1.05rem; }
  .prose p { font-size: 1rem; }
  .poster { width: 120px; margin-right: 14px; }
  .poster img { width: 120px; height: 180px; }
  .quote { font-size: 0.92rem; }
}

/* ============ light theme polish (premium, not an afterthought) ============ */
:root[data-theme="light"] {
  --bg: #f6f4f2;
  --bg-2: #ffffff;
  --surface: rgba(120, 20, 40, 0.022);
  --surface-2: #ffffff;
  --border: rgba(40, 20, 25, 0.12);
  --muted: #635f61;
  --accent-soft: rgba(163, 31, 62, 0.09);
  --ring: rgba(163, 31, 62, 0.30);
  --particle: 150, 22, 48;
  --glow: rgba(163, 31, 62, 0.14);
}
:root[data-theme="light"] body {
  background: linear-gradient(180deg, #faf9f8 0%, #f1eeeb 60%, #ece8e5 100%);
}
:root[data-theme="light"] body::before {
  background:
    radial-gradient(1000px 560px at 82% -10%, rgba(163, 31, 62, 0.12), transparent 60%),
    radial-gradient(780px 540px at 8% 110%, rgba(163, 31, 62, 0.08), transparent 62%);
}
:root[data-theme="light"] .name {
  background: linear-gradient(180deg, #1a1012, var(--accent) 210%);
  -webkit-background-clip: text; background-clip: text;
}
/* elevated surfaces */
:root[data-theme="light"] .chip,
:root[data-theme="light"] .toggle,
:root[data-theme="light"] .btn,
:root[data-theme="light"] .contact-card {
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 10, 12, 0.04), 0 10px 26px -18px rgba(120, 20, 40, 0.28);
}
:root[data-theme="light"] .chip:hover { background: var(--accent-soft); box-shadow: 0 6px 18px -10px var(--ring); }
:root[data-theme="light"] .handle { background: #fff; box-shadow: 0 6px 18px -12px var(--ring); }
:root[data-theme="light"] .sec-head::after,
:root[data-theme="light"] .xp::before { background: linear-gradient(90deg, rgba(40,20,25,0.16), transparent); }
/* vivid posters on light */
:root[data-theme="light"] .poster { box-shadow: 0 14px 32px -18px rgba(120, 20, 40, 0.4); }
:root[data-theme="light"] .poster img { filter: grayscale(0.16) brightness(0.97) contrast(1.03); }
:root[data-theme="light"] .poster::after { background: linear-gradient(180deg, transparent 46%, rgba(120, 20, 40, 0.5)); opacity: 0.38; }
:root[data-theme="light"] .poster:hover::after { opacity: 0.12; }
/* quotes stay legible */
:root[data-theme="light"] .quote { text-shadow: 0 1px 0 rgba(255,255,255,0.6); font-weight: 500; }

/* ============ readability scrim + futuristic scroll fx ============ */
#particles { opacity: .88; }
.wrap { position: relative; z-index: 1; }

/* keeps the centred text column legible over any background; bg still shows at the edges */
.scrim {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--bg) 15%, var(--bg) 85%, transparent);
  opacity: .58;
}

/* scroll progress bar */
.scrollbar {
  position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: 60;
  transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--maroon-deep), var(--accent), var(--maroon-bright));
  box-shadow: 0 0 12px var(--ring);
}

/* ambient glow that rises as you scroll (deepest layer, never touches text) */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(1100px 760px at 50% calc(125% - var(--scroll, 0) * 115%), rgba(var(--particle), .12), transparent 60%);
  opacity: calc(.35 + var(--scroll, 0) * .65);
}

/* section reveal on scroll (only when JS is active, so content never hides without it) */
.js main > section:not(.hero) {
  animation: none;
  opacity: 0; transform: translateY(26px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.js main > section.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js main > section:not(.hero) { opacity: 1; transform: none; transition: none; }
}
