/* ==========================================================================
   Northline premium demos — shared base layer
   Reset, accessibility primitives, form system, motion policy.
   Per-trade art direction lives in <site>.css and overrides the tokens here.
   ========================================================================== */

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

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0;
  line-height: 1.02;
  letter-spacing: var(--display-tracking, -0.03em);
  font-weight: var(--display-weight, 800);
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

a { color: inherit; }

/* --- Accessibility ------------------------------------------------------ */

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

/* Only remove the default ring where we provide our own visible one. */
:focus:not(:focus-visible) { outline: none; }

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

.skip-link {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -150%);
  top: 8px;
  z-index: 999;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .18s ease;
}
.skip-link:focus { transform: translate(-50%, 0); }

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

.shell {
  width: min(100% - 2.5rem, var(--measure, 1180px));
  margin-inline: auto;
}
@media (min-width: 900px) {
  .shell { width: min(100% - 5rem, var(--measure, 1180px)); }
}

section { position: relative; }

.rule { height: 1px; background: var(--hairline); border: 0; margin: 0; }

/* --- Motion policy ------------------------------------------------------
   Everything that moves does so through .reveal. One switch turns the whole
   site static for users who ask for that.                                  */

.reveal {
  opacity: 1;
  transform: none;
  transition: opacity .7s cubic-bezier(.22,.61,.36,1),
              transform .7s cubic-bezier(.22,.61,.36,1);
  transition-delay: var(--reveal-delay, 0ms);
}
.motion-ready .reveal:not(.is-visible) { opacity: 0; transform: translateY(18px); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .motion-ready .reveal:not(.is-visible) { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: 52px;
  padding: 0 1.9rem;
  border: 0;
  border-radius: var(--btn-radius, 999px);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-ink);
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--hairline-strong);
}
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }

.btn--lg { min-height: 60px; font-size: 1.06rem; padding: 0 2.4rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .9rem; align-items: center; }

@media (prefers-reduced-motion: reduce) {
  .btn:hover { transform: none; }
}

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

.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--masthead-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 74px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: var(--display-weight, 800);
  font-size: 1.06rem;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.wordmark svg { width: 30px; height: 30px; flex: none; }

.nav { display: none; }
@media (min-width: 900px) {
  .nav { display: flex; align-items: center; gap: 2rem; }
}

/* The header CTA is desktop-only. At 390px its label wrapped to six lines and
   doubled the height of the masthead. It still reaches mobile users twice:
   in the hero and in the menu panel. */
.masthead__cta { display: none; }
@media (min-width: 900px) {
  .masthead__cta {
    display: inline-flex;
    min-height: 44px;
    padding: 0 1.3rem;
    font-size: .92rem;
    white-space: nowrap;
  }
}
.nav a {
  text-decoration: none;
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink-soft);
  position: relative;
  padding: .35rem 0;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  transition: right .25s ease;
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { right: 0; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 46px;
  padding: 0 1rem;
  background: transparent;
  border: 1.5px solid var(--hairline-strong);
  border-radius: 999px;
  color: var(--ink);
  font: inherit;
  font-size: .92rem;
  font-weight: 700;
  cursor: pointer;
}
@media (min-width: 900px) { .nav-toggle { display: none; } }

.nav-toggle__bars { width: 17px; height: 11px; position: relative; }
.nav-toggle__bars i {
  position: absolute; left: 0; right: 0; height: 1.8px;
  background: currentColor; border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle__bars i:nth-child(1) { top: 0; }
.nav-toggle__bars i:nth-child(2) { top: 50%; margin-top: -.9px; }
.nav-toggle__bars i:nth-child(3) { bottom: 0; }
[aria-expanded="true"] .nav-toggle__bars i:nth-child(1) { transform: translateY(4.6px) rotate(45deg); }
[aria-expanded="true"] .nav-toggle__bars i:nth-child(2) { opacity: 0; }
[aria-expanded="true"] .nav-toggle__bars i:nth-child(3) { transform: translateY(-4.6px) rotate(-45deg); }

.mobile-panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--panel-bg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
}
.mobile-panel[hidden] { display: none; }

.mobile-panel__top {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 56px;
}
.mobile-panel__close {
  min-height: 46px; padding: 0 1.1rem;
  background: transparent; border: 1.5px solid var(--hairline-strong);
  border-radius: 999px; color: var(--ink); font: inherit; font-weight: 700;
  cursor: pointer;
}
.mobile-panel nav { display: flex; flex-direction: column; }
.mobile-panel nav a {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 9vw, 2.6rem);
  font-weight: var(--display-weight, 800);
  letter-spacing: -.03em;
  text-decoration: none;
  padding: .55rem 0;
  border-bottom: 1px solid var(--hairline);
}
.mobile-panel .btn { width: 100%; }

body.nav-open { overflow: hidden; }

/* --- Forms -------------------------------------------------------------- */

/* The form ships with its fieldset disabled so that, before premium.js runs,
   there is nothing to submit — no control is successful, and the submit button
   is inert. That closes the window where a pre-JS submit could put a name and
   phone number into a GET query string. JS enables it once the handler is on. */
.form-body {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0; /* stops fieldset forcing min-content width in grid */
}
.form-body[disabled] { opacity: .6; }

.field { display: flex; flex-direction: column; gap: .45rem; }

.field label {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 54px;
  padding: .85rem 1rem;
  font: inherit;
  color: var(--ink);
  background: var(--input-bg);
  border: 1.5px solid var(--hairline-strong);
  border-radius: var(--input-radius, 10px);
  transition: border-color .18s ease, background-color .18s ease;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink-soft); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }

.field input::placeholder, .field textarea::placeholder { color: var(--ink-faint); }

.field--invalid input,
.field--invalid select,
.field--invalid textarea { border-color: var(--danger); }

.field__error {
  font-size: .85rem;
  font-weight: 600;
  color: var(--danger);
  min-height: 1.2em;
}
.field__error:empty { display: none; }

.form-grid { display: grid; gap: 1.1rem; }
@media (min-width: 680px) {
  .form-grid--2 { grid-template-columns: 1fr 1fr; }
  .form-grid--2 .field--full { grid-column: 1 / -1; }
}

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

/* Simulation result banner. Never styled to look like a real confirmation
   of dispatch — it says what actually happened, which is nothing. */
.sim-result {
  border: 1.5px solid var(--accent);
  border-radius: var(--input-radius, 10px);
  background: var(--sim-bg);
  padding: 1.15rem 1.25rem;
  display: grid;
  gap: .5rem;
}
.sim-result[hidden] { display: none; }
.sim-result h3 { font-size: 1.12rem; }
.sim-result p { font-size: .95rem; color: var(--ink-soft); }
.sim-result dl {
  margin: .35rem 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .3rem 1rem;
  font-size: .9rem;
}
.sim-result dt { color: var(--ink-faint); font-weight: 600; }
.sim-result dd { margin: 0; }

/* --- Demo disclosure ---------------------------------------------------- */

.demo-flag {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .42rem .95rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  background: var(--flag-bg);
  color: var(--flag-ink);
  border: 1px solid var(--flag-border);
}
.demo-flag::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  flex: none;
}

/* One compact line. The full simulation notice lives at the form and in the
   footer, where it is actually load-bearing — repeating long demo copy in the
   hero just pushed the real content down. */
.demo-bar {
  background: var(--demo-bar-bg);
  color: var(--demo-bar-ink);
  font-size: .8rem;
  padding: .5rem 1rem;
  line-height: 1.35;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .9rem;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.demo-bar a { font-weight: 700; white-space: nowrap; }

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

.site-foot {
  border-top: 1px solid var(--hairline);
  padding: 3.5rem 0 2.5rem;
  font-size: .93rem;
  color: var(--ink-soft);
}
.site-foot__grid {
  display: grid;
  gap: 2rem;
}
@media (min-width: 780px) {
  .site-foot__grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
.site-foot h4 {
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: .85rem;
}
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.site-foot a { text-decoration: none; }
.site-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }

.colophon {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  font-size: .85rem;
  color: var(--ink-faint);
}
