/* Jared Gillespie portfolio
   One family (Archivo), width axis does the expressive work.
   Track colors come from the hero timeline and mean the same thing everywhere:
   pink = creator work, blue = builder work, green = class work, amber = now. */

:root {
  --paper: #edeff2;
  --surface: #ffffff;
  --ink: #1a1d24;
  --muted: #586070;
  --line: #cdd2da;
  --creator: #d63f72;
  --builder: #2f56e0;
  --class: #1c8a69;
  --playhead: #f0a202;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: 2.5rem;
  --step-4: clamp(2.75rem, 7vw, 5.5rem);

  --gutter: clamp(1rem, 4vw, 3rem);
  --max: 72rem;
  --measure: 38rem;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: var(--step-0);
  line-height: 1.55;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--playhead); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 3.75rem;
}
.wordmark {
  font-weight: 800; font-variation-settings: "wdth" 125;
  text-decoration: none; letter-spacing: -0.01em; font-size: 1.05rem;
}
.site-nav { display: flex; gap: clamp(0.75rem, 2.5vw, 1.75rem); font-size: var(--step--1); }
.site-nav a { text-decoration: none; color: var(--muted); padding: 0.4rem 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[data-track] { display: inline-flex; align-items: center; gap: 0.4rem; }
.site-nav a[data-track]::before {
  content: ""; width: 0.55rem; height: 0.55rem; border-radius: 2px; background: currentColor;
}
.site-nav a[data-track="creator"]::before { background: var(--creator); }
.site-nav a[data-track="builder"]::before { background: var(--builder); }
.site-nav a[data-track="class"]::before { background: var(--class); }
@media (max-width: 560px) {
  .site-nav .nav-contact { display: none; }
  .site-nav a[data-track]::before { display: none; }
}

/* ---------- hero ---------- */
.hero { padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero h1 {
  margin: 0;
  font-size: var(--step-4);
  line-height: 0.92;
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  letter-spacing: -0.03em;
}
.hero .lede {
  max-width: var(--measure);
  margin: 1.25rem 0 0;
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--muted);
}
.hero .lede strong { color: var(--ink); font-weight: 600; }

/* ---------- the timeline ---------- */
.timeline {
  margin-top: clamp(2rem, 5vw, 3rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.timeline-scroll { overflow-x: auto; }
.timeline-inner { --lw: 7.5rem; position: relative; min-width: 46rem; }
@media (max-width: 560px) { .timeline-inner { --lw: 5.5rem; min-width: 40rem; } }
.tl-row {
  display: grid;
  grid-template-columns: var(--lw) 1fr;
  border-bottom: 1px solid var(--line);
}
.tl-row:last-child { border-bottom: 0; }
.tl-label {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0 0.85rem;
  font-size: var(--step--1); font-weight: 600;
  border-right: 1px solid var(--line);
  background: #f6f7f9;
  position: sticky; left: 0; z-index: 3;
}
.tl-label::before { content: ""; flex-shrink: 0; width: 0.6rem; height: 0.6rem; border-radius: 2px; background: var(--c, var(--muted)); }
.tl-lane {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
  padding: 0.55rem 0;
  position: relative;
}
.tl-ruler .tl-label { background: #f6f7f9; color: var(--muted); font-weight: 500; }
.tl-ruler .tl-label::before { display: none; }
.tl-ruler .tl-lane { padding: 0.35rem 0; }
.tl-ruler span {
  font-size: 0.75rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
  border-left: 1px solid var(--line); padding-left: 0.35rem;
}
.clip {
  grid-row: 1;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 3.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 5px;
  background: color-mix(in srgb, var(--c) 14%, white);
  border: 1px solid color-mix(in srgb, var(--c) 45%, white);
  border-left: 4px solid var(--c);
  text-decoration: none;
  overflow: hidden;
  transition: background-color 0.15s;
}
.clip:hover { background: color-mix(in srgb, var(--c) 24%, white); }
.clip b { font-weight: 650; font-size: 0.875rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clip small { font-size: 0.75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.row-creator { --c: var(--creator); }
.row-builder { --c: var(--builder); }
.row-class   { --c: var(--class); }

.playhead {
  position: absolute; top: 0; bottom: 0;
  left: calc(var(--lw) + (100% - var(--lw)) * var(--at, 0.9));
  width: 2px; background: var(--playhead);
  pointer-events: none; z-index: 2;
}
.playhead::before {
  content: ""; position: absolute; top: 0; left: -6px;
  border: 7px solid transparent; border-top: 9px solid var(--playhead);
}
.playhead span {
  position: absolute; top: 0.3rem; right: 0.6rem;
  font-size: 0.75rem; font-weight: 700; white-space: nowrap;
  background: var(--playhead); color: var(--ink);
  padding: 0.05rem 0.4rem; border-radius: 3px;
}
.js .playhead { animation: sweep 1.6s cubic-bezier(.3,.7,.2,1) 0.2s both; }
@keyframes sweep { from { left: var(--lw); } }
@media (prefers-reduced-motion: reduce) { .js .playhead { animation: none; } }

.timeline-note { margin: 0.6rem 0 0; font-size: var(--step--1); color: var(--muted); }
.timeline-note .swipe { display: none; }
@media (max-width: 760px) { .timeline-note .swipe { display: inline; } }

/* ---------- sections ---------- */
.section { padding: clamp(3rem, 8vw, 5.5rem) 0; border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 0.75rem; margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }
.track-tag {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: var(--step--1); font-weight: 600; color: var(--c);
}
.track-tag::before { content: ""; flex-shrink: 0; width: 0.6rem; height: 0.6rem; border-radius: 2px; background: var(--c); }
.section h2 {
  margin: 0;
  font-size: var(--step-3);
  line-height: 1.02;
  font-weight: 800;
  font-variation-settings: "wdth" 118;
  letter-spacing: -0.02em;
  max-width: 20ch;
}
.section-head p { margin: 0; max-width: var(--measure); color: var(--muted); font-size: var(--step-1); line-height: 1.45; }
.sec-creator { --c: var(--creator); }
.sec-builder { --c: var(--builder); }
.sec-class   { --c: var(--class); }

h3 {
  margin: 0 0 0.5rem;
  font-size: var(--step-1);
  line-height: 1.2;
  font-weight: 700;
  font-variation-settings: "wdth" 108;
}
.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1em; }

/* ---------- builder: HookLab ---------- */
.product {
  display: grid; gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: 1fr;
}
@media (min-width: 880px) { .product { grid-template-columns: 1.25fr 1fr; } }
.facts { margin: 0; display: grid; gap: 0; align-content: start; border-top: 2px solid var(--builder); }
.facts div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.facts dt { font-size: var(--step--1); color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; font-size: 0.975rem; }
.pipeline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.pipeline span { background: color-mix(in srgb, var(--builder) 10%, white); border: 1px solid color-mix(in srgb, var(--builder) 35%, white); border-radius: 4px; padding: 0.05rem 0.45rem; font-size: 0.875rem; }
.pipeline i { font-style: normal; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.1rem; border-radius: 6px;
  font-weight: 650; font-size: 0.95rem; text-decoration: none;
  background: var(--ink); color: var(--paper); border: 0; cursor: pointer;
  font-family: inherit;
}
.btn:hover { background: #333845; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-ghost:hover { background: var(--surface); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* ---------- creator ---------- */
.stats {
  display: grid; grid-template-columns: repeat(2, 1fr);
  border-top: 2px solid var(--creator);
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 1rem 1rem 1rem 0; border-bottom: 1px solid var(--line); }
.stat b {
  display: block; font-size: var(--step-3); line-height: 1; font-weight: 800;
  font-variation-settings: "wdth" 112; font-variant-numeric: tabular-nums;
}
.stat span { display: block; margin-top: 0.4rem; font-size: var(--step--1); color: var(--muted); line-height: 1.35; }

.cases { display: grid; gap: 0; }
.case {
  display: grid; gap: 0.75rem 2.5rem;
  padding: clamp(1.5rem, 3vw, 2rem) 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 880px) { .case { grid-template-columns: 1.4fr 1fr; } }
.case .where { font-size: var(--step--1); color: var(--muted); margin: 0 0 0.35rem; }
.case p { margin: 0; max-width: var(--measure); }
.case dl { margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.85rem 1.25rem; align-content: start; }
.case dt { font-size: 0.8rem; color: var(--muted); }
.case dd { margin: 0; font-size: var(--step-1); font-weight: 750; font-variant-numeric: tabular-nums; font-variation-settings: "wdth" 110; }

.subhead { margin: clamp(2.5rem, 6vw, 4rem) 0 1.25rem; font-size: var(--step-2); font-weight: 800; font-variation-settings: "wdth" 115; letter-spacing: -0.01em; }

.shots {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
}
.shots figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.shots button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.shots img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; }
.shots figcaption { padding: 0.6rem 0.8rem; font-size: var(--step--1); color: var(--muted); border-top: 1px solid var(--line); }

.videos { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); align-items: start; }
.video { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.video .frame { position: relative; background: #e2e5ea; }
.video .frame.tall { aspect-ratio: 9 / 16; max-height: 36rem; }
.video .frame.wide { aspect-ratio: 16 / 9; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video p { margin: 0; padding: 0.7rem 0.9rem; font-size: var(--step--1); color: var(--muted); border-top: 1px solid var(--line); }
.video p b { color: var(--ink); font-weight: 650; }

dialog.lightbox { padding: 0; border: 0; border-radius: 8px; max-width: min(92vw, 60rem); max-height: 92vh; background: var(--surface); }
dialog.lightbox::backdrop { background: rgba(20, 22, 28, 0.75); }
dialog.lightbox img { max-height: 84vh; width: auto; margin: 0 auto; }
dialog.lightbox form { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0.75rem; gap: 1rem; font-size: var(--step--1); }

/* ---------- class / CIS103 teaser ---------- */
.class-link {
  display: grid; gap: 1rem; align-items: center;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid color-mix(in srgb, var(--class) 40%, white);
  border-left: 6px solid var(--class);
  border-radius: 8px;
  background: color-mix(in srgb, var(--class) 8%, white);
  text-decoration: none;
}
@media (min-width: 760px) { .class-link { grid-template-columns: 1fr auto; } }
.class-link h3 { margin: 0 0 0.3rem; }
.class-link p { margin: 0; color: var(--muted); max-width: var(--measure); }
.class-link .btn { background: var(--class); }

/* ---------- about + contact ---------- */
.about { display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
@media (min-width: 760px) { .about { grid-template-columns: 16rem 1fr; } }
.about img { border-radius: 8px; width: 100%; max-width: 16rem; aspect-ratio: 4 / 5; object-fit: cover; }

.contact { display: grid; gap: clamp(2rem, 5vw, 3.5rem); }
@media (min-width: 880px) { .contact { grid-template-columns: 1fr 1.1fr; } }
.links { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.links li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.links span { color: var(--muted); font-size: var(--step--1); padding-top: 0.15rem; }
.links a { text-underline-offset: 3px; overflow-wrap: anywhere; }

.form { display: grid; gap: 1rem; }
.form label { display: grid; gap: 0.35rem; font-size: var(--step--1); font-weight: 600; }
.form input, .form textarea {
  font: inherit; font-weight: 400; font-size: 1rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid #b7bdc7; border-radius: 6px;
  background: var(--surface); color: var(--ink);
}
.form textarea { min-height: 8rem; resize: vertical; }
.form .hp { position: absolute; left: -9999px; }

.site-foot { padding: 2rem 0 3rem; border-top: 1px solid var(--line); font-size: var(--step--1); color: var(--muted); }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }

/* ---------- CIS103 page ---------- */
.course-meta { margin: 1.25rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.course-meta span { font-size: var(--step--1); padding: 0.2rem 0.6rem; border-radius: 4px; background: color-mix(in srgb, var(--class) 12%, white); border: 1px solid color-mix(in srgb, var(--class) 35%, white); }
.work-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--class); counter-reset: work; }
.work-list > li {
  display: grid; gap: 0.5rem 2rem;
  padding: clamp(1.25rem, 3vw, 1.75rem) 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 760px) { .work-list > li { grid-template-columns: 9rem 1fr auto; align-items: start; } }
.work-list .when { font-size: var(--step--1); color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 0.2rem; }
.work-list p { margin: 0; max-width: var(--measure); color: var(--muted); }
.status { font-size: 0.8rem; font-weight: 600; padding: 0.15rem 0.55rem; border-radius: 4px; white-space: nowrap; justify-self: start; }
.status.done { background: color-mix(in srgb, var(--class) 15%, white); color: #12654c; }
.status.soon { background: #e3e6eb; color: var(--muted); }

/* HookLab demo */
.demo { margin: 0 0 clamp(2rem, 5vw, 3rem); }
.demo video { width: 100%; height: auto; aspect-ratio: 16 / 9; display: block; border-radius: 10px; background: #14121c; border: 1px solid var(--line); }
.demo figcaption { margin-top: 0.6rem; font-size: var(--step--1); color: var(--muted); }
.shots-wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.shots-wide img { aspect-ratio: 16 / 9; object-position: center; }

/* CIS103 podcast entry */
.crumb { margin: 0 0 1rem; font-size: var(--step--1); color: var(--muted); }
.crumb a { color: var(--class); }
.hero .h1-sm { font-size: clamp(2.25rem, 5.5vw, 4rem); line-height: 0.98; max-width: 18ch; }
.episode { margin-top: 2rem; padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--class); border-radius: 10px; max-width: 44rem; }
.episode audio { width: 100%; display: block; }
.episode-meta { margin: 0.75rem 0 0; font-size: var(--step--1); color: var(--muted); }
.episode-meta a { color: var(--class); }
.sources { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--class); }
.sources li { display: grid; gap: 0.35rem 1.5rem; padding: 1rem 0; border-bottom: 1px solid var(--line); scroll-margin-top: 5rem; }
@media (min-width: 760px) { .sources li { grid-template-columns: 8rem 1fr; } }
.sources p { margin: 0; max-width: 46rem; padding-left: 2em; text-indent: -2em; }
.sources a { overflow-wrap: anywhere; color: var(--ink); }
.src-key, .cite { font-size: 0.8rem; font-weight: 650; color: #12654c; }
.sources li:target { background: color-mix(in srgb, var(--class) 8%, white); }
.cite { display: inline-block; margin-left: 0.15rem; padding: 0 0.4rem; border-radius: 4px; background: color-mix(in srgb, var(--class) 14%, white); text-decoration: none; vertical-align: 0.1em; }
.cite:hover { background: color-mix(in srgb, var(--class) 26%, white); }
.transcript { border-top: 2px solid var(--class); }
.t-block { display: grid; gap: 0.25rem 2rem; padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
@media (min-width: 760px) { .t-block { grid-template-columns: 9rem 1fr; } }
.t-part { margin: 0; font-size: var(--step--1); font-weight: 650; color: var(--muted); padding-top: 0.15rem; }
.t-block div p { margin: 0 0 0.8em; max-width: var(--measure); }
.t-block div p:last-child { margin-bottom: 0; }
.work-list h3 a { text-decoration: none; }
.work-list h3 a:hover { text-decoration: underline; }

/* CIS103 storyboard entry */
.facts { display: grid; gap: 0; margin: 0; border-top: 2px solid var(--class); }
.facts > div { display: grid; gap: 0.25rem 2rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
@media (min-width: 760px) { .facts > div { grid-template-columns: 11rem 1fr; } }
.facts dt { font-size: var(--step--1); font-weight: 650; color: var(--muted); }
.facts dd { margin: 0; max-width: var(--measure); }
.scene { margin: 0 0 1.5rem; border: 1px solid var(--line); border-top: 4px solid var(--class); border-radius: 10px; background: var(--surface); overflow: hidden; }
.scene-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; padding: 1rem 1.25rem 0.75rem; border-bottom: 1px solid var(--line); }
.scene-head h3 { margin: 0; font-size: 1.2rem; }
.scene-num { font-size: 0.8rem; font-weight: 650; color: #12654c; text-transform: uppercase; letter-spacing: 0.04em; }
.scene-time { margin-left: auto; font-size: var(--step--1); color: var(--muted); }
.scene-grid { display: grid; }
@media (min-width: 900px) { .scene-grid { grid-template-columns: 1fr 1.4fr 0.9fr 1fr; } .scene-grid .cell + .cell { border-left: 1px solid var(--line); } }
.scene-grid .cell { padding: 1rem 1.25rem; border-top: 1px solid var(--line); }
@media (min-width: 900px) { .scene-grid .cell { border-top: 0; } }
.cell p { margin: 0 0 0.6em; }
.cell p:last-child { margin-bottom: 0; }
.lbl { font-size: 0.75rem !important; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.cue { font-style: italic; color: var(--muted); font-size: var(--step--1); }
.snd, .srcs { font-size: var(--step--1); color: var(--muted); }
.ost { display: block; margin: 0 0 0.45rem; padding: 0.35rem 0.55rem; background: #111; color: #fff; font-weight: 650; font-size: 0.9rem; border-radius: 4px; }
.timing, .media { width: 100%; border-collapse: collapse; border-top: 2px solid var(--class); }
.timing td, .timing th, .media td, .media th { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.timing tfoot td { font-weight: 700; }
.media th { width: 14rem; font-weight: 650; }
.note { color: var(--muted); font-size: var(--step--1); max-width: var(--measure); }
.why { margin: 0.35rem 0 0; font-size: var(--step--1); color: var(--muted); }
.sources .mla { padding-left: 2em; text-indent: -2em; }
.plain { padding-left: 1.2rem; max-width: var(--measure); }
.plain li { margin-bottom: 0.5rem; }
.sources .why { padding-left: 0; text-indent: 0; }
