/* ============================================================
   Trion Code — landing
   Palette: paper neutrals + brand indigo as solid ink + one
   signal-orange accent. No gradients, no shadows-on-everything.
   Type: Bricolage Grotesque (display/body) + IBM Plex Mono (labels).
   ============================================================ */

:root {
  --paper: #F5F6F9;
  --paper-deep: #EBEDF3;
  --ink: #23264B;
  --ink-soft: #4A4E77;
  --brand: #394084;
  --brand-weak: rgba(57, 64, 132, 0.14);
  --accent: #E4572E;
  --accent-ink: #C43D17;
  --line: rgba(35, 38, 75, 0.16);
  --line-strong: rgba(35, 38, 75, 0.38);

  --font-sans: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  /* headings: HK Grotesk Bold (published today as Hanken Grotesk) */
  --font-display: "Hanken Grotesk", "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;

  --measure: 34rem;
  --pad-x: clamp(1rem, 4vw, 3.5rem);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* paper grain — one subtle texture, not glass/blur */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.mono { font-family: var(--font-mono); }

a { color: inherit; }

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

/* ============ top bar ============ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.8rem var(--pad-x);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

/* Official logo (hexagon mark + TRION in HK Grotesk + CODE in Disket Mono),
   rebuilt as SVG outlines from the brand files — see assets/logo.svg. */
.brand-logo { display: block; height: 44px; width: auto; }
@media (max-width: 640px) { .brand-logo { height: 36px; } }

.topnav {
  display: flex;
  gap: 1.6rem;
  margin-left: auto;
}

.topnav a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.topnav a:hover { color: var(--ink); border-bottom-color: var(--accent); }

.lang-switch { border: 1px solid var(--line-strong); display: flex; }
.lang-switch button {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.32rem 0.6rem;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] {
  background: var(--brand);
  color: var(--paper);
}

/* ============ hero ============ */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

#lattice {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 72rem;
  margin-inline: auto;
  padding: clamp(4rem, 11vh, 8rem) var(--pad-x) clamp(4rem, 10vh, 7rem);
}

.kicker {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin: 0 0 1.4rem;
}

.kicker-dot {
  width: 9px; height: 9px;
  background: var(--accent);
  border-radius: 50%;
  flex: none;
}

.display {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7.2vw, 5.3rem);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1.4rem;
  max-width: 13ch;
}

.accent-ink { color: var(--brand); }

.lede {
  max-width: var(--measure);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: var(--ink-soft);
  margin: 0 0 2.2rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.78rem 1.5rem;
  border: 1px solid transparent;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-ink); }

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

/* ============ demo strip ============ */

.demo-strip {
  background: var(--brand);
  color: var(--paper);
  border-bottom: 1px solid var(--line);
}

.demo-strip-inner {
  max-width: 72rem;
  margin-inline: auto;
  padding: clamp(2.2rem, 5vh, 3.4rem) var(--pad-x);
  display: grid;
  grid-template-columns: minmax(10rem, 16rem) 1fr;
  gap: 2rem;
}

.strip-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245, 246, 249, 0.75);
}

.demo-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem;
}

.demo-steps li { display: flex; gap: 0.8rem; align-items: flex-start; }
.demo-steps p { margin: 0; font-size: 0.98rem; line-height: 1.5; }

.step-no {
  flex: none;
  width: 1.7rem; height: 1.7rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 246, 249, 0.5);
  border-radius: 50%;
  font-size: 0.85rem;
}

.demo-chip-inline {
  font-family: var(--font-mono);
  font-size: 0.85em;
  font-weight: 500;
  background: var(--accent);
  color: #fff;
  padding: 0.1em 0.5em;
  white-space: nowrap;
}

/* ============ project index ============ */

.projects {
  max-width: 72rem;
  margin-inline: auto;
  padding: clamp(3.5rem, 9vh, 6rem) var(--pad-x);
}

.projects-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.2rem;
}

.projects-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.projects-note { font-size: 0.85rem; color: var(--ink-soft); }

.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
}

.project-row {
  border-bottom: 1px solid var(--line-strong);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.4rem;
  align-items: center;
  transition: background-color 150ms ease;
}

.project-row:hover { background: var(--paper-deep); }

.project-link {
  display: grid;
  grid-template-columns: 5rem 1fr auto;
  gap: 1.4rem;
  align-items: center;
  text-decoration: none;
  padding: 1.6rem 0.4rem;
  min-width: 0;
}

.p-code {
  font-size: 0.85rem;
  color: var(--ink-soft);
  align-self: start;
  padding-top: 0.55rem;
}

.p-main { display: grid; gap: 0.45rem; }

.p-name {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--brand);
  line-height: 1.05;
}

.project-row:hover .p-name { color: var(--accent-ink); }

.p-desc {
  max-width: 44rem;
  color: var(--ink-soft);
  font-size: 1rem;
}

.p-stack {
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  opacity: 0.75;
}

.p-side {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  justify-self: end;
  padding-right: 0.4rem;
}

.p-docs {
  font-size: 0.78rem;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--brand);
  color: var(--brand);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 140ms ease, color 140ms ease;
}
.p-docs:hover { background: var(--brand); color: var(--paper); }

.p-status {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 140ms ease, color 140ms ease;
}

.project-row[data-status="live"] .p-status {
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
}
.project-row[data-status="live"] .p-status:hover {
  background: var(--accent);
  color: var(--paper);
}

.p-arrow {
  font-size: 1.5rem;
  color: var(--brand);
  transition: transform 180ms ease;
}
.project-row:hover .p-arrow { transform: translateX(6px); }

/* rows not yet live: keep them visible, mark them, soften the arrow */
.project-row[data-status="soon"] .p-arrow { opacity: 0.35; }

.projects-foot {
  margin: 2rem 0 0;
  max-width: var(--measure);
  color: var(--ink-soft);
  font-size: 0.98rem;
}

/* ============ team ============ */

.team {
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
}

.team-inner {
  max-width: 72rem;
  margin-inline: auto;
  padding: clamp(3rem, 8vh, 5rem) var(--pad-x);
  display: grid;
  grid-template-columns: minmax(14rem, 30rem) 1fr;
  gap: 2.5rem;
  align-items: start;
}

.team h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 700;
  margin: 0;
}

.team-text {
  margin: 0 0 1.4rem;
  max-width: var(--measure);
  color: var(--ink-soft);
}

.team-facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
}

.team-facts li {
  font-size: 0.8rem;
  border: 1px solid var(--line-strong);
  padding: 0.3rem 0.7rem;
  color: var(--ink);
}

/* ============ colophon ============ */

.colophon { border-top: 1px solid var(--line); }

.colophon-inner {
  max-width: 72rem;
  margin-inline: auto;
  padding: 1.6rem var(--pad-x) 2rem;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.colophon p { margin: 0; max-width: 46rem; }

/* ============ entrance choreography ============ */

@media (prefers-reduced-motion: no-preference) {
  .hero-inner > * {
    opacity: 0;
    transform: translateY(14px);
    animation: rise 640ms cubic-bezier(0.2, 0.65, 0.25, 1) forwards;
  }
  .hero-inner > *:nth-child(1) { animation-delay: 60ms; }
  .hero-inner > *:nth-child(2) { animation-delay: 150ms; }
  .hero-inner > *:nth-child(3) { animation-delay: 260ms; }
  .hero-inner > *:nth-child(4) { animation-delay: 360ms; }

  @keyframes rise {
    to { opacity: 1; transform: none; }
  }
}

/* ============ responsive ============ */

@media (max-width: 860px) {
  .demo-strip-inner { grid-template-columns: 1fr; gap: 1.2rem; }
  .demo-steps { grid-template-columns: 1fr; gap: 1.1rem; }
  .team-inner { grid-template-columns: 1fr; gap: 1.4rem; }
}

@media (max-width: 700px) {
  .topnav { display: none; }
  .project-row { grid-template-columns: 1fr; gap: 0; }
  .project-link { grid-template-columns: 1fr; gap: 0.7rem; padding: 1.3rem 0.2rem 0.5rem; }
  .p-code { padding-top: 0; }
  .p-arrow { display: none; }
  .p-side { justify-self: start; padding: 0 0.2rem 1.2rem; }
}
