/* Arctena — arctena.com. Tokens and rules: docs/landing-brief.md, section 4. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* Metric-matched fallback so the swap to Inter does not shift the layout. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  ascent-override: 90.44%;
  descent-override: 22.52%;
  line-gap-override: 0%;
  size-adjust: 107.12%;
}

:root {
  --obsidian: #0B0F14;
  --navy: #0F1A24;
  --graphite: #1F2937;
  --slate: #64748B;
  --steel: #94A3B8;
  --mist: #CBD5E1;
  --ivory: #F7F5EF;
  --red: #E83046;

  --font: "Inter", "Inter Fallback", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --content: 1120px;
  --measure: 680px;
  --gutter: 24px;
  --section: 64px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  color-scheme: dark;
}

@media (min-width: 900px) {
  :root {
    --gutter: 40px;
    --section: 96px;
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--graphite) var(--obsidian);
}

body {
  margin: 0;
  background: var(--obsidian);
  color: var(--mist);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 900px) {
  body {
    font-size: 1.125rem;
  }
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
figure {
  margin: 0;
}

ol {
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--ivory);
  text-decoration: underline;
  text-decoration-color: var(--slate);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: text-decoration-color 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  a:hover {
    text-decoration-color: var(--ivory);
  }
}

::selection {
  background: var(--ivory);
  color: var(--obsidian);
}

:focus-visible {
  outline: 2px solid var(--ivory);
  outline-offset: 2px;
}

strong {
  color: var(--ivory);
  font-weight: 500;
}

.mono {
  font-family: var(--mono);
  font-size: 0.9em;
  letter-spacing: 0;
  white-space: nowrap;
}

.nowrap {
  white-space: nowrap;
}

.wrap {
  width: 100%;
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Type ---------- */

.eyebrow {
  color: var(--steel);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
}

.h2 {
  max-width: 22ch;
  color: var(--ivory);
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.1;
  text-wrap: balance;
}

/* Brand mark under every H2. Red elsewhere: CTA buttons, logo rule, "awaiting a human decision". */
.h2::after {
  content: "";
  display: block;
  width: 32px;
  height: 3px;
  margin-top: 20px;
  background: var(--red);
}

.h3 {
  color: var(--ivory);
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.note {
  max-width: var(--measure);
  margin-top: 40px;
  color: var(--steel);
  font-size: 1rem;
}

.note--tight {
  margin-top: 32px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 26px;
  border: 0;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms var(--ease-out);
}

/* Ivory label on red, at the brand book's button size (Emil's call; 3.9:1, see docs/questions.md). */
.btn--pill {
  border-radius: 999px;
  background: var(--red);
  color: var(--ivory);
  transition: background-color 160ms ease, color 160ms ease, transform 160ms var(--ease-out);
}

.btn--pill:hover {
  background: var(--ivory);
  color: var(--obsidian);
}

.btn:active {
  transform: scale(0.97);
}

.btn--small {
  min-height: 40px;
  padding: 8px 18px;
}

/* ---------- Header ---------- */

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
}

.logo {
  display: inline-block;
  flex-shrink: 0;
  padding-block: 6px;
}

.logo img {
  width: 108px;
  height: auto;
}

.site-footer .logo img {
  width: 168px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-nav__link {
  display: none;
  color: var(--mist);
  font-size: 1rem;
  text-decoration: none;
  transition: color 160ms ease;
}

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

@media (min-width: 640px) {
  .logo img {
    width: 160px;
  }
  .site-footer .logo img {
    width: 200px;
  }
  .site-nav__link {
    display: inline;
  }
}

@media (max-width: 479px) {
  .btn--small {
    padding-inline: 12px;
    font-size: 0.875rem;
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow-x: clip;
  padding-top: 48px;
  padding-bottom: var(--section);
}

.hero__title {
  max-width: 19ch;
  margin-top: 20px;
  color: var(--ivory);
  font-size: clamp(2.375rem, 1.1rem + 5.4vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-wrap: balance;
}

.hero__copy {
  margin-top: 36px;
}

.hero__sub {
  max-width: 34ch;
  margin-bottom: 32px;
  color: var(--mist);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  line-height: 1.5;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: var(--obsidian);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
}

.hero__bg picture,
.hero__bg img {
  display: block;
  width: 100%;
  height: 100%;
}

/* Photo: dark mountains with the one red route (Brand Book 3.1, imagery). */
.hero__bg img {
  object-fit: cover;
  object-position: 70% 55%;
}

/* Neutral scrim keeps the headline readable over the photo. */
.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(11, 15, 20, 0.78) 0%, rgba(11, 15, 20, 0.35) 55%, rgba(11, 15, 20, 0) 100%),
    linear-gradient(to bottom, rgba(11, 15, 20, 0) 70%, var(--obsidian) 100%);
}

/* Phone: copy on top, the mountains fill the lower part of the hero. */
@media (max-width: 767px) {
  .hero {
    padding-bottom: 260px;
  }
  .hero__bg {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
  }
  .hero__bg img {
    object-position: 50% 100%;
  }
  .hero__bg::after {
    background: linear-gradient(to bottom, rgba(11, 15, 20, 0.55) 0%, rgba(11, 15, 20, 0.2) 55%, var(--obsidian) 100%);
  }
}

@media (min-width: 900px) {
  .hero {
    min-height: min(680px, 88vh);
    padding-top: 72px;
    padding-bottom: 24px;
  }
  .hero__copy {
    margin-top: 48px;
  }
}

/* Scenario: the product-card illustration, in its own section (the caption is its heading). */
.section.scenario {
  padding-top: 56px;
}

.scenario .h2 {
  max-width: 24ch;
  font-size: clamp(1.5rem, 1rem + 1.6vw, 2rem);
}

/* ---------- Ticket card (imitates the product: the only rounded surface) ---------- */

.ticket {
  padding: 24px;
  border: 1px solid var(--graphite);
  border-radius: 8px;
  background: var(--navy);
}

@media (min-width: 640px) {
  .ticket {
    padding: 28px 32px 32px;
  }
}

.ticket__head {
  color: var(--ivory);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.4;
}

.ticket__id {
  color: var(--steel);
  font-weight: 400;
}

.ticket__dot {
  margin-inline: 4px;
  color: var(--steel);
}

/* Each stack holds all three states in one grid cell, so the card never changes height. */
.ticket__stack {
  display: grid;
}

.ticket__stack > * {
  grid-area: 1 / 1;
}

.ticket__stack--status {
  justify-items: start;
  margin-top: 16px;
}

.ticket__stack--lines {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--graphite);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--graphite);
  border-radius: 4px;
  color: var(--ivory);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}

.status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--steel);
}

.status--awaiting {
  border-color: var(--red);
}

.status--awaiting .status__dot {
  background: var(--red);
}

.status--decided .status__dot {
  background: var(--ivory);
}

.status--progress .status__dot {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--ivory);
}

.ticket__line {
  color: var(--mist);
  font-size: 1rem;
  line-height: 1.6;
}

.ticket__line .mono {
  color: var(--ivory);
}

/* Without script, or with reduced motion: final status, all three lines stacked. */
.ticket__stack--status > :not([data-step="3"]) {
  display: none;
}

.ticket__stack--lines {
  gap: 14px;
}

.ticket__stack--lines > * {
  grid-area: auto;
}

/* Animated loop, switched on by main.js. */
.ticket.is-looping .ticket__stack > * {
  grid-area: 1 / 1;
  opacity: 0;
  filter: blur(3px);
  transform: translateY(6px);
  transition:
    opacity 380ms var(--ease-out),
    transform 380ms var(--ease-out),
    filter 380ms var(--ease-out);
}

.ticket.is-looping .ticket__stack--status > * {
  display: inline-flex;
}

.ticket.is-looping .ticket__stack--lines {
  gap: 0;
}

.ticket.is-looping[data-state="1"] [data-step="1"],
.ticket.is-looping[data-state="2"] [data-step="2"],
.ticket.is-looping[data-state="3"] [data-step="3"] {
  opacity: 1;
  filter: none;
  transform: none;
  transition-delay: 120ms;
}

/* ---------- Sections ---------- */

.section {
  padding-block: var(--section);
}

.section--navy {
  background: var(--navy);
}

.split {
  display: grid;
  gap: 40px;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 5fr 7fr;
    gap: 64px;
  }
}

.prose {
  max-width: var(--measure);
}

.prose > * + * {
  margin-top: 1.1em;
}

/* Problem */

.problem .h2 {
  max-width: 24ch;
}

.problem .prose {
  max-width: none;
  margin-top: 48px;
}

@media (min-width: 900px) {
  .problem .prose {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px 64px;
    margin-top: 64px;
  }
  .problem .prose > * + * {
    margin-top: 0;
  }
}

.problem .prose p:not(.source) {
  color: var(--mist);
}

.source {
  padding-top: 0.4em;
  color: var(--mist);
}

.source a {
  display: inline-block;
  color: var(--steel);
  font-size: 0.875rem;
  text-decoration-color: var(--slate);
  white-space: nowrap;
}

.source a:hover {
  color: var(--ivory);
}

/* What Arctena does */

.columns {
  display: grid;
  gap: 32px;
  margin-top: 48px;
}

.column {
  padding-top: 24px;
  border-top: 1px solid var(--graphite);
}

.column p {
  margin-top: 12px;
}

@media (min-width: 900px) {
  .columns {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-top: 64px;
  }
}

/* Where it works */

.places {
  margin-top: 48px;
  border-bottom: 1px solid var(--graphite);
}

.place {
  display: grid;
  gap: 8px;
  padding-block: 24px;
  border-top: 1px solid var(--graphite);
}

.place dt {
  color: var(--ivory);
  font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

@media (min-width: 900px) {
  .places {
    margin-top: 64px;
  }
  .place {
    grid-template-columns: 5fr 7fr;
    align-items: baseline;
    gap: 64px;
    padding-block: 32px;
  }
}

/* How it works */

.steps {
  display: grid;
  gap: 16px;
  margin-top: 48px;
  counter-reset: none;
}

.step {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--graphite);
}

.step--human {
  border-color: var(--red);
}

.step__num {
  margin-bottom: 32px;
  color: var(--steel);
  font-size: 0.875rem;
}

.step p {
  margin-top: 10px;
  font-size: 1rem;
}

@media (min-width: 640px) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .steps {
    grid-template-columns: repeat(4, 1fr);
    margin-top: 64px;
  }
  .step {
    min-height: 280px;
    padding: 28px;
  }
  .step__num {
    margin-bottom: 72px;
  }
}

/* Example */

.timeline {
  counter-reset: example;
}

.timeline li {
  position: relative;
  padding: 0 0 28px 56px;
  counter-increment: example;
}

.timeline li::before {
  content: counter(example);
  position: absolute;
  top: 1px;
  left: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--graphite);
  color: var(--steel);
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1;
  background: var(--navy);
}

.timeline li::after {
  content: "";
  position: absolute;
  top: 34px;
  bottom: 0;
  left: 16px;
  width: 1px;
  background: var(--graphite);
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li:last-child::after {
  content: none;
}

.timeline .mono {
  color: var(--ivory);
}

/* Apply */

.terms {
  margin-top: 48px;
}

.term {
  display: grid;
  gap: 6px;
  padding-block: 20px;
  border-top: 1px solid var(--graphite);
}

.term dt {
  color: var(--ivory);
  font-weight: 500;
}

.term dd {
  max-width: var(--measure);
}

@media (min-width: 900px) {
  .terms {
    margin-top: 64px;
  }
  .term {
    grid-template-columns: 5fr 7fr;
    gap: 64px;
    padding-block: 24px;
  }
}

/* Form */

.form {
  margin-top: 40px;
  padding: 24px;
  border: 1px solid var(--graphite);
  background: var(--navy);
}

@media (min-width: 900px) {
  .form {
    margin-top: 56px;
    padding: 48px;
  }
}

.form__trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.form__grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 720px) {
  .form__grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px 32px;
  }
  .field--wide,
  .field--group {
    grid-column: 1 / -1;
  }
}

.field {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field > label,
.field legend {
  margin-bottom: 8px;
  padding: 0;
  color: var(--ivory);
  font-size: 1rem;
  font-weight: 500;
}

.field__hint {
  margin: -4px 0 8px;
  color: var(--steel);
  font-size: 0.875rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--graphite);
  border-radius: 0;
  background: var(--obsidian);
  color: var(--ivory);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  caret-color: var(--ivory);
  transition: border-color 160ms ease;
  appearance: none;
}

textarea {
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--slate);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--steel);
}

.select {
  position: relative;
}

.select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--steel);
  border-bottom: 1.5px solid var(--steel);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

select {
  padding-right: 44px;
  cursor: pointer;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
}

.check {
  display: inline-flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--mist);
  font-size: 1rem;
  line-height: 1.5;
  cursor: pointer;
}

.check input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  border: 1px solid var(--slate);
  background: var(--obsidian);
  cursor: pointer;
  appearance: none;
  display: grid;
  place-items: center;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.check input::before {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--obsidian);
  border-bottom: 2px solid var(--obsidian);
  transform: translateY(-1px) rotate(-45deg) scale(0.6);
  opacity: 0;
  transition: opacity 120ms ease, transform 160ms var(--ease-out);
}

.check input:checked {
  border-color: var(--ivory);
  background: var(--ivory);
}

.check input:checked::before {
  opacity: 1;
  transform: translateY(-1px) rotate(-45deg) scale(1);
}

.consent {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
}

.consent a {
  margin-left: 32px;
}

/* Errors: ivory text and ivory border, never red. */
.field__error {
  margin-top: 8px;
  color: var(--ivory);
  font-size: 0.875rem;
  font-weight: 500;
}

.field.is-invalid input[type="text"],
.field.is-invalid input[type="email"],
.field.is-invalid input[type="tel"],
.field.is-invalid select,
.field.is-invalid textarea,
.field.is-invalid .check input {
  border-color: var(--ivory);
}

.form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 36px;
}

.form__actions .btn[aria-busy="true"] {
  opacity: 0.7;
  cursor: progress;
}

.form__status {
  padding: 10px 14px;
  border: 1px solid var(--ivory);
  color: var(--ivory);
  font-size: 1rem;
}

/* Who */

.who .prose p:first-child {
  color: var(--mist);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  line-height: 1.5;
}

.links {
  color: var(--steel);
}

.links [aria-hidden="true"] {
  margin-inline: 6px;
}

/* ---------- Footer ---------- */

.site-footer__inner {
  display: grid;
  gap: 20px;
  padding-block: 56px;
  color: var(--steel);
  font-size: 1rem;
}

.site-footer__line {
  max-width: 52ch;
}

.site-footer__copy {
  color: var(--steel);
}

@media (min-width: 900px) {
  .site-footer__inner {
    grid-template-columns: 5fr 7fr;
    column-gap: 64px;
    padding-block: 72px;
  }
  .site-footer__inner .logo {
    grid-row: span 3;
    align-self: start;
  }
  .site-footer .logo img {
    width: 240px;
  }
}

/* ---------- Simple pages (thanks, 404, privacy) ---------- */

.page {
  min-height: 60vh;
  padding-block: 48px var(--section);
}

.page__title {
  max-width: 20ch;
  color: var(--ivory);
  font-size: clamp(2rem, 1.2rem + 3.4vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-wrap: balance;
}

.page__body {
  max-width: var(--measure);
  margin-top: 28px;
}

.page__body > * + * {
  margin-top: 1.1em;
}

.page__back {
  display: inline-block;
  margin-top: 40px;
}

.policy h2 {
  margin-top: 2em;
  color: var(--ivory);
  font-size: 1.125rem;
  font-weight: 500;
}

/* ---------- Entrance (added by main.js only, so content never depends on it) ---------- */

.reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 700ms var(--ease-out),
    transform 700ms var(--ease-out);
}

.reveal-ready [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal-ready [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn:active {
    transform: none;
  }
}
