/* heathercornick.ca — "House out. Cue 1: GO."
   The page is the dark house; her work is the only thing that's lit.
   Palette names are real Lee/Rosco gels — the insider handshake. */

@font-face {
  font-family: 'Fraunces';
  src: url('/assets/fonts/fraunces-var.woff2') format('woff2-variations');
  font-weight: 400 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Archivo';
  src: url('/assets/fonts/archivo-var.woff2') format('woff2-variations');
  font-weight: 400 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('/assets/fonts/plexmono-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('/assets/fonts/plexmono-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  --house-dark:    #151021;  /* house at black — warm violet-black, never #000 */
  --scrim:         #221A33;  /* surfaces */
  --congo:         #8A6BFF;  /* Lee 181 Congo Blue, lifted for screen */
  --congo-deep:    #3B2D8F;  /* Lee 181 full saturation */
  --bastard-amber: #F2C48D;  /* Rosco R02 — warm counterpoint, used sparingly */
  --scrim-white:   #EFEAE2;  /* body text */
  --haze:          #9C93AD;  /* captions, metadata */

  --edge: 1px solid rgb(255 255 255 / 8%);

  --f-display: 'Fraunces', Georgia, serif;
  --f-body:    'Archivo', system-ui, sans-serif;
  --f-cue:     'Plex Mono', ui-monospace, monospace;

  --s-hero: 3.5rem;
  --s-h2:   2.25rem;
  --s-h3:   1.5rem;
  --s-lead: 1.125rem;
  --s-body: 1rem;
  --s-fine: 0.875rem;

  --gut: 2rem;
  --max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--house-dark);
  color: var(--scrim-white);
  font: 400 var(--s-body)/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, picture, video { max-width: 100%; height: auto; display: block; }

a { color: var(--congo); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--bastard-amber); }

:focus-visible {
  outline: 2px solid var(--congo);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: -9999px;
  background: var(--scrim); color: var(--scrim-white);
  padding: 0.75rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 600;
  line-height: 1.08;
  margin: 0 0 0.5em;
  font-variation-settings: 'SOFT' 30, 'WONK' 1;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--s-hero); }
h2 { font-size: var(--s-h2); }
h3 { font-size: var(--s-h3); font-weight: 500; }

p { margin: 0 0 1.1em; }
.prose { max-width: 68ch; }
.prose p { font-size: var(--s-lead); }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gut); }

/* ---- masthead ------------------------------------------------------------ */

.masthead {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
  max-width: var(--max); margin-inline: auto;
  padding: 1.5rem var(--gut);
}
.masthead__name {
  font-family: var(--f-display); font-size: 1.25rem; font-weight: 600;
  color: var(--scrim-white); text-decoration: none; letter-spacing: 0.01em;
}
.masthead__name:hover { color: var(--bastard-amber); }
.masthead__nav { display: flex; gap: 1.5rem; font-size: var(--s-fine); }
.masthead__nav a {
  color: var(--haze); text-decoration: none;
  padding-bottom: 2px; border-bottom: 1px solid transparent;
}
.masthead__nav a:hover { color: var(--scrim-white); }
.masthead__nav a[aria-current='page'] {
  color: var(--scrim-white); border-bottom-color: var(--congo);
}

/* ---- hero: the one permitted gradient, read as haze in a beam ------------ */

.hero { position: relative; margin-bottom: 4rem; }
.hero__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.hero__media img, .hero__media picture { width: 100%; height: 100%; object-fit: cover; }
.hero__media::after {
  content: ''; position: absolute; inset: 0;
  /* Only enough wash to seat the type on the bottom-left. These are stage shots
     already lit against a black void — the earlier heavier vignette buried the
     work, which is the one thing this page exists to show. */
  background:
    linear-gradient(to top, var(--house-dark) 0%, rgb(21 16 33 / 55%) 14%, transparent 42%),
    linear-gradient(to right, rgb(21 16 33 / 45%) 0%, transparent 45%);
}
.hero__text {
  position: absolute; inset: auto 0 0 0; z-index: 2;
  max-width: var(--max); margin-inline: auto; padding: 0 var(--gut) 2.5rem;
}
.hero h1 { margin-bottom: 0.25em; text-wrap: balance; }
.hero__sub {
  font-size: var(--s-lead); color: var(--haze); margin-bottom: 1.25rem;
  max-width: 46ch;
}
.hero__sub strong { color: var(--scrim-white); font-weight: 500; }

.btn {
  display: inline-block;
  font: 500 var(--s-fine)/1 var(--f-body);
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--scrim-white); text-decoration: none;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--congo);
  background: rgb(138 107 255 / 10%);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.btn:hover { background: var(--congo-deep); border-color: var(--congo); color: #fff; }

/* ---- gel chips: the signature device ------------------------------------- */

.gels {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  list-style: none; margin: 0 0 2.5rem; padding: 0;
}
.gel {
  --chip: var(--congo-deep);
  display: inline-flex; flex-direction: column; align-items: center; gap: 0.35rem;
  padding: 0.5rem 0.85rem 0.45rem;
  border: var(--edge); border-radius: 3px;
  background: color-mix(in srgb, var(--chip) 22%, transparent);
  color: var(--scrim-white); text-decoration: none;
  font: 500 var(--s-fine)/1 var(--f-body);
  transition: filter 160ms ease, background 160ms ease, border-color 160ms ease;
}
.gel:hover, .gel:focus-visible {
  /* a channel coming up on a fader */
  filter: brightness(1.45);
  background: color-mix(in srgb, var(--chip) 40%, transparent);
  color: var(--scrim-white);
}
.gel[aria-current='true'] {
  border-color: var(--congo);
  background: color-mix(in srgb, var(--chip) 46%, transparent);
}
.gel__no {
  font-family: var(--f-cue); font-size: 0.6875rem; font-weight: 400;
  letter-spacing: 0.08em; color: var(--haze);
}
.gel:hover .gel__no { color: var(--scrim-white); }
.gel__n { font-variant-numeric: tabular-nums; color: var(--haze); font-weight: 400; }

/* ---- work grid ----------------------------------------------------------- */

.grid {
  display: grid; gap: 2rem;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  margin: 0 0 4rem; padding: 0; list-style: none;
}
.card { position: relative; }
.card a { display: block; text-decoration: none; color: inherit; }
.card__media {
  position: relative; overflow: hidden; background: var(--scrim);
  aspect-ratio: 3 / 2; border: var(--edge);
}
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.card a:hover .card__media img { transform: scale(1.03); }
.card__media--empty {
  display: grid; place-items: center;
  color: var(--haze); font-family: var(--f-cue); font-size: var(--s-fine);
}
.card__meta { padding-top: 0.7rem; }
.card__title { font-family: var(--f-display); font-size: 1.125rem; font-weight: 500; }
.card a:hover .card__title { color: var(--bastard-amber); }
.card__sub {
  font-family: var(--f-cue); font-size: 0.75rem; color: var(--haze);
  letter-spacing: 0.02em; margin-top: 0.15rem;
}
.card__draft {
  position: absolute; top: 0.6rem; left: 0.6rem; z-index: 2;
  font: 500 0.6875rem/1 var(--f-cue); letter-spacing: 0.08em;
  background: var(--bastard-amber); color: #2a1c07;
  padding: 0.3rem 0.5rem; border-radius: 2px;
}

/* ---- section headings ---------------------------------------------------- */

.eyebrow {
  font-family: var(--f-cue); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--haze);
  margin: 0 0 0.6rem;
}

/* ---- project page -------------------------------------------------------- */

.project { padding-top: 1rem; }
.project__head { max-width: 68ch; margin-bottom: 2.5rem; }
.project__plate { margin: 0 0 3rem; }
.project__plate figure { margin: 0 0 1.25rem; }
.project__plate figcaption {
  font-family: var(--f-cue); font-size: 0.75rem; color: var(--haze);
  padding-top: 0.5rem; letter-spacing: 0.02em;
}
.project__plate img { width: 100%; border: var(--edge); }

.makingof {
  border-top: var(--edge); padding-top: 2.5rem; margin-top: 1rem;
}
.makingof .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }

/* cue sheet — doubles as crawlable credit data */
.cue {
  font-family: var(--f-cue); font-size: var(--s-fine); line-height: 1.9;
  color: var(--scrim-white); margin: 0;
}
.cue__k {
  display: inline-block; min-width: 8.5rem;
  color: var(--haze); letter-spacing: 0.08em; text-transform: uppercase;
  font-size: 0.6875rem;
}
.cuesheet {
  background: var(--scrim); border: var(--edge);
  padding: 1.5rem 1.75rem; margin: 3rem 0;
}
.cuesheet h2 {
  font-family: var(--f-cue); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--haze);
  margin-bottom: 1rem;
}
.cuesheet .cue__v { color: var(--scrim-white); }

.pager {
  display: flex; justify-content: space-between; gap: 1.5rem;
  border-top: var(--edge); padding-top: 1.5rem; margin: 3rem 0 4rem;
  font-size: var(--s-fine);
}
.pager a { text-decoration: none; }
.pager span { display: block; color: var(--haze); font-family: var(--f-cue); font-size: 0.6875rem;
              letter-spacing: 0.08em; text-transform: uppercase; }
.pager__next { text-align: right; margin-left: auto; }

/* ---- footer -------------------------------------------------------------- */

.footer {
  border-top: var(--edge); background: var(--scrim);
  margin-top: 5rem; padding: 3rem var(--gut) 2rem;
}
.footer__inner {
  max-width: var(--max); margin-inline: auto;
  display: flex; flex-wrap: wrap; gap: 2.5rem 4rem; justify-content: space-between;
}
.footer__id { font-size: var(--s-fine); color: var(--haze); margin: 0; line-height: 1.7; }
.footer__id strong { color: var(--scrim-white); font-family: var(--f-display); font-size: 1.05rem; font-weight: 500; }
.footer__fine {
  max-width: var(--max); margin: 2.5rem auto 0;
  font-family: var(--f-cue); font-size: 0.6875rem; color: var(--haze);
  letter-spacing: 0.06em;
}

/* ---- forms (admin + stats login) ----------------------------------------- */

.panel {
  background: var(--scrim); border: var(--edge);
  padding: 2rem; max-width: 26rem; margin: 3rem auto;
}
/* The CSP is style-src 'self', so this cannot live in a style attribute. */
.panel__h1 { font-size: var(--s-h3); margin-bottom: 1.5rem; }
.field { margin-bottom: 1.1rem; }
.field label {
  display: block; font-family: var(--f-cue); font-size: 0.6875rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--haze);
  margin-bottom: 0.4rem;
}
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=number], .field textarea, .field select {
  width: 100%; padding: 0.65rem 0.75rem;
  background: var(--house-dark); color: var(--scrim-white);
  border: var(--edge); border-radius: 2px;
  font: 400 var(--s-body)/1.4 var(--f-body);
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--congo); outline: none;
}
button.btn { cursor: pointer; font-family: var(--f-body); }
.notice {
  border: 1px solid var(--congo); background: rgb(138 107 255 / 12%);
  padding: 0.75rem 1rem; font-size: var(--s-fine); margin-bottom: 1.25rem;
}
.notice--warn { border-color: var(--bastard-amber); background: rgb(242 196 141 / 12%); }

/* ---- admin table --------------------------------------------------------- */

.table { width: 100%; border-collapse: collapse; font-size: var(--s-fine); }
.table th, .table td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: var(--edge); }
.table th {
  font-family: var(--f-cue); font-size: 0.6875rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--haze);
}
.table tr:hover td { background: rgb(255 255 255 / 3%); }
.pill {
  font-family: var(--f-cue); font-size: 0.6875rem; letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem; border-radius: 2px; border: var(--edge);
}
.pill--live  { color: var(--congo); border-color: var(--congo); }
.pill--draft { color: var(--bastard-amber); border-color: var(--bastard-amber); }

.stat {
  background: var(--scrim); border: var(--edge); padding: 1.25rem;
}
.stat__n { font-family: var(--f-display); font-size: 2rem; font-weight: 600; }
.stat__k { font-family: var(--f-cue); font-size: 0.6875rem; letter-spacing: 0.08em;
           text-transform: uppercase; color: var(--haze); }

/* ---- motion: one orchestrated moment ------------------------------------- */

.hero__media picture { animation: cue1 620ms ease-out both; }
@keyframes cue1 { from { opacity: 0; } to { opacity: 1; } }

/* Thumbnails fade up as they enter — but ONLY as a scroll-driven CSS animation.
   The grid is never hidden by default: these photographs are the content, and no
   amount of animation is worth a blank portfolio if a script or observer fails.
   Browsers without scroll-driven animations simply show everything, which is the
   correct fallback rather than a degraded one. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: fadeup linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 45%;
    }
  }
}
@keyframes fadeup {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__media picture { animation: none; }
  .reveal { animation: none; opacity: 1; transform: none; }
  .card a:hover .card__media img { transform: none; }
  * { scroll-behavior: auto !important; }
}

/* ---- responsive ---------------------------------------------------------- */

@media (max-width: 900px) {
  .hero__media { aspect-ratio: 4 / 3; }
}

@media (max-width: 640px) {
  :root {
    --s-hero: 2.5rem; --s-h2: 1.75rem; --s-h3: 1.25rem;
    --s-lead: 1.0625rem; --s-body: 1rem; --s-fine: 0.8125rem;
    --gut: 1.25rem;
  }
  .grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .makingof .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .cue__k { min-width: 6.5rem; }
  .cuesheet { padding: 1.25rem; }
  .masthead { padding-block: 1.1rem; }
  .masthead__nav { gap: 1.1rem; }
  /* captions always visible on mobile — no hover to reveal them */
  .card__sub { display: block; }
}

@media (max-width: 360px) {
  :root { --gut: 1rem; }
}

/* ---- analytics ------------------------------------------------------------
   /stats only. Every measurement here is expressed as a class or an SVG
   attribute: the CSP is style-src 'self', so a `style` attribute never lands. */

.stats { padding-top: 1rem; }
.stats__h1 { font-size: var(--s-h2); }
.stats__nav { font-size: var(--s-fine); }
.stats__range { margin-top: 2rem; }
.stats .gel { --chip: var(--congo-deep); }

.stats__kpis {
  display: grid; gap: 1rem; margin: 0 0 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.stats__kpis--2 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); max-width: 34rem; }
.stats__kpis .stat__n { font-size: 1.75rem; }

.sheet {
  border: var(--edge); background: var(--scrim);
  padding: 1.5rem; margin-bottom: 2rem;
}
.sheet__head { margin-bottom: 1.25rem; }
.sheet__head .eyebrow { margin-bottom: 0.2rem; }
.sheet__note { font-size: var(--s-fine); color: var(--haze); max-width: 60ch; }

.chart { width: 100%; height: auto; display: block; }

.stats__cols {
  display: grid; gap: 1.5rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 1.5rem;
}
.stats__cols--3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.stats__cols .eyebrow { font-size: 0.6875rem; }

/* ranked tables: label takes what's left, bar and count are fixed */
.table--rank { table-layout: fixed; width: 100%; }
.table--rank td { padding: 0.4rem 0.4rem; vertical-align: middle; }
.rank__label {
  width: auto; display: flex; align-items: center; gap: 0.5rem;
  overflow: hidden; min-width: 0;
}
.rank__label span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rank__icon { flex: 0 0 auto; width: 16px; height: 16px; object-fit: contain; }
.rank__bar { width: 5.5rem; }
.rank__bar svg { width: 100%; height: 10px; display: block; }
.rank__n {
  width: 3.25rem; text-align: right; font-family: var(--f-cue);
  font-variant-numeric: tabular-nums; color: var(--scrim-white);
}

.stats__empty { color: var(--haze); font-size: var(--s-fine); margin-top: 0.5rem; }
.stats__foot { margin: 3rem 0 4rem; font-size: var(--s-fine); color: var(--haze); max-width: 68ch; }

/* visitor map */
.map__wrap { background: #100C1A; border: var(--edge); padding: 0.5rem; }
.map { width: 100%; height: auto; display: block; }
.map__dots circle { fill: var(--bastard-amber); fill-opacity: 0.75; stroke: #2a1c07; stroke-width: 0.5; }

/* new vs returning */
.split { margin-bottom: 0.5rem; }
.split__bar { width: 100%; height: 8px; display: block; }
.split__key {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.25rem;
  margin-top: 0.6rem; font-size: var(--s-fine); color: var(--haze);
}
.split__sw { width: 0.65rem; height: 0.65rem; display: inline-block; }
.split__sw--new { background: var(--congo); }
.split__sw--ret { background: var(--bastard-amber); }

/* hour-of-day strip */
.hours { width: 100%; max-width: 44rem; height: auto; display: block; }

@media (max-width: 640px) {
  .sheet { padding: 1rem; }
  .rank__bar { display: none; }
}
