/* Kana Forensics Lab — focused casework, not a dashboard. */
.kf-page {
  width: min(100% - 2rem, 1080px);
  margin-inline: auto;
  padding-block: 1rem 5rem;
}

.kf-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
  overflow: hidden;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl, 24px);
  background:
    radial-gradient(ellipse at 5% 0%, var(--gold-ghost), transparent 40%),
    linear-gradient(140deg, var(--ink-2), var(--ink-1));
}

.kf-hero-copy {
  max-width: 720px;
}

.kf-eyebrow,
.kf-kicker {
  margin: 0 0 0.65rem;
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-transform: uppercase;
}

.kf-hero h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 6vw, 4.15rem);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.kf-lede {
  max-width: 65ch;
  margin: 1rem 0 0;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.7vw, 1.12rem);
  line-height: 1.75;
}

.kf-scope-note {
  max-width: 72ch;
  margin: 1.15rem 0 0;
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--gold-light);
  border-radius: 0 var(--radius-sm, 8px) var(--radius-sm, 8px) 0;
  background: var(--gold-ghost);
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.6;
}

.kf-hero-mark {
  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 8vw, 6.4rem);
  font-weight: 750;
  letter-spacing: 0.08em;
  line-height: 1.05;
  opacity: 0.78;
  text-align: center;
}

.kf-workbench {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  scroll-margin-top: 6rem;
}

.kf-section-heading {
  display: flex;
  gap: 1.5rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.kf-section-heading h2,
.kf-method h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.kf-section-heading > div > p:last-child {
  margin: 0.5rem 0 0;
  color: var(--text-faint);
  font-size: 0.9rem;
  line-height: 1.55;
}

.kf-session-note {
  max-width: 24ch;
  margin: 0;
  color: var(--text-faint);
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: right;
}

.kf-case-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}

.kf-case-nav-button {
  min-width: 0;
  min-height: 3.15rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 12px);
  background: var(--ink-2);
  color: var(--text-soft);
  cursor: pointer;
  text-align: left;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

.kf-case-nav-button:hover {
  border-color: var(--gold-dim);
  color: var(--text);
}

.kf-case-nav-button[aria-current="step"] {
  border-color: var(--gold-light);
  background: var(--gold-ghost);
  color: var(--text);
}

.kf-case-nav-index {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
}

.kf-case-nav-title {
  display: block;
  overflow: hidden;
  font-size: 0.77rem;
  font-weight: 650;
  line-height: 1.3;
  text-overflow: ellipsis;
}

.kf-case-card {
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl, 24px);
  background: var(--ink-1);
  box-shadow: var(--shadow-md);
}

.kf-case-header {
  padding: clamp(1.25rem, 3.5vw, 2rem) clamp(1.25rem, 4vw, 2.4rem) 1.15rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(110deg, var(--ink-2), var(--ink-1) 72%);
}

.kf-case-overline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kf-case-dossier {
  color: var(--text-faint);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.kf-case-header h2 {
  margin: 0.5rem 0 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.5vw, 2.15rem);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.kf-topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.kf-topic {
  display: inline-flex;
  padding: 0.28rem 0.58rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full, 999px);
  color: var(--text-faint);
  font-size: 0.72rem;
  line-height: 1.35;
}

.kf-case-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(1rem, 3vw, 1.7rem);
  padding: clamp(1rem, 3vw, 1.6rem);
}

.kf-evidence-panel,
.kf-analysis-panel {
  min-width: 0;
  padding: clamp(1rem, 2.6vw, 1.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 18px);
  background: var(--ink-2);
}

.kf-evidence-panel h3,
.kf-analysis-panel > h3 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.kf-evidence-list {
  display: grid;
  gap: 0.7rem;
  padding: 0;
  margin: 1rem 0 0;
  list-style: none;
}

.kf-evidence-item {
  padding: 0.85rem 0.9rem;
  border-left: 2px solid var(--indigo-light);
  border-radius: 0 var(--radius-sm, 8px) var(--radius-sm, 8px) 0;
  background: var(--ink-3);
}

.kf-evidence-label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.kf-evidence-value {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.kf-evidence-item:first-child .kf-evidence-value {
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: 0.04em;
}

.kf-evidence-footnote {
  margin: 1rem 0 0;
  color: var(--text-faint);
  font-size: 0.78rem;
  line-height: 1.6;
}

.kf-task {
  margin: 0.7rem 0 1rem;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.6;
}

.kf-answer-form {
  display: grid;
  gap: 0.8rem;
}

.kf-answer-controls {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.kf-answer-label {
  display: grid;
  gap: 0.4rem;
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 650;
}

.kf-answer-input {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm, 8px);
  background: var(--ink-1);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.4;
}

.kf-answer-input::placeholder {
  color: var(--text-ghost);
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.kf-answer-note {
  margin: -0.25rem 0 0;
  color: var(--text-faint);
  font-size: 0.72rem;
  line-height: 1.55;
}

.kf-answer-input:focus-visible,
.kf-case-nav-button:focus-visible,
.kf-case-controls .c-button:focus-visible,
.kf-hint-header .c-button:focus-visible,
.kf-answer-form > .c-button:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 3px;
}

.kf-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  padding: 0.8rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 8px);
  background: var(--ink-1);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 0.84rem;
  line-height: 1.55;
}

.kf-choice:has(input:checked) {
  border-color: var(--gold-light);
  background: var(--gold-ghost);
  color: var(--text);
}

.kf-choice input {
  accent-color: var(--gold-light);
  margin: 0.22rem 0 0;
}

.kf-answer-form > .c-button {
  justify-self: start;
  min-height: 2.65rem;
}

.kf-answer-form > .c-button:disabled,
.kf-hint-header .c-button:disabled,
.kf-case-controls .c-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.kf-hint-box {
  margin-top: 1.15rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 12px);
  background: var(--ink-1);
}

.kf-hint-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: center;
  justify-content: space-between;
}

.kf-hint-header .kf-kicker {
  margin-bottom: 0.15rem;
  color: var(--indigo-light);
}

.kf-hint-count {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.75rem;
}

.kf-hint-list {
  display: grid;
  gap: 0.5rem;
  padding-left: 1.25rem;
  margin: 0.7rem 0 0;
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.55;
}

.kf-hint-list:empty {
  display: none;
}

.kf-feedback {
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 12px);
  color: var(--text-soft);
  font-size: 0.85rem;
  line-height: 1.65;
}

.kf-feedback.correct {
  border-color: var(--jade-light);
  background: color-mix(in srgb, var(--jade-light) 10%, var(--ink-1));
}

.kf-feedback.incorrect {
  border-color: var(--shu-light);
  background: color-mix(in srgb, var(--shu-light) 9%, var(--ink-1));
}

.kf-answer-key {
  margin-top: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md, 12px);
  background: var(--ink-1);
}

.kf-answer-key h4 {
  margin: 0 0 0.45rem;
  color: var(--text);
  font-size: 0.82rem;
}

.kf-answer-key ul {
  display: grid;
  gap: 0.4rem;
  padding-left: 1.2rem;
  margin: 0;
  color: var(--text-soft);
  font-size: 0.8rem;
  line-height: 1.55;
}

.kf-answer-key code {
  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: 1rem;
}

.kf-contextual-alternatives {
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

.kf-contextual-alternatives h4 {
  color: var(--text-faint);
  font-weight: 650;
}

.kf-contextual-alternatives code {
  color: var(--text-soft);
}

.kf-case-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 3vw, 1.6rem);
  border-top: 1px solid var(--border);
  background: var(--ink-2);
}

.kf-related {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  align-items: center;
  color: var(--text-faint);
  font-size: 0.74rem;
}

.kf-related a {
  color: var(--indigo-light);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.2em;
}

.kf-related a:hover {
  text-decoration-color: currentColor;
}

.kf-case-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.kf-method {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  padding: clamp(1.3rem, 3.5vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl, 24px);
  background: var(--ink-2);
}

.kf-method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.kf-method-grid article {
  padding: 1rem;
  border-top: 1px solid var(--border-light);
  background: var(--ink-1);
}

.kf-method-grid article > span {
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
}

.kf-method-grid h3 {
  margin: 0.5rem 0 0.35rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.kf-method-grid p {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.8rem;
  line-height: 1.6;
}

.kf-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 760px) {
  .kf-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .kf-hero-mark {
    display: none;
  }

  .kf-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.55rem;
  }

  .kf-session-note {
    max-width: none;
    text-align: left;
  }

  .kf-case-nav {
    grid-template-columns: repeat(5, minmax(8.5rem, 1fr));
    overflow-x: auto;
    padding: 0.15rem 0.1rem 0.55rem;
    scrollbar-width: thin;
  }

  .kf-case-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .kf-method-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .kf-page {
    width: min(100% - 1.25rem, 1080px);
  }

  .kf-case-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .kf-case-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .kf-case-controls .c-button {
    justify-content: center;
    padding-inline: 0.45rem;
    white-space: normal;
  }

  .kf-hint-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .kf-answer-form > .c-button {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kf-page * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
