/* ============================================================================
   Kotoba — brand components
   The single CODE implementation of docs/BRAND_GUIDELINES.md §8.
   One definition, reused on every surface, so the mark can never drift.
   Depends ONLY on css/tokens.css (color + type tokens). No hardcoded hex
   except the rest-shadows (warm sumi, same values as the journey topbar).

   Components:
     .kotoba-wordmark        the wordmark "Kotoba" (Inter tracked caps, rendered KOTOBA)
     .kotoba-motto           the motto line (Inter 400) — its 3 homes only (§7)
     .brand-hanko            a quiet standalone seal (nav / voice header)
     .brand-cluster          the in-app mark for dense chrome (topbar) — "Colophon rule"
     .brand-lockup           the vertical identity lockup (seal · wordmark · gold dot · motto)
   ============================================================================ */

/* ── The wordmark — §8 locked spec ─────────────────────────────────────────── */
.kotoba-wordmark {
  font-family: var(--font-ui);          /* Inter — the tracked-caps logotype (brand §8) */
  font-weight: 500;
  text-transform: uppercase;            /* markup stays "Kotoba"; renders "KOTOBA" */
  letter-spacing: 0.2em;
  color: var(--ink);
  font-style: normal;
  white-space: nowrap;
}
/* context scales — one logotype, sized per surface (caps read large, so small px + open tracking) */
.kotoba-wordmark--bar    { font-size: 13px; line-height: 1; letter-spacing: 0.2em; }  /* topbar / nav cluster */
.kotoba-wordmark--nav    { font-size: 12px; line-height: 1; letter-spacing: 0.22em; } /* grid nav / hall + composer beams (§8 grid-nav scale) */
.kotoba-wordmark--header { font-size: 16px; line-height: 1; letter-spacing: 0.22em; } /* desktop header */
.kotoba-wordmark--lockup { font-size: 22px; line-height: 1; letter-spacing: 0.24em; } /* session-end / onboarding */
.kotoba-wordmark--splash { font-size: 46px; line-height: 1; letter-spacing: 0.26em; } /* splash / social */

/* ── The motto — §8 locked spec. Appears in EXACTLY the 3 homes in §7. ──────── */
.kotoba-motto {
  font-family: var(--font-ui);         /* Inter */
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--stone);
  /* sentence case, with the period: "Japanese, one scene at a time." */
}

/* ── A quiet standalone seal — Learn Mode nav, Voice header ─────────────────── */
.brand-hanko {
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  display: block;
  box-shadow: 0 2px 8px rgba(20, 16, 10, 0.08);
}

/* ── In-app mark: the topbar brand cluster — "Colophon rule" (panel winner) ───
   seal + wordmark welded into one stamped lockup · a single inset cap-to-baseline
   hairline (the only divider, --divider never gold) · a recessed context column
   where the greeting leads and the date whispers beneath it. Identity, then a
   quiet colophon, then context. No motto in chrome (§7). */
.brand-cluster {
  display: flex;
  align-items: center;
  gap: 13px;
  flex: 1;
  min-width: 0;
}
.brand-cluster .bc-mark {           /* the welded seal+wordmark stamp */
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}
.brand-cluster .bc-hanko {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  box-shadow: 0 2px 8px rgba(20, 16, 10, 0.08);
}
/* the cluster's wordmark carries the .kotoba-wordmark--bar modifier in markup —
   single source of truth for the bar size + tracking, so it can't drift from a stale copy */
.brand-cluster .bc-rule {           /* the colophon hairline — full --divider, holds at DPR */
  flex: 0 0 auto;
  width: 1px;
  align-self: center;
  height: 15px;                 /* cap-to-baseline of the 21px wordmark — a colophon rule, not a box edge */
  background: var(--divider);
}
.brand-cluster .bc-context {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.brand-cluster .bc-greet {          /* warm, present, recessed below the ink wordmark */
  font-family: var(--font-jp);
  font-size: 15px;
  line-height: 1.05;
  color: var(--stone);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-cluster .bc-date {           /* numeral-led folio whisper: "Thu · Jun 4" */
  font-family: var(--font-ui);
  font-size: 11.5px;
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: var(--color-faint-warm);   /* warm faint #6E6860 — holds AA at 11.5px regardless of mount context */
  white-space: nowrap;
}

/* ── Identity lockup: seal above · wordmark · single gold dot · motto ─────────
   The full brand statement for identity moments: splash, social/OG, onboarding
   hero, session-complete. §8 + §9. Size via a modifier. */
.brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.brand-lockup .bl-seal {
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(20, 16, 10, 0.06); /* warm sumi rest shadow (same warm channels as the topbar seal), never pure black, never a glow */
  flex: 0 0 auto;
}
.brand-lockup .bl-dot {              /* the seal's one gold accent, reused as the divider */
  border-radius: 50%;
  background: var(--gold);
}

/* lockup — splash / social (large) */
.brand-lockup--splash .bl-seal       { width: 172px; height: 172px; }
.brand-lockup--splash .kotoba-wordmark { font-size: 46px; margin-top: 30px; }
.brand-lockup--splash .bl-dot        { width: 8px; height: 8px; margin: 24px 0; }
.brand-lockup--splash .kotoba-motto  { font-size: 24px; }

/* lockup — session-end / onboarding (compact) */
.brand-lockup--end .bl-seal          { width: 60px; height: 60px; }
.brand-lockup--end .kotoba-wordmark  { font-size: 20px; margin-top: 15px; }
.brand-lockup--end .bl-dot           { width: 6px; height: 6px; margin: 10px 0; }
.brand-lockup--end .kotoba-motto     { font-size: 14.5px; }

/* ── Completion sign-off: the brand signature for session-complete screens ──────
   The motto's session-complete home (brand §7). seal + wordmark + one gold dot + motto,
   opened by a short hairline rule. Shared by Learn Mode end + Journey Study done.
   ("結び署名" — chosen via a 6-variant design build-off + 3-judge panel.) Reuses the
   .kotoba-wordmark + .kotoba-motto bases above; only sizes + the signoff frame here. */
.kotoba-signoff { display: flex; flex-direction: column; align-items: center; text-align: center; }
.kotoba-signoff .ks-rule { width: 34px; height: 1px; background: var(--divider); margin-bottom: 22px; }
.kotoba-signoff .ks-seal { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 50%; overflow: hidden;
  background: var(--color-card); box-shadow: 0 1px 2px rgba(20, 16, 10, 0.06); }
.kotoba-signoff .ks-seal img { width: 118%; height: 118%; margin: -9%; object-fit: cover; display: block; } /* crop the washi square into the circle */
.kotoba-signoff .kotoba-wordmark { margin-top: 14px; font-size: 13px; letter-spacing: 0.2em; line-height: 1; }
.kotoba-signoff .ks-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--gold); margin: 11px 0; }
.kotoba-signoff .kotoba-motto { font-size: 11.5px; line-height: 1.4; }

@media (prefers-reduced-motion: no-preference) {
  .kotoba-signoff { animation: ksRise 0.5s var(--ease-out) both; }
}
@keyframes ksRise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
