/* HEURISTIK Lab — Landing
 * Dark Swiss-punk on a LEFT SPINE: one full-height white rule is the page's
 * organizing axis. The masthead (topbar + hero) stays open; below the full-bleed
 * signal, the body hangs on a four-column grid whose rules cut out cleanly around
 * content. Two rule weights (white structural + hairline); gold is the single
 * accent — mono labels, markers, interactive hover, the live readhead. Emotion
 * palette shared with the CUE engine showcase.
 *
 * One cascade, one source per selector: base styles read top to bottom and
 * every breakpoint lives in the single responsive section at the end.
 */


/* ── Fonts ── */

@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/SpaceGrotesk.ttf") format("truetype");
  font-weight: 300 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter.ttf") format("truetype");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("../fonts/SpaceMono-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}


/* ── Design tokens ── */

:root {
  color-scheme: dark;
  font-size: clamp(15px, 0.4vw + 0.78rem, 19px);

  --bg: #000000;
  --fg: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --faint: rgba(255, 255, 255, 0.46);

  /* exactly two rule weights */
  --rule: rgba(255, 255, 255, 0.90);   /* white structural — spine + major bands */
  --hair: rgba(255, 255, 255, 0.22);   /* hairline — internal lines, inputs */

  --accent: #e6a93c;                    /* gold — the single accent */

  /* layout frame */
  --spine: clamp(60px, 6vw, 96px);      /* left margin column to the spine rule */
  --gutter: clamp(20px, 3vw, 48px);     /* spine rule → content */
  --pad-r: clamp(20px, 5vw, 72px);      /* content → right edge */
  --field-max: 1340px;
  --cutout: 13px;                       /* even grid-rule clearance around content */

  /* three brand faces — display (Space Grotesk), text (Inter), mono (Space Mono) */
  --fonts-display: "Space Grotesk", ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fonts-text: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fonts-mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}


/* ── Reset & base ── */

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;   /* clip the full-bleed signal's 100vw edge to the viewport */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--fonts-text);
  font-weight: 400;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;   /* with html overflow-x:clip, contains the full-bleed signal's 100vw */
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
img, svg { display: block; }

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


/* ── Frame + spine ── */

.frame {
  position: relative;
  max-width: var(--field-max);
  margin: 0 auto;
}

/* the single full-height white structural rule — the page's axis */
.frame::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--spine);
  width: 1px;
  background: var(--rule);
}

/* visible modular grid — full-height column rules the content snaps to */
.grid-rules {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--spine) + var(--gutter));
  right: var(--pad-r);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  pointer-events: none;
  z-index: 0;
}
.grid-rules > span + span { border-left: 1px solid var(--hair); }

/* The column grid lives in the body only (capabilities → contact). The masthead
   (topbar + hero) and the full-bleed signal stay open above it — the signal is
   the transition into the gridded body. The spine rule still spans the page. */
.grid-zone { position: relative; }

/* every band hangs off the spine: content starts past the rule + gutter */
.band {
  position: relative;
  z-index: 1;
  padding-left: calc(var(--spine) + var(--gutter));
  padding-right: var(--pad-r);
}

/* section running-head, ranged into the spine margin against the rule */
.band-mark {
  position: absolute;
  left: 0;
  top: 26px;
  width: var(--spine);
  padding-right: 12px;
  text-align: right;
  font-family: var(--fonts-mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  pointer-events: none;
}


/* ── Topbar ── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  border-bottom: 1px solid var(--rule);
}

.brand { display: inline-flex; align-items: center; transition: opacity 140ms ease; }
.brand:hover { opacity: 0.82; }

/* the primary lockup (mark = the H, gold circle = the accent) carries the wordmark */
.brand-lockup { height: 20px; width: auto; max-width: 100%; display: block; }

.site-nav { display: flex; align-items: center; gap: 22px; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--fonts-mono);
  font-size: 0.64rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg);
  transition: color 140ms ease;
}
.nav-link span { transition: transform 160ms ease; }
.nav-link:hover { color: var(--accent); }
.nav-link:hover span { transform: translate(2px, -2px); }

.github-link { display: flex; align-items: center; color: var(--fg); transition: color 140ms ease, opacity 140ms ease; }
.github-link:hover { color: var(--accent); }
.github-link svg { width: 21px; height: 21px; fill: currentColor; }


/* ── Hero ── */

.hero {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  row-gap: clamp(20px, 2.6vw, 34px);
  padding-top: clamp(40px, 7vw, 92px);
  padding-bottom: clamp(36px, 5vw, 72px);
}

.hero-title {
  grid-column: 1 / 5;
  margin: 0;
  font-family: var(--fonts-display);
  font-size: clamp(3rem, 7vw, 6.2rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.hero-tags {
  grid-column: 1 / 5;
  justify-self: start;
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 0;
}

.hero-lede {
  grid-column: 1 / 3;
  margin: 0 var(--gutter) 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.hero-tags span {
  color: var(--accent);
  font-family: var(--fonts-mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero-tags span::after {
  content: "\00b7";
  margin: 0 15px;
  color: rgba(230, 169, 60, 0.42);
}
.hero-tags span:last-child::after { content: ""; margin: 0; }


/* ── Signal print — sole full-bleed element, crosses the spine ── */

.signal {
  position: relative;
  z-index: 2;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: var(--bg);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--hair);
}

.signal-stage { position: relative; height: clamp(148px, 17vw, 236px); }

.signal-canvas { display: block; width: 100%; height: 100%; }

/* the one broken element: the live readout overshoots the band's lower edge */
.signal-readout {
  position: absolute;
  left: 0;
  bottom: 0;
  transform: translate(-50%, 52%);
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.78);
  font-family: var(--fonts-mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
}


/* ── Capabilities — one ruled spec row ── */

.capabilities {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: start;
  border-bottom: 1px solid var(--hair);
  padding-top: 0;
  padding-bottom: 0;
}

.capability { padding: 26px clamp(14px, 1.4vw, 22px) 30px; }
.capability:first-child { padding-left: 0; }

.capability-label {
  display: block;
  margin: 0 0 10px;
  font-family: var(--fonts-mono);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.capability p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }


/* ── Stacked sections (ragged-right, hung off the spine) ── */

.section {
  padding-top: clamp(40px, 5vw, 64px);
  padding-bottom: clamp(40px, 5vw, 64px);
}

.section + .section { border-top: 1px solid var(--hair); }

.section-title {
  margin: 0 0 12px;
  font-family: var(--fonts-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-title--sentence {
  letter-spacing: 0;
  text-transform: none;
  font-size: 1.2rem;
  display: inline-block;                          /* hug the text so the cutout fits it */
  background: var(--bg);
  box-shadow: 0 0 0 var(--cutout) var(--bg);
}

/* About — left two columns, ragged void to the right */
#about { display: grid; grid-template-columns: repeat(4, 1fr); }
.about-body { grid-column: 1 / 3; margin-right: var(--gutter); background: var(--bg); box-shadow: 0 0 0 var(--cutout) var(--bg); display: flex; flex-direction: column; gap: 12px; }
.about-body p { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.6; }


/* ── Spotlight ── */

.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: start;
}

.demo-frame {
  grid-column: 1 / 3;
  position: relative;
  margin-right: var(--gutter);       /* inset from the col-2/3 divider */
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0c0c0c;
  border: 1px solid var(--hair);
  box-shadow: 0 0 0 var(--cutout) var(--bg);
}

.project-text { grid-column: 3 / 5; margin-left: var(--gutter); background: var(--bg); box-shadow: 0 0 0 var(--cutout) var(--bg); }
.demo-poster { position: absolute; inset: 0; cursor: pointer; }
.demo-thumb { width: 100%; height: 100%; object-fit: cover; }
.demo-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 40px; height: 40px; padding: 0; border: none; background: none;
  cursor: pointer; opacity: 0.55; transition: opacity 200ms ease;
}
.demo-play:hover { opacity: 1; }
.demo-play svg { width: 100%; height: 100%; }

.project-desc { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.55; }

.project-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  font-family: var(--fonts-mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 140ms ease, border-color 140ms ease;
}
.project-cta span { transition: transform 160ms ease; }
.project-cta:hover { color: var(--accent); border-color: var(--accent); }
.project-cta:hover span { transform: translate(2px, -2px); }

/* tech stack — a compact mono spec run that rhymes with the signal readout */
.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  margin-top: 20px;
}
.stack span {
  font-family: var(--fonts-mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.stack span::after { content: "\00b7"; margin: 0 8px; color: rgba(230, 169, 60, 0.42); }
.stack span:last-child::after { content: ""; margin: 0; }


/* ── Lightbox ── */

.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0); transition: background 300ms ease;
}
.lightbox.is-open { background: rgba(0, 0, 0, 0.9); }
.lightbox-wrap {
  position: relative; width: 88vw; max-width: 960px; aspect-ratio: 16 / 9;
  opacity: 0; transform: scale(0.96); transition: opacity 300ms ease, transform 300ms ease;
}
.lightbox.is-open .lightbox-wrap { opacity: 1; transform: scale(1); }
.lightbox-wrap iframe { width: 100%; height: 100%; border: 0; }
.lightbox-close {
  position: absolute; top: -36px; right: 0; background: none; border: none;
  color: rgba(255, 255, 255, 0.6); font-size: 1.5rem; line-height: 1; cursor: pointer;
  padding: 4px 8px; transition: color 140ms ease;
}
.lightbox-close:hover { color: #fff; }


/* ── Contact — engagements col 1, form cols 3-4 ── */

.contact .section-title { margin-bottom: clamp(22px, 3vw, 34px); }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: start;
}

.contact-types { grid-column: 1 / 2; }
.contact-main { grid-column: 3 / 5; margin-left: var(--gutter); background: var(--bg); box-shadow: 0 0 0 var(--cutout) var(--bg); }

.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-field { margin-bottom: 12px; }

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

.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--hair);
  background: transparent;
  color: var(--fg);
  padding: 11px 12px;
  font-size: 0.95rem;
  outline: 0;
  resize: vertical;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.form-field input::placeholder,
.form-field textarea::placeholder {
  font-family: var(--fonts-mono);
  font-size: 0.68rem; font-weight: 400; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--faint); opacity: 1;
}
.form-field input:focus,
.form-field textarea:focus { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.form-actions { display: flex; justify-content: flex-end; }

.form-submit {
  display: inline-flex; align-items: center;
  border: 1px solid var(--fg); background: transparent; color: var(--fg);
  padding: 9px 26px;
  font-family: var(--fonts-mono); font-size: 0.72rem; font-weight: 400;
  letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.form-submit:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.form-submit:disabled { opacity: 0.5; cursor: default; }

.form-confirmation {
  font-family: var(--fonts-mono); font-size: 0.72rem; font-weight: 400;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent);
}

.contact-types {
  list-style: none; margin: 6px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.contact-types li {
  font-family: var(--fonts-mono);
  font-size: 0.7rem; font-weight: 400; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
  white-space: nowrap;
}
.contact-types li::before {
  content: ""; display: inline-block; width: 6px; height: 6px;
  background: var(--accent); margin-right: 11px; vertical-align: 1px;
}


/* ── Footer ── */

.footer {
  padding-top: 22px;
  padding-bottom: 22px;
  border-top: 1px solid var(--rule);
}
.footer p {
  margin: 0; color: var(--faint);
  font-family: var(--fonts-mono); font-size: 0.6rem; font-weight: 400;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.footer a { color: var(--muted); transition: color 140ms ease; }
.footer a:hover { color: var(--accent); }


/* ── Responsive ── */

/* Spine collapses to inline running-heads; single column. */
@media (max-width: 1024px) {
  :root { --pad-m: clamp(16px, 5vw, 40px); }

  /* spine + modular grid collapse to a single left-flush column */
  .frame::before { display: none; }
  .grid-rules { display: none; }

  .band { padding-left: var(--pad-m); padding-right: var(--pad-m); }

  .band-mark {
    position: static;
    display: block;
    width: auto;
    padding: 0 0 10px;
    text-align: left;
  }

  .hero {
    grid-template-columns: 1fr;
    align-items: start;
    row-gap: 22px;
  }
  .hero-title { grid-column: 1; }
  .hero-lede { grid-column: 1; margin: 0; max-width: 42ch; }
  .hero-tags { grid-column: 1; margin-left: 0; }

  .capabilities { grid-template-columns: 1fr 1fr; }
  .capability { border-top: 1px solid var(--hair); }
  .capability:nth-child(odd) { padding-left: 0; }
  .capability:nth-child(even) { padding-right: 0; }

  #about, .spotlight-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-body { grid-column: 1; margin-right: 0; }
  .demo-frame, .project-text { grid-column: 1; }
  .demo-frame { margin-right: 0; }
  .project-text { margin-left: 0; margin-top: 20px; }
  .contact-types, .contact-main { grid-column: 1; }
  .contact-main { margin-left: 0; }
  .contact-types { flex-direction: row; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 24px; }
}

@media (max-width: 600px) {
  .band { padding-left: 16px; padding-right: 16px; }

  .topbar { height: auto; flex-wrap: wrap; gap: 6px 16px; padding-top: 12px; padding-bottom: 12px; }
  .brand { flex: 1 0 100%; }
  .site-nav { flex: 1 0 100%; justify-content: flex-start; gap: 18px; }

  .hero-title { font-size: clamp(2.5rem, 14vw, 3.6rem); }

  .capabilities { grid-template-columns: 1fr; }
  .capability, .capability:nth-child(odd) { padding-left: 0; padding-right: 0; }

  .form-row { grid-template-columns: 1fr; }
  .demo-play { width: 32px; height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
