/* ============================================================
   Component Spec Sheet — layout stylesheet
   No inline styles in the DC; no raw hex / magic px here either.
   Everything reads the global tokens (palette.css / type.css / shape.css);
   the only locals are spec-sheet layout constants, declared once below.
   ============================================================ */
.spec {
  /* spec-local layout constants (the table geometry + code face) */
  --spec-cols: 160px 1.4fr 116px 1.4fr;   /* Property · Token · Level · Notes */
  --spec-mono: 'Space Mono', ui-monospace, monospace;
  --spec-code-size: 13px;
  --spec-max: 1120px;

  min-height: 100vh;
  background: var(--background);
  font-family: var(--font-body);
  color: var(--text);
  padding: var(--space-7) var(--page-gutter, 24px) var(--space-8);
  box-sizing: border-box;
}
.spec-wrap {
  max-width: var(--spec-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
}

/* ---------- masthead ---------- */
.spec-masthead { display: flex; flex-direction: column; gap: var(--space-2); }
.spec h1, .spec h2, .spec h3, .spec p { margin: 0; }
.spec-masthead .t-lead { max-width: 680px; }
.spec-legend { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.spec-legend-item {
  display: flex; align-items: center; gap: var(--space-2);
  border: var(--surface-border); border-radius: var(--surface-radius);
  background: var(--surface); padding: var(--space-2) var(--space-3);
}

/* ---------- section ---------- */
.spec-section { display: flex; flex-direction: column; gap: var(--space-5); }
.spec-section-head {
  display: flex; flex-direction: column; gap: var(--space-1);
  border-bottom: 2px solid var(--brand); padding-bottom: var(--space-2);
}
.spec-section-head .t-display { margin: 0; }
.spec-section-head p { margin: var(--space-1) 0 0; color: var(--text-muted); max-width: 680px; }

/* ---------- card ---------- */
.spec-card {
  border: var(--surface-border); border-radius: var(--surface-radius);
  background: var(--surface); box-shadow: var(--surface-shadow); overflow: hidden;
}
.spec-card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--space-3); flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-tint); border-bottom: var(--surface-border);
}

/* ---------- demo / specimen area ---------- */
.spec-demo {
  padding: var(--space-4);
  background: var(--surface-sunken);
  border-bottom: var(--surface-border);
}
.spec-demo--plain { background: var(--surface); }
.spec-demo--flush { padding: 0; }

/* a row of caption legends under a specimen */
.spec-caps { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-3); }

/* ---------- token table ---------- */
.spec-table { display: block; }
.spec-thead, .spec-row {
  display: grid; grid-template-columns: var(--spec-cols);
  padding: var(--space-3) var(--space-4);
}
.spec-thead { padding-top: var(--space-2); padding-bottom: var(--space-2); border-bottom: var(--surface-border); }
.spec-row { border-bottom: 1px solid var(--border); align-items: start; }
.spec-row:last-child { border-bottom: 0; }
.spec-prop { font-weight: 600; }
.spec-tok {
  font-family: var(--spec-mono); font-size: var(--spec-code-size);
  color: var(--brand-strong); word-break: break-word; line-height: 1.5;
}

/* ---------- level chip ---------- */
.spec-chip {
  display: inline-flex; align-items: center;
  padding: 2px var(--space-2); border-radius: 999px;
  font-family: var(--font-label); font-size: 12px; font-weight: 700;
  letter-spacing: .3px; text-transform: uppercase; white-space: nowrap;
}
.spec-chip[data-level="Theme"]      { background: var(--surface-tint);   color: var(--brand-strong); }
.spec-chip[data-level="Derived"]    { background: var(--surface-sunken); color: var(--text-muted); }
.spec-chip[data-level="Structure"]  { background: var(--background);     color: var(--text); border: 1px solid var(--border); }
.spec-chip[data-level="Exception"]  { background: color-mix(in oklab, var(--accent), white 80%); color: var(--accent-strong); }
.spec-chip[data-level="Breakpoint"] { background: var(--brand);          color: var(--on-brand); }

/* ---------- segmented control ---------- */
.spec-segrow { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; padding: var(--space-4) var(--space-4) 0; }
.spec-seg {
  display: inline-flex; align-items: center; gap: 3px; padding: 4px;
  background: var(--surface-sunken); border-radius: 999px; line-height: 1;
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--border) 55%, transparent);
}
.spec-seg-btn {
  border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap; height: 30px; line-height: 1; padding: 0 var(--space-4);
  box-sizing: border-box; border-radius: 999px;
  font-family: var(--font-label); font-size: 12px; letter-spacing: .4px;
  text-transform: uppercase; font-weight: 600;
  background: transparent; color: var(--text-muted);
  transition: background .15s, color .15s;
}
.spec-seg-btn.is-active { background: var(--brand); color: var(--on-brand); font-weight: 700; }

/* ---------- hero live-specimen frame ---------- */
.spec-heroframe { width: 100%; border: var(--surface-border); overflow: hidden; }
.spec-herostage { width: 1280px; transform-origin: top left; }

/* ---------- misc specimen bits ---------- */
.spec-shell-demo { max-width: 520px; margin: 0 auto; background: var(--background); border: 1px dashed var(--border); padding: var(--space-4) var(--space-5); }

/* sub-table heading inside a card (separates multiple token tables) */
.spec-subhead {
  display: flex; align-items: baseline; gap: var(--space-2);
  padding: var(--space-3) var(--space-4) var(--space-1);
  border-top: var(--surface-border);
}
.spec-card > .spec-subhead:first-child,
.spec-card > .spec-table:first-of-type .spec-thead { border-top: 0; }

/* hero photo + scrim specimen */
.spec-photo { position: relative; height: 200px; border-radius: var(--surface-radius); overflow: hidden; }
.spec-photo__img { position: absolute; inset: 0; background-image: var(--hero-img); background-size: cover; background-position: center; }
.spec-photo__scrim-l { position: absolute; inset: 0; background: var(--hero-scrim-left); }
.spec-photo__scrim-b { position: absolute; left: 0; right: 0; bottom: 0; height: 70%; background: var(--hero-scrim-bottom); }
.spec-photo__cap { position: absolute; left: var(--space-3); bottom: var(--space-3); }

/* headline specimen */
.spec-headline { position: relative; padding: var(--space-5) var(--hero-content-pad-x); background-image: var(--hero-img); background-size: cover; background-position: center; }
.spec-headline__scrim { position: absolute; inset: 0; background: var(--hero-scrim-bottom); }
.spec-headline__body { position: relative; }
.spec-headline__logo { height: 46px; width: auto; display: block; margin-bottom: var(--space-3); filter: var(--logo-filter); }
.spec-headline__title { margin: 0; font-size: 54px; line-height: 1; }
.spec-headline__pill { margin-top: var(--space-4); display: inline-flex; }

/* info-band specimen */
.spec-band { background: var(--brand); padding: var(--space-4) var(--hero-content-pad-x); display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; border-radius: var(--surface-radius); }

/* glass-pane specimen stage */
.spec-gpstage { position: relative; margin: var(--space-3) var(--space-4) var(--space-4); height: 240px; border: var(--surface-border); border-radius: var(--surface-radius); background-image: var(--hero-img); background-size: cover; background-position: center; overflow: hidden; }
.spec-gppane { position: absolute; right: 48px; bottom: 18px; background: var(--glass-brand-bg); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); box-shadow: var(--glass-shadow); padding: var(--glass-pad) calc(var(--glass-pad) * 2); display: flex; flex-direction: column; gap: var(--space-4); box-sizing: border-box; }
.spec-perk { display: flex; gap: var(--space-3); align-items: center; }
.spec-perk__icon { width: 30px; height: 30px; filter: var(--glass-icon-filter); }

/* nav-card specimen */
.spec-navlist { max-width: 280px; display: flex; flex-direction: column; gap: var(--space-2); }
.spec-navcard { text-decoration: none; display: flex; align-items: center; gap: var(--space-3); border: 2px solid var(--brand); border-left: 4px solid var(--accent); border-radius: 6px; padding: var(--space-3) var(--space-3); background: var(--surface-tint); }
.spec-navcard__icon { width: 34px; height: 34px; flex-shrink: 0; border: var(--surface-border); border-radius: var(--surface-radius); background: var(--surface); display: flex; align-items: center; justify-content: center; }

/* ---------- page-selector — two active-state variants ---------- */
.spec-navset { display: flex; gap: var(--space-5); flex-wrap: wrap; }
.spec-navcol { flex: 1 1 240px; min-width: 220px; display: flex; flex-direction: column; gap: var(--space-3); }
.spec-navsection { background: var(--surface); border: var(--surface-border); border-radius: var(--surface-radius); box-shadow: var(--surface-shadow); padding: var(--surface-pad); }
.spec-nav { display: flex; flex-direction: column; gap: var(--space-1); }
.spec-nav-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3); border-radius: var(--btn-radius, var(--radius-sm));
  border: 2px solid transparent; text-decoration: none;
  color: color-mix(in oklab, var(--brand), white 34%);   /* inactive = soft brand */
}
.spec-nav-item__icon { --icon-size: 26px; }
.spec-nav-item__label { font-family: var(--font-heading); font-size: var(--t-size-card-title, 20px); font-weight: 600; line-height: 1.1; }
/* variant 1 — solid fill */
.spec-nav--solid .spec-nav-item.is-active { background: var(--brand); color: var(--on-brand); }
/* variant 2 — outline box */
.spec-nav--outline .spec-nav-item.is-active { border-color: var(--brand); color: var(--brand); background: var(--surface); }

/* page-selector icon glyphs (icon identity lives here, not inline) */
.spec-ic-arrival     { --icon: url('icons/Location.png'); }
.spec-ic-house       { --icon: url('icons/House.png'); }
.spec-ic-water       { --icon: url('icons/Lakefront.png'); }
.spec-ic-attractions { --icon: url('icons/Amazing Views.png'); }
.spec-ic-social      { --icon: url('icons/Outdoor.png'); }

