/* ==========================================================================
   YARAGON — coming soon
   Type:   IBM Plex Sans (display + body) / IBM Plex Mono (status, footer)
   Mark:   hexagonal perimeter, one edge detached — echoed by the lattice
   Layout: a narrow column on small screens; from 60rem the headline sets on
           one line across the full measure and the body text stays narrow.
   ========================================================================== */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("plex-sans-var-latin.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("plex-mono-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------------------------------------- tokens ---- */

:root {
  color-scheme: light;

  --bg: #ffffff;
  --ink: #0b1f35;
  --ink-2: #405568;
  --ink-3: #5b7086;
  --rule: #e3e9f0;
  --rule-strong: #c3d1e0;
  --accent: #1f6feb;
  --accent-hover: #1558c4;
  --logo-core: #0b2a4a;
  --logo-gap: #1f6feb;
  --surface-hover: rgba(31, 111, 235, 0.06);
  --icon-sun: none;
  --icon-moon: block;

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* System preference, only while the visitor has not chosen a theme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #070d16;
    --ink: #eaf0f8;
    --ink-2: #a3b4c6;
    --ink-3: #8296ab;
    --rule: #1a2536;
    --rule-strong: #2e3e52;
    --accent: #5b9bff;
    --accent-hover: #86b6ff;
    --logo-core: #ffffff;
    --logo-gap: #5b9bff;
    --surface-hover: rgba(91, 155, 255, 0.09);
    --icon-sun: block;
    --icon-moon: none;
  }
}

/* Explicit choice — declared after the media query so it always wins. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070d16;
  --ink: #eaf0f8;
  --ink-2: #a3b4c6;
  --ink-3: #8296ab;
  --rule: #1a2536;
  --rule-strong: #2e3e52;
  --accent: #5b9bff;
  --accent-hover: #86b6ff;
  --logo-core: #ffffff;
  --logo-gap: #5b9bff;
  --surface-hover: rgba(91, 155, 255, 0.09);
  --icon-sun: block;
  --icon-moon: none;
}

/* --------------------------------------------------------------- base ---- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 100%;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

h1,
h2,
p {
  margin: 0;
}

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

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

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

/* ----------------------------------------------------------- masthead ---- */

.masthead {
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.35s var(--ease);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: clamp(1rem, 2.6vw, 1.5rem);
}

.logo__svg {
  display: block;
  height: clamp(1.125rem, 3.6vw, 1.4rem);
  width: auto;
}

.logo__core {
  stroke: var(--logo-core);
  transition: stroke 0.35s var(--ease);
}

.logo__gap {
  stroke: var(--logo-gap);
  transition: stroke 0.35s var(--ease);
}

.toggle {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
    background-color 0.2s var(--ease);
}

.toggle:hover {
  color: var(--ink);
  border-color: var(--rule-strong);
  background: var(--surface-hover);
}

.toggle__icon {
  width: 1.125rem;
  height: 1.125rem;
}

/* Show the icon for the theme the button switches *to*. */
.toggle__icon--sun {
  display: var(--icon-sun);
}

.toggle__icon--moon {
  display: var(--icon-moon);
}

/* --------------------------------------------------------------- hero ---- */

.main {
  display: grid;
  justify-items: center;
  align-content: center;
  padding-block: clamp(2.25rem, 6vh, 4.5rem);
}

.hero {
  width: 100%;
  max-width: 40rem;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.eyebrow__pip {
  width: 5px;
  height: 5px;
  flex: none;
  background: var(--accent);
  animation: pip 3.2s ease-in-out infinite;
}

@keyframes pip {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Two lines on small screens, one line from 60rem. The size is driven by vw
   so neither arrangement can wrap or overflow at any width. */
.title {
  margin-top: 1.25rem;
  font-size: min(3rem, 9.4vw);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.022em;
  color: var(--ink);
}

.title__line {
  display: block;
  white-space: nowrap;
}

.title__amp {
  color: var(--accent);
}

/* Below the rule: the description on the left, the action on the right from
   60rem, stacked in reading order below that. */
.body {
  margin-top: 2.25rem;
  display: grid;
  row-gap: 2rem;
}

.lede {
  max-width: 34em;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  line-height: 1.65;
  color: var(--ink-2);
}

.lede + .lede {
  margin-top: 1rem;
}

.status {
  margin-top: 1.25rem;
  max-width: 34em;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  line-height: 1.65;
  color: var(--ink-3);
}

/* ------------------------------------------------------------ lattice ---- */
/* A row of controls under continuous validation: a beam passes across the
   ticks and one tick stands out — the gap the platform is built to find.
   It is also the only divider on the page. */

.lattice {
  --tick-gap: 12px;
  --tick-mask: repeating-linear-gradient(90deg, #000 0 1px, transparent 1px var(--tick-gap));
  position: relative;
  height: 18px;
  margin-top: 2.25rem;
  background-image: repeating-linear-gradient(90deg, var(--rule-strong) 0 1px, transparent 1px var(--tick-gap));
  background-size: 100% 10px;
  background-position: 0 100%;
  background-repeat: no-repeat;
}

.lattice__scan {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(90deg, transparent, var(--accent) 50%, transparent);
  background-size: 30% 10px;
  background-position: -55% 100%;
  background-repeat: no-repeat;
  -webkit-mask-image: var(--tick-mask);
  mask-image: var(--tick-mask);
  -webkit-mask-size: 100% 10px;
  mask-size: 100% 10px;
  -webkit-mask-position: 0 100%;
  mask-position: 0 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  animation: scan 7.5s linear infinite;
}

@keyframes scan {
  from { background-position: -55% 100%; }
  to { background-position: 155% 100%; }
}

.lattice__flag {
  position: absolute;
  left: 62%;
  bottom: 0;
  width: 1px;
  height: 18px;
  background: var(--accent);
}

/* ------------------------------------------------------------ contact ---- */

.contact__label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.contact__text {
  margin-top: 0.75rem;
  max-width: 30em;
  font-size: 1rem;
  color: var(--ink-2);
}

.contact__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-block: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--rule-strong);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.contact__link:hover {
  color: var(--accent-hover);
  border-color: var(--accent);
}

.contact__arrow {
  width: 0.75rem;
  height: 0.75rem;
  flex: none;
  transition: transform 0.2s var(--ease);
}

.contact__link:hover .contact__arrow {
  transform: translate(2px, -2px);
}

/* ------------------------------------------------------------- footer ---- */

.footer {
  border-top: 1px solid var(--rule);
  transition: border-color 0.35s var(--ease);
}

.footer__inner {
  padding-block: 1.125rem;
}

.footer__note {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

/* -------------------------------------------------------- breakpoints ---- */

/* Tablet: the column can carry more of the viewport. */
@media (min-width: 40rem) {
  .hero {
    max-width: 44rem;
  }

  .title {
    margin-top: 1.5rem;
  }

  .lattice {
    margin-top: 2.5rem;
  }

  .body {
    margin-top: 2.5rem;
    row-gap: 2.25rem;
  }
}

/* Desktop: the headline sets on a single line across the full measure. */
@media (min-width: 60rem) {
  .hero {
    max-width: 100%;
  }

  .title {
    margin-top: 1.75rem;
    font-size: min(3.9rem, 5vw);
    letter-spacing: -0.028em;
    white-space: nowrap;
  }

  .title__line {
    display: inline;
  }

  .eyebrow {
    font-size: 0.75rem;
  }

  .lattice {
    margin-top: 2.75rem;
  }

  .body {
    margin-top: 2.75rem;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    column-gap: clamp(3rem, 5vw, 5.5rem);
    align-items: start;
  }
}

/* ------------------------------------------------------------ reveals ---- */

@keyframes rise {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}

/* Gated on the .reveal class that theme.js adds before first paint: without
   scripting the content is simply visible, never stuck at opacity 0. */
:root.reveal .logo,
:root.reveal .toggle,
:root.reveal .hero > *,
:root.reveal .footer__note {
  animation: rise 0.6s var(--ease) both;
}

.logo { animation-delay: 0.04s; }
.toggle { animation-delay: 0.1s; }
.hero > *:nth-child(1) { animation-delay: 0.16s; }
.hero > *:nth-child(2) { animation-delay: 0.22s; }
.hero > *:nth-child(3) { animation-delay: 0.32s; }
.hero > *:nth-child(4) { animation-delay: 0.4s; }
.footer__note { animation-delay: 0.48s; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* Hold the beam over the flagged tick instead of sweeping. */
  .lattice__scan {
    animation: none;
    background-position: 67% 100%;
  }
}
