/* Northbound — northboundcx.com gateway.
 *
 * The visual world is PINNED to Northbound Connect. Every token below is copied
 * from the app's src/index.css (light and dark), and the layout is the app's
 * sign-in surface: a 12px frame, a bordered card, a near-black brand panel.
 * If the app's palette changes, change it here too.
 *
 * One rule carried over because it is the one that bites: brand yellow on white
 * is 1.38:1. It is a FILL with near-black on it, never text or a focus ring on
 * a light ground.
 */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/inter-latin-wght.woff2") format("woff2");
}

:root {
  color-scheme: light dark;

  --background: hsl(0 0% 100%);
  --foreground: hsl(240 6% 10%);
  --card: hsl(0 0% 100%);
  --muted: hsl(240 5% 96%);
  --muted-foreground: hsl(240 4% 42%);
  --border: hsl(240 6% 90%);
  --ring: hsl(0 0% 9%);
  --primary: hsl(59.1 80.3% 49.8%);
  --primary-foreground: hsl(0 0% 4%);

  --panel: #050505;
  --panel-olive: #0a0a02;
  --radius: 0.5rem;
  --radius-md: calc(var(--radius) - 2px);

  --font-sans: "Inter Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: hsl(240 6% 6%);
    --foreground: hsl(240 8% 96%);
    --card: hsl(240 5% 11%);
    --muted: hsl(240 4% 17%);
    --muted-foreground: hsl(240 5% 66%);
    --border: hsl(240 4% 18%);
    --ring: hsl(0 0% 98%);
  }
}

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

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

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

.skip-link {
  position: absolute;
  left: 0.75rem; top: 0.75rem;
  z-index: 10;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-md);
  background: var(--foreground);
  color: var(--background);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

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

/* ---- Frame: the sign-in surface's 12px gutter and two panels ---- */

.frame {
  display: grid;
  gap: 0.75rem;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0.75rem;
}

.gateway {
  display: flex;
  align-items: center;
  padding: 3rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
}

.gateway__inner {
  width: 100%;
  max-width: 28.75rem;
  margin-inline: auto;
}

.gateway__logo img { height: 1.75rem; width: auto; }

.gateway__heading {
  margin: 2.5rem 0 0;
  font-size: clamp(2rem, 1.4rem + 2.4vw, 2.5rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.gateway__lede {
  margin: 0.875rem 0 0;
  max-width: 44ch;
  color: var(--muted-foreground);
  font-size: 1.0625rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.gateway__foot {
  margin: 2.5rem 0 0;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}

/* ---- The two destinations: the whole job of the page ---- */

.destinations {
  display: grid;
  gap: 0.75rem;
  margin-top: 2.5rem;
}

.destination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.125rem 1.125rem 1.125rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.destination__body { display: grid; gap: 0.125rem; min-width: 0; }

.destination__name {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.destination__about {
  color: var(--muted-foreground);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.destination__host {
  margin-top: 0.375rem;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* Yellow as a fill with near-black on it — 15:1 — the only way it is legal. */
.destination__go {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.75rem; height: 2.75rem;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-foreground);
  transition: transform 200ms var(--ease-out);
}

.destination:hover,
.destination:focus-visible {
  border-color: var(--foreground);
  background: var(--muted);
}
.destination:hover .destination__go,
.destination:focus-visible .destination__go { transform: translate(2px, -2px); }
.destination:active .destination__go { transform: none; }

/* ---- Brand panel: shown only where it has room to be something ---- */

.brand-panel {
  position: relative;
  display: none;
  overflow: hidden;
  padding: 3rem;
  border-radius: var(--radius-md);
  background: var(--panel);
  color: #fff;
  isolation: isolate;
}

.brand-panel__field {
  position: absolute;
  inset: -10%;
  transform: translate3d(var(--px, 0), var(--py, 0), 0);
  transition: transform 900ms var(--ease-out);
}

.brand-panel__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(56px);
  will-change: transform;
}
.brand-panel__glow--a {
  left: 22%; top: -22%;
  width: 78%; aspect-ratio: 1;
  background: radial-gradient(closest-side, #e5e219 0%, rgb(229 226 25 / 0.7) 40%, transparent 74%);
  animation: drift-a 26s ease-in-out infinite alternate;
}
.brand-panel__glow--b {
  left: -12%; top: 22%;
  width: 58%; aspect-ratio: 1;
  background: radial-gradient(closest-side, #a8a512 0%, rgb(124 122 12 / 0.55) 50%, transparent 76%);
  animation: drift-b 32s ease-in-out infinite alternate;
}
.brand-panel__glow--c {
  right: -18%; top: 30%;
  width: 50%; aspect-ratio: 1;
  background: radial-gradient(closest-side, var(--panel-olive) 0%, rgb(10 10 2 / 0.9) 55%, transparent 78%);
  animation: drift-c 38s ease-in-out infinite alternate;
}

.brand-panel__grain {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  mix-blend-mode: overlay;
}

/* The scrim is the white type's contrast guarantee, not a mood effect: which
   colour of the moving field sits under the text is not knowable at author
   time, so the darks are anchored at both ends. Same construction as the app. */
.brand-panel__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgb(5 5 5 / 0.7), transparent 6rem),
    linear-gradient(to top, var(--panel) 0%, rgb(5 5 5 / 0.4) 30%, transparent 100%);
}

.brand-panel__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  height: 100%;
}

.brand-panel__logo { height: 1.75rem; width: auto; align-self: flex-start; }

.brand-panel__line {
  margin: 0;
  max-width: 15ch;
  font-size: clamp(3rem, 1.2rem + 3vw, 4rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

@keyframes drift-a { to { transform: translate3d(-14%, 16%, 0) scale(1.15); } }
@keyframes drift-b { to { transform: translate3d(20%, -12%, 0) scale(0.9); } }
@keyframes drift-c { to { transform: translate3d(-16%, -18%, 0) scale(1.2); } }

/* ---- Upward from mobile ---- */

@media (min-width: 480px) {
  .gateway { padding: 3rem 2.5rem; }
}

@media (min-width: 992px) {
  .gateway { padding: 5rem 3.5rem; }
}

@media (min-width: 1280px) {
  .frame { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .brand-panel { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-panel__glow { animation: none; }
  .brand-panel__field,
  .destination,
  .destination__go { transition: none; }
  .destination:hover .destination__go,
  .destination:focus-visible .destination__go { transform: none; }
}

@media (forced-colors: active) {
  .destination__go { border: 1px solid ButtonText; }
}
