/* ==========================================================================
   Portfolio styles

   The LED wall is pinned behind every page and stays still while the page
   scrolls over it. Everything else is built from parts of an LED installation:

   Wall       The fixed canvas behind everything (class="led-wall").
   Sheet      Frosted acrylic mounted on the wall. Holds each section's
              content. The wall glows through it faintly.
   Diffuser   Lighter frosted panel for short text: the hero, the hint, the nav.
   Screen     Dark LED hardware with a bezel: every video, still and diagram.
   Label      Outlined plate on a sheet: skills, facts, side projects.
   Sign       Small dot-matrix display in the same font as the wall: the
              wordmark, section headings and case study step numbers.
   Key        Buttons. The primary one is lit.

   Colours, radii and spacing are set once in :root.
   ========================================================================== */

/* Geist and Geist Mono, self-hosted (SIL Open Font License, see
   assets/fonts/OFL.txt). Each is one variable file covering weights 100–900.
   Geist sets headings and prose; Geist Mono sets short labels and facts.
   See DESIGN.md for which parts use which. */
@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* The wall */
  --wall: #0d0f12;        /* behind the LEDs */
  --led-on: #ffa733;      /* lit LED */
  --led-off: #22272d;     /* unlit LED */

  /* Type */
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  --label-size: max(0.75rem, 12px);  /* mono labels, never below 12px */
  --label-track: 0.08em;      /* letter-spacing for uppercase mono labels */

  /* Text */
  --ink: #e8eaed;
  --muted: #a9b0b8;
  --rule: rgba(255, 255, 255, 0.12);
  --signal: #ffa733;      /* link underlines and focus rings */

  /* Parts */
  --bezel: #2a3037;       /* screen and sign frames */
  --panel: #0d0f12;       /* inside a screen or sign */
  --glass: rgba(15, 17, 21, 0.32);         /* diffuser tint */
  --glass-strong: rgba(15, 17, 21, 0.86);  /* sheet tint, for reading */
  --glass-edge: rgba(255, 255, 255, 0.1);
  --field: rgba(255, 255, 255, 0.05);      /* form fields, label plates */

  /* Shape: each kind of part has its own corner */
  --r-screen: 18px;
  --r-glass: 14px;
  --r-key: 8px;
  --r-label: 4px;
  --bezel-w: 10px;

  /* Space */
  --max: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-space: clamp(40px, 6vw, 80px);
  --sheet-pad: clamp(22px, 3.6vw, 48px);
  --header-h: 72px;

  color-scheme: dark;
}

/* --- Base ----------------------------------------------------------------- */

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

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  touch-action: pan-y pinch-zoom;   /* sideways finger drags light the wall */
}

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

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

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

h1, h2, h3 { margin: 0; line-height: 1.1; font-weight: 600; }

h1 {
  font-size: clamp(2.4rem, 1.4rem + 3.4vw, 4rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  letter-spacing: -0.03em;
}

h3 { font-size: 1.3rem; letter-spacing: -0.02em; }

/* Mono label: the control-panel voice for short facts (status, spec terms,
   nav, captions). Uppercase only for a few words, never for sentences. */
.mono-label {
  font-family: var(--font-mono);
  font-size: var(--label-size);
  font-weight: 500;
  letter-spacing: var(--label-track);
  text-transform: uppercase;
}

p { margin: 0 0 1em; }

.lede { font-size: 1.2rem; line-height: 1.5; }

/* Highlighted placeholder text. Search the HTML for class="todo" and replace
   every one before you publish. */
mark.todo {
  background: color-mix(in srgb, var(--led-on) 32%, transparent);
  color: inherit;
  padding: 0 0.2em;
  border-radius: 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.skip {
  position: absolute;
  left: -9999px;
  z-index: 10;
}
.skip:focus {
  left: 16px;
  top: 16px;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--wall);
}

/* Keep the hidden attribute working even on elements styled with display. */
[hidden] { display: none !important; }

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

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

/* ==========================================================================
   Parts
   ========================================================================== */

/* --- Wall ----------------------------------------------------------------- */

.led-wall {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  height: 100lvh;          /* doesn't jump when a phone's address bar hides */
  pointer-events: none;    /* the page listens for the cursor instead */
}

/* Everything else sits in front of the wall. */
.site-header,
main,
.site-footer { position: relative; z-index: 1; }

/* --- Sheet and diffuser --------------------------------------------------- */

.sheet,
.diffuser {
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* Sheets are tinted but not blurred. Blurring a large area over a wall that
   stays still while the page moves makes the browser redo the blur on every
   scroll frame, which halves the frame rate while scrolling. */
.sheet {
  padding: var(--sheet-pad);
  background: var(--glass-strong);
}

.diffuser {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 40%),
    var(--glass);
  -webkit-backdrop-filter: blur(2.5px) saturate(1.5);
  backdrop-filter: blur(2.5px) saturate(1.5);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .diffuser { background: rgba(15, 17, 21, 0.8); }
}

/* --- Screen --------------------------------------------------------------- */

.screen-frame {
  display: block;
  margin: 0;
  padding: var(--bezel-w);
  border-radius: var(--r-screen);
  background: var(--bezel);
}

.screen-frame > img,
.screen-frame > video,
.screen-frame > iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: calc(var(--r-screen) - var(--bezel-w));
  background: var(--panel);
  object-fit: cover;
}

a.screen-frame { text-decoration: none; }

/* --- Label ---------------------------------------------------------------- */

.label {
  background: var(--field);
  border: 1px solid var(--rule);
  border-radius: var(--r-label);
  padding: clamp(18px, 2.2vw, 26px);
}

/* Spec rows: Role, Built with, Shown at... */
.spec { display: grid; margin: 18px 0; }

.spec > div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 2px 12px;
  padding: 9px 0;
  border-top: 1px solid var(--rule);
}
.spec > div:last-child { border-bottom: 1px solid var(--rule); }
.spec dt {
  padding-top: 0.25em;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--label-size);
  letter-spacing: var(--label-track);
  text-transform: uppercase;
}
.spec dd { margin: 0; }

/* --- Sign ----------------------------------------------------------------- */

/* Styled only once the dots are drawn, so without JavaScript headings stay
   ordinary text. */
.is-lit {
  display: inline-block;
  padding: 6px;
  border: 3px solid var(--bezel);
  border-radius: 9px;
  background: var(--panel);
  line-height: 0;
  vertical-align: middle;
}
.is-lit svg { height: auto; }
.is-lit .on { fill: var(--led-on); }
.is-lit .off { fill: var(--led-off); }

/* --- Key (buttons) -------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--r-key);
  background: var(--led-on);
  color: #1d1406;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
.button:hover {
  background: #ffb95e;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--led-on) 30%, transparent);
}

.button--quiet {
  background: transparent;
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ink) 45%, transparent);
}
.button--quiet:hover {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  border-color: var(--ink);
  box-shadow: none;
}

.actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* A single lit LED, used as a status light. */
.led-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--led-on);
  box-shadow: 0 0 10px 2px color-mix(in srgb, var(--led-on) 60%, transparent);
  flex: none;
  transform: translateY(-1px);
}

/* ==========================================================================
   Page structure
   ========================================================================== */

/* --- Header and footer ---------------------------------------------------- */

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
}

.wordmark {
  display: inline-flex;
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
}
.wordmark .is-lit { padding: 4px; border-width: 2px; border-radius: 7px; }

.site-nav ul {
  display: flex;
  gap: clamp(14px, 2.6vw, 28px);
  margin: 0;
  padding: 9px clamp(14px, 2vw, 20px);
  list-style: none;
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-glass);
  background: var(--glass-strong);
}
.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: var(--label-track);
  text-transform: uppercase;
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a[aria-current] {
  text-decoration: underline;
  text-decoration-color: var(--signal);
  text-decoration-thickness: 2px;
}

.site-footer { padding-block: var(--section-space) 24px; }
.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--label-size);
  letter-spacing: var(--label-track);
  text-transform: uppercase;
}
.footer-row p { margin: 0; }

/* --- Home: the first screen ----------------------------------------------- */

.hero {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
}

.hero-top,
.hero-bottom { width: 100%; }

.hero-top { padding-top: clamp(4px, 1vw, 12px); }

/* Empty space the lettering is sized to fit. */
.hero-stage {
  flex: 1 1 auto;
  min-height: clamp(170px, 30vh, 600px);
}

.hero-bottom { padding-bottom: clamp(16px, 3vw, 32px); }

.chip {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 8px 14px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.chip .touch { display: none; }
@media (hover: none) {
  .chip .pointer { display: none; }
  .chip .touch { display: inline; }
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px clamp(24px, 4vw, 56px);
  align-items: end;
  padding: clamp(20px, 3vw, 36px);
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--label-size);
  letter-spacing: var(--label-track);
  text-transform: uppercase;
}
.status .led-dot { transform: none; }

/* Your name, above the headline. */
.hero-name {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: clamp(1.15rem, 1rem + 0.5vw, 1.4rem);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.hero-panel .lede { margin-bottom: 22px; }

/* --- Home: sections ------------------------------------------------------- */

.section { padding-top: var(--section-space); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 48px;
  margin-bottom: clamp(24px, 3.4vw, 40px);
}
.section-head p { margin: 0; max-width: 46ch; color: var(--muted); }

/* Case studies: a screen with its details beside it. */
.exhibit {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 20px clamp(20px, 3vw, 36px);
  align-items: center;
}
.exhibit + .exhibit {
  margin-top: clamp(28px, 4vw, 44px);
  padding-top: clamp(28px, 4vw, 44px);
  border-top: 1px solid var(--rule);
}

.exhibit h3 { margin-bottom: 10px; font-size: 1.22rem; }
.exhibit h3 a { text-decoration: none; }
.exhibit h3 a:hover { text-decoration: underline; text-decoration-color: var(--signal); }
.exhibit-text p { font-size: 1rem; line-height: 1.55; }
.exhibit .spec { margin: 14px 0 16px; font-size: 0.97rem; }
.exhibit .spec > div { grid-template-columns: 6.5rem minmax(0, 1fr); padding: 7px 0; }

.more { font-weight: 650; }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px clamp(32px, 5vw, 56px);
  align-items: start;
}
.about-grid .spec { margin: 0; }
.about-grid .spec > div { grid-template-columns: 9.5rem minmax(0, 1fr); }
.about-grid .spec > div:first-child { border-top: 0; padding-top: 0; }
.about-grid .spec > div:last-child { border-bottom: 0; padding-bottom: 0; }

.prose { max-width: 64ch; }
.prose .lede { margin-bottom: 1em; }

/* Contact */
.contact-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), max-content));
  gap: 20px clamp(32px, 6vw, 72px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.contact-list li { display: flex; align-items: center; gap: 14px; }

/* An icon (a small LED sign), with a mono label above the address. */
.contact-icon { flex: none; padding: 4px; }
.contact-list li:hover .contact-icon { border-color: color-mix(in srgb, var(--led-on) 55%, var(--bezel)); }
.contact-text { display: grid; gap: 4px; min-width: 0; }
.contact-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--label-size);
  font-weight: 500;
  letter-spacing: var(--label-track);
  text-transform: uppercase;
}
.contact-value {
  justify-self: start;
  font-size: clamp(1.1rem, 0.95rem + 0.7vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  overflow-wrap: break-word;
}

.nowrap { white-space: nowrap; }

/* A small key beside a label, e.g. Copy next to Email. */
.copy-button {
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
  border-radius: var(--r-label);
  background: transparent;
  color: var(--ink);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.copy-button:hover { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  font-weight: 600;
}


/* --- Case study pages ----------------------------------------------------- */

.case-page { padding-top: 8px; }
.case-page > .sheet + .sheet { margin-top: var(--section-space); }

.crumb {
  margin: 0 0 24px;
  font-family: var(--font-mono);
  font-size: var(--label-size);
  font-weight: 500;
  letter-spacing: var(--label-track);
  text-transform: uppercase;
}

.case-head .lede { max-width: 58ch; margin: 18px 0 0; }

.media-frame { margin: clamp(24px, 3.6vw, 40px) 0 0; }

figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.case-layout {
  display: grid;
  grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
  gap: 36px clamp(36px, 5vw, 64px);
  align-items: start;
}

.case-facts { position: sticky; top: 24px; }
.case-facts .spec { margin: 0; }
.case-facts .spec > div { grid-template-columns: 1fr; }
.case-facts .spec > div:first-child { border-top: 0; padding-top: 0; }
.case-facts .links { flex-direction: column; gap: 8px; margin-top: 18px; }

.prose h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 2.2em 0 0.7em;
  font-size: 1.5rem;
}
.prose h2:first-child { margin-top: 0; }
.prose h2 .is-lit { padding: 3px; border-width: 2px; border-radius: 6px; }
.prose figure { margin: 1.8em 0; }

/* Lists in case studies: each bullet is a small lit LED. */
.prose ul { margin: 0 0 1em; padding: 0; list-style: none; }
.prose li { position: relative; margin: 0.55em 0; padding-left: 1.5em; }
.prose li::before {
  content: "";
  position: absolute;
  left: 0.25em;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--led-on);
  box-shadow: 0 0 8px 1px color-mix(in srgb, var(--led-on) 55%, transparent);
}
.prose li strong { color: var(--ink); font-weight: 600; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.case-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: var(--section-space);
}
.case-nav a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 24px;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-decoration: none;
}
.case-nav a:hover { border-color: rgba(255, 255, 255, 0.3); }
.case-nav a.next { grid-column: 2; text-align: right; }
.case-nav span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--label-size);
  font-weight: 500;
  letter-spacing: var(--label-track);
  text-transform: uppercase;
}

/* --- Small pages (404, thanks) -------------------------------------------- */

.small-page .small-stage { height: clamp(200px, 38vh, 420px); }
.small-page h1 { font-size: clamp(2rem, 1.3rem + 2.4vw, 3rem); }
.small-page p { margin: 16px 0 0; max-width: 52ch; }

/* Small print at the end of a case study, such as a copyright line. */
.fineprint {
  margin-top: 2em;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   Narrow screens
   ========================================================================== */

@media (max-width: 900px) {
  .hero-panel,
  .exhibit,
  .about-grid,
  .case-layout { grid-template-columns: minmax(0, 1fr); }


  .case-facts { position: static; }
  .case-facts .spec > div { grid-template-columns: 8.5rem minmax(0, 1fr); }
}

@media (max-width: 560px) {
  :root { --header-h: 64px; --bezel-w: 7px; --sheet-pad: 20px; --label-track: 0.04em; --label-size: 12px; }
  .site-nav ul { gap: 12px; padding: 8px 12px; }
  .site-nav a { font-size: 0.75rem; }
  .hero-panel .lede { font-size: 1.08rem; }
  .spec > div,
  .about-grid .spec > div,
  .case-facts .spec > div { grid-template-columns: minmax(0, 1fr); }
  .case-nav { grid-template-columns: minmax(0, 1fr); }
  .case-nav a.next { grid-column: auto; text-align: left; }
}
