/* Kanoniq — kanoniq.extenza.dev */

@layer tokens, base, layout, components;

@layer tokens {
  @font-face {
    font-family: 'IBM Plex Sans';
    src: url('/fonts/ibm-plex-sans-400.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
  }
  @font-face {
    font-family: 'IBM Plex Sans';
    src: url('/fonts/ibm-plex-sans-600.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
  }
  @font-face {
    font-family: 'Space Grotesk';
    src: url('/fonts/space-grotesk-700.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
  }

  :root {
    color-scheme: light dark;

    --paper: #d6e6f7;
    --ink: #0f2340;
    --derived: #5d7594;
    --muted: #3a4f6c;
    --rule: #a3c0df;
    --accent: #a8320f;

    --sans: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: ui-monospace, 'Cascadia Mono', 'Consolas', monospace;
    --display: 'Space Grotesk', var(--sans);

    --step--1: 0.875rem;
    --step-0: 1rem;
    --step-1: 1.25rem;
    --step-2: 1.5625rem;
    --step-3: clamp(1.9rem, 1.45rem + 1.5vw, 2.4rem);
    --step-4: clamp(2.25rem, 1.5rem + 3.4vw, 4rem);

    --measure: 60ch;
    --gutter: 1rem;
    --space-xs: 0.5rem;
    --space-s: 1rem;
    --space-m: 1.5rem;
    --space-l: 2.5rem;
    --space-xl: 4rem;
  }

  @media (min-width: 48rem) {
    :root {
      --gutter: 2rem;
      --space-l: 3.5rem;
      --space-xl: 6rem;
    }
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --paper: #12201d;
      --ink: #e8edea;
      --derived: #8aa199;
      --muted: #9fb3ac;
      --rule: #2a3b37;
      --accent: #d9a441;
    }
  }

  :root[data-theme="dark"] {
    color-scheme: dark;
    --paper: #12201d;
    --ink: #e8edea;
    --derived: #8aa199;
    --muted: #9fb3ac;
    --rule: #2a3b37;
    --accent: #d9a441;
  }

  :root[data-theme="light"] {
    color-scheme: light;
    --paper: #d6e6f7;
    --ink: #0f2340;
    --derived: #5d7594;
    --muted: #3a4f6c;
    --rule: #a3c0df;
    --accent: #a8320f;
  }
}

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

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

  body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: var(--step-0);
    line-height: 1.6;
    text-underline-offset: 0.2em;
  }

  h1, h2, h3 {
    margin: 0;
    font-weight: 600;
    line-height: 1.12;
    text-wrap: balance;
  }

  p { margin: 0; }

  a {
    color: var(--accent);
    text-decoration-thickness: 1px;
  }

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

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

@layer layout {
  .wrap {
    max-width: 64rem;
    margin-inline: auto;
    padding-inline: var(--gutter);
  }

  .band { padding-block: var(--space-l); }
  main > .band + .band { border-top: 1px solid var(--rule); }
  header.band { padding-block: var(--space-m) 0; }
  header.band .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-s); }
  .hero { padding-block: var(--space-xl); }

  .skip {
    position: absolute;
    left: var(--gutter);
    top: -4rem;
    z-index: 1;
    padding: var(--space-xs) var(--space-s);
    background: var(--ink);
    color: var(--paper);
    text-decoration: none;
    transition: top 120ms ease-out;
  }
  .skip:focus { top: var(--space-xs); }

  @media (prefers-reduced-motion: reduce) {
    .skip { transition: none; }
  }
}

@layer components {

  /* ---- logo ------------------------------------------------------------- */

  .logo {
    display: flex;
    align-items: center;
    gap: 0.7rem;
  }

  .logo-mark {
    width: 2.4rem;
    height: 2.4rem;
    flex: none;
  }

  .mark-a,
  .mark-d {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.7;
  }

  .mark-d {
    stroke-dasharray: 2.6 2.1;
    opacity: 0.6;
  }

  .logo-word {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.85rem;
    letter-spacing: -0.02em;
    color: var(--accent);
  }

  /* ---- hero and prose ----------------------------------------------------- */

  .hero h1 {
    font-size: var(--step-4);
    letter-spacing: -0.025em;
    max-width: 16ch;
  }

  .lede {
    max-width: var(--measure);
    margin-top: var(--space-m);
    font-size: var(--step-1);
    line-height: 1.5;
  }

  .prose {
    font-size: var(--step-1);
    line-height: 1.5;
  }

  .prose .lede {
    font-size: var(--step-2);
    line-height: 1.35;
    letter-spacing: -0.015em;
  }

  .prose p + p { margin-top: var(--space-m); }
  .prose p:not(.lede) { max-width: var(--measure); }

  .band h2 {
    font-size: var(--step-3);
    letter-spacing: -0.02em;
    max-width: 20ch;
  }

  /* ---- the three points -------------------------------------------------- */

  .points {
    display: grid;
    gap: var(--space-l);
    margin: var(--space-l) 0 0;
    padding: 0;
    list-style: none;
  }

  .points > li {
    border-top: 1px solid var(--rule);
    padding-top: var(--space-s);
  }

  .points h3 {
    font-size: var(--step-1);
    margin-bottom: var(--space-xs);
  }

  .points p { max-width: 44ch; }

  @media (min-width: 48rem) {
    .points {
      grid-template-columns: repeat(3, 1fr);
      gap: var(--space-m);
    }
  }

  /* ---- status ------------------------------------------------------------- */

  .status {
    max-width: var(--measure);
    font-size: var(--step-2);
    line-height: 1.3;
    letter-spacing: -0.015em;
  }

  .status-sub {
    max-width: var(--measure);
    margin-top: var(--space-m);
    color: var(--muted);
  }

  /* ---- theme toggle --------------------------------------------------------- */

  .theme-toggle {
    flex: none;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-family: var(--mono);
    font-size: var(--step--1);
    cursor: pointer;
  }

  .theme-toggle:hover,
  .theme-toggle:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
  }

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

  footer {
    padding-block: var(--space-l) var(--space-m);
    color: var(--muted);
    font-size: var(--step--1);
  }

  .foot-motif { border-top: 1px solid var(--ink); }

  .foot-motif::after {
    content: '';
    display: block;
    margin-top: 5px;
    border-top: 1px dashed var(--derived);
  }

  .foot-grid {
    display: grid;
    gap: var(--space-l);
    margin-top: var(--space-l);
  }

  .foot-brand p {
    max-width: 38ch;
    margin-top: var(--space-s);
  }

  .foot-brand .logo-word { font-size: 1.45rem; }
  .foot-brand .logo-mark { width: 1.9rem; height: 1.9rem; }

  .foot-h {
    margin-bottom: var(--space-xs);
    font-size: var(--step-0);
    color: var(--ink);
  }

  .foot-legal { margin-top: var(--space-l); }

  .dim { font-family: var(--mono); }

  @media (min-width: 48rem) {
    .foot-grid {
      grid-template-columns: 1.7fr 1.2fr;
      gap: var(--space-m);
    }
  }
}
