/* ============================================================
   KimaraCode - Homepage (hero, typed wordmark, contents index, manifesto)
   Layers on tokens.css + layout.css.
   ============================================================ */

/* ============================================================
   Hero
   ============================================================ */
.kc-hero { border-bottom: 1px solid var(--rule); }

.kc-hero-centered { padding: 104px 0 80px; text-align: center; }
.kc-hero-display {
  font-family: var(--kc-wordmark-font, var(--font-mono));
  font-weight: 500;
  font-size: clamp(3rem, 11vw, 6.875rem);
  line-height: 1;
  letter-spacing: var(--tracking-tight);
  margin: 0 0 36px;
  display: inline-flex;
  white-space: nowrap;
}
.kc-hero-display .kimara { color: var(--kc-kimara); }
.kc-hero-display .code { color: var(--kc-code); }

/* Moving caret - a real <span> element JS inserts into the wordmark.
   Absolutely positioned, so the wordmark's own width is never affected
   (no layout shift). JS sets transform: translateX(<px>) to follow the
   right edge of the just-typed character. */
.kc-hero-display { position: relative; }
.kc-typed-caret {
  position: absolute;
  top: 0.05em;
  left: 0;
  width: 2px;
  height: 0.9em;
  background: var(--fg2);
  animation: kc-caret-blink 900ms steps(1) infinite;
  pointer-events: none;
  transition: transform 60ms linear;
}
.kc-typed-caret.is-done { display: none; }
@keyframes kc-caret-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .kc-typed-caret { display: none; }
}

.kc-hero-tag {
  font-size: clamp(1.4rem, 3.4vw, 1.75rem);
  color: var(--fg1);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}
.kc-hero-sub {
  font-size: 16px;
  color: var(--fg2);
  max-width: 540px;
  margin: 0 auto;
  line-height: var(--leading-body);
}
.kc-hero-centered .kc-hero-sub { margin: 0 auto; }

.kc-hero-masthead { padding: 72px 0 56px; }
.kc-hero-masthead .kc-hero-display {
  font-size: clamp(2.6rem, 8vw, 5.25rem);
  margin: 0 0 28px;
}
.kc-hero-masthead .kc-hero-tag { margin: 0 0 14px; }
.kc-hero-masthead .kc-hero-sub { margin: 0; max-width: 560px; }
.kc-masthead-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}
.kc-masthead-meta-item { display: flex; flex-direction: column; gap: 4px; }
.kc-masthead-meta-item .k { font-family: var(--font-mono); font-size: 11px; color: var(--fg3); text-transform: uppercase; letter-spacing: var(--tracking-wide); }
.kc-masthead-meta-item .v { font-size: 14px; color: var(--fg1); }

/* Inline link inside the Practice value - subtle, underline on hover only */
.kc-meta-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color var(--dur-2) var(--ease-quiet), color var(--dur-2) var(--ease-quiet);
}
.kc-meta-link:hover { text-decoration-color: var(--underline-color); }

/* Whole-row link (Posture → /about/) */
a.kc-masthead-meta-item {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
a.kc-masthead-meta-item .v {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color var(--dur-2) var(--ease-quiet);
}
a.kc-masthead-meta-item:hover .v { text-decoration-color: var(--underline-color); }

@media (prefers-reduced-motion: no-preference) {
  .is-mounted .kc-fade-up { animation: kc-fade-up var(--dur-3) var(--ease-enter) both; }
  .is-mounted .kc-fade-up.d1 { animation-delay: 80ms; }
  .is-mounted .kc-fade-up.d2 { animation-delay: 160ms; }
  .is-mounted .kc-fade-up.d3 { animation-delay: 240ms; }
}
@keyframes kc-fade-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Layout-stable typed reveal - wordmark renders at full width from frame 0;
   each character is wrapped in <span class="kc-typed-ch"> and revealed via
   opacity, so the container never reflows. No wiggle. */
.kc-typed-ch { display: inline-block; opacity: 1; transition: opacity 60ms ease-out; }
.kc-hero-display.kc-typed-pending .kc-typed-ch { opacity: 0; }
.kc-hero-display.kc-typed-pending .kc-typed-ch.is-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .kc-typed-ch { opacity: 1 !important; transition: none; }
}

@media (max-width: 380px) {
  .kc-hero-masthead .kc-hero-display { font-size: 2.3rem; }
  .kc-hero-centered .kc-hero-display { font-size: 2.6rem; }
}

/* ============================================================
   Homepage - editorial "Contents" index (option B, committed)
   ============================================================ */
.kc-contents {
  border: 1px solid var(--rule);
  border-radius: var(--r-1);
  margin-top: 8px;
  background: var(--bg-elev);
  overflow: hidden;
}
.kc-contents-mast {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 18px 26px;
  border-bottom: 1px solid var(--rule);
}
.kc-contents-mast .ttl {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--fg2);
}
.kc-contents-mast .meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg3);
}
.kc-crow {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: baseline;
  column-gap: 22px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 24px 26px;
  cursor: pointer;
  color: var(--fg1);
  font-family: var(--font-sans);
  text-decoration: none;
  transition: background-color var(--dur-2) var(--ease-quiet);
}
.kc-crow:last-child { border-bottom: 0; }
.kc-crow:hover { background: var(--bg); text-decoration: none; }
.kc-cnum {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  color: var(--fg3);
  line-height: 1;
  letter-spacing: -0.02em;
  transition: color var(--dur-2) var(--ease-quiet);
}
.kc-crow:hover .kc-cnum { color: var(--kc-kimara); }
.kc-cmain { min-width: 0; }
.kc-cnameline { display: flex; align-items: baseline; gap: 14px; }
.kc-cname { font-size: 25px; font-weight: 600; letter-spacing: -0.02em; color: var(--fg1); }
.kc-cleader { flex: 1; border-bottom: 1px dotted var(--rule); transform: translateY(-5px); min-width: 24px; }
.kc-ccount { font-family: var(--font-mono); font-size: 12px; color: var(--fg3); white-space: nowrap; }
.kc-ccount.live { color: var(--intent-positive); }
.kc-ccount.future { font-style: italic; }
.kc-cdesc { font-size: 14px; color: var(--fg2); margin: 8px 0 0; max-width: 440px; line-height: 1.5; }
.kc-cgo { font-family: var(--font-mono); font-size: 14px; color: var(--fg3); align-self: center; transition: color var(--dur-2) var(--ease-quiet); }
.kc-crow:hover .kc-cgo { color: var(--fg1); }
@media (max-width: 600px) {
  .kc-crow { grid-template-columns: 38px 1fr; column-gap: 14px; padding: 20px 18px; }
  .kc-cgo { display: none; }
  .kc-contents-mast { padding: 14px 18px; }
  .kc-cname { font-size: 22px; }
}

/* ============================================================
   Manifesto strip
   ============================================================ */
.kc-manifesto { max-width: 600px; }
.kc-manifesto p { font-size: var(--t-md); color: var(--fg1); line-height: var(--leading-body); margin: 0 0 18px; }
.kc-manifesto p.muted { color: var(--fg2); }

a.kc-manifesto-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: color var(--dur-2) var(--ease-quiet);
}
a.kc-manifesto-link:hover { text-decoration: none; }
.kc-manifesto-more {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg3);
  transition: color var(--dur-2) var(--ease-quiet), transform var(--dur-2) var(--ease-quiet);
}
a.kc-manifesto-link:hover .kc-manifesto-more { color: var(--fg1); transform: translateX(4px); }
