/* ============================================================
   core.css — dotshock.ai v3 FOUNDATION (single source of truth)
   ------------------------------------------------------------
   The shared base for ALL three templates:
     • SITE  (shock.css + pages.css / services.css)  — marketing + suite landing
     • APP   (suite-app.css + suite.css + per-app)    — the .shock Suite apps
     • ADMIN (admin.css)                              — admin / backend pages
   Owns: @font-face, design tokens (:root), reset/base, layout primitives,
   the editorial frame motif, and the button system. Change brand colour,
   type, spacing or motion HERE and it propagates everywhere.
   Managed from the `design` branch — feature branches consume, never redefine.
   No external font CDNs. Self-hosted woff2 with strong system fallbacks.
   ============================================================ */

/* ---------- @font-face (owner drops woff2 into /assets/fonts/) ----------
   The page renders perfectly with system fallbacks even before the owner
   supplies font files. font-display:swap avoids invisible text. */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/fonts/PlusJakartaSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/fonts/PlusJakartaSans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/fonts/PlusJakartaSans-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/fonts/PlusJakartaSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/fonts/PlusJakartaSans-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/IBMPlexMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   TOKENS (§1 — exact hex values, surfaced as CSS custom properties)
   ============================================================ */
:root {
  /* Surfaces */
  --surface: #0C0C0F;
  --panel:   #131318;
  --panel2:  #191920;
  --panel3:  #202028;
  --line:    #272730;
  --line2:   #33333D;

  /* Text */
  --text:  #EDECF2;
  --dim:   #8A8A95;
  --faint: #8E8E98; /* was #56565F — failed WCAG AA (2.5:1) on real text; now ≥4.5:1 on all surfaces */

  /* Accents (red used sparingly — <=2% of surface area) */
  --red:    #C8070A;
  --green:  #3FB950;
  --yellow: #D9A60A;

  /* Type stacks — display + mono with strong system fallbacks */
  --font-display: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI",
                  Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", "Cascadia Mono",
               "Menlo", "Consolas", monospace;

  /* Layout */
  --maxw: 1280px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 4px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 0.28s;
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, video, svg { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
h1, h2, h3 { text-wrap: balance; }

p { margin: 0; }

ul { margin: 0; padding: 0; list-style: none; }

button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 2px;
}

.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: var(--gutter); top: -100px;
  background: var(--red);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius);
  z-index: 200;
  font-family: var(--font-mono);
  font-size: 13px;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 14px; }

/* ============================================================
   LAYOUT PRIMITIVES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(64px, 10vw, 128px);
  position: relative;
}
.section--tight { padding-block: clamp(48px, 7vw, 88px); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 18px;
}

.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head h2 {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  font-weight: 800;
}
.section-head p {
  margin-top: 16px;
  color: var(--dim);
  font-size: clamp(0.97rem, 1.25vw, 1.07rem);
  line-height: 1.65;
  max-width: 60ch;
}

.section-foot { margin-top: clamp(32px, 5vw, 48px); }

/* ============================================================
   EDITORIAL FRAME-LINE MOTIF (1px #C8070A — MAX 4 per page)
   Used as restrained accents: a corner bracket, a hairline rule.
   ============================================================ */
.frame-rule {
  height: 1px;
  width: 64px;
  background: var(--red);
  border: 0;
  margin: 0 0 28px;
}

.corner-bracket { position: relative; }
.corner-bracket::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 34px; height: 34px;
  border-top: 1px solid var(--red);
  border-left: 1px solid var(--red);
  pointer-events: none;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  padding: 0.95em 1.5em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              transform var(--dur) var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--text);
  color: var(--surface);
}
.btn--primary:hover { background: #fff; }

/* readable red CTA — used where a white button would sit on a light/prose area.
   The .prose a.btn--red rule beats .prose a's link colour so text stays white. */
.btn--red { background: var(--red); color: #fff; border-color: var(--red); }
.btn--red:hover, .btn--red:focus-visible { background: #e30b0e; color: #fff; border-color: #e30b0e; }
.prose a.btn--red { color: #fff; text-decoration: none; }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line2);
}
.btn--ghost:hover { border-color: var(--text); background: var(--panel2); }

.btn--quiet {
  padding-inline: 0;
  background: none;
  color: var(--text);
  font-weight: 600;
}
.btn--quiet .arrow { transition: transform var(--dur) var(--ease); }
.btn--quiet:hover .arrow { transform: translateX(4px); }
.btn--quiet:hover { color: #fff; }

.arrow { display: inline-block; }

/* ============================================================
   BRAND / LOGO  (shared wordmark — site, suite apps, admin)
   The ".name.shock" wordmark, red dot, and chevron road-sign mark.
   Lives in the foundation so the logo field is identical everywhere.
   ============================================================ */
/* red dots — bigger & bolder on every item EXCEPT the logo wordmarks */
.dot { color: var(--red); font-size: 1.3em; font-weight: 900; }
.brand .dot, .intro__brand .dot, .footer-brand .dot { font-size: inherit; font-weight: inherit; }
.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.95rem;
  letter-spacing: -0.03em;
  color: var(--text);
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
}
.brand-wrap { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.brand-tagline {
  font-size: 0.52rem;
  font-family: var(--font-mono);
  color: var(--dim);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

/* Brand chevron mark — the .shock road-sign, set to the RIGHT of the wordmark.
   Reuses the favicon SVG as the logo glyph; applies in header + footer via .brand.
   Scales with the wordmark. */
.brand::after {
  content: "";
  flex: none;
  /* Tightly-cropped chevron box (199×176) so the element box IS the visible box.
     With .brand{align-items:baseline}, the box's bottom edge aligns to the wordmark baseline. */
  height: 1.0em;
  width: 1.131em;   /* keep the box's true 199:176 aspect ratio */
  margin-left: 0.30em;
  margin-bottom: -0.05em;
  background: url("/assets/img/shock-box-tight.png") center / contain no-repeat;
}
