/* ==========================================================
   Oscar Lu: storyboard site, v1
   Look: storyboard paper, ink, one red-pencil accent.
   ========================================================== */

:root {
  --paper: #f4f1ea;
  --paper-2: #ebe6db;
  --ink: #161513;
  --muted: #6b665d;
  --line: rgba(22, 21, 19, 0.14);
  --accent: #d6452b; /* red pencil */

  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --rail: 88px; /* width of the left timeline rail */
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141311;
    --paper-2: #1d1b18;
    --ink: #eeeae1;
    --muted: #a39d92;
    --line: rgba(238, 234, 225, 0.14);
    --accent: #ff6a4d;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------- Shared bits ---------- */

.label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 16px;
}

.resume-pill {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
  padding: 8px 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.resume-pill:hover { background: var(--ink); color: var(--paper); }

/* ---------- Left rail ---------- */

.rail {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--rail);
  z-index: 5;
  pointer-events: none;
}
.rail-line {
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 40px;
  width: 2px;
  background: var(--line);
}
.rail-fill {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: top;
  transform: scaleY(0);
}
.rail-year {
  position: absolute;
  top: 50%;
  left: 52px;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: left center;
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  opacity: 0.18;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- Scenes ---------- */

.scene {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 96px 24px 96px calc(var(--rail) + 24px);
  border-bottom: 1px dashed var(--line);
}
.scene-inner {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}
.scene-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: center;
}
/* Alternate the photo side every other chapter */
.scene:nth-of-type(odd) .scene-grid .frame { order: -1; }

h1, h2 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 24px;
}
h2 { font-size: clamp(34px, 5vw, 56px); }

.scene-body p { margin: 0 0 14px; max-width: 34em; }

.proof {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.proof li {
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper-2);
}

blockquote {
  margin: 28px 0 0;
  padding-left: 16px;
  border-left: 2px solid var(--accent);
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--muted);
}

/* Storyboard frame (photo or placeholder) */
.frame { margin: 0; }
.frame img,
.frame-empty {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
}
.frame-empty {
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  background:
    repeating-linear-gradient(45deg, transparent 0 10px, var(--line) 10px 11px),
    var(--paper-2);
}
.frame-empty span { background: var(--paper); padding: 6px 10px; max-width: 26em; }
.frame figcaption {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* Cold open */
.scene--open .open-name {
  font-size: clamp(64px, 13vw, 168px);
  margin-bottom: 20px;
}
.open-tagline {
  font-family: var(--serif);
  font-size: clamp(22px, 3vw, 32px);
  max-width: 22em;
  margin: 0 0 32px;
}
.open-sub { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.scroll-cue { display: inline-block; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(6px); } }

/* Next chapter */
.next-body { max-width: 30em; font-size: 19px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.cta a:not(.btn) { font-family: var(--mono); font-size: 13px; align-self: center; }
.btn {
  display: inline-block;
  padding: 12px 20px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-weight: 500;
  text-decoration: none;
}
.btn--primary { background: var(--ink); color: var(--paper); }
.blank-page {
  margin-top: 64px;
  height: 120px;
  border: 1.5px dashed var(--line);
  border-radius: 2px;
  padding: 16px;
}
.cursor {
  display: inline-block;
  width: 2px;
  height: 22px;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.noscript { padding: 48px; }

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue, .cursor { animation: none; }
}

/* ---------- Mobile ---------- */

@media (max-width: 800px) {
  :root { --rail: 0px; }
  body { font-size: 16px; }
  .rail { display: none; }
  .scene { padding: 72px 16px 88px; min-height: auto; }
  .scene--open { min-height: 100svh; }
  .scene-grid { grid-template-columns: 1fr; gap: 28px; }
  .scene:nth-of-type(odd) .scene-grid .frame { order: 0; }
  /* Resume pill becomes a bottom bar */
  .resume-pill {
    top: auto;
    bottom: 12px;
    left: 16px;
    right: 16px;
    text-align: center;
    padding: 12px;
  }
}

/* ==========================================================
   Resume page
   ========================================================== */

.resume-page { font-size: 15px; line-height: 1.5; }

.resume-nav {
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 13px;
}
.resume-nav button {
  font: inherit;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}

.resume {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}
.resume header { border-bottom: 2px solid var(--ink); padding-bottom: 12px; margin-bottom: 8px; }
.resume h1 { font-size: 40px; margin: 0 0 6px; }
.resume header p { margin: 0; color: var(--muted); }
.resume h2 {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 24px 0 8px;
}
.entry { margin-bottom: 12px; }
.entry-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.entry-place { color: var(--muted); }
.entry-dates { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.entry-detail { margin: 2px 0 0; }
.entry ul { margin: 4px 0 0; padding-left: 18px; }
.entry li { margin-bottom: 2px; }
.resume section > p { margin: 4px 0; }

@media print {
  :root { --paper: #fff; --ink: #000; --muted: #444; --accent: #000; }
  .resume-nav { display: none; }
  .resume { padding: 0; max-width: none; }
  .resume-page { font-size: 10.5pt; }
  .resume h1 { font-size: 22pt; }
  a { text-decoration: none; }
  @page { margin: 0.5in; }
}
