/* ==========================================================================
   AMBytz — American Bytz Media
   Design system. Palette + display face are the only per-brand tokens;
   everything below :root is the shared house component library
   (same structural system as techhub.us / t4devco.com).
   ========================================================================== */

:root {
  /* --- brand palette (extracted from the live ambytz.com) --- */
  --blue:         #1b3cf5;
  --blue-bright:  #2b59ff;
  --navy:         #141857;
  --navy-deep:    #0b0e23;
  --ink:          #12141d;
  --slate:        #2f354b;
  --slate-soft:   #475569;

  /* --- surfaces (light: editorial / credible, the default) --- */
  --bg:           #ffffff;
  --bg-alt:       #f6f7fb;
  --bg-sunk:      #eef1f8;
  --bg-invert:    var(--navy-deep);
  --fg:           var(--ink);
  --fg-muted:     var(--slate-soft);
  --fg-invert:    #ffffff;
  --fg-invert-mut:#a8b0cf;
  --line:         #e2e5f0;
  --line-strong:  #cbd2e6;
  --accent:       var(--blue);
  --accent-hover: var(--blue-bright);
  --accent-tint:  #eef1ff;
  --on-accent:    #ffffff;

  /* --- type --- */
  --serif: 'Newsreader', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --sans:  'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  /* --- structure (shared house tokens; change only with reason) --- */
  --wrap: 1180px;
  --wrap-narrow: 760px;
  --gut: clamp(1.25rem, 4vw, 3rem);
  --sec: clamp(4.5rem, 9vw, 8rem);
  --r-sm: 6px;
  --r: 12px;
  --r-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(11,14,35,.06), 0 2px 8px rgba(11,14,35,.04);
  --shadow: 0 4px 12px rgba(11,14,35,.07), 0 18px 40px -12px rgba(11,14,35,.12);
  --shadow-lg: 0 8px 24px rgba(11,14,35,.09), 0 32px 64px -16px rgba(11,14,35,.18);
  --ease: cubic-bezier(.22,.61,.36,1);
}

:root[data-theme="dark"] {
  --bg:           #0b0e23;
  --bg-alt:       #12162e;
  --bg-sunk:      #171c39;
  --bg-invert:    #060814;
  --fg:           #f2f4fb;
  --fg-muted:     #a8b0cf;
  --fg-invert:    #ffffff;
  --fg-invert-mut:#a8b0cf;
  --line:         #242a4d;
  --line-strong:  #333b66;
  --accent:       #6b8cff;
  --accent-hover: #8ba5ff;
  --accent-tint:  #1a2145;
  --on-accent:    #070a19;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 4px 12px rgba(0,0,0,.45), 0 18px 40px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.5), 0 32px 64px -16px rgba(0,0,0,.7);
}

/* ---------------------------------------------------------------- reset */
*, *::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;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -.018em;
  color: var(--fg);
  margin: 0 0 .6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 6.2vw, 4.25rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); }
p  { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: var(--on-accent);
  padding: .7rem 1.1rem; border-radius: 0 0 var(--r-sm) 0; font-weight: 700;
}
.skip:focus { left: 0; }

/* ------------------------------------------------------------- layout */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }
.narrow { max-width: var(--wrap-narrow); margin-inline: auto; }
section { padding-block: var(--sec); }
.sunk { background: var(--bg-alt); }
.sunk-2 { background: var(--bg-sunk); }
.invert { background: var(--bg-invert); color: var(--fg-invert); }
.invert h1, .invert h2, .invert h3 { color: var(--fg-invert); }
.invert p { color: var(--fg-invert-mut); }

.eyebrow {
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
  display: flex; align-items: center; gap: .6rem;
}
.eyebrow::before {
  content: ""; width: 1.75rem; height: 2px; background: currentColor; flex: none;
}
.invert .eyebrow { color: var(--accent-hover); }

.lede {
  font-size: clamp(1.075rem, 1.6vw, 1.25rem);
  color: var(--fg-muted);
  line-height: 1.6;
  max-width: 60ch;
}
.sec-head { max-width: 68ch; margin-bottom: clamp(2.5rem, 5vw, 3.75rem); }

/* -------------------------------------------------------- concept bar */
.concept-bar {
  background: var(--navy-deep);
  color: #dfe4ff;
  font-size: .8rem;
  line-height: 1.45;
  padding: .55rem 0;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.concept-bar .wrap { display: flex; gap: .5rem 1rem; align-items: baseline; flex-wrap: wrap; }
.concept-bar strong { color: #fff; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; font-size: .72rem; }
.concept-bar a { color: #b9c4ff; }

/* --------------------------------------------------------------- nav */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.nav.is-stuck { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.nav .wrap { display: flex; align-items: center; gap: 1.25rem; min-height: 4.5rem; }

.brand { display: flex; align-items: center; gap: .6rem; margin-right: auto; text-decoration: none; }
.brand-mark {
  flex: none; display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem; border-radius: 7px;
  background: var(--navy); color: #fff;
}
.brand-mark svg { width: 100%; height: 100%; }
.brand-txt { display: flex; flex-direction: column; line-height: 1; }
.brand-txt b {
  font-family: var(--serif); font-size: 1.3rem; font-weight: 600;
  color: var(--fg); letter-spacing: -.02em;
}
.brand-txt span {
  font-size: .6rem; font-weight: 800; letter-spacing: .18em;
  text-transform: uppercase; color: var(--fg-muted); margin-top: .18rem;
}

.nav-links { display: flex; align-items: center; gap: .35rem; }
.nav-links a {
  color: var(--fg); text-decoration: none; font-size: .93rem; font-weight: 600;
  padding: .5rem .7rem; border-radius: var(--r-sm);
  transition: background .18s var(--ease), color .18s var(--ease);
}
.nav-links a:hover { background: var(--accent-tint); color: var(--accent); }
.nav-links a[aria-current="page"] { color: var(--accent); }

.nav-tools { display: flex; align-items: center; gap: .5rem; }

.icon-btn {
  display: grid; place-items: center;
  width: 2.3rem; height: 2.3rem; padding: 0;
  background: transparent; color: var(--fg);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  cursor: pointer; transition: background .18s var(--ease), border-color .18s var(--ease);
}
.icon-btn:hover { background: var(--bg-alt); border-color: var(--accent); }
.icon-btn svg { width: 1.05rem; height: 1.05rem; }
[data-theme="dark"] .sun, :root:not([data-theme="dark"]) .moon { display: none; }

.nav-toggle { display: none; }

@media (max-width: 940px) {
  .nav-toggle { display: grid; }
  .nav-links {
    position: absolute; inset: 100% 0 auto; flex-direction: column; align-items: stretch;
    gap: 0; padding: .5rem var(--gut) 1.25rem;
    background: var(--bg); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow); display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: .8rem .25rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-cta { color: var(--accent) !important; font-weight: 800 !important; }
}
/* Below this width the header CTA wraps to two lines and crowds the bar, so it
   folds into the menu instead — where .nav-cta carries the same destination. */
@media (min-width: 941px) { .nav-cta { display: none; } }
@media (max-width: 560px) { .nav .nav-tools > .btn-primary { display: none; } }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .82rem 1.4rem;
  font-family: var(--sans); font-size: .95rem; font-weight: 700;
  border-radius: var(--r-sm); border: 1px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: transform .18s var(--ease), background .18s var(--ease),
              box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }
.invert .btn-ghost { color: #fff; border-color: rgba(255,255,255,.32); }
.invert .btn-ghost:hover { background: rgba(255,255,255,.09); border-color: #fff; color: #fff; }
.btn-arrow::after { content: "→"; font-weight: 400; transition: transform .18s var(--ease); }
.btn:hover .btn-arrow::after, .btn-arrow:hover::after { transform: translateX(3px); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.textlink {
  font-weight: 700; font-size: .95rem; text-decoration: none;
  display: inline-flex; align-items: center; gap: .4rem;
}
.textlink::after { content: "→"; transition: transform .18s var(--ease); }
.textlink:hover::after { transform: translateX(3px); }

/* --------------------------------------------------------------- hero */
.hero {
  position: relative; overflow: hidden;
  padding-block: clamp(4rem, 10vw, 8.5rem) clamp(4rem, 8vw, 7rem);
  background: var(--bg);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(58rem 32rem at 82% -12%, var(--accent-tint) 0%, transparent 62%),
    linear-gradient(180deg, transparent 55%, var(--bg-alt) 100%);
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { max-width: 22ch; }
.hero .lede { font-size: clamp(1.1rem, 1.9vw, 1.375rem); max-width: 56ch; }

.hero-rule {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px; margin-top: clamp(3rem, 6vw, 4.5rem);
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden;
}
.hero-rule div { background: var(--bg); padding: 1.15rem 1.25rem; }
.hero-rule dt {
  font-size: .7rem; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--fg-muted); margin-bottom: .3rem;
}
.hero-rule dd { margin: 0; font-family: var(--serif); font-size: 1.25rem; color: var(--fg); }

/* --------------------------------------------------------------- grids */
.grid { display: grid; gap: 1.25rem; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(272px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.6rem;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.sunk .card, .sunk-2 .card { background: var(--bg); }
.card-hover:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--fg-muted); font-size: .96rem; margin: 0; }
.card-ico {
  width: 2.5rem; height: 2.5rem; margin-bottom: 1.05rem;
  display: grid; place-items: center;
  background: var(--accent-tint); color: var(--accent); border-radius: var(--r-sm);
}
.card-ico svg { width: 1.25rem; height: 1.25rem; }

/* -------------------------------------------------- method (numbered) */
.steps { counter-reset: step; display: grid; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.step { counter-increment: step; background: var(--bg); padding: 1.75rem 1.5rem; position: relative; }
.step::before {
  content: "0" counter(step);
  font-family: var(--mono); font-size: .8rem; font-weight: 700; letter-spacing: .1em;
  color: var(--accent); display: block; margin-bottom: .9rem;
}
.step h3 { font-size: 1.15rem; margin-bottom: .45rem; }
.step p { color: var(--fg-muted); font-size: .93rem; margin: 0; }

/* --------------------------------------------------------------- stats */
.stats { display: grid; gap: clamp(1.5rem, 4vw, 3rem); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat b {
  display: block; font-family: var(--serif); font-weight: 500;
  font-size: clamp(2.75rem, 6.5vw, 4.25rem); line-height: .95;
  letter-spacing: -.03em; color: var(--fg);
}
.invert .stat b { color: #fff; }
.stat span {
  display: block; margin-top: .7rem; font-size: .88rem; line-height: 1.45;
  color: var(--fg-muted); max-width: 26ch;
}
.invert .stat span { color: var(--fg-invert-mut); }

/* ------------------------------------------------------------ articles */
.arts { display: grid; gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.art {
  background: var(--bg); padding: 1.6rem 0; display: grid; gap: .2rem 1.75rem;
  grid-template-columns: 8.5rem 1fr auto; align-items: baseline;
  text-decoration: none; color: inherit;
  transition: background .18s var(--ease);
}
.art:hover { background: var(--accent-tint); }
.art:hover .art-t { color: var(--accent); }
.art > * { padding-inline: 1.25rem; }
.art-meta { font-family: var(--mono); font-size: .74rem; letter-spacing: .04em; color: var(--fg-muted); text-transform: uppercase; }
.art-t {
  font-family: var(--serif); font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  line-height: 1.25; color: var(--fg); letter-spacing: -.012em;
  transition: color .18s var(--ease);
}
.art-t small { display: block; font-family: var(--sans); font-size: .85rem; font-weight: 400; color: var(--fg-muted); margin-top: .4rem; line-height: 1.5; letter-spacing: 0; }
.art-go { color: var(--accent); font-weight: 700; font-size: 1.1rem; }
@media (max-width: 760px) {
  .art { grid-template-columns: 1fr; gap: .6rem; }
  .art-go { display: none; }
}

.tag {
  display: inline-block; padding: .2rem .55rem;
  font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-tint);
  border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}

/* ----------------------------------------------------------- quote */
.quote { border-left: 3px solid var(--accent); padding-left: clamp(1.25rem, 3vw, 2.25rem); }
.quote blockquote {
  margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.4rem, 3vw, 2.05rem); line-height: 1.32;
  letter-spacing: -.018em; color: var(--fg);
}
.invert .quote blockquote { color: #fff; }
.quote cite {
  display: block; margin-top: 1.4rem; font-family: var(--sans); font-style: normal;
  font-size: .82rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-muted);
}

/* ------------------------------------------------------- split panel */
.split { display: grid; gap: clamp(2rem, 5vw, 4.5rem); align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); }
.checks { list-style: none; margin: 1.75rem 0 0; padding: 0; display: grid; gap: .85rem; }
.checks li { display: grid; grid-template-columns: 1.4rem 1fr; gap: .7rem; font-size: .98rem; color: var(--fg-muted); }
.checks li::before {
  content: "✓"; color: var(--accent); font-weight: 800;
  background: var(--accent-tint); border-radius: 50%;
  width: 1.4rem; height: 1.4rem; display: grid; place-items: center; font-size: .78rem;
  margin-top: .15rem;
}
.invert .checks li { color: var(--fg-invert-mut); }
.invert .checks li::before { background: rgba(255,255,255,.1); color: #fff; }

.panel {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: clamp(1.6rem, 3.5vw, 2.4rem);
  box-shadow: var(--shadow);
}
.invert .panel { background: rgba(255,255,255,.045); border-color: rgba(255,255,255,.12); box-shadow: none; }

/* ---------------------------------------------------------------- form */
.field { margin-bottom: 1.05rem; }
.field label {
  display: block; margin-bottom: .38rem;
  font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--fg);
}
.invert .field label { color: #fff; }
.field input, .field select, .field textarea {
  width: 100%; padding: .78rem .9rem;
  font-family: var(--sans); font-size: 1rem; color: var(--fg);
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.invert .field input, .invert .field select, .invert .field textarea {
  background: rgba(0,0,0,.28); border-color: rgba(255,255,255,.2); color: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.field textarea { min-height: 8.5rem; resize: vertical; }
.field .hint { font-size: .82rem; color: var(--fg-muted); margin-top: .4rem; font-weight: 400; letter-spacing: 0; text-transform: none; }
.hp { position: absolute; left: -9999px; }

.form-note {
  margin-top: 1rem; font-size: .85rem; padding: .8rem .95rem;
  border-radius: var(--r-sm); display: none;
}
.form-note.ok { display: block; background: var(--accent-tint); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); }
.form-note.err { display: block; background: #fdecec; color: #9b1c1c; border: 1px solid #f5c2c2; }
[data-theme="dark"] .form-note.err { background: #2b1414; color: #ffb4b4; border-color: #5b2626; }

.inline-form { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.75rem; }
.inline-form input { flex: 1 1 16rem; }

/* ------------------------------------------------------------- footer */
.foot { background: var(--bg-invert); color: var(--fg-invert-mut); padding-block: clamp(3.5rem, 6vw, 5rem) 2rem; }
.foot a { color: #c3ccff; text-decoration: none; }
.foot a:hover { color: #fff; text-decoration: underline; }
.foot-top { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.foot-brand { grid-column: 1 / -1; max-width: 34ch; }
@media (min-width: 860px) { .foot-brand { grid-column: span 2; } }
.foot-brand .brand { margin: 0 0 1.1rem; }
.foot-brand .brand-mark { background: rgba(255,255,255,.12); }
.foot-brand .brand-txt b { color: #fff; }
.foot-brand .brand-txt span { color: var(--fg-invert-mut); }
.foot-brand p { font-size: .92rem; }
.foot h4 {
  font-family: var(--sans); font-size: .74rem; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase; color: #fff; margin: 0 0 1rem;
}
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; font-size: .92rem; }
.foot-bot {
  margin-top: 3.25rem; padding-top: 1.75rem;
  border-top: 1px solid rgba(255,255,255,.13);
  display: flex; flex-wrap: wrap; gap: .75rem 2rem; justify-content: space-between;
  font-size: .8rem; line-height: 1.6;
}
.foot-bot p { margin: 0; max-width: 68ch; }
.social { display: flex; gap: .5rem; }
.social a {
  width: 2.2rem; height: 2.2rem; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.2); border-radius: var(--r-sm);
  transition: background .18s var(--ease), border-color .18s var(--ease);
}
.social a:hover { background: rgba(255,255,255,.11); border-color: #fff; }
.social svg { width: 1rem; height: 1rem; fill: currentColor; }

/* ------------------------------------------------------------- reveal
   Progressive enhancement, and it matters more than it looks. Content here is
   VISIBLE by default; the hidden pre-reveal state applies only under `html.js`,
   which an inline script in <head> adds and a failsafe timer removes if the main
   script never initialises. So JavaScript being disabled, blocked by an
   extension, or broken by a runtime error can never leave the page's content
   permanently invisible — it just arrives without the animation.

   Do NOT move `opacity: 0` back onto a bare `.rv`. This exact defect shipped
   once already (an IntersectionObserver that never saw an element intersect left
   12 of 25 sections at opacity 0 forever) and the no-JS variant of it was caught
   in cross-engine review. Visibility must never depend on a script running. */
.js .rv { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .rv { opacity: 1; transform: none; transition: none; }
  .btn:hover, .card-hover:hover { transform: none; }
}
