/* Kokoro components. Every value comes from tokens.css; nothing hardcoded. */

.k-root { font-family: var(--font-sans); color: var(--ink); background: var(--surface); }

/* Icon */
.k-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  width: var(--icon-size-md, 24px);
  height: var(--icon-size-md, 24px);
  fill: currentColor;
  line-height: 1;
}
.k-icon--sm {
  width: var(--icon-size-sm, 20px);
  height: var(--icon-size-sm, 20px);
}
.k-icon--md {
  width: var(--icon-size-md, 24px);
  height: var(--icon-size-md, 24px);
}
.k-icon--accent { color: var(--accent); }
.k-icon--ink-2 { color: var(--ink-2); }
.k-icon--brand { color: var(--brand); }
.k-icon--success { color: var(--success); }
.k-icon--error { color: var(--error); }
.k-icon--on-ink { color: var(--on-ink); }

/* Button */
.k-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  box-sizing: border-box; min-height: 48px; padding: var(--space-3) var(--space-6);
  font-family: var(--font-sans); font-size: var(--text-button); line-height: 1.4; font-weight: 500; letter-spacing: 0.04em;
  border-radius: var(--radius-xs); border: var(--border-hairline) solid transparent;
  cursor: pointer; text-decoration: none; transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.k-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.k-btn--primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
/* Filled buttons darken their own color on hover and press, and keep white text in every state (base.css would turn a:hover text ink). */
.k-btn--primary:hover, .k-btn--primary:active { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--on-brand); }
.k-btn--secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
.k-btn--secondary:hover, .k-btn--secondary:active { background: var(--accent); color: var(--on-brand); }
/* Accent: a filled indigo button for a second language or a second audience next to a primary, so brand stays the one red on screen */
.k-btn--accent { background: var(--accent); color: var(--on-brand); border-color: var(--accent); }
.k-btn--accent:hover, .k-btn--accent:active { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-brand); }
.k-btn--quiet { background: transparent; color: var(--ink); border-color: transparent; padding-left: var(--space-2); padding-right: var(--space-2); }
.k-btn--quiet:hover { color: var(--brand); }
.k-btn--on-ink.k-btn--primary { background: var(--brand); color: var(--on-brand); }
.k-btn--on-ink.k-btn--secondary { color: var(--on-ink); border-color: var(--on-ink); }
.k-btn--on-ink.k-btn--secondary:hover { background: var(--on-ink); color: var(--ink); }
.k-btn[disabled], .k-btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }
.k-btn--block { display: flex; width: 100%; }

/* Link */
.k-link {
  color: var(--brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: var(--hairline); transition: text-decoration-color var(--dur-fast) var(--ease-out);
}
.k-link:hover { text-decoration-color: var(--brand); }
.k-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-xs); }
.k-link--quiet { color: var(--ink); }
.k-link--quiet:hover { color: var(--brand); }
.k-link--on-ink { color: var(--on-ink); text-decoration-color: var(--ink-3); }
.k-link--on-ink:hover { text-decoration-color: var(--on-ink); }

/* Card */
.k-card {
  display: block; padding: var(--space-6); background: var(--surface);
  border: var(--border-hairline) solid var(--hairline); border-radius: var(--radius-sm); color: var(--ink);
}
.k-card--tint { background: var(--surface-tint); }
.k-card__eyebrow { margin: 0 0 var(--space-2); font-size: var(--text-eyebrow); line-height: 1.4; font-weight: 700; letter-spacing: 0; color: var(--accent); }
.k-card__title { margin: 0 0 var(--space-2); font-size: var(--text-h3); line-height: 1.35; font-weight: 700; letter-spacing: 0.01em; }
.k-card__body { margin: 0; font-size: var(--text-body); line-height: 1.6; color: var(--ink); max-width: var(--measure); }
.k-card__body + .k-card__action { margin-top: var(--space-4); }
.k-card__figure { margin: calc(-1 * var(--space-6)) calc(-1 * var(--space-6)) var(--space-6); display: block; }
.k-card__figure img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
a.k-card { text-decoration: none; transition: border-color var(--dur-fast) var(--ease-out); }
a.k-card:hover { border-color: var(--ink-3); }
a.k-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Media — a framed photo, or a placeholder until the real photo exists.
   The aspect ratio reserves the space, so nothing moves when the photo loads. */
.k-media { position: relative; display: flex; align-items: flex-end; margin: 0; overflow: hidden; aspect-ratio: var(--k-media-ratio, 3 / 2); background: var(--surface-tint); border-radius: var(--radius-sm); }
.k-media--portrait { --k-media-ratio: 4 / 5; }
.k-media--square { --k-media-ratio: 1 / 1; }
.k-media img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.k-media--placeholder::before { content: ""; position: absolute; top: 16%; right: 12%; width: 36%; aspect-ratio: 1; border: var(--border-hairline) solid var(--accent); border-radius: var(--radius-circle); opacity: 0.3; }
.k-media__note { position: relative; margin: 0; padding: var(--space-4); font-size: var(--text-small); line-height: 1.45; color: var(--ink-3); }

/* Input — tuned for phones in daylight: bold labels, 17px text, a 3:1+ border, 52px fields */
.k-field { display: block; max-width: 420px; }
.k-field + .k-field { margin-top: var(--space-6); }
.k-field__label { display: block; margin: 0 0 var(--space-2); font-size: var(--text-body); line-height: 1.45; font-weight: 700; letter-spacing: 0.01em; color: var(--ink); }
.k-field__optional { font-weight: 400; color: var(--ink-2); }
.k-field__hint { display: block; margin: var(--space-2) 0 0; font-size: var(--text-small); line-height: 1.45; font-weight: 500; color: var(--ink-2); }
.k-input {
  display: block; width: 100%; box-sizing: border-box; min-height: 52px; padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans); font-size: var(--text-body); line-height: 1.5; font-weight: 500; color: var(--ink);
  background: var(--surface); border: var(--border-hairline) solid var(--control-border); border-radius: var(--radius-xs);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.k-input::placeholder { color: var(--ink-3); font-weight: 400; }
.k-input:hover { border-color: var(--ink-2); }
.k-input:focus { outline: 2px solid var(--focus); outline-offset: 2px; border-color: var(--accent); }
.k-input[disabled] { opacity: 0.4; cursor: not-allowed; }
textarea.k-input { min-height: 120px; resize: vertical; }
.k-field--error .k-input { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.k-field--error .k-field__hint { color: var(--error); }
.k-field--success .k-input { border-color: var(--success); box-shadow: inset 0 0 0 1px var(--success); }
.k-field--error .k-field__hint, .k-field--success .k-field__hint { font-weight: 700; }
.k-field--success .k-field__hint { color: var(--success); }
.k-field__hint::before { content: ""; }
.k-field--error .k-field__hint::before { content: "Error: "; }

/* CTA card — mobile first: stacked, full-width button, one tap to text */
.k-cta {
  display: block; box-sizing: border-box; width: 100%; padding: var(--space-8) var(--space-6);
  background: var(--surface-highlight); border-radius: var(--radius-sm); color: var(--ink);
}
.k-cta__eyebrow { margin: 0 0 var(--space-2); font-size: var(--text-eyebrow); line-height: 1.4; font-weight: 700; letter-spacing: 0; color: var(--accent); }
.k-cta__title { margin: 0 0 var(--space-2); font-size: var(--text-h2); line-height: calc(var(--text-h2) + 8px); font-weight: 500; letter-spacing: 0; }
.k-cta__body { margin: 0 0 var(--space-6); font-size: var(--text-body); line-height: 1.6; color: var(--ink); max-width: var(--measure); }
.k-cta__actions { display: flex; flex-direction: column; gap: var(--space-3); align-items: stretch; }
.k-cta__actions .k-btn { width: 100%; min-height: 52px; font-size: var(--text-button); }
.k-cta__alt { font-size: var(--text-small); line-height: 1.45; color: var(--ink-2); text-align: center; }
.k-cta__alt .k-link { font-weight: 700; }
.k-cta__mark { display: block; width: 16px; height: 16px; border-radius: var(--radius-circle); background: var(--brand); margin-bottom: var(--space-4); }
.k-cta--ink { background: var(--ink); color: var(--on-ink); }
.k-cta--ink .k-cta__eyebrow, .k-cta--ink .k-cta__body, .k-cta--ink .k-cta__alt { color: var(--on-ink); }
.k-cta--ink .k-cta__alt .k-link { color: var(--on-ink); text-decoration-color: var(--ink-3); }
.k-cta--tint { background: var(--surface-tint); }
.k-cta { container-type: inline-size; }
@container (min-width: 560px) {
  .k-cta__actions { flex-direction: row; align-items: center; gap: var(--space-6); }
  .k-cta__actions .k-btn { width: auto; }
  .k-cta__alt { text-align: left; }
}
/* Sticky bar: phones only, pinned to the bottom, appears after the hero */
.k-cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; box-sizing: border-box;
  display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: var(--border-hairline) solid var(--hairline); box-shadow: var(--shadow-float);
}
.k-cta-bar .k-btn { flex: 1; min-height: 52px; font-size: var(--text-button); }
@media (min-width: 720px) { .k-cta-bar { display: none; } }

/* Step */
.k-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-8); max-width: var(--measure); }
.k-step { display: grid; grid-template-columns: 40px 1fr; gap: var(--space-4); align-items: start; }
.k-step__badge {
  width: 40px; height: 40px; border-radius: var(--radius-circle);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 19px; line-height: 1; font-weight: 500;
  color: var(--on-brand); background: var(--accent);
}
.k-step--current .k-step__badge { background: var(--brand); }
.k-step__title { margin: 2px 0 var(--space-1); font-size: var(--text-h3); line-height: 1.35; font-weight: 700; letter-spacing: 0.01em; }
.k-step__body { margin: 0; font-size: var(--text-body); line-height: 1.6; color: var(--ink); }

/* Callout */
.k-callout {
  display: block; padding: var(--space-8); background: var(--surface-highlight);
  border-radius: var(--radius-md); max-width: 720px;
}
.k-callout__figure { margin: 0 0 var(--space-2); font-family: var(--font-display); font-size: 52px; line-height: 60px; font-weight: 500; letter-spacing: 0.01em; color: var(--brand); }
.k-callout__title { margin: 0 0 var(--space-2); font-size: 26px; line-height: 34px; font-weight: 500; letter-spacing: 0.01em; color: var(--ink); }
.k-callout__body { margin: 0; font-size: var(--text-body); line-height: 1.6; color: var(--ink); max-width: var(--measure); }
.k-callout__body + .k-callout__action { margin-top: var(--space-6); }
.k-callout--quiet { background: var(--surface-tint); }
.k-callout--quiet .k-callout__figure { color: var(--ink); }
.k-callout--success, .k-callout--error { border: var(--border-hairline) solid; border-radius: var(--radius-sm); padding: var(--space-6); }
.k-callout--success { background: var(--success-tint); border-color: var(--success); }
.k-callout--error { border-color: var(--error); }
.k-callout--success .k-callout__title { color: var(--success); }
.k-callout--error { background: var(--error-tint); }
.k-callout--error .k-callout__title { color: var(--error); }
.k-callout--ink { background: var(--ink); }
.k-callout--ink .k-callout__title, .k-callout--ink .k-callout__body { color: var(--on-ink); }
.k-callout--ink .k-callout__figure { color: var(--brand); }

/* Logotype — plain type plus the seal until a real logo exists */
.k-logo { display: inline-flex; align-items: center; gap: var(--space-2); text-decoration: none; color: var(--ink); min-height: var(--tap-target); }
.k-logo__seal { width: 12px; height: 12px; border-radius: var(--radius-circle); background: var(--brand); flex: none; }
.k-logo__word { font-family: var(--font-display); font-size: 24px; line-height: 1; font-weight: 500; letter-spacing: 0.02em; }
.k-logo:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-xs); }
.k-logo--on-ink { color: var(--on-ink); }

/* Header — mobile first; the layout follows the header's own width */
.k-header { container-type: inline-size; position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: var(--border-hairline) solid var(--hairline); font-family: var(--font-sans); }
.k-header__bar { display: flex; align-items: center; gap: var(--space-3); min-height: 64px; padding: 0 var(--space-4); max-width: var(--container); margin: 0 auto; box-sizing: border-box; }
.k-header__bar .k-logo { margin-right: auto; }
.k-header__cta.k-btn { min-height: 44px; padding: var(--space-2) var(--space-4); white-space: nowrap; }
.k-header__menu-btn {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap-target); min-width: var(--tap-target); padding: 0 var(--space-2);
  background: transparent; border: 0; border-radius: var(--radius-xs); color: var(--ink); cursor: pointer;
  font-family: var(--font-sans); font-size: var(--text-small); font-weight: 500; letter-spacing: 0.04em;
}
.k-header__menu-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.k-header__icon { position: relative; flex: none; width: 18px; height: 10px; }
.k-header__icon::before, .k-header__icon::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor; transition: transform var(--dur-fast) var(--ease-out), top var(--dur-fast) var(--ease-out); }
.k-header__icon::before { top: 0; }
.k-header__icon::after { top: 8px; }
.k-header--open .k-header__icon::before { top: 4px; transform: rotate(45deg); }
.k-header--open .k-header__icon::after { top: 4px; transform: rotate(-45deg); }
.k-header__panel { display: none; border-top: var(--border-hairline) solid var(--hairline); padding: var(--space-2) var(--space-4) var(--space-8); background: var(--surface); }
.k-header--open .k-header__panel { display: block; animation: k-drop var(--dur-enter) var(--ease-out); }
.k-header__panel ul { list-style: none; margin: 0; padding: 0; }
.k-header__panel li { border-bottom: var(--border-hairline) solid var(--hairline); }
.k-header__panel ul a { display: flex; align-items: center; min-height: 56px; font-size: 20px; font-weight: 500; color: var(--ink); text-decoration: none; }
.k-header__panel ul a[aria-current="page"] { color: var(--brand); }
.k-header__panel ul a:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.k-header__panel .k-header__sub { padding: 0 0 var(--space-3) var(--space-4); }
.k-header__panel .k-header__sub li { border-bottom: 0; }
.k-header__panel .k-header__sub a { min-height: var(--tap-target); font-size: 17px; font-weight: 400; color: var(--ink-2); }
.k-header__panel-cta { margin-top: var(--space-6); }
.k-header__nav { display: none; }
.k-header__mega { display: none; border-top: var(--border-hairline) solid var(--hairline); background: var(--surface); box-shadow: var(--shadow-float); }
.k-header__mega-inner { max-width: var(--container); margin: 0 auto; box-sizing: border-box; padding: var(--space-8) var(--space-12) var(--space-12); display: grid; grid-template-columns: 1fr 200px; gap: var(--space-12); }
.k-header__mega-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.k-header__mega-link { display: block; padding: var(--space-4) 0 0; border-top: var(--border-rule) solid var(--hairline); text-decoration: none; color: var(--ink); transition: border-color var(--dur-fast) var(--ease-out); }
.k-header__mega-link:hover, .k-header__mega-link[aria-current="page"] { border-top-color: var(--brand); }
.k-header__mega-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-xs); }
.k-header__mega-title { display: block; font-size: var(--text-button); line-height: 1.4; font-weight: 700; letter-spacing: 0.01em; }
.k-header__mega-desc { display: block; margin-top: var(--space-1); font-size: var(--text-small); line-height: 1.45; color: var(--ink-2); }
.k-header__mega-aside { padding-left: var(--space-6); border-left: var(--border-hairline) solid var(--hairline); }
.k-header__mega-aside p { margin: 0 0 var(--space-2); font-size: var(--text-small); line-height: 1.45; color: var(--ink-2); }
.k-header__mega-aside .k-link { font-weight: 700; }
.k-header__panel-cta .k-btn { width: 100%; min-height: 52px; font-size: var(--text-button); }
.k-header__panel-note { margin: var(--space-3) 0 0; font-size: var(--text-small); color: var(--ink-2); text-align: center; }
@container (min-width: 880px) {
  .k-header__bar { min-height: 72px; padding: 0 var(--space-12); gap: var(--space-8); }
  .k-header__bar .k-logo { margin-right: 0; }
  .k-header__nav-wrap { margin-right: auto; }
  .k-header__nav { display: flex; gap: var(--space-6); list-style: none; padding: 0; margin: 0; }
  .k-header__nav a, .k-header__nav-btn { display: inline-flex; align-items: center; min-height: var(--tap-target); font-size: var(--text-body); font-weight: 500; letter-spacing: 0.02em; color: var(--ink); text-decoration: none; border-bottom: 2px solid transparent; }
  .k-header__nav-btn { gap: var(--space-2); padding: 0; background: transparent; border-top: 0; border-left: 0; border-right: 0; font-family: var(--font-sans); cursor: pointer; }
  .k-header__nav a:hover, .k-header__nav-btn:hover, .k-header__nav-btn[aria-expanded="true"] { color: var(--brand); }
  .k-header__nav a[aria-current="page"], .k-header__nav-btn[aria-current="page"] { border-bottom-color: var(--brand); }
  .k-header__nav a:focus-visible, .k-header__nav-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-xs); }
  .k-header__chev { width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform var(--dur-fast) var(--ease-out); }
  .k-header__nav-btn[aria-expanded="true"] .k-header__chev { transform: translateY(1px) rotate(-135deg); }
  .k-header__mega--open { display: block; }
  .k-header__menu-btn, .k-header__panel, .k-header--open .k-header__panel { display: none; }
  .k-header__cta.k-btn { min-height: 44px; padding: var(--space-2) var(--space-6); }
}

/* Footer — ink ground, stacked on phones, columns when wide */
.k-footer { container-type: inline-size; background: var(--ink); color: var(--on-ink); font-family: var(--font-sans); }
.k-footer__inner { max-width: var(--container); margin: 0 auto; padding: var(--space-12) var(--space-4) var(--space-8); box-sizing: border-box; display: grid; gap: var(--space-8); }
.k-footer__brand p { margin: var(--space-3) 0 0; font-size: var(--text-small); line-height: 1.6; color: var(--on-ink-2); max-width: 320px; }
.k-footer__contact { display: grid; gap: var(--space-3); }
.k-footer__contact .k-btn { width: 100%; min-height: 52px; font-size: var(--text-button); }
.k-footer__contact p { margin: 0; font-size: var(--text-small); line-height: 1.45; color: var(--on-ink-2); text-align: center; }
.k-footer__contact p a { color: var(--on-ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--ink-3); text-underline-offset: 3px; }
.k-footer__cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8) var(--space-6); }
.k-footer__col h2 { margin: 0 0 var(--space-2); font-size: var(--text-small); line-height: 1.45; font-weight: 700; letter-spacing: 0; color: var(--on-ink-2); }
.k-footer__col ul { list-style: none; margin: 0; padding: 0; }
.k-footer__col a { display: flex; align-items: center; min-height: 44px; font-size: var(--text-small); color: var(--on-ink); text-decoration: none; }
.k-footer__col a:hover { text-decoration: underline; text-underline-offset: 3px; }
.k-footer__col a:focus-visible, .k-footer__legal a:focus-visible, .k-footer__contact a:focus-visible { outline: 2px solid var(--on-ink); outline-offset: 2px; border-radius: var(--radius-xs); }
.k-footer__legal { align-items: center; border-top: var(--border-hairline) solid var(--ink-hairline); padding-top: var(--space-6); display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); font-size: var(--text-small); line-height: 1.45; color: var(--on-ink-2); }
.k-footer__legal a { color: var(--on-ink-2); display: inline-flex; align-items: center; min-height: 44px; }
.k-footer__legal p { margin: 0; flex-basis: 100%; }
@container (min-width: 880px) {
  .k-footer__inner { grid-template-columns: 5fr 7fr; grid-template-areas: "brand cols" "contact cols" "legal legal"; padding: var(--space-16) var(--space-12) var(--space-8); column-gap: var(--space-12); row-gap: var(--space-6); }
  .k-footer__brand { grid-area: brand; }
  .k-footer__contact { grid-area: contact; align-self: start; }
  .k-footer__cols { grid-area: cols; }
  .k-footer__legal { grid-area: legal; margin-top: var(--space-6); }
  .k-footer__contact { justify-items: start; }
  .k-footer__contact .k-btn { width: auto; }
  .k-footer__contact p { text-align: left; }
  .k-footer__cols { grid-template-columns: repeat(3, 1fr); }
  .k-footer__legal p { flex-basis: auto; margin-right: auto; }
}

/* Motion — sections fade up once as they enter the screen.
   main.js adds .js-motion to <html> only when the browser supports it and the
   visitor has not asked for reduced motion. Without that class nothing hides. */
.js-motion [data-reveal] {
  opacity: 0; transform: translateY(var(--rise));
  transition: opacity var(--dur-enter) var(--ease-out), transform var(--dur-enter) var(--ease-out);
  transition-delay: calc(var(--reveal-i, 0) * var(--stagger));
}
.js-motion [data-reveal].is-revealed { opacity: 1; transform: none; }
@keyframes k-drop { from { opacity: 0; transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) {
  .js-motion [data-reveal] { opacity: 1; transform: none; }
  .k-header--open .k-header__panel { animation: none; }
}
@media print {
  .js-motion [data-reveal] { opacity: 1; transform: none; }
}
