/* Quigley Systems — shared styles for index.html and privacy.html.
   Greys only. The accent (random per load, accent.js) marks one thing at a time: the bottleneck, or the action. */

@font-face {
  font-family: "Jost";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/jost-latin.woff2") format("woff2");
}

:root {
  --paper: #FAFAFA;
  --ink: #121212;
  --grey-7: #4A4A4A;   /* body text on paper */
  --grey-6: #6B6B6B;   /* captions, labels */
  --grey-3: #CFCFCF;
  --grey-2: #E2E2E2;   /* rules */
  --night: #0E0E0E;
  --night-text: #B5B5B5;
  --accent: #601C2F;       /* fallback; accent.js sets one of 100 colours per load */
  --accent-lift: #7A2439;  /* hover: away from the text colour */
  --accent-text: #FFFFFF;
  --edge: 36px;            /* lattice triangle edge; site.js sets it from the viewport */
  --gutter: clamp(1.25rem, 4.5vw, 3.5rem);
  --tri: 0.57735;      /* tan 30deg: slant of a 60deg edge per unit height */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Jost", ui-sans-serif, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.night :focus-visible { outline-color: #fff; }

.wrap { width: min(100% - 2 * var(--gutter), 72rem); margin-inline: auto; }

.eyebrow {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey-6);
}
h1, h2, h3 { font-weight: 500; text-wrap: balance; }
h2 {
  font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.012em;
}
h3 { font-size: 1.25rem; line-height: 1.3; }
p { text-wrap: pretty; }

/* ---------- Header ---------- */
.top {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  padding-block: 1.5rem;
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.mark { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.mark svg { width: 1.75rem; height: auto; }
.mark span {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.top-link {
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

/* ---------- Triangle button ----------
   A parallelogram of alternating triangles. The CSS shape is the no-JS fallback;
   site.js adds the facets and snaps the width to whole triangles. */
.tri-btn {
  --h: 3.5rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  height: var(--h);
  padding-inline: calc(var(--h) * 0.95);
  color: var(--accent-text);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  isolation: isolate;
}
.tri-btn::before,
.tri-btn .facets {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  clip-path: polygon(calc(var(--h) * var(--tri)) 0, 100% 0, calc(100% - var(--h) * var(--tri)) 100%, 0 100%);
}
.tri-btn::before { background: var(--accent); transition: background-color 0.3s; }
.tri-btn .facets { width: 100%; height: 100%; }
.tri-btn .facets polygon { fill: var(--f); stroke: var(--f); stroke-width: 0.6; transition: fill 0.35s ease, stroke 0.35s ease; }
.tri-btn:hover .facets polygon,
.tri-btn:focus-visible .facets polygon { fill: var(--g); stroke: var(--g); }
.tri-btn:hover::before { background: var(--accent-lift); }
.tri-btn .arrow {
  width: 0;
  height: 0;
  border-block: 0.36em solid transparent;
  border-left: 0.62em solid currentColor;
  transition: transform 0.3s ease;
}
.tri-btn:hover .arrow,
.tri-btn:focus-visible .arrow { transform: translateX(0.3em); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
}
.text-link .arrow-down {
  width: 0;
  height: 0;
  border-inline: 0.34em solid transparent;
  border-top: 0.58em solid currentColor;
  transition: transform 0.3s ease;
}
.text-link:hover .arrow-down { transform: translateY(0.2em); }
.text-link span:first-child { border-bottom: 1px solid var(--grey-3); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: center;
  overflow: hidden;
}
.lattice {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.hero .lattice {
  -webkit-mask-image: linear-gradient(90deg, rgb(0 0 0 / 0.22) 0%, rgb(0 0 0 / 0.22) 40%, #000 72%);
  mask-image: linear-gradient(90deg, rgb(0 0 0 / 0.22) 0%, rgb(0 0 0 / 0.22) 40%, #000 72%);
}
.hero-copy { position: relative; z-index: 1; padding-block: 7rem 5rem; max-width: 54rem; }
.hero h1 {
  margin-top: 1.4rem;
  font-size: clamp(2.9rem, 1.5rem + 5.4vw, 6.1rem);
  line-height: 0.98;
  letter-spacing: -0.022em;
}
.hero h1 .then { display: block; color: #767676; }
@media (min-width: 720px) { .hero h1 .then { white-space: nowrap; } }
.lede {
  margin-top: 1.8rem;
  max-width: 34rem;
  font-size: clamp(1.125rem, 1rem + 0.4vw, 1.3rem);
  color: var(--grey-7);
}
.actions { margin-top: 2.6rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2.25rem; }

@media (max-width: 719px) {
  .hero { align-items: end; }
  .hero .lattice {
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 30%, rgb(0 0 0 / 0.16) 52%);
    mask-image: linear-gradient(180deg, #000 0%, #000 30%, rgb(0 0 0 / 0.16) 52%);
  }
  .hero-copy { padding-block: 33svh 2.5rem; }
  .mark span { font-size: 0.85rem; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(5rem, 4rem + 5vw, 8.5rem); }
.section + .section { border-top: 1px solid var(--grey-2); }
.section-head { max-width: 40rem; }
.section-head p { margin-top: 1.1rem; color: var(--grey-7); }

/* The jobs */
.jobs {
  list-style: none;
  margin-top: 3.5rem;
  display: grid;
  gap: 2.75rem 3rem;
}
@media (min-width: 860px) { .jobs { grid-template-columns: repeat(3, 1fr); } }
.jobs svg { width: 4rem; height: auto; margin-bottom: 1.3rem; }
.jobs p { margin-top: 0.6rem; color: var(--grey-7); }

/* How it works */
.how {
  margin-top: 3.5rem;
  display: grid;
  gap: 3rem 5rem;
  align-items: center;
}
@media (min-width: 860px) { .how { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); } }
.figure { width: min(100%, 27rem); margin-inline: auto; }
.figure svg { width: 100%; height: auto; overflow: visible; }
.figure .piece { transition: fill 0.35s ease; }
.figure .piece-group {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.9s cubic-bezier(.2, .8, .2, 1), opacity 0.6s ease;
}
.figure text {
  font-family: "Jost", ui-sans-serif, system-ui, sans-serif;
  font-size: 22px;
  font-weight: 500;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}
.js .figure:not(.is-in) .piece-group { opacity: 0; }
.js .figure:not(.is-in) [data-step="1"] { transform: translate(-40px, 30px) rotate(-60deg); }
.js .figure:not(.is-in) [data-step="2"] { transform: translate(0, 50px) rotate(120deg); }
.js .figure:not(.is-in) [data-step="3"] { transform: translate(40px, 30px) rotate(60deg); }
.js .figure:not(.is-in) [data-step="4"] { transform: translate(0, -50px) rotate(-120deg); }
.figure [data-step="2"] { transition-delay: 0.15s; }
.figure [data-step="3"] { transition-delay: 0.3s; }
.figure [data-step="4"] { transition-delay: 0.45s; }
.figure.lit-1 [data-step="1"] .piece,
.figure.lit-2 [data-step="2"] .piece,
.figure.lit-3 [data-step="3"] .piece,
.figure.lit-4 [data-step="4"] .piece { fill: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  .figure .piece-group { transition: none; }
  .js .figure:not(.is-in) .piece-group { opacity: 1; transform: none; }
}

.steps { list-style: none; display: grid; gap: 1.9rem; }
.steps li { position: relative; padding-left: 2rem; }
.steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42em;
  border-inline: 0.42em solid transparent;
  border-bottom: 0.72em solid var(--grey-3);
  transition: border-color 0.3s ease;
}
.steps li[data-step="4"]::before { border-bottom-color: var(--ink); }
.steps p { color: var(--grey-7); margin-top: 0.3rem; }

/* ---------- Contact + footer (night) ---------- */
.night {
  position: relative;
  background: var(--night);
  color: #fff;
  margin-top: 1.75rem;
}
.night::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  /* One lattice row of teeth: same edge and same x origin as the lattice below it. */
  height: calc(var(--edge) * 0.8660254);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 1.7320508' preserveAspectRatio='none'%3E%3Cpath d='M0 1.7320508 1 0 2 1.7320508Z' fill='%230E0E0E'/%3E%3C/svg%3E") repeat-x left bottom / var(--edge) 100%;
}
/* site.js replaces the CSS teeth with an SVG row that flattens, left to right, on first view. */
.has-teeth .night::before { display: none; }
.teeth {
  position: absolute;
  left: 0;
  bottom: calc(100% - 1px); /* overlap 1px so no hairline shows between teeth and band */
  width: 100%;
  fill: var(--night);
  pointer-events: none;
}
.contact { position: relative; padding-block: clamp(5.5rem, 4rem + 6vw, 9rem); overflow: hidden; }
.contact .lattice {
  -webkit-mask-image: linear-gradient(90deg, rgb(0 0 0 / 0.25) 0%, rgb(0 0 0 / 0.25) 45%, #000 85%);
  mask-image: linear-gradient(90deg, rgb(0 0 0 / 0.25) 0%, rgb(0 0 0 / 0.25) 45%, #000 85%);
}
.contact .wrap { position: relative; z-index: 1; }
.contact .eyebrow { color: var(--night-text); }
.contact h2 { margin-top: 1.2rem; max-width: 30rem; }
.contact p.sub { margin-top: 1.2rem; max-width: 32rem; color: var(--night-text); }
.contact .actions { margin-top: 2.4rem; }
.contact .addr { color: var(--night-text); text-decoration: none; border-bottom: 1px solid #444; }
.contact .addr:hover { color: #fff; }

.legal {
  position: relative;
  z-index: 1;
  border-top: 1px solid #262626;
  padding-block: 2rem 2.4rem;
  color: #A0A0A0;
  font-size: 0.85rem;
  line-height: 1.7;
}
.legal .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.legal a { color: #D0D0D0; }

/* ---------- Privacy page ---------- */
.page { padding-block: 2rem 6rem; }
.page .top { position: static; padding-block: 0 4rem; }
.page .top .wrap { width: 100%; }
.doc { max-width: 44rem; }
.doc h1 { font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.4rem); line-height: 1.05; letter-spacing: -0.015em; }
.doc h2 { font-size: 1.4rem; margin-top: 2.6rem; }
.doc p, .doc ul { margin-top: 0.9rem; color: var(--grey-7); }
.doc ul { padding-left: 1.2rem; }
.doc li + li { margin-top: 0.4rem; }
.doc .updated { margin-top: 1rem; color: var(--grey-6); font-size: 0.95rem; }
