/* Hallmark · pre-emit critique: P4 H5 E4 S4 R5 V4
 * Existing CALL-E system · composition: illustrated case guide · reference: Apple Design
 */
@import url("../tokens.css");

:root {
  color-scheme: light;
  --page: var(--color-detail-paper);
  --surface: var(--color-detail-surface);
  --ink: var(--color-detail-ink);
  --muted: var(--color-detail-muted);
  --signal: var(--color-detail-link);
  --action: var(--color-detail-action);
  --action-hover: var(--color-detail-action-hover);
  font-family: var(--font-detail-body);
  background: var(--page);
  color: var(--ink);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body { margin: 0; min-width: 0; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
button, a, summary { -webkit-tap-highlight-color: var(--color-detail-selection); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--signal); outline-offset: 4px; }
::selection { background: var(--color-detail-selection); color: var(--ink); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { min-width: 0; overflow-wrap: anywhere; text-wrap: balance; }
p, li { line-height: 1.65; }
.wrap { width: min(calc(100% - 64px), 1120px); margin-inline: auto; }
.skip-link { position: absolute; top: -80px; left: 20px; z-index: 5; padding: 12px 16px; background: var(--surface); }
.skip-link:focus { top: 12px; }
.brand-shell { background: var(--page); }
.header-shell { background: var(--surface); }
.site-header { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 24px; }
.brand { display: inline-flex; align-items: center; min-height: 44px; }
.brand img { width: 110px; height: auto; }
.site-header nav { font-size: 14px; font-weight: 550; }
.site-header nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--signal); text-decoration: none; white-space: nowrap; }
.site-header nav a:hover { text-decoration: underline; }
.contents { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 28px; min-height: 44px; margin-bottom: 40px; font-size: 14px; font-weight: 550; }
.contents a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.contents a:hover { color: var(--signal); text-decoration: underline; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 60px; padding-block: 64px 48px; }
.hero-copy { min-width: 0; }
h1 { font-size: clamp(40px, 4.5vw, 60px); line-height: 1.06; letter-spacing: -.045em; font-weight: 650; scroll-margin-top: 24px; }
.hero-description { margin-top: 28px; font-size: 19px; line-height: 1.6; max-width: 48ch; }
.hero-description strong { font-weight: 600; }
.byline { margin-top: 20px; font-size: 14px; color: var(--muted); }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; margin-top: 30px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 600; line-height: 1.4; text-decoration: none; white-space: nowrap; transition: transform 160ms var(--ease-card), background-color 160ms var(--ease-card); }
.primary { color: var(--surface); background: var(--action); }
.primary:hover { background: var(--action-hover); }
.secondary { color: var(--signal); padding-inline: 0; }
.secondary:hover { text-decoration: underline; }
.button:active { transform: scale(.98); }
.entry-note { margin-top: 18px; max-width: 46ch; font-size: 13px; line-height: 1.6; color: var(--muted); }
.hero-artwork { min-width: 0; margin: 0; aspect-ratio: 1.03; overflow: clip; border-radius: var(--radius-detail-panel); }
.hero-artwork img { display: block; width: 100%; height: 100%; object-fit: cover; }
.section { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.35fr); gap: 64px; margin-bottom: 96px; scroll-margin-top: 24px; }
.section > div { min-width: 0; }
.section h2, .closing h2 { font-size: clamp(32px, 3.6vw, 44px); line-height: 1.12; letter-spacing: -.04em; font-weight: 650; }
.section-intro > p { margin-top: 20px; font-size: 17px; max-width: 68ch; }
.section-intro .note { margin-top: 16px; color: var(--muted); font-size: 13px; }
.section-intro .text-link { margin-top: 20px; }
.workflow-section, .example-section { display: block; padding: 48px; border-radius: var(--radius-detail-panel); background: var(--color-detail-inset); }
.workflow-section > .section-intro, .example-section > .section-intro { max-width: 760px; margin-bottom: 40px; }
.workflow { list-style: none; padding: 0; margin: 0; }
.workflow li { display: flex; align-items: flex-start; gap: 16px; padding: 0 0 30px; }
.workflow li:last-child { padding-bottom: 0; }
.workflow li > div { min-width: 0; }
.step-number { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); color: var(--signal); text-align: center; line-height: 32px; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
h3 { font-size: 21px; line-height: 1.3; letter-spacing: -.02em; font-weight: 650; }
.workflow p { margin-top: 10px; font-size: 16px; }
.workflow-section .workflow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.workflow-section .workflow li { display: block; padding-bottom: 0; }
.workflow-section .step-number { display: block; margin-bottom: 20px; }
.example-showcase { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; align-items: start; }
.answer-preview { margin: 0; border-radius: 24px; background: var(--surface); overflow: clip; }
.preview-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 28px 28px 0; font-size: 12px; color: var(--muted); }
.answer-preview h3 { padding: 24px 28px; font-size: 27px; line-height: 1.2; }
.preview-answer { padding: 0 28px 28px; }
.answer-label { color: var(--color-detail-success); font-size: 13px; font-weight: 650; }
.preview-answer > p:first-of-type { margin-top: 8px; font-size: 22px; line-height: 1.4; letter-spacing: -.025em; }
blockquote { margin: 18px 0 14px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.answer-date { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
figcaption { padding: 22px 28px; background: var(--color-detail-blue); font-size: 14px; line-height: 1.6; }
figcaption strong { font-weight: 650; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; gap: 6px; color: var(--signal); font-size: 15px; font-weight: 550; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.pattern-content { padding: 36px; background: var(--color-detail-blue); border-radius: var(--radius-detail-panel); }
.pattern-content > p { margin-top: 16px; font-size: 16px; }
.reuse-section { display: block; }
.reuse-section > .section-intro { margin-bottom: 32px; }
.reuse-content { min-width: 0; padding: 32px; background: var(--color-detail-inset); border-radius: var(--radius-detail-panel); }
.snippet-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.copy-control { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.snippet-head .copy-control { align-items: flex-end; flex-direction: column; }
button { border: 0; border-radius: 999px; background: var(--surface); color: var(--ink); padding: 12px 18px; font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.4; cursor: pointer; white-space: nowrap; min-height: 44px; }
button:hover { background: var(--color-detail-selection); }
.copy-feedback { font-size: 13px; color: var(--color-detail-success); line-height: 1.5; max-width: 250px; }
.copy-feedback:empty { display: none; }
pre { margin: 0; padding: 24px; max-width: 100%; overflow-x: auto; border-radius: 16px; background: var(--surface); color: var(--color-detail-code); font-size: 14px; line-height: 1.8; tab-size: 2; }
code { font-family: var(--font-detail-mono); }
.prompt, details pre, #local-commands { white-space: pre-wrap; overflow-wrap: anywhere; }
details { margin-top: 16px; padding: 0 20px; border-radius: 16px; background: var(--surface); }
details[open] { padding-bottom: 20px; }
summary { font-size: 16px; font-weight: 600; cursor: pointer; padding: 18px 0; min-height: 56px; }
summary:hover { color: var(--signal); }
details > p { font-size: 14px; margin: 0 0 18px; color: var(--muted); }
details .copy-control { margin-bottom: 12px; }
details pre { padding: 18px; background: var(--color-detail-inset); }
.demo-sequence { margin-top: 36px; scroll-margin-top: 24px; }
.demo-sequence > .sequence-checks { margin-top: 20px; }
.sequence-checks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.sequence-checks > div { padding: 20px 16px; border-radius: 12px; background: var(--surface); }
.sequence-checks .sequence-match { background: var(--color-detail-green); }
.sequence-checks .sequence-skipped { background: var(--page); color: var(--muted); }
.sequence-checks dd { margin-top: 10px; font-size: 14px; }
.source-note { color: var(--muted); font-size: 13px; line-height: 1.65; margin-top: 20px; }
.run-steps { padding-left: 20px; margin: 24px 0 0; }
.run-steps li { padding-left: 4px; margin-top: 14px; font-size: 16px; }
#try pre { background: var(--color-detail-inset); }
dt { font-size: 15px; font-weight: 650; line-height: 1.5; }
dd { margin: 0; font-size: 15px; line-height: 1.65; }
.limits { padding-left: 18px; margin: 20px 0 0; }
.limits li { margin-top: 16px; padding-left: 4px; font-size: 15px; }
.limits strong { font-weight: 650; }
.closing { display: flex; align-items: center; justify-content: space-between; gap: 36px; padding: 48px; border-radius: var(--radius-detail-panel); background: var(--color-detail-yellow); }
.closing h2 { font-size: 36px; }
.closing p { font-size: 17px; margin-top: 16px; }
.closing-links { display: flex; align-items: center; flex-direction: column; gap: 10px; flex-shrink: 0; }
.ownership { font-size: 13px; line-height: 1.7; color: var(--muted); margin: 24px 0 48px; max-width: 100ch; }
footer { background: var(--surface); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 24px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.footer-inner a { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }

@media (max-width: 1000px) {
  .hero { gap: 32px; }
  .hero h1 { font-size: 46px; }
  .section { gap: 32px; }
  .workflow-section, .example-section { padding: 32px; }
  .workflow-section .workflow { gap: 24px; }
  .example-showcase { gap: 28px; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-artwork { aspect-ratio: 16 / 9; }
}
@media (max-width: 760px) {
  .wrap { width: min(calc(100% - 36px), 560px); }
  .site-header { gap: 16px; }
  .brand img { width: 96px; }
  .site-header nav { font-size: 13px; }
  .contents { column-gap: 24px; margin-bottom: 32px; font-size: 13px; }
  .hero { grid-template-columns: minmax(0, 1fr); padding-block: 40px 32px; gap: 32px; }
  .hero h1 { font-size: clamp(38px, 9vw, 52px); }
  .hero-description { margin-top: 22px; font-size: 17px; }
  .byline { margin-top: 16px; }
  .actions { gap: 10px 20px; margin-top: 24px; }
  .button { font-size: 13px; padding-inline: 18px; }
  .secondary { padding-inline: 0; }
  .hero-artwork { aspect-ratio: 4 / 3; border-radius: 24px; }
  .section { grid-template-columns: minmax(0, 1fr); gap: 28px; margin-bottom: 56px; }
  .section h2 { font-size: 32px; }
  .section-intro > p { margin-top: 16px; font-size: 16px; }
  .workflow-section, .example-section { padding: 28px; border-radius: 24px; }
  .workflow-section > .section-intro, .example-section > .section-intro { margin-bottom: 32px; }
  .workflow-section .workflow, .example-showcase { display: block; }
  .workflow-section .workflow li { display: flex; padding-bottom: 28px; }
  .workflow-section .workflow li:last-child { padding-bottom: 0; }
  .workflow-section .step-number { margin-bottom: 0; }
  .workflow li { gap: 14px; }
  h3 { font-size: 20px; }
  .workflow p { font-size: 15px; }
  .answer-preview { margin-bottom: 32px; border-radius: 20px; }
  .answer-preview h3 { font-size: 25px; }
  .preview-top, .answer-preview h3, .preview-answer, figcaption { padding-inline: 22px; }
  .preview-answer > p:first-of-type { font-size: 21px; }
  .pattern-content, .reuse-content { padding: 24px; border-radius: 24px; }
  .snippet-head { flex-wrap: wrap; gap: 12px; }
  .snippet-head .copy-control { align-items: flex-start; }
  pre { padding: 18px; font-size: 12px; }
  details { padding-inline: 16px; }
  details pre { padding: 14px; }
  summary { font-size: 15px; }
  .sequence-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .closing { align-items: flex-start; flex-direction: column; padding: 32px 28px; border-radius: 24px; gap: 24px; }
  .closing h2 { font-size: 32px; }
  .closing p { font-size: 16px; }
  .closing-links { align-items: flex-start; }
  .footer-inner { flex-wrap: wrap; gap: 12px 28px; }
  .footer-inner span { order: 3; width: 100%; }
}
@media (max-width: 380px) {
  .hero h1 { font-size: 36px; }
  .workflow-section, .example-section { padding: 24px 20px; }
  .pattern-content, .reuse-content { padding: 20px; }
  .section h2, .closing h2 { font-size: 29px; }
  .text-link { font-size: 13px; }
  .sequence-checks { grid-template-columns: minmax(0, 1fr); }
  .preview-top, .answer-preview h3, .preview-answer, figcaption { padding-inline: 18px; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
  .button:active { transform: none; }
}
