/* ============================================================
   TULPARIA — flat design system
   Glassmorphism removed: no backdrop-filter, no translucent
   cards, no glow orbs, no gradient text, no blur shadows.
   Surfaces are opaque, separated by hairlines.
   ============================================================ */
:root {
  /* Ground */
  --ink: #05070a;
  --panel: #0b0e13;
  --panel-2: #11151b;
  --line: #1b2027;
  --line-bright: #2c333c;

  /* Type colour */
  --fg: #f2f5f7;
  --fg-muted: #89929b;
  --fg-dim: #5a636d;

  /* Single accent — the brand green, unchanged */
  --accent: #00ff0d;
  --accent-ink: #05070a;

  /* Fonts — free stand-ins for the licensed families */
  --f-display: 'Clash Grotesk', system-ui, sans-serif;
  /* Die Grotesk */
  --f-editorial: 'General Sans', system-ui, sans-serif;
  /* PolySans   */
  --f-ui: 'Switzer', system-ui, sans-serif;
  /* PP Mori    */
  --f-mono: 'Geist Mono', ui-monospace, monospace;
  /* Pix Geist  */

  --nav-h: 76px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --maxw: 1360px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--ink);
  color: var(--fg);
  font-family: var(--f-ui);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--ink);
}

::-webkit-scrollbar-thumb {
  background: var(--line-bright);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ---------- layout primitives ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.sec {
  padding-block: clamp(5rem, 11vh, 9rem);
  position: relative;
  border-top: 1px solid var(--line);
}

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
}

/* ---------- type ---------- */
/* Panel heading — carries the small-title role the eyebrows used to,
   inside the contact-success and notify panels. */
.panel-title {
  font-family: var(--f-mono);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--accent);
}

.h1 {
  font-family: var(--f-display);
  font-size: clamp(2.6rem, 7.2vw, 6.2rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.h2 {
  font-family: inherit;
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.025em;
  /* `pretty`, not `balance`: balancing "The Legend of >Tulpar" strands
     "of" at the head of line two. */
  text-wrap: pretty;
}

/* Section titles that are entirely Matrix text. Geist Mono sets far wider
   than Clash Grotesk, so the whole-title variant steps the size down to
   keep "The Legend of Tulpar" on one line down to phone widths. */
.h2--mono {
  font-size: clamp(1.5rem, 3.4vw, 2.6rem);
  letter-spacing: -.01em;
  line-height: 1.1;
}

.h3 {
  font-family: inherit;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.015em;
}

.lede {
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  color: var(--fg-muted);
  line-height: 1.62;
  max-width: 56ch;
  text-wrap: pretty;
}

.body {
  color: var(--fg-muted);
  line-height: 1.68;
  text-wrap: pretty;
}

.mono-label {
  font-family: var(--f-mono);
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

/* ============================================================
   BUTTON — inverse circle on hover, inverse fill on click
   Base state: transparent field, accent text + hairline.
   The .tbtn__fill layer holds a second copy of the label in the
   inverted colours, exposed through a circular clip-path window
   that tracks the pointer and expands to cover on click.
   clip-path is used rather than a drawn shape so the inner label
   never reflows — the two copies stay in exact register and the
   circle inverts field and text together.
   ============================================================ */
.tbtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: 1.05rem 2rem;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: transparent;
  color: var(--accent);
  /* Pix Geist (Geist Mono stand-in) */
  font-family: var(--f-mono);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.tbtn__t {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}

.tbtn__fill {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  background: var(--accent);
  color: var(--accent-ink);
  /* Resting state only. The circle's radius and centre are applied inline
     by TButton in ui.jsx: it tracks the pointer on hover and expands to
     cover the whole button on click. A :hover rule here would race the
     pointer handler, so the mechanic stays entirely in JS. */
  clip-path: circle(0px at 50% 50%);
  pointer-events: none;
}

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

/* neutral variant — same mechanic, white ink */
.tbtn--ghost {
  border-color: var(--line-bright);
  color: var(--fg);
}

.tbtn--ghost .tbtn__fill {
  background: var(--fg);
  color: var(--ink);
}

.tbtn--ghost:focus-visible {
  outline-color: var(--fg);
}

.tbtn--sm {
  padding: .72rem 1.25rem;
  font-size: .76rem;
}


/* ---------- flat surface (replaces .glass-card) ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: clamp(1.6rem, 3vw, 2.5rem);
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}

.panel--hover:hover {
  border-color: var(--line-bright);
  background: var(--panel-2);
}

.panel--flush {
  background: transparent;
}

/* ---------- card scroll reveal animations ---------- */
.sec .panel {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity .5s var(--ease),
    transform .5s var(--ease),
    border-color .3s var(--ease),
    background-color .3s var(--ease);
  will-change: opacity, transform;
}

.sec .panel.in-view {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity .7s var(--ease),
    transform .7s var(--ease),
    border-color .3s var(--ease),
    background-color .3s var(--ease);
}

.g3>.panel.in-view:nth-child(1) {
  transition-delay: 0ms, 0ms, 0ms, 0ms;
}

.g3>.panel.in-view:nth-child(2) {
  transition-delay: 100ms, 100ms, 0ms, 0ms;
}

.g3>.panel.in-view:nth-child(3) {
  transition-delay: 200ms, 200ms, 0ms, 0ms;
}

.g2>.panel.in-view:nth-child(1) {
  transition-delay: 0ms, 0ms, 0ms, 0ms;
}

.g2>.panel.in-view:nth-child(2) {
  transition-delay: 120ms, 120ms, 0ms, 0ms;
}

@media (prefers-reduced-motion: reduce) {
  .sec .panel {
    opacity: 1;
    transform: none;
    transition: border-color .3s var(--ease), background-color .3s var(--ease);
  }
}

/* ============================================================
   CORNER-ANCHORED STAGE — shared by Hero and Contact.
   Labels pin bottom-left (stacked vertically), actions pin
   bottom-right (stacked horizontally).
   ============================================================ */
.stage {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  isolation: isolate;
}

.stage__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.stage__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1) contrast(1.08) brightness(.62);
}

/* readability scrim — flat linear ramps, no blur */
.stage__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, var(--ink) 2%, rgba(5, 7, 10, .82) 26%, rgba(5, 7, 10, .30) 62%, rgba(5, 7, 10, .55) 100%),
    linear-gradient(to right, rgba(5, 7, 10, .72) 0%, rgba(5, 7, 10, 0) 55%);
}

.stage__foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(2rem, 5vw, 4rem);
  padding-bottom: clamp(2.5rem, 6vh, 4.5rem);
  padding-top: 8rem;
}

/* bottom-left: labels stacked vertically */
.stage__labels {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(1rem, 2vh, 1.6rem);
  min-width: 0;
}

/* bottom-right: buttons stacked horizontally */
.stage__actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .85rem;
  flex-shrink: 0;
  padding-bottom: .35rem;
}

/* ---------- matrix text (preserved effect) ---------- */
/* Plain inline, not inline-flex: whole section titles now run through this
   and must be able to wrap on narrow viewports. */
.matrix {
  font-family: var(--f-mono);
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: -.02em;
  line-height: inherit;
  color: var(--accent);
}

.matrix__prefix {
  opacity: .55;
  user-select: none;
  margin-right: .12em;
}

.matrix__caret {
  display: inline-block;
  width: .42em;
  height: .78em;
  background: var(--accent);
  margin-left: .08em;
  transform: translateY(.02em);
  animation: caret .8s steps(2, start) infinite;
}

@keyframes caret {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .matrix__caret {
    animation: none;
  }
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 900;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background-color .3s var(--ease), border-color .3s var(--ease);
}

.nav[data-solid="true"] {
  background: var(--ink);
  border-bottom-color: var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  width: 100%;
}

.nav__brand {
  font-family: var(--f-display);
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--fg);
  text-decoration: none;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1.1rem, 2.4vw, 2.2rem);
}

.nav__link {
  position: relative;
  font-family: var(--f-mono);
  font-size: .76rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  text-decoration: none;
  padding-block: .4rem;
  transition: color .25s var(--ease);
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 100%;
  background: var(--accent);
  /* Scaled rather than grown from width: 0 — same visual, but it animates on
     the compositor instead of relaying out the rule on every frame. */
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}

.nav__link:hover {
  color: var(--fg);
}

.nav__link[data-active="true"] {
  color: var(--accent);
}

.nav__link[data-active="true"]::after {
  transform: scaleX(1);
}

.nav__burger {
  display: none;
  background: none;
  border: 1px solid var(--line-bright);
  border-radius: 2px;
  color: var(--fg);
  padding: .55rem .7rem;
  cursor: pointer;
  font-family: var(--f-mono);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.nav__sheet {
  position: fixed;
  inset: var(--nav-h) 0 auto 0;
  background: var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 1rem var(--gutter) 1.6rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  z-index: 899;
}

.nav__sheet a {
  font-family: var(--f-mono);
  font-size: .82rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  text-decoration: none;
  padding: .85rem 0;
  border-bottom: 1px solid var(--line);
}

/* ---------- section heading ---------- */
.sechead {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  align-items: center;
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  margin-left: auto;
  margin-right: auto;
  max-width: 62ch;
}

/* ---------- grids ---------- */
.g2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

.g3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}


/* ---------- product card ---------- */
.prod {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 100%;
}

.prod__mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-bright);
  border-radius: 2px;
  font-family: var(--f-mono);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--fg);
  flex-shrink: 0;
}

.prod--live .prod__mark {
  border-color: var(--accent);
  color: var(--accent);
}

.prod__status {
  font-family: var(--f-mono);
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: .3rem .55rem;
  border: 1px solid var(--line-bright);
  border-radius: 2px;
  color: var(--fg-dim);
  white-space: nowrap;
}

.prod--live .prod__status {
  color: var(--accent);
  border-color: var(--accent);
}

.prod__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}

.prod__list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .8rem;
  align-items: baseline;
  font-size: .9rem;
  color: var(--fg-muted);
  padding-block: .6rem;
  border-top: 1px solid var(--line);
}

.prod__list li::before {
  content: "—";
  color: var(--fg-dim);
  font-family: var(--f-mono);
  font-size: .8rem;
}

.prod--live .prod__list li::before {
  color: var(--accent);
}

/* ---------- reason rows (About) ---------- */
.reason {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.25rem;
  padding-block: 1.4rem;
  border-top: 1px solid var(--line);
  align-items: start;
}

.reason__n {
  font-family: var(--f-mono);
  font-size: 1.1rem;
  line-height: 1.2;
  color: var(--accent);
  letter-spacing: .1em;
  user-select: none;
}

/* ---------- form ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.field label {
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.field input,
.field textarea {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: .85rem 1rem;
  color: var(--fg);
  font-family: var(--f-ui);
  font-size: .95rem;
  outline: none;
  transition: border-color .25s var(--ease);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--fg-dim);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
}

.field textarea {
  resize: vertical;
  min-height: 116px;
}

/* ---------- contact panel ---------- */
.cpanel {
  position: relative;
  z-index: 3;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  width: min(480px, 100%);
  animation: panelIn .4s var(--ease) both;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cpanel {
    animation: none;
  }
}

/* ---------- contact channel rows ---------- */
.chan {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
  text-decoration: none;
  padding-block: .55rem;
}

.chan__k {
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.chan__v {
  color: var(--fg);
  font-size: 1.02rem;
  transition: color .25s var(--ease);
}

a.chan:hover .chan__v {
  color: var(--accent);
}

/* ---------- privacy banner ---------- */
.privacy-banner {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 850;
  background: var(--ink);
  border-top: 1px solid var(--line);
  padding-block: 1rem;
  animation: bannerIn .35s var(--ease) both;
}

@keyframes bannerIn {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .privacy-banner {
    animation: none;
  }
}

.privacy-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.privacy-banner__text {
  font-size: .88rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

/* ---------- error pages (404, and whatever follows) ---------- */
.errpage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  text-align: center;
  /* Die Grotesk, matching the other full-viewport moments */
  font-family: var(--f-display);
}

.errpage__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 3vh, 1.75rem);
  max-width: 100%;
}

.errpage__code {
  font-size: clamp(2.25rem, 6.5vw, 5rem);
  font-weight: 600;
  line-height: .98;
  letter-spacing: -.03em;
  color: var(--fg);
  text-wrap: balance;
}

/* .matrix is inline and inherits its size from here. */
.errpage__msg {
  font-size: clamp(1.35rem, 3.4vw, 2.4rem);
  line-height: 1.15;
}

.errpage .tbtn {
  margin-top: clamp(.5rem, 2vh, 1.25rem);
}

/* ---------- footer ---------- */
.foot {
  border-top: 1px solid var(--line);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
}

.foot__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}

.foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
}

.foot__links a {
  font-family: var(--f-mono);
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color .25s var(--ease);
}

.foot__links a:hover {
  color: var(--accent);
}

.foot__bot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.75rem;
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  color: var(--fg-dim);
}

.foot__bot a {
  color: var(--accent);
  text-decoration: none;
}

/* ---------- per-section typeface assignment ---------- */
/* Hero + Contact -> Die Grotesk (Clash Grotesk) */
#hero,
#contact {
  font-family: var(--f-display);
}

#hero .lede,
#hero .body,
#contact .lede,
#contact .body,
#contact input,
#contact textarea {
  font-family: var(--f-ui);
}

/* Story + About -> PolySans (General Sans) */
#story,
#about {
  font-family: var(--f-editorial);
}

/* Products -> PP Mori (Switzer) */
#products {
  font-family: var(--f-ui);
}

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .g3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .nav__links {
    display: none;
  }

  .nav__burger {
    display: block;
  }

  .g2,
  .g3 {
    grid-template-columns: minmax(0, 1fr);
  }

  /* corner anchoring collapses to a single stacked column */
  .stage__foot {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 2rem;
    padding-top: 6rem;
  }

  .stage__actions {
    flex-wrap: wrap;
    padding-bottom: 0;
  }

  .stage__actions .tbtn {
    flex: 1 1 auto;
  }
}

@media (max-width: 480px) {
  .tbtn {
    padding: .9rem 1.2rem;
    font-size: .78rem;
  }

  .stage__actions {
    width: 100%;
  }
}
