/* ===================== Tokens ===================== */
:root {
  --bg: #0a0f0d;
  --bg-soft: #101714;
  --fg: #e9f2ee;
  --fg-dim: #9db3ac;
  --accent: #3dffa0;
  --accent-dim: #1f7a52;
  --amber: #ffcc33;
  --line: rgba(233, 242, 238, 0.14);
  --overlay: rgba(6, 10, 9, 0.72);
  --overlay-strong: rgba(4, 7, 6, 0.85);

  --light-bg: #f3f5f3;
  --light-fg: #10161a;
  --light-fg-dim: #4c5a56;
  --accent-on-light: #0e6440;
  --amber-on-light: #8a6200;

  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --panel-pad-x: clamp(1.25rem, 5vw, 4rem);
  color-scheme: dark;
}

/* ===================== Reset ===================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.65;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
code {
  font-family: var(--font-mono);
  background: rgba(255,255,255,0.08);
  padding: 0.1em 0.45em;
  border-radius: 4px;
  font-size: 0.9em;
}
h1, h2, h3 {
  font-family: var(--font-mono);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.6rem, 7.5vw, 5.6rem); }
h2 { font-size: clamp(2.1rem, 5.4vw, 3.4rem); }
h3 { font-size: clamp(1.2rem, 2.8vw, 1.5rem); margin-bottom: 0.4em; }
p { margin: 0 0 1.1em; color: var(--fg-dim); font-size: 1.05rem; }
p strong { color: var(--fg); font-weight: 600; }
.accent { color: var(--accent); }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #04140c;
  padding: 0.6em 1em;
  z-index: 999;
  font-family: var(--font-mono);
  font-weight: 700;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ===================== Nav ===================== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(8, 12, 11, 0.7);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid transparent;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease, border-color 0.35s ease;
}
.site-nav.is-visible {
  transform: translateY(0);
  opacity: 1;
  border-bottom-color: var(--line);
}
.site-nav__brand {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--fg);
  font-size: 1.05rem;
  white-space: nowrap;
}
.site-nav__links {
  display: flex;
  gap: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
.site-nav__links a { color: var(--fg-dim); }
.site-nav__links a:hover { color: var(--accent); }
@media (max-width: 720px) {
  .site-nav__links { display: none; }
}

/* ===================== Buttons ===================== */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85em 1.6em;
  border-radius: 6px;
  border: 1.5px solid var(--accent);
  text-decoration: none !important;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn--accent { background: var(--accent); color: #04140c; }
.btn--accent:hover { background: #6bffbb; transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn--small { padding: 0.55em 1.1em; font-size: 0.85rem; }

/* ===================== Panel mechanics ===================== */
/* Text panels are solid black/white, alternating, so copy stays fully
   readable -- no background photo ever sits under running text. Only the
   hero (canvas) and the two standalone ROIHU photo beats use imagery. */
.panel {
  position: relative;
  isolation: isolate;
  scroll-margin-top: 64px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 6rem var(--panel-pad-x);
}

.content-block { max-width: 46rem; }
.content-block--wide { max-width: 56rem; }
.content-block--center { max-width: 60rem; margin: 0 auto; text-align: center; }

.eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  text-transform: lowercase;
  letter-spacing: 0.02em;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.7em;
}

/* ===================== Hero ===================== */
.panel--hero { background: var(--bg); padding-top: 8rem; }
#matrix-canvas {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  opacity: 0.5;
}
.hero-radial {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 30%, rgba(10, 20, 16, 0.35) 0%, rgba(6, 10, 9, 0.9) 70%);
}
.hero-content h1 { color: var(--fg); }
.hero-lede { font-size: 1.3rem; max-width: 42rem; }
.hero-terminal {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  display: block;
  width: min(40ch, 92vw);
  margin-bottom: 1.8rem;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
}
.hero-terminal__prompt { color: var(--fg-dim); margin-right: 0.6ch; }
.cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.hero-deadline { font-family: var(--font-mono); font-size: 0.9rem; color: var(--fg-dim); }
.hero-deadline strong { color: var(--amber); }

.scroll-cue {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: var(--fg-dim);
  font-size: 1.4rem;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ===================== Skills ===================== */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.8rem 0;
}
@media (max-width: 780px) {
  .skills-grid { grid-template-columns: 1fr; }
}
.skill-card {
  background: rgba(10, 16, 14, 0.55);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.6rem;
}
.skill-card__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  padding: 0.25em 0.7em;
  margin-bottom: 0.7rem;
  width: fit-content;
}
.skill-card__tag--amber { color: var(--amber); border-color: rgba(255, 204, 51, 0.4); }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  position: relative;
  padding-left: 2.2rem;
  margin-bottom: 0.75rem;
  color: var(--fg);
}
.checklist li::before {
  content: '[x]';
  position: absolute;
  left: 0;
  width: 1.8rem;
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85em;
}
.checklist--desired li::before { content: '[+]'; color: var(--amber); }
.skills-note { margin-top: 1.5rem; }

/* ===================== Timeline ===================== */
.timeline { list-style: none; margin: 2rem 0 0; padding: 0; border-left: 2px solid var(--line); }
.timeline__item {
  position: relative;
  padding: 0 0 2.2rem 2rem;
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__marker {
  position: absolute;
  left: -1.55rem;
  top: -0.15rem;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.timeline__item h3 { color: var(--fg); margin-bottom: 0.3em; }
.timeline__item p { margin-bottom: 0; }

/* ===================== Photo beat (ROIHU) ===================== */
.panel--photo {
  padding: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
.panel--photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 10, 9, 0) 78%, rgba(6, 10, 9, 0.55) 100%);
}
.photo-credit {
  position: absolute;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg);
  background: rgba(6, 10, 9, 0.55);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35em 0.9em;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ===================== Apply ===================== */
.apply-box {
  background: rgba(10, 16, 14, 0.55);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 1.4rem 1.6rem;
  margin: 1.6rem 0;
}
.apply-box__label {
  font-family: var(--font-mono);
  color: var(--fg);
  font-weight: 700;
  margin-bottom: 0.8em;
}
.apply-fineprint { opacity: 0.85; }

/* ===================== Light panels ===================== */
/* Alternating solid black/white sections (About, Skills, Apply, Partners
   all light; Meet ROIHU, Timeline, Contact dark) mean every color that
   isn't the plain body/heading color needs an explicit light-mode value,
   since bright accent-on-dark colors read poorly on white. */
.panel--light {
  background: var(--light-bg);
  color: var(--light-fg);
  padding: 6rem var(--panel-pad-x);
}
.panel--light .eyebrow { color: var(--accent-on-light); }
.panel--light h2, .panel--light h3 { color: var(--light-fg); }
.panel--light p { color: var(--light-fg-dim); }
.panel--light p strong { color: var(--light-fg); }
.panel--light a { color: var(--accent-on-light); }
.panel--light code { background: rgba(16, 22, 26, 0.08); }

.panel--light .checklist li { color: var(--light-fg); }
.panel--light .checklist li::before { color: var(--accent-on-light); }
.panel--light .checklist--desired li::before { color: var(--amber-on-light); }

.panel--light .skill-card {
  background: rgba(16, 22, 26, 0.035);
  border-color: rgba(16, 22, 26, 0.14);
}
.panel--light .skill-card__tag {
  color: var(--accent-on-light);
  border-color: rgba(14, 100, 64, 0.35);
}
.panel--light .skill-card__tag--amber {
  color: var(--amber-on-light);
  border-color: rgba(138, 98, 0, 0.35);
}

.panel--light .apply-box {
  background: rgba(16, 22, 26, 0.035);
  border-color: rgba(16, 22, 26, 0.14);
  border-left-color: var(--accent-on-light);
}
.panel--light .apply-box__label { color: var(--light-fg); }

.logo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 2.5rem;
  margin-top: 2.5rem;
}
@media (max-width: 780px) {
  .logo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.logo-grid__item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  filter: grayscale(0%);
  transition: transform 0.2s ease;
}
.logo-grid__item:hover { transform: translateY(-3px); }
.logo-grid__item img { max-height: 64px; width: auto; }

/* ===================== Contact (dark solid) ===================== */
.panel--dark-solid {
  background: linear-gradient(180deg, var(--bg-soft), var(--bg));
  padding: 6rem var(--panel-pad-x) 5rem;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
}
.contact-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.6rem;
  text-align: left;
}
.contact-card p { margin-bottom: 1.1em; }

/* ===================== Footer ===================== */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 2rem var(--panel-pad-x) 3rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--fg-dim);
}
.site-footer p { margin: 0.3em 0; color: inherit; }
.site-footer__fine { opacity: 0.7; }

/* ===================== Reveal animation ===================== */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ===================== Reduced motion ===================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .cursor { animation: none; opacity: 1; }
  .scroll-cue { animation: none; }
  .site-nav { transition: none; }
  .btn, .logo-grid__item { transition: none; }
}

/* ===================== Small-screen tuning ===================== */
@media (max-width: 560px) {
  .panel { padding-top: 5rem; padding-bottom: 4rem; }
  .panel--hero { padding-top: 6.5rem; }
  .panel--photo { padding: 0; }
  .hero-ctas .btn { width: 100%; text-align: center; }
}

/* background-attachment:fixed is a no-op on iOS Safari (never
   implemented) -- it just falls back to a normal scrolling background,
   so disable it outright there to avoid any janky/partial behavior and
   let the image scroll normally instead. */
@supports (-webkit-touch-callout: none) {
  .panel--photo {
    background-attachment: scroll;
  }
}
