/* specifica.org home page. */

/* Hero */
.hero { padding: 72px 0 96px; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(45% 55% at 78% 45%, rgba(26,122,86,0.10), transparent 70%); pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; position: relative; }
.hero h1 { font-size: clamp(40px, 6vw, 64px); font-weight: 700; letter-spacing: -2.4px; line-height: 1.02; margin-bottom: 20px; }
.hero h1 .green { color: var(--green); }
.hero-sub { font-size: 18px; color: var(--text-secondary); line-height: 1.65; margin-bottom: 28px; max-width: 520px; }
.hero-sub em { font-style: normal; color: var(--text-primary); font-weight: 600; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.hero-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--text-tertiary); }
.hero-meta span::before { content: "✓ "; color: var(--green); font-weight: 700; }

/* Click-to-play walkthrough: the poster is the video's branded first frame. */
.hero-video { margin: 0; min-width: 0; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; scroll-margin-top: 100px; }
.video-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--border); }
.video-heading span:last-child { color: var(--text-tertiary); font-family: var(--mono); }
.video-player { position: relative; background: #f3f6f2; }
.video-player video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.video-play { position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%); display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: max-content; max-width: calc(100% - 24px); padding: 11px 17px; border: 1px solid rgba(255,255,255,.6); border-radius: 999px; background: var(--green); color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 5px 20px rgba(20,63,43,.2); }
.video-play[hidden] { display: none; }
.video-play:hover { background: var(--green-hover); }
.video-play:focus-visible { outline: 3px solid var(--text-primary); outline-offset: 4px; }
.hero-video figcaption { padding: 17px 18px; font-size: 13px; line-height: 1.6; }
.hero-video figcaption > strong, .hero-video figcaption > span { display: block; }
.hero-video figcaption > span { color: var(--text-secondary); }
.video-transcript { margin-top: 9px; color: var(--text-secondary); }
.video-transcript summary { width: fit-content; color: var(--green); cursor: pointer; font-size: 12px; }
.video-transcript p { margin-top: 12px; }

/* Hero demo: a miniature playground */
.demo { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; font-size: 13px; }
.demo-bar { display: flex; align-items: center; gap: 6px; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--bg); }
.demo-bar i { width: 10px; height: 10px; border-radius: 50%; background: #e4e4e7; }
.demo-bar span { margin-left: 10px; font-size: 12px; font-weight: 600; color: var(--text-tertiary); }
.demo-body { display: grid; grid-template-columns: 1.45fr 1fr; min-height: 252px; }
.demo-doc { padding: 16px 18px; }
.demo-tab { display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 500; padding-bottom: 6px; border-bottom: 2px solid var(--green); margin-bottom: 12px; }
.demo-h { font-weight: 700; font-size: 13px; padding-bottom: 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.demo-row { display: flex; gap: 9px; align-items: flex-start; padding: 7px 6px; border-bottom: 1px solid #f0f0ee; line-height: 1.45; border-radius: 6px; transition: background .6s ease; }
.demo-row b { flex: none; width: 13px; height: 13px; margin-top: 2px; border: 1.5px solid #a1a1aa; border-radius: 3px; }
.demo-new { opacity: 0; transform: translateY(8px); max-height: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; transition: opacity .5s var(--ease), transform .5s var(--ease), max-height .5s var(--ease), padding .5s var(--ease), background .8s ease; }
.demo-chat { border-left: 1px solid var(--border); background: var(--bg-subtle); padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.demo-bubble { border-radius: 10px; padding: 9px 11px; line-height: 1.45; }
.demo-user { background: var(--bg-elevated); border: 1px solid var(--border); align-self: flex-end; min-height: 38px; }
.demo-ai { color: var(--text-secondary); opacity: 0; transform: translateY(6px); transition: opacity .4s ease, transform .4s ease; }
.demo-ai u { color: var(--text-primary); font-size: 12px; }
.caret { display: inline-block; width: 1.5px; height: 1.05em; background: var(--green); margin-left: 1px; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
.demo-foot { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--bg); }
.demo-copy { font-weight: 600; font-size: 12px; padding: 6px 12px; border-radius: 7px; border: 1px solid var(--border); background: var(--bg-elevated); transition: all .4s var(--ease); }
.demo-agents { font-size: 12px; color: var(--text-tertiary); opacity: 0; transition: opacity .5s ease; }
@keyframes blink { 50% { opacity: 0; } }

/* Steps of the loop (site.js sets data-step) */
.demo[data-step="0"] .caret, .demo[data-step="1"] .caret { animation: blink 1s steps(1) infinite; }
.demo[data-step="2"] .caret, .demo[data-step="3"] .caret, .demo[data-step="4"] .caret { display: none; }
.demo[data-step="2"] .demo-ai, .demo[data-step="3"] .demo-ai, .demo[data-step="4"] .demo-ai { opacity: 1; transform: none; }
.demo[data-step="3"] .demo-new, .demo[data-step="4"] .demo-new { opacity: 1; transform: none; max-height: 60px; padding-top: 7px; padding-bottom: 7px; }
.demo[data-step="3"] .demo-new { background: var(--green-subtle); }
.demo[data-step="4"] .demo-new { background: var(--green-subtle); }
.demo[data-step="4"] .demo-copy { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 6px 18px rgba(26,122,86,0.28); }
.demo[data-step="4"] .demo-copy::after { content: " ✓"; }
.demo[data-step="4"] .demo-agents { opacity: 1; }

/* How it works */
.steps { list-style: none; margin-top: 40px; }
.step-n { display: inline-flex; width: 32px; height: 32px; border-radius: 50%; align-items: center; justify-content: center; background: var(--green-subtle); color: var(--green); font-weight: 700; font-size: 15px; margin-bottom: 14px; }

/* Example library preview */
.example-preview-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-top: 40px; }
.example-preview { grid-column: span 2; color: var(--text-primary); text-decoration: none; }
.example-preview:nth-child(4) { grid-column: 2 / span 2; }
.example-preview .file-name { margin-bottom: 16px; }
.examples-more { margin-top: 24px; text-align: center; font-weight: 600; }
.examples-more a { text-decoration: none; }
.migration-reference { max-width: 760px; margin: 28px auto 0; color: var(--text-tertiary); font-size: 14px; text-align: center; }
.migration-reference strong { color: var(--text-secondary); }
.migration-reference a { font-weight: 600; text-decoration: none; }

/* Files */
.files { margin-top: 36px; }
.files .card { padding: 22px; }
.tree { display: grid; grid-template-columns: minmax(0, 1.2fr) 1fr; gap: 32px; align-items: center; margin-top: 32px; }
.tree-note { color: var(--text-secondary); }

/* Why */
.why { margin-top: 36px; }
.why-item h3 { font-size: 16px; font-weight: 700; margin: 10px 0 4px; }
.why-item p { font-size: 15px; color: var(--text-secondary); }
.why-icon { display: inline-flex; width: 40px; height: 40px; border-radius: 10px; align-items: center; justify-content: center; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--green); font-weight: 700; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding: 48px 0 64px; }
  .tree { grid-template-columns: 1fr; }
  .example-preview-grid { grid-template-columns: repeat(2, 1fr); }
  .example-preview, .example-preview:nth-child(4) { grid-column: auto; }
}
@media (max-width: 640px) {
  .demo-body { grid-template-columns: 1fr; }
  .demo-chat { border-left: none; border-top: 1px solid var(--border); }
  .demo-agents { display: none; }
  .example-preview-grid { grid-template-columns: 1fr; }
}
