/* ==========================================================================
   hteane.ca — portfolio stylesheet
   Plan: dark room, one glowing thing. The only decorative element on the page
   is the firefly swarm in the hero; everything else is quiet type and media.
   ========================================================================== */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../assets/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../assets/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../assets/fonts/source-serif-4-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  /* colour: night room, mercury light, one firefly */
  --ink: #06090c;
  --ink-raised: #0d1318;
  --mercury: #d5dde4;
  --dim: #8b98a5;
  --firefly: #f0b94a;
  --line: rgba(213, 221, 228, 0.16);

  /* type */
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --text: "Source Serif 4", Georgia, "Times New Roman", serif;

  /* layout */
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --max: 74rem;
  --section-gap: clamp(5rem, 11vw, 9rem);
}

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

html {
  background: var(--ink);
  color: var(--mercury);
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration-color: var(--line);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration-color: var(--firefly); }

:focus-visible {
  outline: 2px solid var(--firefly);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.6rem 1rem;
  background: var(--mercury);
  color: var(--ink);
  font-family: var(--display);
  z-index: 100;
}
.skip-link:focus { top: 0.75rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- navigation ---------- */
.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  gap: clamp(1rem, 3vw, 2.25rem);
  padding: 1.1rem var(--gutter) 2.2rem;
  background: linear-gradient(to bottom, rgba(6, 9, 12, 0.97) 55%, rgba(6, 9, 12, 0));
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 500;
  pointer-events: none;
}
.site-nav a {
  pointer-events: auto;
  text-decoration: none;
  color: var(--dim);
  transition: color 0.15s;
}
.site-nav a:hover,
.site-nav a:focus-visible { color: var(--mercury); }

@media (max-width: 40rem) {
  .site-nav { justify-content: space-between; font-size: 0.9rem; }
  .site-nav a { white-space: nowrap; }
  .site-nav a[href="#live"],
  .site-nav a[href="#experience"] { display: none; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 34rem;
  height: 100svh;
  overflow: hidden;
  touch-action: pan-y;
}
#swarm {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-name {
  position: absolute;
  inset: 0 0 auto 0;
  top: 38%;
  margin: 0;
  transform: translateY(-50%);
  text-align: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3.5rem, 15vw, 14rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
/* when the swarm is running it draws the name; keep the h1 for screen readers */
.hero.is-live .hero-name {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.hero:not(.is-live) #swarm { display: none; }

.hero-copy {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: clamp(2rem, 6vh, 4rem);
  max-width: var(--max);
  margin-inline: auto;
  display: grid;
  gap: 1.25rem;
}
.hero-copy .role {
  margin: 0;
  max-width: 34rem;
  font-family: var(--display);
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-weight: 400;
  line-height: 1.35;
}
.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--display);
  font-weight: 500;
}
.hero-links a { color: var(--firefly); text-decoration-color: rgba(240, 185, 74, 0.4); }
.hero-links a:hover { text-decoration-color: var(--firefly); }

/* ---------- sections ---------- */
.section {
  padding: var(--section-gap) var(--gutter) 0;
}
.wrap { max-width: var(--max); margin-inline: auto; }

.section-title {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.section-intro {
  max-width: 38rem;
  margin: 0 0 clamp(2.5rem, 6vw, 4.5rem);
  color: var(--dim);
}

/* ---------- media slots ---------- */
.media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background:
    radial-gradient(60% 80% at 30% 35%, rgba(240, 185, 74, 0.07), transparent 70%),
    var(--ink-raised);
}
.media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-note {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  font-family: var(--display);
  font-size: 0.95rem;
  color: var(--dim);
}
.media.is-empty video { display: none; }
.media.is-empty .media-note { display: grid; }

/* ---------- projects ---------- */
.project + .project { margin-top: var(--section-gap); }

.project-body {
  display: grid;
  gap: 1.5rem clamp(2rem, 6vw, 5rem);
  grid-template-columns: minmax(0, 1fr);
  margin-top: 1.75rem;
}
@media (min-width: 56rem) {
  .project-body { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

.project h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  line-height: 1.1;
}
.project .meta {
  margin: 0.5rem 0 0;
  color: var(--dim);
  max-width: 24rem;
}

.prose { max-width: 38rem; }
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 1.1em; }
.prose h4 {
  margin: 1.8em 0 0.5em;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.1rem;
}
.prose ul { margin: 0 0 1.1em; padding-left: 1.2em; }
.prose li { margin-bottom: 0.55em; padding-left: 0.2em; }
.prose li::marker { color: var(--firefly); }
.prose strong { font-weight: 600; color: var(--mercury); }

/* ---------- Kinto Lumino system flow ---------- */
.flow {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}
.flow h4 {
  margin: 0 0 1.25rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.1rem;
}
.flow-map {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr);
}
.node {
  appearance: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.9rem 1rem;
  text-align: left;
  color: var(--dim);
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
.node:hover { color: var(--mercury); border-color: rgba(213, 221, 228, 0.4); }
.node[aria-pressed="true"] {
  color: var(--ink);
  background: var(--firefly);
  border-color: var(--firefly);
}
.flow-detail {
  margin-top: 1.25rem;
  min-height: 7.5rem;
  max-width: 44rem;
}
.flow-detail h5 {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
}
.flow-detail p { margin: 0; color: var(--mercury); }

@media (min-width: 52rem) {
  .flow-map {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-areas:
      "sense control render output"
      ".     app     .      .";
    gap: 2.25rem 1.5rem;
  }
  .node[data-node="sense"]   { grid-area: sense; }
  .node[data-node="control"] { grid-area: control; }
  .node[data-node="render"]  { grid-area: render; }
  .node[data-node="output"]  { grid-area: output; }
  .node[data-node="app"]     { grid-area: app; }

  /* data flows left to right; the app joins from below */
  .node { position: relative; }
  .node[data-node="sense"]::after,
  .node[data-node="control"]::after,
  .node[data-node="render"]::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    width: 1.5rem;
    border-top: 1px solid var(--firefly);
    opacity: 0.7;
  }
  .node[data-node="app"]::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 100%;
    height: 2.25rem;
    border-left: 1px solid var(--firefly);
    opacity: 0.7;
  }
}

/* ---------- lab contact sheet ---------- */
.lab-grid {
  display: grid;
  gap: 2px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--line);
}
.lab-item { background: var(--ink); margin: 0; }
.lab-item .media { aspect-ratio: 4 / 3; }
.lab-item p {
  margin: 0;
  padding: 0.9rem 1rem 1.3rem;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--dim);
}
.lab-item strong {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--mercury);
}

/* ---------- ruled lists (live production, capabilities) ---------- */
.rows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.rows > li,
.rows > div {
  display: grid;
  gap: 0.4rem 3rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 52rem) {
  .rows > li,
  .rows > div { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
}
.rows h3, .rows dt {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.25;
}
.rows p, .rows dd { margin: 0; max-width: 40rem; }
.rows .small { color: var(--dim); font-size: 0.98rem; }

/* ---------- timeline (this one really is a sequence) ---------- */
.timeline {
  margin: 0;
  padding: 0 0 0 1.75rem;
  list-style: none;
  border-left: 1px solid var(--line);
}
.timeline > li { position: relative; padding-bottom: 2.75rem; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: "";
  position: absolute;
  left: calc(-1.75rem - 4px);
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
}
.timeline > li:first-child::before {
  background: var(--firefly);
  box-shadow: 0 0 10px 2px rgba(240, 185, 74, 0.55);
}
.timeline time { display: block; color: var(--dim); font-size: 0.98rem; }
.timeline h3 {
  margin: 0.15rem 0 0.1rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
}
.timeline .where { margin: 0 0 0.6rem; color: var(--dim); }
.timeline p:last-child { margin: 0; max-width: 40rem; }

/* ---------- contact + footer ---------- */
.contact .section-title { max-width: 18ch; }
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 500;
}
.contact-links a { color: var(--firefly); text-decoration-color: rgba(240, 185, 74, 0.4); }
.contact-links a:hover { text-decoration-color: var(--firefly); }

.site-footer {
  margin-top: var(--section-gap);
  padding: 2rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.95rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }
.site-footer p { margin: 0; }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
