/* ==========================================================================
   REDNAL Solutions — production website
   Palette is restricted to the approved brand tokens. Every other tone in the
   page is one of those three colours at reduced alpha, so nothing new is
   introduced to the identity.
   ========================================================================== */

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("assets/fonts/Montserrat-Latin-500-700.woff2") format("woff2");
}

:root {
  /* Approved brand tokens */
  --ink: #11181C;
  --oxide: #A33B2F;
  --cream: #F3F0E8;

  /* Derived from ink, on cream surfaces */
  /* Contrast against cream, in the order below: 8.8:1, 5.5:1, 4.8:1. Every
     tone carrying text clears WCAG AA (4.5:1) at any size; tests/check_site.py
     recalculates these from the token values. */
  --ink-80: rgba(17, 24, 28, 0.80);
  --ink-66: rgba(17, 24, 28, 0.66);
  --ink-62: rgba(17, 24, 28, 0.62);
  --ink-rule: rgba(17, 24, 28, 0.16);
  --ink-hairline: rgba(17, 24, 28, 0.09);
  --ink-wash: rgba(17, 24, 28, 0.035);

  /* Derived from cream, on ink surfaces */
  --cream-78: rgba(243, 240, 232, 0.78);
  --cream-52: rgba(243, 240, 232, 0.52);
  --cream-rule: rgba(243, 240, 232, 0.20);
  --cream-hairline: rgba(243, 240, 232, 0.12);

  --oxide-rule: rgba(163, 59, 47, 0.55);

  --font-display: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  --shell: 1180px;
  --shell-pad: clamp(1.25rem, 5vw, 3.5rem);
  --header-h: 4.5rem;

  --section-y: clamp(4.5rem, 9vw, 8rem);
}

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

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.nav-open { overflow: hidden; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1.05em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

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

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

::selection { background: var(--oxide); color: var(--cream); }

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

.section--ink :focus-visible,
.site-footer :focus-visible { outline-color: var(--cream); }

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

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

.shell--narrow { max-width: 820px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 100;
  transform: translate(-50%, -110%);
  padding: 0.7rem 1.25rem;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.skip-link:focus-visible {
  transform: translate(-50%, 0);
  outline-offset: -4px;
}

.lede {
  font-size: clamp(1.0625rem, 1rem + 0.45vw, 1.3125rem);
  line-height: 1.55;
  color: var(--ink-80);
}

.section--ink .lede { color: var(--cream-78); }

.kicker,
.eyebrow {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-62);
  margin: 0 0 1.1rem;
}

.section--ink .kicker { color: var(--cream-52); }

.kicker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.kicker::before {
  content: "";
  width: 1.75rem;
  height: 2px;
  background: var(--oxide);
  flex: none;
}

.eyebrow__sep {
  color: var(--oxide);
  padding-inline: 0.15rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.6rem;
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn--solid {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

.btn--solid:hover { background: var(--oxide); border-color: var(--oxide); }

.btn--quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink-rule);
}

.btn--quiet:hover { border-color: var(--ink); }

.section--ink .btn--solid {
  background: var(--cream);
  color: var(--ink);
  border-color: var(--cream);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--cream);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.is-stuck {
  border-bottom-color: var(--ink-hairline);
  box-shadow: 0 1px 16px rgba(17, 24, 28, 0.06);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding-block: 0.35rem;
}

.brand__lockup {
  width: auto;
  height: 2.25rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 2.6vw, 2.25rem);
}

.site-nav__list a {
  position: relative;
  display: inline-block;
  padding-block: 0.35rem;
  font-family: var(--font-display);
  font-size: 0.78125rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-66);
  transition: color 0.2s ease;
}

.site-nav__list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--oxide);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.site-nav__list a:hover { color: var(--ink); }

.site-nav__list a[aria-current="true"] { color: var(--ink); }
.site-nav__list a[aria-current="true"]::after { transform: scaleX(1); }

.site-nav__cta { padding: 0.7rem 1.25rem; }

/* Mobile toggle ----------------------------------------------------------- */

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  background: transparent;
  border: 1px solid var(--ink-rule);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.menu-toggle__bars {
  display: block;
  width: 1.1rem;
}

.menu-toggle__bars span {
  display: block;
  height: 2px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.menu-toggle__bars span + span { margin-top: 5px; }

.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

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

.hero {
  padding-block: clamp(3.5rem, 9vw, 7rem) clamp(3.5rem, 8vw, 6rem);
}

.hero__heading {
  max-width: 17ch;
  font-size: clamp(2.35rem, 1.1rem + 5.4vw, 4.6rem);
  letter-spacing: -0.025em;
  line-height: 1.04;
  margin-bottom: 1.6rem;
}

.hero__support {
  max-width: 60ch;
  margin-bottom: 2.4rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: clamp(3rem, 7vw, 5rem);
}

.hero__stages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2.25rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--ink-rule);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-62);
  counter-reset: stage;
}

.hero__stages li {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  counter-increment: stage;
}

.hero__stages li::before {
  content: counter(stage, decimal-leading-zero);
  color: var(--oxide);
}

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

section[id],
main[id] { scroll-margin-top: calc(var(--header-h) + 1rem); }

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

.section--rule { border-top: 1px solid var(--ink-hairline); }

.section--ink {
  background: var(--ink);
  color: var(--cream);
}

.section__head {
  max-width: 62ch;
  margin-bottom: clamp(2.75rem, 5vw, 4rem);
}

.section__heading {
  font-size: clamp(1.85rem, 1.2rem + 2.4vw, 2.9rem);
  margin-bottom: 1.25rem;
}

.section__intro { margin-bottom: 0; }

.section__close {
  max-width: 62ch;
  margin-top: clamp(2.5rem, 4vw, 3.5rem);
  padding-top: clamp(1.75rem, 3vw, 2.5rem);
  border-top: 1px solid var(--cream-rule);
  font-family: var(--font-display);
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--cream);
}

/* Problems ---------------------------------------------------------------- */

.problems {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 3.25rem);
}

.problem {
  padding-top: 1.5rem;
  border-top: 1px solid var(--cream-rule);
}

.problem__title {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin-bottom: 0.7rem;
}

.problem p {
  color: var(--cream-78);
  max-width: 46ch;
}

/* What changes ------------------------------------------------------------ */

.shifts {
  border-top: 1px solid var(--ink-rule);
}

.shift {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 4rem);
  padding-block: clamp(1.75rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--ink-hairline);
}

.shift__label {
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-62);
  margin-bottom: 0.6rem;
}

.shift__side--before p:not(.shift__label) { color: var(--ink-66); }

.shift__side--after {
  position: relative;
  padding-left: clamp(1rem, 2.5vw, 2rem);
  border-left: 2px solid var(--oxide);
}

.shift__side--after .shift__label { color: var(--oxide); }

.shift__side--after p:not(.shift__label) {
  font-weight: 500;
  color: var(--ink);
}

/* Method ------------------------------------------------------------------ */

.method {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--ink-hairline);
}

.method__step {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-block: clamp(1.85rem, 3.2vw, 2.75rem);
  border-bottom: 1px solid var(--ink-hairline);
}

.method__num {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--oxide);
  margin: 0;
}

.method__title {
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  margin-bottom: 0.65rem;
}

.method__body p {
  max-width: 68ch;
  color: var(--ink-80);
}

/* Traits ------------------------------------------------------------------ */

.traits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(1.75rem, 3.5vw, 3rem);
  row-gap: clamp(2rem, 3.5vw, 3rem);
}

.trait {
  padding-top: 1.4rem;
  border-top: 1px solid var(--ink-rule);
}

.trait__title {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0.005em;
  margin-bottom: 0.65rem;
}

.trait p {
  font-size: 0.9375rem;
  color: var(--ink-66);
}

/* Boundary ---------------------------------------------------------------- */

.boundary .section__heading { margin-bottom: 1.6rem; }

.boundary p { color: var(--cream-78); }

.boundary__line {
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--oxide-rule);
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 1rem + 0.7vw, 1.5rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--cream);
}

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

.contact { border-top: 1px solid var(--ink-hairline); }

.contact .lede { max-width: 54ch; }

.contact__email {
  margin: clamp(2rem, 4vw, 2.75rem) 0 0.9rem;
}

.contact__email a {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 0.9rem + 2.2vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  border-bottom: 2px solid var(--oxide);
  padding-bottom: 0.12em;
  overflow-wrap: anywhere;
  transition: color 0.2s ease;
}

.contact__email a:hover { color: var(--oxide); }

.contact__note {
  font-size: 0.9375rem;
  color: var(--ink-62);
}

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

.site-footer {
  background: var(--ink);
  color: var(--cream);
  padding-block: clamp(3rem, 5vw, 4.5rem);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.site-footer__lockup {
  width: auto;
  height: 2.5rem;
  margin-bottom: 1.1rem;
}

.site-footer__descriptor {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream-52);
  margin: 0;
}

.site-footer__meta {
  text-align: right;
  font-size: 0.9375rem;
}

.site-footer__meta a {
  color: var(--cream);
  text-decoration-color: var(--oxide-rule);
  text-underline-offset: 0.25em;
}

.site-footer__meta a:hover { text-decoration-color: var(--cream); }

.site-footer__legal {
  margin: 0.5rem 0 0;
  color: var(--cream-52);
  font-size: 0.8125rem;
}

/* --------------------------------------------------------------------------
   Reveal (only applied once JS is present)
   -------------------------------------------------------------------------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.js .problems [data-reveal]:nth-child(2),
.js .traits [data-reveal]:nth-child(2) { transition-delay: 0.06s; }

.js .problems [data-reveal]:nth-child(3),
.js .traits [data-reveal]:nth-child(3) { transition-delay: 0.12s; }

.js .problems [data-reveal]:nth-child(4),
.js .traits [data-reveal]:nth-child(4) { transition-delay: 0.18s; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .traits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
  /* Stacked shape, shared by the plain header list and the toggled panel. */
  .site-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

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

  .site-nav__list a {
    display: block;
    padding-block: 0.95rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--ink-hairline);
  }

  .site-nav__list a::after { display: none; }

  .site-nav__list a[aria-current="true"] { color: var(--oxide); }

  .site-nav__cta {
    margin-top: 1.5rem;
    width: 100%;
  }

  /* No scripting: the toggle can never work, so it stays hidden (its base
     rule) and the navigation stays in the header, visible and usable. The
     header stops sticking so the taller header does not hold the viewport. */
  html:not(.js) .site-header { position: static; }

  html:not(.js) .site-header__inner {
    flex-wrap: wrap;
    row-gap: 0;
  }

  html:not(.js) .site-nav {
    width: 100%;
    padding-block: 0.25rem 1.5rem;
    border-top: 1px solid var(--ink-rule);
  }

  /* Scripting available: the same navigation becomes a toggled panel. */
  .js .menu-toggle { display: inline-flex; }

  .js .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    padding: 1.5rem var(--shell-pad) 2.25rem;
    background: var(--cream);
    border-bottom: 1px solid var(--ink-rule);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.75rem);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  }

  .js body.nav-open .site-nav {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
}

@media (max-width: 720px) {
  :root { --header-h: 4rem; }

  .brand__lockup { height: 1.9rem; }

  .problems,
  .traits { grid-template-columns: minmax(0, 1fr); }

  .shift { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }

  .shift__side--after { padding-left: 1rem; }

  .method__step {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }

  .site-footer__inner { align-items: flex-start; }

  .site-footer__meta { text-align: left; }
}

@media (max-width: 420px) {
  .hero__actions .btn { width: 100%; }

  .hero__stages { gap: 0.5rem 1.5rem; }
}

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

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
    scroll-behavior: auto;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */

@media print {
  .site-header,
  .menu-toggle,
  .hero__actions { display: none; }

  body { background: var(--cream); color: var(--ink); }

  .section--ink,
  .site-footer { background: var(--cream); color: var(--ink); }

  .section--ink .lede,
  .boundary p,
  .problem p { color: var(--ink-80); }
}
