/* XCF site styles. One typeface (Archivo, variable width + weight).
   Headings run condensed like road and plate lettering; body runs at normal width. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("/assets/fonts/archivo-latin-var.woff2") format("woff2");
}

:root {
  --ink: #13202a;         /* text, dark bands */
  --bluestone: #3b4a54;   /* secondary text */
  --paper: #f2f4f1;       /* page */
  --tint: #e4eae6;        /* alternate band */
  --white: #ffffff;
  --gum: #6f8a7e;         /* list markers, rules on dark */
  --rule: #c5cec9;        /* hairlines on light */
  --amber: #f2b000;       /* boom-gate amber: fills and text on ink only */
  --amber-deep: #d99e00;
  --screen: #1c2c37;      /* camera view */
  --on-ink: #e8eeeb;
  --on-ink-muted: #a7b6bd;
  --rec: #ff5a4f;

  --focus: var(--ink);
  --wrap: 75rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --section: clamp(4rem, 10vw, 8rem);
}

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

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  font-stretch: 100%;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }

h1, h2, h3 {
  font-stretch: 75%;
  font-weight: 760;
  line-height: 1.02;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

p, li { text-wrap: pretty; }

a { color: inherit; }

abbr[title] { text-decoration: none; }

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Skip link */
.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 1rem; outline-color: var(--amber); }

/* Buttons and links */
.button {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.75rem 1.4rem;
  border-radius: 6px;
  background: var(--amber);
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
  touch-action: manipulation;
  transition: background-color 150ms ease;
}
.button:hover { background: var(--amber-deep); }
.button--small { min-height: 2.75rem; padding: 0.55rem 1rem; font-size: 0.95rem; }

.text-link {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--gum);
  transition: text-decoration-color 150ms ease;
}
.text-link:hover { text-decoration-color: currentColor; }

/* Header */
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 5rem;
}

.brand {
  font-size: 2rem;
  font-stretch: 62%;
  font-weight: 860;
  letter-spacing: 0.02em;
  line-height: 1;
  text-decoration: none;
  padding-block: 0.4rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
  padding: 0;
  list-style: none;
}
.nav__item a {
  display: inline-block;
  padding-block: 0.6rem;
  font-weight: 500;
  text-decoration: none;
  text-underline-offset: 0.3em;
}
.nav__item a:hover { text-decoration: underline; text-decoration-thickness: 2px; }

@media (max-width: 47.99rem) {
  .nav__item { display: none; }
}

/* Hero */
.hero { padding-block: clamp(2.5rem, 7vw, 6rem) clamp(1rem, 4vw, 3rem); }

.hero__grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
}

@media (min-width: 60rem) {
  .hero__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
}

.hero h1 {
  font-size: clamp(2.75rem, 7.4vw, 5.75rem);
  font-stretch: 68%;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
  max-width: 14ch;
}

.lead {
  margin-top: clamp(1.25rem, 3vw, 2rem);
  max-width: 38rem;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.55;
  color: var(--bluestone);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2rem;
}
.hero__actions .text-link { padding-block: 0.6rem; }

.hero__where {
  margin-top: 2rem;
  font-size: 0.95rem;
  color: var(--bluestone);
}

/* Gate scene: the one animated moment on the page */
.gate figcaption {
  margin-top: 0.85rem;
  font-size: 0.95rem;
  color: var(--bluestone);
}

.gate__screen {
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border-radius: 14px;
  background: var(--ink);
  color: var(--on-ink);
}

.gate__cam {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.875rem;
  color: var(--on-ink-muted);
}
.gate__rec {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--rec);
  animation: rec-blink 1.2s steps(2, jump-none) 4;
}

.gate__view {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  margin-top: 0.85rem;
  border-radius: 8px;
  background: var(--screen);
}

.gate__target {
  position: relative;
  padding: clamp(1rem, 2.5vw, 1.5rem) clamp(1.25rem, 3vw, 2rem);
}

.gate__corners {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.gate__corners i {
  position: absolute;
  width: 1.25rem;
  height: 1.25rem;
  border: 0 solid #7d929c;
}
.gate__corners i:nth-child(1) { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; }
.gate__corners i:nth-child(2) { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; }
.gate__corners i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; }
.gate__corners i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }
.gate__corners--lock i { border-color: var(--amber); border-width: 0; }
.gate__corners--lock i:nth-child(1) { border-top-width: 3px; border-left-width: 3px; }
.gate__corners--lock i:nth-child(2) { border-top-width: 3px; border-right-width: 3px; }
.gate__corners--lock i:nth-child(3) { border-bottom-width: 3px; border-left-width: 3px; }
.gate__corners--lock i:nth-child(4) { border-bottom-width: 3px; border-right-width: 3px; }
.gate__corners--lock { animation: lock 240ms ease-out 1.35s both; }

.plate {
  position: relative;
  overflow: hidden;
  padding: 0.12em 0.5em 0.16em;
  border-radius: 8px;
  background: var(--white);
  box-shadow: inset 0 0 0 3px var(--ink), 0 0 0 1px #8fa3ae;
  color: var(--ink);
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-stretch: 70%;
  font-weight: 760;
  letter-spacing: 0.06em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.plate__scan {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: scan 1.1s cubic-bezier(0.45, 0, 0.55, 1) 0.25s both;
}
.plate__scan::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--amber);
  box-shadow: 0 0 12px 2px rgba(242, 176, 0, 0.7);
}

.gate__log {
  margin-top: 1rem;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
}
.gate__log li {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr);
  gap: 0.75rem;
  padding-block: 0.4rem;
  border-top: 1px solid #2b3d49;
  animation: log-in 360ms ease-out both;
}
.gate__log li:nth-child(1) { animation-delay: 1.5s; }
.gate__log li:nth-child(2) { animation-delay: 1.85s; }
.gate__log li:nth-child(3) { animation-delay: 2.2s; }
.gate__log li:nth-child(4) { animation-delay: 2.55s; }
.gate__log time {
  color: var(--on-ink-muted);
  font-variant-numeric: tabular-nums;
}
.gate__log li:last-child span { color: var(--amber); }

/* With JS, the gate scene waits until it is on screen (it sits below the fold on phones). */
.js .gate:not(.is-playing) .gate__rec,
.js .gate:not(.is-playing) .gate__corners--lock,
.js .gate:not(.is-playing) .plate__scan,
.js .gate:not(.is-playing) .gate__log li { animation-play-state: paused; }

@keyframes scan {
  0% { opacity: 1; transform: translateX(0); }
  92% { opacity: 1; transform: translateX(100%); }
  100% { opacity: 0; transform: translateX(100%); }
}
@keyframes lock {
  from { opacity: 0; transform: scale(1.06); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes log-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes rec-blink {
  0% { opacity: 1; }
  100% { opacity: 0.25; }
}

/* Sections */
.section { padding-block: var(--section); scroll-margin-top: 1rem; }
.section--tint { background: var(--tint); }
.contact { scroll-margin-top: 1rem; }

.section__head {
  display: grid;
  gap: 1rem 3rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section__head h2 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
.section__head p { max-width: 36rem; font-size: 1.125rem; color: var(--bluestone); }

@media (min-width: 60rem) {
  .section__head { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: end; }
  .section__head p { padding-bottom: 0.35rem; }
}

.ticks {
  padding-left: 1.1em;
  list-style: square;
}
.ticks li + li { margin-top: 0.35rem; }
.ticks li::marker { color: var(--gum); }

/* What we build */
.sectors { padding: 0; list-style: none; border-bottom: 1px solid var(--rule); }

.sector {
  display: grid;
  gap: 0.75rem 2.5rem;
  padding-block: clamp(1.75rem, 3.5vw, 2.5rem);
  border-top: 1px solid var(--rule);
}
.sector h3 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); }
.sector > p { max-width: 34rem; }
.sector .ticks { color: var(--bluestone); }

@media (min-width: 52rem) {
  .sector { grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) minmax(0, 4fr); }
  .sector h3 { padding-top: 0.1rem; }
}

/* Our work */
.case {
  display: grid;
  gap: 2rem 3rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: 14px;
  background: var(--paper);
}
.case h3 { font-size: clamp(2rem, 4vw, 3rem); }
.case__intro p { margin-top: 1rem; max-width: 34rem; }
.case h4 {
  margin-bottom: 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
}

@media (min-width: 52rem) {
  .case { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case__intro { grid-column: 1 / -1; }
}
@media (min-width: 68rem) {
  .case { grid-template-columns: minmax(0, 6fr) minmax(0, 4fr) minmax(0, 4fr); }
  .case__intro { grid-column: auto; }
}

.case__more { margin-top: 2rem; font-size: 1.125rem; }

/* How we work: a real sequence, so it is numbered */
.steps {
  display: grid;
  gap: 2.5rem 2rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.step { counter-increment: step; }
.step::before {
  content: counter(step);
  display: block;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--ink);
  font-size: clamp(3rem, 6vw, 4.5rem);
  font-stretch: 62%;
  font-weight: 800;
  line-height: 1;
  color: var(--bluestone);
}
.step h3 { font-size: 1.6rem; }
.step p { margin-top: 0.6rem; color: var(--bluestone); }

@media (min-width: 40rem) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 68rem) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Contact */
.contact {
  --focus: var(--amber);
  padding-block: var(--section);
  background: var(--ink);
  color: var(--on-ink);
}
.contact__grid {
  display: grid;
  gap: 2.5rem 4rem;
}
.contact h2 { font-size: clamp(2.5rem, 6vw, 4.5rem); max-width: 12ch; }
.contact__grid > div > p { margin-top: 1.25rem; max-width: 34rem; font-size: 1.125rem; color: var(--on-ink-muted); }

@media (min-width: 60rem) {
  .contact__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; }
}

.contact__email {
  display: inline-block;
  padding-block: 0.25rem;
  color: var(--amber);
  font-size: clamp(1.6rem, 3.6vw, 2.5rem);
  font-stretch: 80%;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}
.contact__email:hover { text-decoration-thickness: 4px; }

.contact__offices {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 3rem;
  margin-top: 2rem;
}
.contact__offices strong { font-weight: 650; color: var(--on-ink); }
.contact__offices p { color: var(--on-ink-muted); }
.contact__note { margin-top: 1.25rem; color: var(--on-ink-muted); }

/* Footer */
.site-footer {
  --focus: var(--amber);
  background: var(--ink);
  color: var(--on-ink-muted);
  font-size: 0.95rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.5rem 2rem;
  border-top: 1px solid #2b3d49;
}
.site-footer a { display: inline-block; padding-block: 0.4rem; color: var(--on-ink); }

/* Error page */
.notfound {
  min-height: 70vh;
  display: grid;
  align-content: center;
  padding-block: var(--section);
}
.notfound h1 { font-size: clamp(2.75rem, 7vw, 5rem); font-stretch: 68%; font-weight: 800; max-width: 14ch; }
.notfound p { margin-top: 1.25rem; max-width: 34rem; font-size: 1.125rem; color: var(--bluestone); }
.notfound .button { margin-top: 2rem; }

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

@media print {
  .site-header nav, .hero__actions, .skip { display: none; }
  .gate__screen, .contact, .site-footer { background: none; color: var(--ink); }
}
