/* =========================================================
   chrisnorris.co — BUILD SPEC v2
   One stylesheet for all seven pages.
   ========================================================= */

/* ---------- 2. TOKENS (verbatim) ---------- */
:root {
  --ground:  oklch(0.19 0.005 250);    /* page background              */
  --ink:     oklch(0.965 0.004 250);   /* titles, wordmark, 3px rule   */
  --read:    oklch(0.86 0.005 250);    /* long-form article body       */
  --body:    oklch(0.82 0.005 250);    /* short copy, résumé values    */
  --meta:    oklch(0.7 0.005 250);     /* mono labels, dek, captions   */
  --red:     oklch(0.65 0.21 25);      /* the only accent on dark      */
  --panel:   oklch(0.24 0.005 250);    /* row hover, image ground      */
  --rule:    oklch(0.965 0.004 250 / .25);  /* section hairlines       */
  --rule-lo: oklch(0.965 0.004 250 / .18);  /* row dividers            */
  --gutter:  40px;
  --ease:    cubic-bezier(.2,.7,.2,1);
}
html, body { margin: 0; background: var(--ground); color: var(--ink);
  font-family: 'Space Grotesk', sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
* { border-radius: 0; box-shadow: none; }

*, *::before, *::after { box-sizing: border-box; }
img { display: block; max-width: 100%; }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden;
      clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 4. SHARED CHROME ---------- */
.ticker {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 6px 18px; padding: 13px var(--gutter);
  font-family: 'JetBrains Mono', monospace; font-weight: 400;
  font-size: 11px; line-height: 1.5; letter-spacing: .20em; text-transform: uppercase;
  color: var(--meta); border-bottom: 1px solid var(--rule);
}
.ticker .status { display: flex; align-items: center; gap: 8px; color: var(--red); }
.dot { animation: pulse 2.4s ease-in-out infinite; }

.masthead {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 12px 24px; padding: 24px var(--gutter) 18px;
  border-bottom: 3px solid var(--ink); position: relative;
}
/* The sweep rides the 3px rule. It needs its own 3px-tall clipping track:
   the masthead's own overflow would clip at the padding box, hiding a bar
   sitting in the border area, and without clipping the 400% travel would
   push the page sideways. */
.sweep { position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; overflow: hidden; }
.sweep::after { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 26%;
  background: var(--red); animation: sweep 11s linear infinite; }

@keyframes sweep { from { transform: translateX(-100%) } to { transform: translateX(400%) } }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }

.wordmark {
  font-family: 'Saira Condensed', sans-serif; font-weight: 800;
  font-size: 40px; line-height: 1.0; letter-spacing: .02em; text-transform: uppercase;
  color: var(--ink);
}
.nav { display: flex; flex-wrap: wrap; gap: 24px;
  font-family: 'JetBrains Mono', monospace; font-weight: 400;
  font-size: 11px; line-height: 1.5; letter-spacing: .16em; text-transform: uppercase;
  color: var(--meta); }
.nav a { padding: 8px 0 2px; border-bottom: 2px solid transparent;
         transition: border-color 200ms ease-out; }
.nav a:hover { border-color: var(--red); }

footer {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 24px; align-items: end;
  padding: 16px var(--gutter) 26px; border-top: 1px solid var(--rule);
  font-family: 'JetBrains Mono', monospace; font-weight: 400;
  font-size: 10.5px; line-height: 1.6; letter-spacing: .12em; text-transform: uppercase;
  color: var(--meta);
}
footer .mid { text-align: center; }
footer .end { text-align: right; }
footer a { transition: color 200ms ease-out; }
footer a:hover { color: var(--ink); }
#meta { transition: color 200ms ease-out; }
#meta.live { color: var(--red); }

/* ---------- 5. HOME — the index ---------- */
.index-main {
  display: flex; align-items: center; justify-content: center;
  padding: 48px var(--gutter) 40px;
}
.index { display: flex; flex-direction: column; align-items: center; }

.idx { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 4px 0;
  font: 800 clamp(28px, 8.6vw, 128px)/1 'Saira Condensed', sans-serif; letter-spacing: .01em;
  text-transform: uppercase; text-wrap: balance; color: var(--ink); opacity: 1;
  transition: color 180ms ease-out, transform 260ms var(--ease); }
.idx-label { position: relative; }
.idx-label::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 4px;
  background: var(--red); transform: scaleX(0); transform-origin: left;
  transition: transform 320ms var(--ease); }
.idx-num { font: 400 12px 'JetBrains Mono', monospace; letter-spacing: .16em; color: var(--red);
  opacity: 0; transform: translateX(10px);
  transition: opacity 180ms ease-out, transform 260ms var(--ease); }
.idx-arrow { font: 400 22px 'JetBrains Mono', monospace; color: var(--red);
  opacity: 0; transform: translateX(-10px);
  transition: opacity 180ms ease-out, transform 260ms var(--ease); }

.idx:hover, .idx:focus-visible { color: var(--red); transform: translateX(8px); }
.idx:hover .idx-label::after,
.idx:focus-visible .idx-label::after { transform: scaleX(1); }
.idx:hover .idx-num, .idx:focus-visible .idx-num,
.idx:hover .idx-arrow, .idx:focus-visible .idx-arrow { opacity: 1; transform: none; }

/* ---------- 6. CASE STUDIES — /work ---------- */
.work-main { padding: 40px var(--gutter); }
.work-head { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
  align-items: baseline; padding-bottom: 14px; margin-bottom: 8px;
  border-bottom: 1px solid oklch(0.965 0.004 250 / .3); }
.work-head h1 { margin: 0;
  font-family: 'Saira Condensed', sans-serif; font-weight: 800;
  font-size: clamp(48px, 7vw, 96px); line-height: .88; letter-spacing: .01em;
  text-transform: uppercase; color: var(--ink); }
.work-head .count { font-family: 'JetBrains Mono', monospace; font-size: 11px; line-height: 1.5;
  letter-spacing: .16em; text-transform: uppercase; color: var(--meta); }

/* Tagline under a list-page heading. Same type as the article dek. */
.list-dek { margin: 16px 0 26px; font-family: 'Space Grotesk', sans-serif; font-weight: 400;
  font-size: clamp(19px, 3.2vw, 22px); line-height: 1.4; color: var(--meta); max-width: 46ch; }

.case-row { display: grid; grid-template-columns: 46px minmax(0,280px) minmax(0,1fr) 80px;
  gap: 24px; align-items: baseline; padding: 22px 12px;
  border-bottom: 1px solid var(--rule-lo); transition: background 150ms ease-out; }
.case-row:hover, .case-row:focus-visible { background: var(--panel); }
.case-row .num { font-family: 'JetBrains Mono', monospace; font-size: 11px; line-height: 1.5;
  letter-spacing: .16em; text-transform: uppercase; color: var(--red); }
.case-row h2 { margin: 0; font-family: 'Saira Condensed', sans-serif; font-weight: 700;
  font-size: 28px; line-height: 1.0; letter-spacing: .02em; text-transform: uppercase;
  color: var(--ink); }
.case-row .copy { font-family: 'Space Grotesk', sans-serif; font-weight: 400;
  font-size: 15.5px; line-height: 1.5; color: var(--body); }
.case-row .read { font-family: 'JetBrains Mono', monospace; font-size: 11px; line-height: 1.5;
  letter-spacing: .16em; text-transform: uppercase; color: var(--meta); text-align: right; }

/* ---------- 7. CASE PAGE ---------- */
.article-main { padding: 0 24px; }
article { max-width: 600px; margin: 0 auto; padding: 48px 0 72px; }

.back { display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 11px;
  line-height: 1.5; letter-spacing: .16em; text-transform: uppercase; color: var(--meta);
  padding: 8px 0 2px; border-bottom: 2px solid transparent;
  transition: border-color 200ms ease-out, color 200ms ease-out; }
.back:hover { border-color: var(--red); color: var(--ink); }

.eyebrow { margin: 36px 0 0; font-family: 'JetBrains Mono', monospace; font-size: 11px;
  line-height: 1.5; letter-spacing: .18em; text-transform: uppercase; color: var(--red); }

article h1 { margin: 14px 0 0; font-family: 'Saira Condensed', sans-serif; font-weight: 800;
  font-size: clamp(40px, 9vw, 60px); line-height: .92; letter-spacing: .005em;
  text-transform: uppercase; text-wrap: balance; color: var(--ink); }

.dek { margin: 18px 0 0; font-family: 'Space Grotesk', sans-serif; font-weight: 400;
  font-size: clamp(19px, 3.2vw, 22px); line-height: 1.4; color: var(--meta); }

.byline { margin: 28px 0 0; padding: 16px 0;
  border-top: 1px solid var(--rule-lo); border-bottom: 1px solid var(--rule-lo);
  display: flex; align-items: center; gap: 12px; }
.byline img { width: 40px; height: 40px; object-fit: cover; object-position: 50% 26%;
  filter: grayscale(1); border: 1px solid oklch(0.965 0.004 250 / .4); }
.byline .name { font-family: 'Space Grotesk', sans-serif; font-weight: 500; font-size: 15px;
  line-height: 1.3; color: var(--ink); }
.byline .bmeta { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; line-height: 1.6;
  letter-spacing: .12em; text-transform: uppercase; color: var(--meta); }

article figure { margin: 36px 0 0; }
article figure img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--panel); }
article figcaption { margin-top: 8px; font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; line-height: 1.6; letter-spacing: .12em; text-transform: uppercase;
  color: var(--meta); }

article section { margin-top: 44px; }
article h2 { margin: 0 0 14px; font-family: 'Saira Condensed', sans-serif; font-weight: 700;
  font-size: 30px; line-height: 1.0; letter-spacing: .02em; text-transform: uppercase;
  color: var(--ink); }
article section p { margin: 0 0 22px; font-family: 'Space Grotesk', sans-serif; font-weight: 400;
  font-size: clamp(18px, 2.6vw, 20px); line-height: 1.68; text-wrap: pretty; color: var(--read); }
article section p:last-child { margin-bottom: 0; }

article blockquote { margin: 32px 0; padding-left: 20px; border-left: 3px solid var(--red);
  font-family: 'Space Grotesk', sans-serif; font-weight: 500;
  font-size: clamp(22px, 3.6vw, 27px); line-height: 1.35; text-wrap: balance; color: var(--ink); }
article blockquote p { margin: 0; font: inherit; color: inherit; }

.stats { margin: 40px 0 0; padding: 0; border-top: 3px solid var(--ink);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stats div { padding: 18px 16px 18px 0; border-bottom: 1px solid var(--rule-lo); }
.stats dt { font-family: 'Saira Condensed', sans-serif; font-weight: 800; font-size: 44px;
  line-height: 1.0; letter-spacing: .01em; text-transform: uppercase; color: var(--red); }
.stats dd { margin: 6px 0 0; font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  line-height: 1.6; letter-spacing: .12em; text-transform: uppercase; color: var(--meta); }

/* Primary action on a build page. Solid ink, inverts to red on hover. */
.visit { display: inline-block; margin-top: 40px; padding: 15px 22px;
  background: var(--ink); color: var(--ground);
  font-family: 'JetBrains Mono', monospace; font-size: 11px; line-height: 1.5;
  letter-spacing: .16em; text-transform: uppercase;
  transition: background-color 180ms ease-out, color 180ms ease-out; }
.visit:hover { background: var(--red); color: var(--ground); }

.next { display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
  margin-top: 56px; padding: 22px 0;
  border-top: 1px solid oklch(0.965 0.004 250 / .3);
  border-bottom: 1px solid oklch(0.965 0.004 250 / .3);
  transition: color 180ms ease-out; }
.next:hover { color: var(--red); }
.next .label { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; line-height: 1.6;
  letter-spacing: .12em; text-transform: uppercase; color: var(--meta);
  transition: color 180ms ease-out; }
.next:hover .label { color: var(--red); }
.next .title { font-family: 'Saira Condensed', sans-serif; font-weight: 700; font-size: 30px;
  line-height: 1.0; letter-spacing: .02em; text-transform: uppercase; }
.next .arrow { font-family: 'JetBrains Mono', monospace; font-size: 20px; }

/* ---------- 8. ABOUT ---------- */
.about-main { display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  border-bottom: 1px solid var(--rule); }

.about-intro { padding: clamp(16px, 2.6vh, 40px) clamp(20px, 2.6vw, 40px);
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: clamp(8px, 1.6vh, 24px); max-width: 760px; }
.about-label { font-family: 'JetBrains Mono', monospace; font-size: 11px; line-height: 1.5;
  letter-spacing: .18em; text-transform: uppercase; color: var(--red); }
.about-split { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }

.plate-wrap { width: clamp(170px, 17vw, 240px); flex: none; }
.plate { border: 1px solid oklch(0.965 0.004 250 / .6); background: var(--panel); overflow: hidden; }
.plate img { width: 100%; height: clamp(120px, 20vh, 280px); object-fit: cover; object-position: 50% 26%;
  filter: grayscale(1) contrast(1.05); transition: transform 700ms ease-out; }
.plate:hover img { transform: scale(1.035); }
.about-copy { flex: 1; min-width: min(440px, 100%); display: flex; flex-direction: column; gap: 20px; }
.about-copy h1 { margin: 0; font-family: 'Saira Condensed', sans-serif; font-weight: 800;
  font-size: clamp(28px, min(5.5vw, 6.5vh), 84px); line-height: .88; letter-spacing: .01em;
  text-transform: uppercase; max-width: 16ch; color: var(--ink); }
.lede { margin: 0; padding-left: 16px; border-left: 3px solid var(--red);
  font-family: 'Space Grotesk', sans-serif; font-weight: 400; font-size: clamp(14px, 1.9vh, 19px); line-height: 1.45;
  max-width: 48ch; color: var(--body); }

.resume { padding: clamp(16px, 2.6vh, 40px) clamp(20px, 2.6vw, 40px); display: flex; flex-direction: column; }
.resume-head { display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: space-between;
  align-items: baseline; padding-bottom: 14px;
  border-bottom: 1px solid oklch(0.965 0.004 250 / .3); }
.resume-head h2 { margin: 0; font-family: 'Saira Condensed', sans-serif; font-weight: 700;
  font-size: 30px; line-height: 1.0; letter-spacing: .02em; text-transform: uppercase;
  color: var(--ink); }

.resume-head .count { font-family: 'JetBrains Mono', monospace; font-size: 11px; line-height: 1.5;
  letter-spacing: .16em; text-transform: uppercase; color: var(--meta); }

.x-row { display: grid; grid-template-columns: 1fr auto; gap: 12px 20px; align-items: baseline;
  padding: clamp(6px, 1.3vh, 16px) 0; border-bottom: 1px solid var(--rule-lo); }
.x-title { display: block; font-family: 'JetBrains Mono', monospace; font-size: 11.5px;
  line-height: 1.8; letter-spacing: .06em; text-transform: uppercase; color: var(--body); }
.x-co { display: block; font-family: 'JetBrains Mono', monospace; font-size: 11px;
  line-height: 1.6; letter-spacing: .12em; text-transform: uppercase; color: var(--meta); }
.x-when { font-family: 'JetBrains Mono', monospace; font-size: 11px; line-height: 1.8;
  letter-spacing: .12em; text-transform: uppercase; color: var(--red); white-space: nowrap;
  text-align: right; }

/* PDF link sits at the foot of the column, right aligned */
.resume-foot { margin-top: auto; padding-top: clamp(12px, 2vh, 24px); display: flex; justify-content: flex-end; }
.resume-foot a { font-family: 'JetBrains Mono', monospace; font-size: 11px; line-height: 1.5;
  letter-spacing: .14em; text-transform: uppercase; color: var(--meta);
  border-bottom: 2px solid var(--red); padding-bottom: 2px; transition: color 200ms ease-out; }
.resume-foot a:hover { color: var(--ink); }

/* ---------- 10. RESPONSIVE ---------- */
@media (max-width: 760px) {
  :root { --gutter: 20px; }
  .case-row { grid-template-columns: 34px 1fr; gap: 6px 16px; }
  .case-row > :nth-child(n+3) { grid-column: 2; }
  .case-row .read { text-align: left; }
  .x-row { grid-template-columns: 1fr; }
  .x-when { text-align: left; }
  .about-intro { border-right: 0; border-bottom: 1px solid var(--rule); }

  /* Phones scroll instead of shrinking: restore full-size type and spacing.
     The viewport-height clamps above only govern screens wide enough to
     hold both columns. */
  .about-intro, .resume { padding: 28px var(--gutter); }
  .about-intro { gap: 24px; }
  .about-copy h1 { font-size: clamp(48px, 13vw, 84px); }
  .lede { font-size: 19px; }
  .plate-wrap { width: 240px; }
  .plate img { height: 280px; }
  .x-row { padding: 16px 0; }
  .resume-foot { padding-top: 24px; }
  footer > * { text-align: left !important; }
}
/* Short laptop screens (720p and similar). The two-column About page is meant
   to sit in one view; the lede running an extra line pushes it over by about
   20px, so the portrait and the copy gap give that back. */
@media (min-width: 761px) and (max-height: 760px) {
  .plate img { height: clamp(110px, 17vh, 280px); }
  .about-copy { gap: 14px; }
}

@media (max-width: 560px) { .ticker .coords { display: none; } }
/* Below 390px the longest title needs a gentler rate to stay on one line. */
@media (max-width: 389px) { .idx { font-size: 7.8vw; } }

@media (hover: none) { .idx { transform: none !important; } }

/* ---------- 9. REDUCED MOTION ---------- */
/* Remove pulse, sweep, every translate and the plate scale.
   Keep color, the underline bar and opacity changes. */
@media (prefers-reduced-motion: reduce) {
  .dot { animation: none; }
  .sweep::after { animation: none; }
  .idx { transition: color 180ms ease-out; }
  .idx:hover, .idx:focus-visible { transform: none; }
  .idx-num, .idx-arrow { transform: none; transition: opacity 180ms ease-out; }
  .plate img { transition: none; }
  .plate:hover img { transform: none; }
}
