/* =========================================================================
   Public resume site
   Palette kept: ink / paper / vermillion.
   Everything else: kinetic type, sticky stacked project cards, film grain,
   custom cursor, vertical section rail, outline marquee.
   ========================================================================= */

:root {
  --ink: #0b0b0c;
  --ink-2: #121215;
  --paper: #f4f1ea;
  --muted: #8b8880;
  --accent: #ff3b1f;
  --line: rgba(244, 241, 234, 0.14);
  --line-strong: rgba(244, 241, 234, 0.32);

  --display: "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --quote: "Playfair Display", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --pad: clamp(20px, 5vw, 72px);
  --rail: 0px;
  --rule: 1px solid var(--line);
  --ease: cubic-bezier(.2, .7, .3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-inline-start: var(--rail);
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ============================================================ atmosphere */
/* film grain — makes flat dark surfaces feel like printed paper */
.grain {
  position: fixed; inset: -120px; z-index: 3; pointer-events: none;
  opacity: .32; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%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)' opacity='.5'/%3E%3C/svg%3E");
  animation: grainshift 700ms steps(2) infinite;
}
@keyframes grainshift {
  0% { transform: translate(0, 0); }
  50% { transform: translate(-14px, 9px); }
  100% { transform: translate(9px, -12px); }
}
@media (prefers-reduced-motion: reduce) { .grain { animation: none; } }

/* scroll progress hairline */
.progress {
  position: fixed; top: 0; inset-inline: 0; height: 2px; z-index: 60;
  background: var(--accent); transform-origin: 0 50%; transform: scaleX(0);
  will-change: transform;
}

/* custom cursor (pointer devices only) */
.cursor, .cursor-ring { position: fixed; top: 0; left: 0; z-index: 70; pointer-events: none; border-radius: 50%; }
.cursor { width: 6px; height: 6px; background: var(--accent); margin: -3px 0 0 -3px; }
.cursor-ring {
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1px solid var(--line-strong);
  transition: width .25s var(--ease), height .25s var(--ease), margin .25s var(--ease),
              border-color .25s var(--ease), background .25s var(--ease);
}
.cursor-ring.hot {
  width: 62px; height: 62px; margin: -31px 0 0 -31px;
  border-color: var(--accent); background: rgba(255, 59, 31, .08);
}
@media (hover: none), (pointer: coarse) { .cursor, .cursor-ring { display: none; } }

/* ================================================================= shell */
.wrap { max-width: 1280px; margin: 0 auto; padding-inline: var(--pad); }

header.top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 14px var(--pad);
  background: rgba(11, 11, 12, .72);
  backdrop-filter: blur(14px);
  border-bottom: var(--rule);
}
.mark { font-family: var(--mono); font-weight: 500; font-size: 13px; letter-spacing: .22em; text-transform: uppercase; }
.mark b { color: var(--accent); }
header.top nav { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
header.top nav a {
  position: relative; font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); padding: 9px 12px;
  transition: color .2s var(--ease);
}
header.top nav a:not(.cta)::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 5px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .32s var(--ease);
}
header.top nav a:not(.cta):hover { color: var(--paper); }
header.top nav a:not(.cta):hover::after { transform: scaleX(1); }
header.top nav a.cta {
  color: var(--ink); background: var(--paper); font-weight: 600; border-radius: 2px;
  transition: background .22s var(--ease), color .22s var(--ease);
}
header.top nav a.cta:hover { background: var(--accent); color: #fff; }
@media (max-width: 760px) { header.top nav a.hide-sm { display: none; } }

/* vertical section rail */
.rail {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: 74px; z-index: 40;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 30px; border-inline-end: var(--rule); background: rgba(11, 11, 12, .6);
}
.rail a {
  writing-mode: vertical-rl; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .3em; text-transform: uppercase; color: var(--muted);
  padding: 6px 0; transition: color .28s var(--ease), transform .28s var(--ease);
}
.rail a:hover { color: var(--paper); }
.rail a.active { color: var(--accent); transform: scale(1.06); }
.rail .tick { width: 1px; height: 34px; background: var(--line); }
@media (min-width: 1180px) {
  :root { --rail: 74px; }
  .rail { display: flex; }
}

/* ============================================================== sections */
section { padding-block: clamp(78px, 11vw, 156px); border-top: var(--rule); position: relative; }
section:first-of-type { border-top: 0; }

.marker {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .24em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 40px;
}
.marker::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.marker b { color: var(--accent); font-weight: 500; }

h2.big {
  font-family: var(--display); font-size: clamp(38px, 7.2vw, 92px);
  font-weight: 800; letter-spacing: -.045em; line-height: .92; margin: 0 0 46px;
  text-wrap: balance;
}

/* =================================================================== hero */
.hero { padding-block: clamp(60px, 10vw, 130px) clamp(40px, 6vw, 84px); position: relative; overflow: hidden; }
/* pointer-tracked glow */
.hero::before {
  content: ""; position: absolute; width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,59,31,.13), transparent 68%);
  left: var(--mx, 50%); top: var(--my, 40%); transform: translate(-50%, -50%);
  pointer-events: none; transition: opacity .5s var(--ease); opacity: 0;
}
.hero.lit::before { opacity: 1; }
/* Touch devices have no pointer to follow, so the glow drifts on its own —
   and jumps to your finger while you touch the hero. */
.hero.ambient::before {
  animation: drift 11s ease-in-out infinite alternate;
}
@keyframes drift {
  from { left: 26%; top: 34%; }
  to   { left: 74%; top: 56%; }
}
@media (prefers-reduced-motion: reduce) { .hero.ambient::before { animation: none; } }

.hero .status {
  display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono);
  font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 26px;
}
.dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 rgba(255, 59, 31, .55); animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 11px rgba(255, 59, 31, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 31, 0); }
}

.hero h1 {
  font-family: var(--display); font-size: clamp(52px, 13.5vw, 190px);
  font-weight: 900; line-height: .82; letter-spacing: -.055em; margin: 0;
  text-transform: uppercase; position: relative; z-index: 1;
}
/* each line rises out of its own mask on load */
.line-mask { display: block; overflow: hidden; }
.line-mask > span {
  display: block; transform: translateY(105%);
  animation: rise 1.05s var(--ease) forwards;
}
.line-mask:nth-of-type(2) > span { animation-delay: .12s; }
@keyframes rise { to { transform: translateY(0); } }
.hero h1 .period { color: var(--accent); }
/* JS sets an exact font-size so each line spans the column edge to edge.
   inline-block is deliberate: a block would report the container width when
   measured, not the width of the text itself. */
.hero h1 .fit { display: inline-block; white-space: nowrap; font-optical-sizing: none; }
/* the second line is outlined, not filled — fills in on hover */
.hero h1 .outline {
  color: transparent; -webkit-text-stroke: 2px var(--paper);
  transition: color .5s var(--ease), -webkit-text-stroke-color .5s var(--ease);
}
.hero h1:hover .outline { color: var(--paper); }
@media (max-width: 620px) { .hero h1 .outline { -webkit-text-stroke-width: 1.4px; } }

.hero .statement {
  font-family: var(--display); font-size: clamp(21px, 2.9vw, 38px); font-weight: 600;
  letter-spacing: -.02em; line-height: 1.22; margin: clamp(34px, 5vw, 58px) 0 0;
  max-width: 20ch; text-wrap: balance; position: relative; z-index: 1;
}
.hero .meta {
  display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 26px;
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 42px; position: relative; z-index: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 15px 24px;
  border: 1px solid var(--line-strong); border-radius: 2px; position: relative;
  font-family: var(--mono); font-size: 12px; letter-spacing: .16em;
  text-transform: uppercase; cursor: pointer; overflow: hidden; isolation: isolate;
  transition: color .28s var(--ease), border-color .28s var(--ease);
}
/* wipe fill from the bottom on hover */
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--accent);
  transform: translateY(101%); transition: transform .38s var(--ease);
}
.btn:hover { color: #fff; border-color: var(--accent); }
.btn:hover::before { transform: translateY(0); }
.btn.solid { background: var(--paper); color: var(--ink); border-color: var(--paper); font-weight: 600; }
.btn svg { width: 15px; height: 15px; }

.scroll-cue {
  margin-top: 54px; display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .24em;
  text-transform: uppercase; color: var(--muted);
}
.scroll-cue i {
  display: block; width: 42px; height: 1px; background: var(--line-strong); position: relative; overflow: hidden;
}
.scroll-cue i::after {
  content: ""; position: absolute; inset: 0; background: var(--accent);
  transform: translateX(-100%); animation: sweep 2.1s var(--ease) infinite;
}
@keyframes sweep { 60%, 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .scroll-cue i::after { animation: none; } }

/* =============================================================== marquee */
.band { border-block: var(--rule); overflow: hidden; padding: 22px 0; }
.band + .band { border-top: 0; }
.track { display: flex; width: max-content; animation: slide 38s linear infinite; }
.track.rev { animation-direction: reverse; }
.track span {
  font-family: var(--display); font-weight: 800; font-size: clamp(30px, 5vw, 62px);
  letter-spacing: -.04em; text-transform: uppercase; padding-inline-end: 44px;
  color: transparent; -webkit-text-stroke: 1px var(--line-strong);
  white-space: nowrap;
}
.track span:nth-child(even) { color: var(--paper); -webkit-text-stroke-width: 0; }
.track span em { color: var(--accent); font-style: normal; -webkit-text-stroke: 0; }
@keyframes slide { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .track { animation: none; } }

/* ================================================================= about */
.about-grid { display: grid; grid-template-columns: 1fr; gap: clamp(32px, 5vw, 64px); }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1.3fr 1fr; } }
.pull {
  font-family: var(--quote); font-style: italic; font-size: clamp(26px, 3.7vw, 50px);
  line-height: 1.16; margin: 0 0 30px; text-wrap: balance;
}
.pull b { color: var(--accent); font-weight: 400; }
.about-body p { color: rgba(244,241,234,.82); margin: 0 0 18px; max-width: 62ch; white-space: pre-line; }
.facts { display: grid; gap: 1px; background: var(--line); border: var(--rule); }
.fact { background: var(--ink); padding: 22px 24px; transition: background .3s var(--ease); }
.fact:hover { background: var(--ink-2); }
.fact b {
  display: block; font-family: var(--display); font-size: clamp(30px, 4vw, 48px);
  font-weight: 800; letter-spacing: -.04em; line-height: 1;
}
.fact:hover b { color: var(--accent); }
.fact span { font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.portrait {
  width: 100%; aspect-ratio: 4/5; object-fit: cover; border: var(--rule);
  filter: grayscale(1) contrast(1.06); transition: filter .45s var(--ease);
}
.portrait:hover { filter: grayscale(0) contrast(1); }

/* ================================================================== rows */
.rows { border-top: var(--rule); }
.row-item {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 28px;
  padding: clamp(26px, 3.4vw, 46px) 0; border-bottom: var(--rule);
  position: relative; isolation: isolate;
}
/* accent wash sweeps in from the start edge on hover */
.row-item::before {
  content: ""; position: absolute; inset: 0 0 0 -100%; z-index: -1;
  background: linear-gradient(90deg, transparent, rgba(255,59,31,.07));
  transition: inset .5s var(--ease);
}
.row-item:hover::before { inset: 0; }
.row-item .idx {
  font-family: var(--display); font-weight: 800; font-size: clamp(26px, 3.4vw, 46px);
  line-height: 1; letter-spacing: -.04em; color: transparent;
  -webkit-text-stroke: 1px var(--line-strong); transition: -webkit-text-stroke-color .35s var(--ease), color .35s var(--ease);
}
.row-item:hover .idx { -webkit-text-stroke-color: var(--accent); }
.row-item h3 {
  font-family: var(--display); font-size: clamp(24px, 3.4vw, 46px); font-weight: 700;
  letter-spacing: -.035em; line-height: 1.04; margin: 0; transition: transform .35s var(--ease);
}
.row-item:hover h3 { transform: translateX(8px); }
.row-item .at { color: var(--muted); font-weight: 500; }
.row-item .period {
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin-top: 10px;
}
.row-item ul.bullets { margin: 16px 0 0; padding: 0; list-style: none; max-width: 68ch; }
.row-item ul.bullets li { position: relative; padding-inline-start: 24px; margin-bottom: 8px; color: rgba(244,241,234,.78); }
.row-item ul.bullets li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 12px; width: 10px; height: 1px;
  background: var(--accent); transform-origin: 0 50%; transform: scaleX(.4);
  transition: transform .35s var(--ease);
}
.row-item:hover ul.bullets li::before { transform: scaleX(1); }

/* ============================================================== projects */
/* cards stack on top of each other as you scroll */
.stack { display: flex; flex-direction: column; gap: clamp(18px, 3vw, 30px); }
.card {
  position: sticky; top: calc(78px + var(--i) * 16px);
  background: var(--ink-2); border: var(--rule); border-radius: 3px;
  padding: clamp(26px, 3.6vw, 52px);
  display: grid; gap: 16px; grid-template-columns: 1fr;
  box-shadow: 0 -18px 44px rgba(0,0,0,.55);
  transition: border-color .35s var(--ease);
}
.card:hover { border-color: var(--line-strong); }
@media (min-width: 940px) { .card { grid-template-columns: 1fr auto; align-items: start; column-gap: 44px; } }
.card .body { display: flex; flex-direction: column; gap: 14px; }
.card .num {
  font-family: var(--display); font-weight: 900; font-size: clamp(46px, 8vw, 116px);
  line-height: .8; letter-spacing: -.06em; color: transparent;
  -webkit-text-stroke: 1.4px var(--line-strong); grid-row: span 2;
  transition: -webkit-text-stroke-color .4s var(--ease), color .4s var(--ease);
}
.card:hover .num { -webkit-text-stroke-color: var(--accent); }
.card h3 {
  font-family: var(--display); font-size: clamp(24px, 3.1vw, 42px); font-weight: 700;
  letter-spacing: -.035em; line-height: 1.06; margin: 0;
}
.card p { margin: 0; color: rgba(244,241,234,.78); max-width: 62ch; }
.card .stackrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.card .stackrow span {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; padding: 6px 11px;
  border: 1px solid var(--line); border-radius: 2px; color: var(--muted);
  transition: border-color .25s var(--ease), color .25s var(--ease);
}
.card:hover .stackrow span { border-color: var(--line-strong); color: var(--paper); }
.card a.visit {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); display: inline-flex; align-items: center; gap: 8px; margin-top: 4px;
}
.card a.visit span { transition: transform .3s var(--ease); }
.card a.visit:hover span { transform: translateX(6px); }

/* ================================================================ skills */
.skill-group { padding: 26px 0; border-bottom: var(--rule); display: grid; gap: 14px; }
@media (min-width: 780px) { .skill-group { grid-template-columns: 250px 1fr; align-items: start; } }
.skill-group h3 {
  font-family: var(--mono); font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); margin: 0; padding-top: 6px;
}
.tags { display: flex; flex-wrap: wrap; gap: 9px; }
.tags span {
  font-size: 14.5px; padding: 8px 15px; border: 1px solid var(--line); border-radius: 2px;
  position: relative; overflow: hidden; isolation: isolate;
  transition: color .28s var(--ease), border-color .28s var(--ease);
}
.tags span::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--accent);
  transform: translateY(101%); transition: transform .34s var(--ease);
}
.tags span:hover { color: #fff; border-color: var(--accent); }
.tags span:hover::before { transform: translateY(0); }

/* =============================================================== contact */
.contact h2 { margin-bottom: 26px; }
.mailto {
  font-family: var(--display); font-weight: 700; letter-spacing: -.03em;
  font-size: clamp(21px, 3.6vw, 48px); display: inline-block; word-break: break-all;
  position: relative; padding-bottom: 8px;
}
.mailto::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .4s var(--ease);
}
.mailto:hover { color: var(--accent); }
.mailto:hover::after { transform: scaleX(1); }
.links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 38px; }

footer {
  border-top: var(--rule); padding: 30px var(--pad) 46px;
  display: flex; flex-wrap: wrap; gap: 12px 26px; align-items: center;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
footer .spacer { margin-inline-start: auto; }
footer a.spacer { transition: color .25s var(--ease); }
footer a.spacer:hover { color: var(--accent); }

/* ================================================================ reveal */
.reveal { opacity: 0; transform: translateY(26px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .75s var(--ease), transform .75s var(--ease); }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in { opacity: 1; transform: none; transition: none; }
  .line-mask > span { animation: none; transform: none; }
  .grain { display: none; }
}
