/* ==========================================================
   rolivares.dev — hand-coded, no build step
   ========================================================== */

:root {
  --bg: #0b0b0f;
  --bg-2: #121219;
  --bg-3: #1a1a23;
  --ink: #f1ece2;
  --ink-2: #c9c3b8;
  --muted: #7f7b86;
  --line: rgba(241, 236, 226, 0.1);
  --accent: #ff6b3d;
  --accent-2: #a99bff;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(16px, 5vw, 72px);
  --max: 1280px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 400; }
.mono { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.02em; }
.accent { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

/* film grain */
.grain {
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 100; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5%, 4%); }
  40% { transform: translate(4%, -6%); }
  60% { transform: translate(-3%, -2%); }
  80% { transform: translate(6%, 3%); }
}

/* ───────── nav ───────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  mix-blend-mode: difference;
}
.nav__logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 1.7rem; text-decoration: none; line-height: 1;
}
.nav__logo .accent { color: var(--ink); font-style: italic; }
.nav__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.nav__links { display: flex; gap: 28px; align-items: center; }
.nav__links a {
  font-family: var(--mono); font-size: 0.75rem; text-transform: lowercase;
  text-decoration: none; opacity: 0.85; transition: opacity 0.2s;
}
.nav__links a:hover { opacity: 1; }
.nav__cta { padding: 8px 14px; border: 1px solid currentColor; border-radius: 999px; }
@media (max-width: 720px) { .nav__links a:not(.nav__cta) { display: none; } }

/* ───────── hero ───────── */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center;
  padding: 120px var(--gutter) 80px;
  overflow: hidden;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 20% 55%, rgba(11,11,15,0.85), transparent 70%),
    linear-gradient(to bottom, transparent 70%, var(--bg));
}
.hero__inner { position: relative; z-index: 2; max-width: var(--max); width: 100%; margin: 0 auto; pointer-events: none; }
.hero__inner a, .hero__inner button { pointer-events: auto; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 0.78rem; color: var(--ink-2);
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(18, 18, 25, 0.6); backdrop-filter: blur(8px);
  margin: 0 0 32px;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #5be38a; box-shadow: 0 0 0 0 rgba(91, 227, 138, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(91, 227, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(91, 227, 138, 0); } }

.hero__title {
  font-family: var(--serif);
  font-size: clamp(3rem, 9.5vw, 9.5rem);
  line-height: 0.92; letter-spacing: -0.02em;
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero__title .line > * { display: inline-block; }
.hero__title .line:first-child { font-size: 0.42em; color: var(--ink-2); margin-bottom: 0.25em; font-style: italic; }
.hero__title .line { animation: rise 1.1s var(--ease) both; }
.hero__title .line:nth-child(2) { animation-delay: 0.1s; }
.hero__title .line:nth-child(3) { animation-delay: 0.2s; }
@keyframes rise { from { opacity: 0; transform: translateY(40%); } to { opacity: 1; transform: none; } }

.rotator { position: relative; color: var(--accent); font-style: italic; }
.rotator__word { display: inline-block; transition: transform 0.6s var(--ease), opacity 0.6s var(--ease), filter 0.6s; }
.rotator__word.is-out { transform: translateY(-60%); opacity: 0; filter: blur(8px); }
.rotator__word.is-in { transform: translateY(60%); opacity: 0; filter: blur(8px); transition: none; }

.hero__lede {
  max-width: 34ch; margin: 36px 0 0;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--ink-2);
  animation: rise 1.1s 0.35s var(--ease) both;
}
.hero__hint { margin-top: 40px; color: var(--muted); animation: rise 1.1s 0.5s var(--ease) both; }
.hero__hint span::before { content: "↖ "; color: var(--accent); }
@media (hover: none) { .hero__hint { display: none; } }

.scroll-cue {
  position: absolute; left: 50%; bottom: 28px; z-index: 2; transform: translateX(-50%);
  width: 26px; height: 42px; border: 1px solid var(--line); border-radius: 20px;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px;
  border-radius: 2px; background: var(--ink); animation: scroll 1.8s var(--ease) infinite;
}
@keyframes scroll { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(16px); } }

/* ───────── marquee ───────── */
.marquee {
  border-block: 1px solid var(--line);
  overflow: hidden; padding: 22px 0;
  background: var(--bg-2);
}
.marquee__track {
  display: flex; gap: 36px; width: max-content; align-items: center;
  animation: marquee 40s linear infinite;
  font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.6rem); white-space: nowrap;
}
.marquee__track i { font-style: normal; color: var(--accent); font-size: 0.6em; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ───────── sections ───────── */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(96px, 14vw, 180px) var(--gutter); }
.section__label { color: var(--muted); margin: 0 0 32px; display: flex; align-items: center; gap: 12px; }
.section__label::before { content: ""; width: 28px; height: 1px; background: var(--accent); }
.h2 { font-family: var(--serif); font-size: clamp(2.4rem, 6vw, 5rem); line-height: 1; letter-spacing: -0.015em; max-width: 18ch; }

/* reveal */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ───────── manifesto ───────── */
.manifesto__text {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4.2vw, 3.6rem);
  line-height: 1.15; letter-spacing: -0.01em; margin: 0; max-width: 26ch;
}
.manifesto__text .w { color: var(--ink); opacity: 0.14; transition: opacity 0.3s linear; }
.manifesto__text .w.on { opacity: 1; }

.principles {
  list-style: none; padding: 0; margin: clamp(80px, 10vw, 140px) 0 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  border-top: 1px solid var(--line);
}
.principle { padding: 32px 28px 36px 0; border-bottom: 1px solid var(--line); }
.principle:nth-child(2) { transition-delay: 0.08s; }
.principle:nth-child(3) { transition-delay: 0.16s; }
.principle:nth-child(4) { transition-delay: 0.24s; }
.principle__n { color: var(--accent); }
.principle h3 { font-family: var(--serif); font-size: 2rem; line-height: 1.05; margin: 18px 0 14px; }
.principle p { color: var(--ink-2); font-size: 1rem; margin: 0; max-width: 30ch; }

/* ───────── equation ───────── */
.equation {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center;
}
@media (max-width: 860px) { .equation { grid-template-columns: 1fr; } }
.equation__copy > p { color: var(--ink-2); max-width: 44ch; }
.equation__copy .h2 { margin-bottom: 28px; }
.formula { color: var(--ink); background: var(--bg-3); padding: 2px 8px; border-radius: 6px; font-size: 0.9em; }

.slider { margin: 36px 0 20px; display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
.slider label { color: var(--muted); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(to right, var(--accent) var(--p, 20%), var(--line) var(--p, 20%)); border-radius: 2px; }
input[type="range"]::-moz-range-track { height: 2px; background: var(--line); }
input[type="range"]::-moz-range-progress { height: 2px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -10px; border-radius: 50%; background: var(--ink); border: 4px solid var(--accent); transition: transform 0.2s; }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 4px solid var(--accent); }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.2); }

.equation__stats { display: flex; gap: 48px; margin: 8px 0 16px; }
.equation__stats dt { color: var(--muted); }
.equation__stats dd { margin: 4px 0 0; font-family: var(--serif); font-size: clamp(3rem, 6vw, 4.5rem); line-height: 1; font-variant-numeric: tabular-nums; }
.equation__stats div:last-child dd { color: var(--accent); }
.equation__verdict { color: var(--ink-2); min-height: 2.6em; font-size: 0.85rem; }

.equation__viz { position: relative; aspect-ratio: 1; width: 100%; max-width: 560px; justify-self: center; }
.equation__viz::before {
  content: ""; position: absolute; inset: 8%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 107, 61, 0.12), transparent 65%);
  transition: opacity 0.4s;
}
.equation__viz svg { position: relative; width: 100%; height: 100%; overflow: visible; }
.eq-lines line { stroke: var(--accent); stroke-width: 0.7; stroke-linecap: round; opacity: 0.55; }
.eq-nodes circle { fill: var(--bg); stroke: var(--ink); stroke-width: 1.5; transition: cx 0.6s var(--ease), cy 0.6s var(--ease); }

/* ───────── numbers ───────── */
.numbers {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--line);
  background: var(--bg-2);
}
@media (max-width: 860px) { .numbers { grid-template-columns: repeat(2, 1fr); } }
.number { padding: clamp(28px, 4vw, 56px) var(--gutter); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.number:last-child { border-right: 0; }
@media (max-width: 860px) {
  .number:nth-child(2) { border-right: 0; }
  .number:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
.number__v { font-family: var(--serif); font-size: clamp(3.5rem, 7vw, 6rem); line-height: 1; font-variant-numeric: tabular-nums; }
.number__l { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }

/* ───────── journey ───────── */
.timeline { list-style: none; padding: 0; margin: clamp(56px, 8vw, 100px) 0 0; position: relative; }
.stop {
  display: grid; grid-template-columns: minmax(120px, 220px) 1fr; gap: 24px;
  padding: 36px 0; border-top: 1px solid var(--line); position: relative;
}
.stop::before {
  content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 0;
  background: var(--accent); transition: width 1.4s var(--ease) 0.2s;
}
.stop.is-visible::before { width: 100%; }
.stop__year { font-family: var(--serif); font-size: clamp(2.4rem, 4vw, 3.4rem); line-height: 1; color: var(--ink); }
.stop__year small { display: block; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); margin-top: 8px; }
.stop__body h3 { font-family: var(--sans); font-size: 1.35rem; font-weight: 500; }
.stop__body .at { color: var(--accent); font-family: var(--serif); font-style: italic; font-size: 1.15em; font-weight: 400; }
.stop__body p { color: var(--ink-2); margin: 10px 0 16px; max-width: 60ch; font-size: 1.02rem; }
.stop--edu .stop__year { color: var(--accent-2); }
.stop--edu .at { color: var(--accent-2); }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); }
@media (max-width: 640px) { .stop { grid-template-columns: 1fr; gap: 12px; } }

/* ───────── side quests ───────── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: clamp(48px, 7vw, 80px); }
.card {
  --mx: 50%; --my: 50%;
  position: relative; display: flex; flex-direction: column; gap: 12px;
  padding: 32px; min-height: 300px; text-decoration: none;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 20px;
  overflow: hidden; isolation: isolate;
  transition: transform 0.5s var(--ease), border-color 0.3s, opacity 1s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(400px circle at var(--mx) var(--my), rgba(255, 107, 61, 0.18), transparent 50%);
}
.card:hover { border-color: rgba(255, 107, 61, 0.4); transform: translateY(-6px); }
.card:hover::before { opacity: 1; }
.card:nth-child(2) { transition-delay: 0.08s; }
.card:nth-child(3) { transition-delay: 0.16s; }
.card__icon { font-size: 2rem; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 14px; background: var(--bg-3); }
.card h3 { font-family: var(--serif); font-size: 2.2rem; margin-top: auto; }
.card p { color: var(--ink-2); margin: 0; font-size: 1rem; }
.card__link { color: var(--accent); margin-top: 8px; }
.card--soon h3::after { content: "soon"; font-family: var(--mono); font-size: 0.7rem; vertical-align: middle; margin-left: 10px; padding: 3px 8px; border-radius: 999px; background: var(--accent-2); color: var(--bg); }

/* ───────── contact ───────── */
.contact {
  position: relative; overflow: hidden;
  padding: clamp(110px, 16vw, 220px) var(--gutter);
  text-align: center;
  background:
    radial-gradient(ellipse 50% 60% at 50% 100%, rgba(255, 107, 61, 0.22), transparent 70%),
    var(--bg);
  border-top: 1px solid var(--line);
}
.contact .section__label { justify-content: center; }
.contact__title { font-family: var(--serif); font-size: clamp(4.5rem, 18vw, 16rem); line-height: 0.85; letter-spacing: -0.03em; }
.contact__lede { color: var(--ink-2); max-width: 40ch; margin: 32px auto 0; font-size: 1.15rem; }
.contact__actions { display: flex; flex-direction: column; align-items: center; gap: 28px; margin-top: 48px; }
.copy {
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 20px 32px; cursor: pointer; color: var(--ink); max-width: 100%;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px;
  transition: border-color 0.3s, transform 0.3s var(--ease), background 0.3s;
}
.copy:hover { border-color: var(--accent); transform: scale(1.03); }
.copy__text { font-size: clamp(0.9rem, 2.4vw, 1.25rem); overflow-wrap: anywhere; }
.copy__hint { color: var(--muted); font-size: 0.7rem; }
.copy.is-copied { border-color: #5be38a; }
.copy.is-copied .copy__hint { color: #5be38a; }
.socials { display: flex; gap: 28px; flex-wrap: wrap; justify-content: center; }
.socials a { text-decoration: none; font-size: 0.85rem; color: var(--ink-2); transition: color 0.2s; }
.socials a:hover { color: var(--accent); }

/* ───────── footer ───────── */
.footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 24px var(--gutter); color: var(--muted); border-top: 1px solid var(--line);
}

/* ───────── motion prefs ───────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .manifesto__text .w { opacity: 1; }
  .grain { display: none; }
}
