/* Fair North Digital 2026: site styles. Hand-written, no build step. */

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

/* Tokens ------------------------------------------------------------------ */

:root {
  /*
   * One red for everything. #ef2e2f clears 4.5:1 as text on ink-950 and
   * ink-900, 3:1 as a graphic on paper, and 4.75:1 behind ink-950 button
   * text. red-shade is only the darker facet in two-tone graphics (the quote
   * mark, compass and scroll rail), echoing the two reds in the logo leaf.
   */
  --red: #ef2e2f;
  --red-shade: #c41e1f;

  --ink-950: #0b0c0e;
  --ink-900: #111316;
  --ink-850: #16191d;
  --ink-800: #1d2126;
  --ink-600: #3a4048;

  --paper: #f3f0eb;
  --paper-2: #e9e4dc;

  --text: #eeebe6;
  --text-muted: #a6abb2;
  --line: rgb(255 255 255 / 0.09);
  --line-strong: rgb(255 255 255 / 0.16);

  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.18vw, 1.1rem);
  --step-1: clamp(1.18rem, 1.1rem + 0.4vw, 1.4rem);
  --step-2: clamp(1.4rem, 1.25rem + 0.75vw, 1.85rem);
  --step-3: clamp(2rem, 1.6rem + 2vw, 3.4rem);
  --step-4: clamp(3rem, 1.9rem + 5.6vw, 7.25rem);

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --section: clamp(3.5rem, 1.5rem + 8vw, 9.5rem);
  --radius: 14px;
  --radius-lg: 22px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --header-h: 5.25rem;

  color-scheme: dark;
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  background: var(--ink-950);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

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

h1,
h2,
h3 {
  font-weight: 640;
  font-stretch: 82%;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

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

main:focus {
  outline: none;
}

.visually-hidden {
  position: absolute !important; /* Utility must win over component display rules. */
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: #fff;
  color: var(--ink-950);
  font-weight: 600;
  border-radius: 8px;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

/* Layout ------------------------------------------------------------------ */

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

.container--narrow {
  max-width: 48rem;
}

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

.section__head {
  display: grid;
  gap: 1.25rem;
  max-width: 52rem;
  margin-bottom: clamp(2rem, 5vw, 5rem);
}

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

.display-2 {
  font-size: var(--step-3);
}

.lede {
  max-width: 38rem;
  color: var(--text-muted);
  font-size: var(--step-1);
  line-height: 1.55;
}

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

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.25rem;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--red);
  border-radius: 999px;
  background: var(--red);
  color: var(--ink-950);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s var(--ease), transform 0.2s var(--ease);
}

/* Hover wipes a black fill in from the left, and out to the right on leave. */
.button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink-950);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease);
}

.button:hover {
  color: var(--text);
}

.button:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

.button:active {
  transform: translateY(1px);
}

.button .icon {
  transition: transform 0.25s var(--ease);
}

.button:hover .icon {
  transform: translateX(3px);
}

.button--small {
  min-height: 2.6rem;
  padding: 0.55rem 1.1rem;
  font-size: var(--step--1);
}

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

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

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled,
.site-header.is-open {
  background: rgb(11 12 14 / 0.82);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

/*
 * Sit below the WordPress admin bar while it is on screen. Where the bar is
 * fixed this is just its height; on small screens WordPress lets the bar
 * scroll away, and main.js shrinks --admin-offset so the header stays pinned
 * to the top of the viewport.
 */
.admin-bar .site-header {
  top: var(--admin-offset, var(--wp-admin--admin-bar--height, 0px));
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.site-header__logo {
  display: block;
  border-radius: 4px;
}

.site-header__logo img {
  width: clamp(150px, 14vw, 182px);
  height: auto;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav__link {
  position: relative;
  display: block;
  padding: 0.5rem 0.9rem;
  color: var(--text-muted);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.site-nav__link:hover,
.site-nav__link[aria-current="true"] {
  color: var(--text);
}

.site-nav__link[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.2rem;
  height: 1px;
  background: var(--red);
}

.site-nav__cta {
  margin-left: 0.75rem;
}

.nav-toggle {
  display: none;
}

@media (max-width: 47.99em) {
  .nav-toggle {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-right: -0.5rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
  }

  /* Two bars that cross into an X when the menu opens. */
  .nav-toggle__bars {
    position: relative;
    width: 1.375rem;
    height: 0.75rem;
  }

  .nav-toggle__bars span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1.75px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.4s var(--ease), top 0.4s var(--ease);
  }

  .nav-toggle__bars span:first-child {
    top: 0;
  }

  .nav-toggle__bars span:last-child {
    top: calc(100% - 1.75px);
  }

  .is-open .nav-toggle__bars span {
    top: calc(50% - 0.875px);
  }

  .is-open .nav-toggle__bars span:first-child {
    transform: rotate(45deg);
  }

  .is-open .nav-toggle__bars span:last-child {
    transform: rotate(-45deg);
  }

  /*
   * The panel hangs off the bottom of the header (absolute, not fixed: the
   * header's backdrop-filter would otherwise become its containing block).
   * It unrolls downward with a clip, then the links follow in sequence.
   */
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 1rem var(--gutter) 2rem;
    background: var(--ink-950);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 48px rgb(0 0 0 / 0.5);
    visibility: hidden;
    clip-path: inset(0 0 100% 0);
    transition: clip-path 0.45s cubic-bezier(0.65, 0, 0.35, 1), visibility 0s linear 0.45s;
  }

  .is-open .site-nav {
    visibility: visible;
    clip-path: inset(0 0 -48px 0);
    transition: clip-path 0.55s cubic-bezier(0.65, 0, 0.35, 1), visibility 0s;
  }

  .site-nav__list > li {
    opacity: 0;
    transform: translateY(-0.5rem);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  }

  .is-open .site-nav__list > li {
    opacity: 1;
    transform: none;
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  }

  .is-open .site-nav__list > li:nth-child(1) { transition-delay: 0.12s; }
  .is-open .site-nav__list > li:nth-child(2) { transition-delay: 0.17s; }
  .is-open .site-nav__list > li:nth-child(3) { transition-delay: 0.22s; }
  .is-open .site-nav__list > li:nth-child(4) { transition-delay: 0.27s; }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-nav__link {
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
    font-size: var(--step-1);
  }

  .site-nav__link[aria-current="true"]::after {
    display: none;
  }

  .site-nav__cta {
    margin: 1.5rem 0 0;
  }

  .site-nav__cta .button {
    width: 100%;
    min-height: 3.25rem;
    font-size: var(--step-0);
  }
}

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

.hero {
  position: relative;
  isolation: isolate;
  padding-top: calc(var(--header-h) + clamp(3rem, 8vw, 7rem));
  padding-bottom: clamp(3.5rem, 9vw, 8rem);
  overflow: hidden;
}

/* Survey-map grid, faded toward the edges. */
.hero__grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 35%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 70% 35%, #000 10%, transparent 75%);
  opacity: 0.6;
}

.hero__inner {
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 60em) {
  .hero__inner {
    grid-template-columns: 1.25fr 1fr;
    min-height: min(36rem, 62svh);
  }
}

.hero__copy {
  display: grid;
  gap: 1.75rem;
  justify-items: start;
}

.hero__title {
  font-size: var(--step-4);
  font-weight: 680;
  font-stretch: 72%;
  line-height: 0.92;
  letter-spacing: -0.025em;
}

.hero__title-accent {
  display: block;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.hero__visual {
  display: none;
}

@media (min-width: 60em) {
  .hero__visual {
    display: block;
    justify-self: end;
    width: min(100%, 30rem);
  }
}

/* Compass ------------------------------------------------------------------ */

.compass {
  width: 100%;
  height: auto;
  overflow: visible;
}

.compass__ring {
  fill: none;
  stroke: rgb(255 255 255 / 0.18);
  stroke-width: 1;
}

.compass__ring--faint {
  stroke: rgb(255 255 255 / 0.07);
}

.compass__ticks line {
  stroke: rgb(255 255 255 / 0.28);
  stroke-width: 1;
}

.compass__bezel {
  transform-origin: 0 0;
  animation: compass-drift 120s linear infinite;
}

.compass__star {
  transform-origin: 0 0;
  animation: compass-settle 2.4s var(--ease) both;
}

.compass__facet {
  fill: rgb(255 255 255 / 0.1);
  stroke: rgb(255 255 255 / 0.22);
  stroke-width: 0.75;
  stroke-linejoin: round;
}

.compass__facet--shade {
  fill: rgb(255 255 255 / 0.03);
}

.compass__north {
  fill: var(--red);
}

.compass__north--dark {
  fill: var(--red-shade);
}

.compass__pin {
  fill: var(--ink-950);
  stroke: rgb(255 255 255 / 0.5);
  stroke-width: 1.5;
}

@keyframes compass-drift {
  to {
    transform: rotate(360deg);
  }
}

@keyframes compass-settle {
  0% {
    transform: rotate(-38deg);
    opacity: 0;
  }
  60% {
    transform: rotate(4deg);
    opacity: 1;
  }
  100% {
    transform: rotate(0deg);
  }
}

/* Approach (light) -------------------------------------------------------- */

.section--light {
  background: var(--paper);
  color: var(--ink-950);
  color-scheme: light;
}

.section--light ::selection {
  background: var(--ink-950);
  color: var(--paper);
}

.section--light :focus-visible {
  outline-color: var(--red);
}

@media (min-width: 60em) {
  .approach {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: clamp(4rem, 8vw, 8rem);
    align-items: start;
  }

  .approach__head {
    position: sticky;
    top: calc(var(--header-h) + 5.5rem);
    margin-bottom: 0;
  }
}

.principles__item {
  display: grid;
  gap: 0.75rem;
  padding-block: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid rgb(11 12 14 / 0.14);
}

.principles__item:first-child {
  padding-top: 0;
}

.principles__item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.principles__title {
  font-size: clamp(1.6rem, 1.25rem + 1.3vw, 2.5rem);
  font-weight: 600;
  font-stretch: 80%;
}

.principles__item p {
  color: #4a4f57;
  max-width: 34rem;
  font-size: var(--step-1);
  line-height: 1.55;
}

/*
 * Scroll rail, added by main.js. Inactive titles stay at 3:1 or better
 * against the paper, which meets contrast for large text.
 */
.principles.is-tracking {
  position: relative;
  padding-left: clamp(1.75rem, 3vw, 3rem);
}

.principles.is-tracking::before,
.principles.is-tracking::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  border-radius: 2px;
}

.principles.is-tracking::before {
  background: rgb(11 12 14 / 0.1);
}

.principles.is-tracking::after {
  background: linear-gradient(var(--red), var(--red-shade));
  transform: scaleY(var(--progress, 0));
  transform-origin: top;
}

.is-tracking .principles__item {
  position: relative;
}

.is-tracking .principles__item::before {
  content: "";
  position: absolute;
  top: calc(var(--item-pad, 0px) + 0.5em - 8px);
  left: calc(-1 * clamp(1.75rem, 3vw, 3rem) - 7px);
  width: 16px;
  height: 16px;
  border: 4px solid var(--paper);
  box-shadow: 0 0 0 1px rgb(239 46 47 / 0.35);
  border-radius: 50%;
  background: var(--red);
  font-size: clamp(1.6rem, 1.25rem + 1.3vw, 2.5rem);
  transform: scale(0);
  transition: transform 0.4s var(--ease);
}

.is-tracking .principles__item:not(:first-child) {
  --item-pad: clamp(2rem, 4vw, 3rem);
}

.is-tracking .principles__title {
  color: #767c84;
  transition: color 0.4s var(--ease);
}

.is-tracking .principles__item p {
  transition: color 0.4s var(--ease);
}

.is-tracking .principles__item.is-active::before {
  transform: scale(1);
}

.is-tracking .principles__item.is-active .principles__title {
  color: var(--ink-950);
}

.is-tracking .principles__item.is-active p {
  color: #2f343a;
}

/* Services ---------------------------------------------------------------- */

.services {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 40em) {
  .services {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64em) {
  .services {
    grid-template-columns: repeat(3, 1fr);
  }
}

.services__item {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border-radius: var(--radius-lg);
  background: var(--ink-850);
}

/*
 * Assemble on scroll, added by main.js on wider screens. --p runs 0 to 1:
 * at 0 the cards float spread apart; at 1 they settle into the grid.
 * --dx and --dy are each card's spread, set from its position.
 */
.services.is-assembling {
  position: relative;
}

.is-assembling .services__item {
  transform: translate(calc(var(--dx, 0px) * (1 - var(--p, 1))), calc(var(--dy, 0px) * (1 - var(--p, 1))));
  will-change: transform;
}

.services__title {
  font-size: var(--step-2);
}

.services__item > p {
  color: var(--text-muted);
  flex: 1;
}

/* Testimonials ------------------------------------------------------------ */

.section--testimonials {
  background: var(--ink-900);
}

/*
 * Without JS the quotes simply stack. main.js adds .is-carousel, which puts
 * every slide in the same grid cell (so the block keeps the height of the
 * tallest quote and nothing jumps) and crossfades between them.
 */
.testimonials {
  --quote-size: clamp(1.7rem, 1.35rem + 1.6vw, 2.75rem);
  --quote-indent: 0px;
}

.testimonials__track {
  display: grid;
  gap: clamp(3rem, 6vw, 5rem);
}

.testimonial {
  display: grid;
  align-content: start;
  gap: 2.5rem;
  max-width: 62rem;
  margin: 0;
}

/* Leave vertical scrolling to the browser so horizontal swipes reach main.js. */
.is-carousel .testimonials__track {
  gap: 0;
  touch-action: pan-y;
}

.is-carousel .testimonials__track > .testimonial {
  grid-area: 2 / 1;
  transition: opacity 0.9s cubic-bezier(0.45, 0, 0.55, 1), visibility 0s linear 0.9s;
}

.is-carousel .testimonial:not(.is-active) {
  visibility: hidden;
  opacity: 0;
}

.is-carousel .testimonial.is-active {
  transition-delay: 0s;
}

.testimonial__quote {
  margin: 0;
}

.testimonial__quote p {
  font-size: var(--quote-size);
  font-weight: 340;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

/*
 * Oversized opening mark, split in the two logo reds like the leaf and compass.
 * In the carousel one shared mark sits on the track, so it holds still while
 * the quotes crossfade; the per-quote marks are only for the stacked fallback.
 */
.testimonial__quote::before,
.is-carousel .testimonials__track::before {
  content: "\201C";
  display: block;
  width: fit-content;
  /* Trim the box to the glyph's ink (Archivo metrics) so it lines up with the text. */
  height: 0.475em;
  margin: -0.145em 0 clamp(1rem, 4vw, 1.5rem) -0.058em;
  color: transparent;
  background: linear-gradient(135deg, var(--red) 50%, var(--red-shade) 50%);
  -webkit-background-clip: text;
  background-clip: text;
  font-size: clamp(8rem, 4rem + 10vw, 15rem);
  font-weight: 800;
  line-height: 1;
  transform-origin: 50% 80%;
  transition: transform 1.1s var(--ease) 0.15s, opacity 1.1s var(--ease) 0.15s;
}

.is-carousel .testimonial__quote::before {
  content: none;
}

/* The mark settles in once, when the section first appears. */
.js .testimonials:not(.is-visible) .testimonial__quote::before,
.js .testimonials:not(.is-visible) .testimonials__track::before {
  opacity: 0;
  transform: translateY(0.12em) rotate(-8deg);
}

@media (min-width: 60em) {
  .testimonials {
    --quote-indent: clamp(9rem, 12vw, 12rem);
  }

  .testimonial {
    position: relative;
    padding-left: var(--quote-indent);
  }

  .is-carousel .testimonials__track {
    position: relative;
  }

  .testimonial__quote::before,
  .is-carousel .testimonials__track::before {
    position: absolute;
    /* Lines the mark's ink up with the quote's cap height (Archivo metrics). */
    top: calc(0.2785 * var(--quote-size) - 0.147em);
    left: -0.058em;
    margin: 0;
  }
}

@media (forced-colors: active) {
  .testimonial__quote::before,
  .is-carousel .testimonials__track::before {
    color: CanvasText;
    background: none;
  }
}

.testimonials__controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-left: var(--quote-indent);
}

.testimonials__controls[hidden] {
  display: none;
}

.testimonials__button {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-inline: -0.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s var(--ease);
}

.testimonials__button:hover {
  color: var(--text);
}

.testimonials__button .icon {
  width: 1.25rem;
  height: 1.25rem;
  transition: transform 0.25s var(--ease);
}

[data-carousel-prev]:hover .icon {
  transform: translateX(-3px);
}

[data-carousel-next]:hover .icon {
  transform: translateX(3px);
}

/* One thin bar per quote; the current one stretches and turns red. */
.testimonials__dots {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.testimonials__dot {
  display: block;
  width: 1.5rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  background: linear-gradient(var(--line-strong), var(--line-strong)) center / 100% 2px no-repeat;
  cursor: pointer;
  transition: width 0.5s var(--ease), background-color 0.3s var(--ease);
}

.testimonials__dot:hover {
  background-image: linear-gradient(rgb(255 255 255 / 0.4), rgb(255 255 255 / 0.4));
}

.testimonials__dot[aria-current="true"] {
  width: 3.5rem;
  background-image: linear-gradient(var(--red), var(--red));
}

.testimonial__cite {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1rem;
  font-size: var(--step--1);
}

.testimonial__name {
  font-weight: 600;
}

.testimonial__role {
  color: var(--text-muted);
}

.testimonial__since {
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 600;
  font-stretch: 75%;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.testimonial__since::before {
  content: "";
  display: inline-block;
  width: 1.25rem;
  height: 1px;
  margin-right: 0.75rem;
  vertical-align: middle;
  background: currentColor;
}

/* Contact ----------------------------------------------------------------- */

.contact {
  display: grid;
  gap: clamp(3rem, 6vw, 5rem);
}

@media (min-width: 60em) {
  .contact {
    grid-template-columns: 1fr 1.15fr;
    align-items: start;
  }

  .contact__intro {
    position: sticky;
    top: calc(var(--header-h) + 5.5rem);
  }
}

.contact__intro {
  display: grid;
  gap: 1.5rem;
  align-content: start;
}

.contact__details {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.contact__details li {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  color: var(--text-muted);
}

.contact__details .icon {
  margin-top: 0.2em;
  color: var(--red);
}

.contact__details a {
  color: var(--text);
  overflow-wrap: anywhere;
  text-decoration-color: rgb(255 255 255 / 0.3);
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease), text-underline-offset 0.2s var(--ease);
}

.contact__details a:hover {
  color: var(--red);
  text-decoration-color: currentColor;
  text-underline-offset: 0.3em;
}

/* Form -------------------------------------------------------------------- */

.form {
  display: grid;
  gap: 1.5rem;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  border-radius: var(--radius-lg);
  /* Gradient length is fixed, not a percentage, so tall phone layouts keep the lift. */
  background:
    linear-gradient(170deg, rgb(255 255 255 / 0.04), transparent 32rem),
    rgb(255 255 255 / 0.035);
}

.form__row {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 40em) {
  .form__row {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}

.field label,
.field legend {
  font-size: var(--step--1);
  font-weight: 600;
}

.field__optional {
  color: var(--text-muted);
  font-weight: 400;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 10px;
  background: rgb(0 0 0 / 0.28);
  color: var(--text);
  font: inherit;
  line-height: 1.4;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.field textarea {
  min-height: 9rem;
  resize: vertical;
}

.field input:hover,
.field textarea:hover {
  border-color: rgb(255 255 255 / 0.28);
}

.field input:focus-visible,
.field textarea:focus-visible {
  /* Transparent, not none, so forced-colors mode still draws a focus ring. */
  outline: 2px solid transparent;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgb(239 46 47 / 0.3);
  border-radius: 10px;
}

.field [aria-invalid="true"] {
  border-color: var(--red);
}

.field__error {
  color: var(--red);
  font-size: 0.85rem;
  font-weight: 500;
}

.field__error:empty {
  display: none;
}

.field--choices {
  margin: 0;
  padding: 0;
  border: 0;
}

.field--choices legend {
  margin-bottom: 0.75rem;
  padding: 0;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.choice {
  position: relative;
  cursor: pointer;
}

.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.choice span {
  display: block;
  padding: 0.6rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.choice:hover span {
  border-color: rgb(255 255 255 / 0.3);
  color: var(--text);
}

.choice input:checked + span {
  border-color: var(--red);
  background: rgb(239 46 47 / 0.16);
  color: var(--text);
}

.choice input:focus-visible + span {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.form__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  padding-top: 0.5rem;
}

.form__status {
  flex: 1 1 14rem;
  font-size: 0.95rem;
}

.form__status--sent {
  color: #6fe3a2;
}

.form__status--invalid,
.form__status--limited,
.form__status--failed {
  color: var(--red);
}

.form.is-sent .field,
.form.is-sent .form__row,
.form.is-sent [data-submit] {
  display: none;
}

.form.is-sent {
  min-height: 18rem;
  align-content: center;
}

.form.is-sent .form__status {
  padding-left: 1.25rem;
  border-left: 2px solid #6fe3a2;
  color: var(--text);
  font-size: var(--step-2);
  font-weight: 600;
  font-stretch: 85%;
  line-height: 1.25;
}

/* Focus moves here by script for screen readers; no visible ring needed. */
.form__status:focus {
  outline: none;
}

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

.site-footer {
  position: relative;
  padding-top: clamp(3.5rem, 7vw, 5.5rem);
  padding-bottom: 2rem;
  background: var(--ink-900);
  color: var(--text-muted);
  font-size: var(--step--1);
}

/* Hairline that burns red at the left and fades out, like the hero glow. */
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, var(--red), rgb(239 46 47 / 0.25) 30%, var(--line) 60%);
}

.site-footer a {
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.site-footer a:hover {
  color: var(--text);
}

.site-footer__top {
  display: grid;
  gap: 2.5rem;
  padding-bottom: clamp(3rem, 6vw, 4.5rem);
}

@media (max-width: 47.99em) {
  .site-footer__top,
  .site-footer__brand {
    justify-items: center;
    text-align: center;
  }

  .site-footer__nav ul,
  .site-footer__bottom {
    justify-content: center;
  }

  .site-footer__bottom {
    flex-direction: column;
    text-align: center;
  }
}

@media (min-width: 48em) {
  .site-footer__top {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
}

.site-footer__brand {
  display: grid;
  gap: 1.1rem;
  justify-items: start;
}

.site-footer__logo {
  display: block;
  border-radius: 4px;
}

.site-footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
}

.site-footer__nav a {
  display: block;
  padding-block: 0.25rem;
  color: var(--text);
  font-size: var(--step-0);
  font-weight: 500;
}

.site-footer__nav a:hover {
  color: var(--red);
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
}

.site-footer__since {
  display: block;
  margin-top: 0.35rem;
}

@media (min-width: 48em) {
  .site-footer__since {
    display: inline;
    margin-top: 0;
  }

  .site-footer__since::before {
    content: "·";
    content: "·" / "";
    margin-inline: 0.6em;
  }
}

.site-footer__top-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding-block: 0.25rem;
  letter-spacing: 0.04em;
}

.site-footer__top-link .icon {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0.4rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition: border-color 0.2s var(--ease);
}

/* Compass needle point, two-tone like the north point on the hero rose. */
.icon__north {
  fill: var(--red);
}

.icon__north-shade {
  fill: var(--red-shade);
}

.site-footer__top-link:hover .icon {
  border-color: var(--red);
  animation: needle-find 0.9s var(--ease);
}

/* The needle swings and settles back on north, which is also "up". */
@keyframes needle-find {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-28deg);
  }
  50% {
    transform: rotate(14deg);
  }
  75% {
    transform: rotate(-5deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

/* Inner pages ------------------------------------------------------------- */

.section--page {
  padding-top: calc(var(--header-h) + var(--section));
  min-height: 70svh;
}

.section--page .container {
  display: grid;
  gap: 1.5rem;
  justify-items: start;
}

/* Motion ------------------------------------------------------------------ */

/*
 * Hero entrance is CSS-only and never starts fully transparent, so the
 * headline still counts as painted for LCP before any JS runs.
 */
.rise {
  animation: rise 0.9s var(--ease) both;
  animation-delay: var(--delay, 0s);
}

@keyframes rise {
  from {
    opacity: 0.2;
    transform: translateY(16px);
  }
}

/*
 * Hero headline words pull into focus one after another. They start at 0.2
 * opacity rather than 0 so the headline still paints early for LCP.
 */
.focus-in {
  display: inline-block;
  animation: focus-in 1s var(--ease) both;
  animation-delay: calc(0.08s + var(--i, 0) * 0.09s);
}

@keyframes focus-in {
  from {
    opacity: 0.2;
    filter: blur(12px);
    transform: translateY(0.12em);
  }
}

/*
 * Section headings light up word by word as they scroll into view. main.js
 * splits the words and sets --lit from 0 to 1 on each. The dim state keeps
 * at least 3:1 contrast, the minimum for large text.
 */
.scroll-lit .word {
  opacity: calc(0.45 + 0.55 * var(--lit, 1));
  transition: opacity 0.15s linear;
}

/* The compass rose turns a little as the page scrolls; main.js sets --turn. */
.compass__bezel {
  rotate: var(--turn, 0deg);
}

.compass__star {
  rotate: calc(var(--turn, 0deg) * -0.5);
}

/* Below-the-fold reveals only hide once the head script has set .js. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--delay, 0s);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important; /* Global override is the point. */
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (forced-colors: active) {
  .button,
  .choice span {
    border: 1px solid ButtonText;
  }
}
