/* ==========================================================================
   Cokaizen Brand Primitives · v1.3.2 · 2026-08-23
   Shared components. Load AFTER tokens.css, BEFORE project styles.
   New in v1.1 — split out of tokens.css so tokens stay pure custom properties
   and shared components stop being duplicated into per-page <style> blocks.
   ========================================================================== */

/* --- Reset ----------------------------------------------------------- */
/* Lives here, not in per-page <style> blocks. Added v1.1.1. */

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

h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd, ul, ol { margin: 0; }

/* --- Baseline -------------------------------------------------------- */

body {
  background: var(--paper);          /* required — never leave transparent */
  color: var(--ink);
  font-family: var(--f-en);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

p { max-width: var(--measure); }

h1 { font-size: var(--t-h1); line-height: var(--lh-tight);   letter-spacing: -0.02em;  text-wrap: balance; }
h2 { font-size: var(--t-h2); line-height: var(--lh-tight);   letter-spacing: -0.015em; text-wrap: balance; }
h3 { font-size: var(--t-h3); line-height: var(--lh-heading); text-wrap: balance; }
h4 { font-size: var(--t-h4); line-height: var(--lh-heading); text-wrap: balance; }

.lead { font-size: var(--t-lead); line-height: var(--lh-lead); color: var(--ink-2); }

/* --- Alignment ------------------------------------------------------- */
/* Text is left-aligned. Centre only genuinely symmetrical objects, and
   opt in explicitly with .u-center — never as a page-level default. */

.u-center { text-align: center; }

/* --- Stacks ---------------------------------------------------------- */
/* Nest these to get asymmetric rhythm without per-element margins. */

.stack          { display: flex; flex-direction: column; gap: var(--gap-group); }
.stack-element  { display: flex; flex-direction: column; gap: var(--gap-element); }
.stack-section  { display: flex; flex-direction: column; gap: var(--gap-section); }

.page {
  max-width: var(--column);
  margin: 0 auto;
  padding: var(--gap-page-top) var(--s-6) var(--gap-page-bottom);
  display: flex;
  flex-direction: column;
  gap: var(--gap-structure);
}

/* --- Labels and data -------------------------------------------------- */

.label {
  font-family: var(--f-mo);
  font-size: var(--t-micro);
  font-weight: 500;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--ink-3);
}

.caption { font-family: var(--f-mo); font-size: var(--t-caption); color: var(--ink-3); }

.numeric { font-variant-numeric: tabular-nums; }

/* --- Japanese --------------------------------------------------------- */

.jp { font-family: var(--f-jp); font-feature-settings: "palt" 1; }

ruby rt {
  font-family: var(--f-mo); font-size: 10px; font-weight: 400; color: var(--ink-3);
}

/* --- The mark --------------------------------------------------------- */

.seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px;
  border: 1.5px solid var(--shu);
  border-radius: var(--r-md);
  color: var(--shu);
  font-family: var(--f-jp);
  font-size: 26px; font-weight: 600; line-height: 1;
  padding-top: 2px;
  flex: none;
  text-decoration: none;
  transition: background var(--m-hover);
}
a.seal:hover { background: var(--shu-soft); }

.seal--sm { width: 32px; height: 32px; font-size: 17px; border-width: 1px; padding-top: 1px; }
.seal--lg { width: 72px; height: 72px; font-size: 36px; border-width: 2px; padding-top: 3px; }

/* --- Site chrome ------------------------------------------------------ */

.site-header {
  display: flex; align-items: center; gap: var(--s-4);
  min-height: 52px;
}

/* .site-header has no padding: it expects a .page parent to supply the
   gutter. Use --bleed when the header sits outside one (full-bleed app
   layouts, where it is a direct child of body). */
.site-header--bleed { padding: var(--s-4) var(--s-6); }

.product-name {
  font-family: var(--f-en);
  font-size: var(--t-h4);
  font-weight: 600;
  line-height: 1;
  color: var(--ink);              /* NOT --shu — the seal is the header's only accent */
  text-decoration: none;
  transition: color var(--m-hover);
}
.product-name:hover { color: var(--shu); }

.site-nav {
  display: flex; align-items: center; gap: var(--s-5);
  font-family: var(--f-mo);
  font-size: var(--t-caption);
  letter-spacing: 0.04em;
}
.site-nav a { color: var(--ink-2); text-decoration: none; }
.site-nav a:hover { color: var(--shu); }
.site-nav a[aria-current="page"] { color: var(--ink); }

.site-footer {
  padding-top: var(--s-6);
  border-top: 1px solid var(--rule);
  font-family: var(--f-mo);
  font-size: var(--t-caption);
  color: var(--ink-3);
}

/* --- Links ------------------------------------------------------------ */
/* Inline links in prose carry the accent. A link WRAPPING a block does not —
   the block itself is the affordance. See DESIGN.md §6. */

a { color: var(--shu); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a.block-link { color: inherit; text-decoration: none; display: block; }

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

/* --- Cards ------------------------------------------------------------ */

.card {
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-md);
  padding: var(--s-5);
  display: flex; flex-direction: column; gap: var(--gap-element);
  transition: border-color var(--m-hover);
}
.card:hover { border-color: var(--ink-3); }
.card .card-title { font-size: var(--t-h4); line-height: var(--lh-heading); color: var(--ink); transition: color var(--m-hover); }
.block-link:hover .card-title { color: var(--shu); }
.card .card-desc  { font-size: var(--t-small); color: var(--ink-2); }

/* --- Callout ---------------------------------------------------------- */

.callout {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--shu);
  padding: var(--s-5) var(--s-6);
  display: flex; flex-direction: column; gap: var(--s-2);
}

/* --- Wide content ----------------------------------------------------- */

.scroll-x { overflow-x: auto; max-width: 100%; }

/* --- Motion ----------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
