/* AutoWrap Robotics — shared design system.
 *
 * One stylesheet for autowrap.ai, autowraprobotics.com and safehumanoids.com.
 * Vercel serves a real static file before it applies the host rewrites, which
 * is why one copy at /assets/ answers on all three domains — the same reason
 * /media/ works today.
 *
 * Before this file each site carried its own inline tokens with different
 * names and different palettes: --ink was #08080D on one and #0A0A0F on
 * another, and the third was a light theme entirely. Three sites that are
 * meant to read as one company did not share a single value.
 *
 * Per-site identity is ONE token: --accent. Everything else is shared.
 */

/* ---------------------------------------------------------------- tokens */
:root {
  /* Surfaces and type are SET PER SITE, because the three sites do not share
   * a theme and should not be forced to: autowrap.ai and autowraprobotics.com
   * are dark, safehumanoids.com is light. Only the structure, the type scale
   * and the spacing are shared. The defaults below are the dark set, so a
   * page that forgets its theme block still renders coherently. */
  --bg:        #08080D;
  --bg-raised: #0E0E15;
  --bg-card:   #12121B;
  --bg-inset:  #171722;

  --fg:        #EDEBE6;
  --fg-muted:  rgba(237,235,230,0.62);
  --fg-faint:  rgba(237,235,230,0.40);
  --fg-ghost:  rgba(237,235,230,0.22);

  --rule:      rgba(237,235,230,0.09);
  --rule-firm: rgba(237,235,230,0.16);

  /* Per-site identity. Overridden once, in the page. */
  --accent:      #00C471;
  --accent-ink:  #08080D;
  --accent-dim:  rgba(0,196,113,0.13);
  --accent-line: rgba(0,196,113,0.30);

  /* Status. Used for claim-element state; never decorative. */
  --ok:      #3DD68C;
  --partial: #E0B341;
  --none:    rgba(237,235,230,0.34);
  --warn:    #E2703A;

  --sans: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --text: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Type scale. One ratio, so headings relate to each other. */
  --t-display: clamp(2.6rem, 6.2vw, 5.1rem);
  --t-h1:      clamp(2.1rem, 4.4vw, 3.4rem);
  --t-h2:      clamp(1.5rem, 2.6vw, 2.1rem);
  --t-h3:      1.16rem;
  --t-body:    1.0rem;
  --t-small:   0.875rem;
  --t-micro:   0.75rem;

  /* Vertical rhythm. Sections breathe; that is most of the "expensive" look. */
  --gap-section: clamp(72px, 11vw, 152px);
  --gap-block:   clamp(32px, 5vw, 64px);
  --measure:     1180px;
  --measure-text: 720px;

  --radius:    10px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--text);
  font-size: var(--t-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); letter-spacing: -0.02em; }
h3 { font-size: var(--t-h3); letter-spacing: -0.01em; line-height: 1.3; }
p  { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }
a  { color: inherit; }
img, svg, video { max-width: 100%; height: auto; }

/* Focus that is visible without being ugly. Never remove it. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--accent); color: var(--accent-ink);
  padding: 12px 20px; font-weight: 700; text-decoration: none;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------- layout */
.wrap { width: 100%; max-width: var(--measure); margin: 0 auto;
        padding-left: clamp(20px, 5vw, 48px);
        padding-right: clamp(20px, 5vw, 48px); }
.wrap-text { max-width: var(--measure-text); }
section { padding-top: var(--gap-section); padding-bottom: var(--gap-section); }
.section-tight { padding-top: var(--gap-block); padding-bottom: var(--gap-block); }
.rule-top { border-top: 1px solid var(--rule); }

.eyebrow {
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin: 0 0 18px;
}
.lede { font-size: clamp(1.05rem, 1.7vw, 1.3rem); color: var(--fg-muted);
        max-width: var(--measure-text); line-height: 1.6; }

/* ------------------------------------------------------------------ nav */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(20px, 5vw, 48px);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--rule);
}
.nav-logo { display: flex; align-items: center; gap: 11px;
            text-decoration: none; flex: 0 0 auto; }
.nav-mark {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
}
.nav-name { font-family: var(--sans); font-weight: 700; font-size: 15px;
            letter-spacing: -0.01em; white-space: nowrap; }
.nav-name .dim { color: var(--fg-faint); font-weight: 500; }

.nav-links { display: flex; align-items: center; gap: clamp(14px, 1.8vw, 26px);
             list-style: none; margin: 0; padding: 0; }
.nav-links a {
  font-size: var(--t-small); font-weight: 500; color: var(--fg-muted);
  text-decoration: none; white-space: nowrap;
  transition: color 0.18s var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--fg); }
.nav-links a[aria-current="page"] { font-weight: 600; }

.nav-toggle { display: none; background: none; border: 1px solid var(--rule);
              color: var(--fg); border-radius: 8px; padding: 8px 12px;
              font-size: var(--t-small); cursor: pointer; }

@media (max-width: 900px) {
  .nav { flex-wrap: wrap; }
  .nav-toggle { display: block; }
  .nav-links {
    flex-basis: 100%; flex-direction: column; align-items: flex-start;
    gap: 4px; padding: 10px 0 4px;
  }
  .nav-links[hidden] { display: none; }
  .nav-links a { display: block; padding: 9px 0; font-size: 0.95rem; }
}

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--text); font-size: var(--t-small); font-weight: 600;
  padding: 11px 22px; border-radius: 8px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.16s var(--ease), opacity 0.16s var(--ease),
              border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { opacity: 0.9; }
.btn-ghost { border-color: var(--rule-firm); color: var(--fg); }
.btn-ghost:hover { border-color: var(--fg-faint); background: var(--bg-card); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* ----------------------------------------------------------------- cards */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* Exactly four across on a wide screen: 4 -> 2 -> 1, never a ragged wrap. */
.grid-row4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1080px) { .grid-row4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .grid-row4 { grid-template-columns: 1fr; } }
/* Cards in a single row carry less text per column, so tighten them. */
.grid-row4 .card { padding: clamp(18px, 1.9vw, 24px); }
.grid-row4 .card h3 { font-size: 1.02rem; }
.grid-row4 .card p { font-size: 0.83rem; line-height: 1.6; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 2.6vw, 30px);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
a.card { text-decoration: none; display: block; }
a.card:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.card-label { font-family: var(--mono); font-size: var(--t-micro);
              letter-spacing: 0.13em; text-transform: uppercase;
              color: var(--fg-faint); margin-bottom: 12px; }
.card h3 { margin-bottom: 10px; }
.card p  { color: var(--fg-muted); font-size: var(--t-small); }

/* Big number / stat. */
.stat-n { font-family: var(--sans); font-size: clamp(2rem, 3.6vw, 3rem);
          font-weight: 700; letter-spacing: -0.03em; line-height: 1;
          color: var(--fg); }
.stat-l { font-size: var(--t-small); color: var(--fg-muted); margin-top: 8px; }

/* ---------------------------------------------------------------- tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch;
                border: 1px solid var(--rule); border-radius: var(--radius);
                background: var(--bg-raised); }
table { width: 100%; border-collapse: collapse; font-size: var(--t-small); }
thead th {
  text-align: left; font-family: var(--mono); font-weight: 700;
  font-size: var(--t-micro); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-faint); padding: 13px 16px;
  border-bottom: 1px solid var(--rule-firm); white-space: nowrap;
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--rule);
           vertical-align: top; color: var(--fg-muted); }
tbody tr:last-child td { border-bottom: 0; }
tbody td:first-child { color: var(--fg); font-weight: 500; }

/* ------------------------------------------------------------- status pip */
.pip { display: inline-flex; align-items: center; gap: 7px;
       font-family: var(--mono); font-size: var(--t-micro);
       letter-spacing: 0.06em; text-transform: uppercase;
       white-space: nowrap; }
.pip::before { content: ""; width: 7px; height: 7px; border-radius: 50%;
               background: var(--none); flex: 0 0 auto; }
.pip-ok::before      { background: var(--ok); }
.pip-partial::before { background: var(--partial); }
.pip-sim::before     { background: var(--partial); }
.pip-none::before    { background: var(--none); }
.pip-hw::before      { background: var(--warn); }

/* ---------------------------------------------------------------- notices */
.note {
  border-left: 2px solid var(--rule-firm);
  padding: 4px 0 4px 20px;
  color: var(--fg-muted);
  font-size: var(--t-small);
}
.note-strong { border-left-color: var(--accent); }
.note-warn   { border-left-color: var(--warn); }
.note b, .note strong { color: var(--fg); }

/* Claim text. Reads as a document, not as marketing. */
.claim { border-left: 2px solid var(--rule-firm); padding-left: 22px;
         margin: 0 0 26px; }
.claim-n { font-family: var(--mono); font-size: var(--t-micro);
           letter-spacing: 0.12em; text-transform: uppercase;
           color: var(--accent); margin-bottom: 9px; }
.claim-body { font-size: 0.94rem; line-height: 1.7; color: var(--fg-muted); }
.claim-body .el { margin: 11px 0 0 0; padding-left: 20px; }
.claim-body .el-l { font-family: var(--mono); color: var(--fg-faint);
                    margin-right: 7px; }

/* ---------------------------------------------------------------- footer */
.foot { border-top: 1px solid var(--rule); padding: var(--gap-block) 0;
        color: var(--fg-faint); font-size: var(--t-small); }
.foot a { color: var(--fg-muted); text-decoration: none; }
.foot a:hover { color: var(--fg); text-decoration: underline; }
.foot-grid { display: flex; flex-wrap: wrap; gap: 28px;
             justify-content: space-between; align-items: flex-start; }

.mono { font-family: var(--mono); }
.muted { color: var(--fg-muted); }
.faint { color: var(--fg-faint); }
.nowrap { white-space: nowrap; }
