/* Purist Industries: shared stylesheet (moved verbatim from index.html). */

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

/* Dark stage, warm-paper light. Contact flips these when the
   triangle swallows the screen. */
:root {
  --bg: #0c0b0a;
  --fg: #efe9dd;
  --tri: #ffc629;
  --fg-2: rgba(239, 233, 221, 0.6);
  --rule: rgba(239, 233, 221, 0.14);

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif;

  --pad: clamp(1rem, 5vw, 4rem);
  --col: 38rem;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
}

a {
  color: inherit;
}

ul,
ol {
  list-style: none;
}

/* ───────────────────────────── STAGE
   Triangle, spotlight, vignette and grain are all fixed layers;
   the content scrolls over them. */
.tri {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(72vh, 86vw);
  height: min(72vh, 86vw);
  pointer-events: none;
  z-index: 0;
}

.tri-par,
.tri svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.tri-edge {
  fill: none;
  stroke: var(--tri);
  stroke-width: 0.3;
}

.tri-flash,
.tri-solid {
  fill: var(--tri);
  opacity: 0;
}

.sub {
  fill: var(--tri);
  stroke: var(--bg);
  stroke-width: 0.5;
  stroke-linejoin: round;
  opacity: 0;
}

.vertex {
  fill: var(--tri);
}

.halo {
  opacity: 0;
}

.halo circle:first-child {
  fill: var(--tri);
}

.halo circle:last-child {
  fill: none;
  stroke: var(--tri);
  stroke-width: 0.2;
}

.js .tri-edge {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

html:not(.js) .tri {
  opacity: 0.12;
}

.spot,
.vignette,
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.spot {
  --x: 50%;
  --y: 40%;
  z-index: 1;
  background: radial-gradient(
    circle 32vmax at var(--x) var(--y),
    rgba(255, 238, 210, 0.07),
    transparent 70%
  );
}

.vignette {
  z-index: 1;
  background: radial-gradient(
    ellipse at center,
    transparent 45%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

.grain {
  z-index: 50;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ───────────────────────────── NAV
   Difference blend keeps it legible on black and on paper. */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  padding-inline: var(--pad);
  font-size: 0.8rem;
  color: var(--fg);
}

.brand {
  text-decoration: none;
  letter-spacing: 0.04em;
}

.nav ul {
  display: flex;
  gap: 1.75rem;
}

.nav a {
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.nav a:hover,
.nav .brand {
  opacity: 1;
}

/* ───────────────────────────── CONTENT */
main,
footer {
  position: relative;
  z-index: 2;
  padding-inline: var(--pad);
}

/* The hero is held on screen for a second viewport of scroll
   while the camera flies through the triangle. */
.hero-wrap {
  height: 200svh;
}

.hero {
  position: sticky;
  top: 0;
  height: 100svh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  padding-block: 64px 1.5rem;
  text-align: center;
}

.hero-inner {
  max-width: 60rem;
}

.hero .label {
  margin-bottom: 2rem;
}

h1 {
  font-size: clamp(3rem, 10vw, 9rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
}

.lede {
  margin: 2.25rem auto 0;
  max-width: 32rem;
  color: var(--fg-2);
}

.lede strong {
  color: var(--fg);
  font-weight: 500;
}

.caps {
  margin: 2.5rem auto 0;
  max-width: 40rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-2);
  line-height: 2.2;
}

.caps li {
  display: inline;
}

.caps li:not(:last-child)::after {
  content: "   △   ";
  white-space: pre;
  opacity: 0.5;
}

.cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-2);
}

.cue span {
  width: 1px;
  height: 42px;
  background: var(--fg);
  transform-origin: top;
  animation: cue 2.2s cubic-bezier(0.7, 0, 0.3, 1) infinite;
}

@keyframes cue {
  0% {
    transform: scaleY(0);
    transform-origin: top;
  }
  45% {
    transform: scaleY(1);
    transform-origin: top;
  }
  55% {
    transform: scaleY(1);
    transform-origin: bottom;
  }
  100% {
    transform: scaleY(0);
    transform-origin: bottom;
  }
}

section {
  max-width: var(--col);
  padding-block: clamp(6rem, 14vw, 10rem);
  scroll-margin-top: 0;
  color: var(--fg);
}

.label {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-2);
  margin-bottom: 1.75rem;
  min-height: 1.2em;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin-bottom: 2.5rem;
}

h3 {
  font-size: 1.45rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

em {
  font-style: italic;
}

p {
  text-wrap: pretty;
}

p + p {
  margin-top: 1rem;
}

.muted {
  color: var(--fg-2);
}

blockquote {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  line-height: 1.3;
  margin-bottom: 2.5rem;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  margin-top: 3rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--fg-2);
}

.stats b {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.6rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--fg);
}

/* Numbered rows: services, pillars, steps */
.rows > li {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  padding-block: 2rem;
  border-top: 1px solid var(--rule);
}

.rows > li:last-child {
  border-bottom: 1px solid var(--rule);
}

.n {
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.15;
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}

.rows h3 {
  margin-bottom: 0.6rem;
}

.rows h3 small {
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-2);
  margin-left: 0.75rem;
  white-space: nowrap;
  vertical-align: 0.2em;
}

.rows p {
  color: var(--fg-2);
}

.tags {
  margin-top: 0.85rem;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--fg-2);
  opacity: 0.8;
}

#contact {
  min-height: 100svh;
  padding-top: clamp(8rem, 16vh, 11rem);
  padding-bottom: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.email {
  display: inline-block;
  align-self: flex-start;
  margin-block: 2.5rem 3rem;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  overflow-wrap: anywhere;
}

dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.7rem 1.75rem;
  font-size: 0.85rem;
}

dt {
  color: var(--fg-2);
}

.close {
  margin-top: 2.5rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.35rem;
}

footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  padding-block: 2rem;
  font-size: 0.72rem;
  color: var(--fg-2);
}

/* Hidden until GSAP reveals it (see gate script above). */
.js [data-fade],
.js [data-split],
.js [data-scramble] {
  visibility: hidden;
}

@media (max-width: 860px) {
  .nav ul li:not(:last-child) {
    display: none;
  }

  dl {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
  }

  dd {
    margin-bottom: 0.8rem;
  }

  .rows > li {
    grid-template-columns: 2.5rem minmax(0, 1fr);
  }
}

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

/* ───────────────────────────── SERVICE PAGES
   Static pages: no GSAP, so the stage rests at its quiet fallback
   (faint outline triangle) and every block is visible from the start. */
.nav a[aria-current="page"] {
  opacity: 1;
}

.hero-page {
  position: relative;
  height: auto;
  min-height: 100svh;
  padding-block: 8rem 1.5rem;
}

.cta {
  display: inline-block;
  margin-top: 2.5rem;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  letter-spacing: -0.01em;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: color 0.2s;
}

.cta:hover {
  color: var(--tri);
}

/* Small text link, e.g. from a services row to its page. */
.more {
  color: var(--fg);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.2s;
}

.more:hover {
  border-color: currentColor;
}

/* Intro copy that sits between an h2 and a list or grid. */
.intro {
  margin-bottom: 3rem;
}

/* A sub-block inside a section, introduced by an h3. */
.part {
  margin-top: 4.5rem;
}

.part > h3 {
  margin-bottom: 1.5rem;
}

.note {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--fg-2);
}

/* Flow: stacked steps joined by the brand triangle. */
.flow > li {
  position: relative;
  padding: 1.25rem 1.5rem 1.4rem;
  border: 1px solid var(--rule);
  background: rgba(12, 11, 10, 0.72);
}

.flow > li:last-child {
  border-color: rgba(255, 198, 41, 0.45);
}

.flow > li + li {
  margin-top: 2.5rem;
}

.flow > li + li::before {
  content: "▽";
  content: "▽" / "";
  position: absolute;
  bottom: 100%;
  left: 1.5rem;
  font-size: 0.75rem;
  line-height: 2.5rem;
  color: var(--tri);
}

.flow-name {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-2);
}

.flow-name span {
  margin-right: 0.75rem;
  color: var(--tri);
  font-variant-numeric: tabular-nums;
}

.flow-what {
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.25;
}

.flow-eg {
  font-size: 0.85rem;
  color: var(--fg-2);
}

.flow p + p {
  margin-top: 0.5rem;
}

/* FAQ: native details/summary, no script. */
.faq details {
  border-top: 1px solid var(--rule);
}

.faq details:last-child {
  border-bottom: 1px solid var(--rule);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding-block: 1.5rem;
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "▷";
  content: "▷" / "";
  flex-shrink: 0;
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--fg-2);
  transition: transform 0.2s;
}

.faq details[open] summary::after {
  transform: rotate(90deg);
}

.faq details > div {
  padding-bottom: 1.75rem;
  color: var(--fg-2);
}

@media (max-width: 860px) {
  .hero-page {
    padding-top: 6rem;
  }

  .flow > li {
    padding-inline: 1rem;
  }

  .flow > li + li::before {
    left: 1rem;
  }

  .faq summary {
    font-size: 1.25rem;
  }
}
