/* Homepage components, one section per renderer in tools/site/blocks/. Proportions follow the cursor.com
   measurements in DESIGN_BRIEF.md: a quiet left-aligned hero, large product windows on soft backdrops,
   narrow text beside wide recordings, and a very large closing line. Motion is vertical only. */

/* ---------- Shared section pieces ---------- */

.section-head { max-width: 44rem; margin-bottom: 2rem; }
.section-head h2 { font-size: var(--text-title); line-height: 1.3; }
.section-head p { margin-top: 0.35rem; color: var(--muted); }
.section-title { max-width: 50rem; margin-inline: auto; font-size: var(--text-section); line-height: 1.2; text-align: center; }

/* ---------- Hero ---------- */

.hero { padding-top: 5.5rem; }
.hero-eyebrow { margin-bottom: 0.9rem; color: var(--muted); font-size: var(--text-sm); }
.hero-eyebrow strong { color: var(--ink); font-weight: 500; }
.hero h1 { max-width: 49rem; font-size: var(--text-hero); line-height: 1.3; }
.hero h1 .accent { color: var(--brand); }
.hero-lead { max-width: 40rem; margin-top: 1rem; color: var(--muted); font-size: 1.25rem; line-height: 1.65; text-wrap: pretty; }
.hero .actions { margin-top: 1.4rem; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin-top: 1.1rem; color: var(--muted); font-size: var(--text-sm); list-style: none; }
.hero-stats strong { color: var(--ink); font-weight: 500; }

/* ---------- Recording: backdrop stage, window, controls ---------- */

.recording { position: relative; }
.stage { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--backdrop); }
.window { position: relative; overflow: hidden; border-radius: var(--radius-window); background: var(--card); box-shadow: var(--shadow-window); }
.media-canvas { position: relative; }
.media-canvas img { width: 100%; }
.media-canvas video { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 300ms ease; }
.media-canvas video.is-playing { opacity: 1; }
.media-actions { display: flex; align-items: center; gap: 0.4rem; }
.media-toggle,
.media-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  min-height: 28px;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgb(255 255 255 / 0.62);
  color: var(--ink);
  font: 400 var(--text-xs)/1.5 var(--font-sans);
  cursor: pointer;
  transition: background-color var(--transition), scale 120ms ease-out;
}
.media-toggle { min-width: 28px; padding: 0; }
.media-expand { padding: 0.2rem 0.75rem; white-space: nowrap; }
@media (hover: hover) {
  .media-toggle:hover, .media-expand:hover { background: #fff; }
}
.media-toggle .icon { width: 13px; height: 13px; }
.media-progress {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  width: 100%;
  height: 2px;
  margin: 0;
  border: 0;
  overflow: clip;
  appearance: none;
  background: transparent;
  pointer-events: none;
}
.media-progress::-webkit-progress-bar { background: transparent; }
.media-progress::-webkit-progress-value { background: var(--brand); transition: inline-size 180ms linear; }
.media-progress::-moz-progress-bar { background: var(--brand); transition: inline-size 180ms linear; }
.recording-caption { margin-top: 0.75rem; color: var(--muted); font-size: var(--text-xs); line-height: 1.6; text-wrap: pretty; }
.recording-details { margin-top: 0.4rem; }
.recording-details summary { width: fit-content; color: var(--brand); cursor: pointer; }
.recording-details p { max-width: 52rem; margin-top: 0.35rem; }
.recording-details::details-content { interpolate-size: allow-keywords; overflow: clip; contain: layout; }
.recording-details:not([open])::details-content { block-size: 0; }
@media (prefers-reduced-motion: no-preference) {
  .recording-details::details-content {
    transition-property: block-size, content-visibility;
    transition-duration: 240ms;
    transition-timing-function: ease-out;
    transition-behavior: allow-discrete;
  }
}

.recording-dialog {
  width: min(1240px, 94vw);
  max-height: 94vh;
  padding: 0;
  border: 0;
  border-radius: var(--radius-window);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-window);
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 180ms;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}
.recording-dialog[open] {
  opacity: 1;
  @starting-style { opacity: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .recording-dialog { transform: scale(0.96); }
  .recording-dialog[open] {
    transform: scale(1);
    @starting-style { transform: scale(0.96); }
  }
}
.recording-dialog:modal { overscroll-behavior: contain; }
.recording-dialog::backdrop {
  background-color: transparent;
  overflow: hidden;
  overscroll-behavior: contain;
  transition-property: background-color, display, overlay;
  transition-duration: 180ms;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}
.recording-dialog[open]::backdrop {
  background-color: var(--scrim);
  @starting-style { background-color: transparent; }
}
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.6rem 0.75rem 0.6rem 1.1rem; }
.dialog-header h2 { font-size: var(--text-sm); }
.dialog-close { display: inline-flex; align-items: center; gap: 0.4em; min-height: 32px; padding: 0.2rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--chip); color: var(--ink); font: 400 var(--text-sm)/1.5 var(--font-sans); cursor: pointer; }
.dialog-media video { width: 100%; max-height: calc(94vh - 110px); background: #000; object-fit: contain; }
.dialog-caption { padding: 0.6rem 1.1rem 0.8rem; color: var(--muted); font-size: var(--text-xs); }

/* ---------- Showcase: the hero window and the workspace guide ---------- */

.showcase { margin-top: 3.5rem; }
.recording-showcase .stage { padding: 0 6.9rem; }
.recording-showcase .window { border-radius: var(--radius-window) var(--radius-window) 0 0; }
.workspace-toolbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; min-height: 4.5rem; }
.workspace-label { color: var(--ink); font-size: var(--text-sm); }
.workspace-toolbar .media-actions { justify-self: end; }
.workspace-controls { display: flex; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: rgb(255 255 255 / 0.5); }
.workspace-controls button {
  min-height: 30px;
  padding: 0.2rem 0.85rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font: 400 var(--text-sm)/1.5 var(--font-sans);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition), scale 120ms ease-out;
}
@media (hover: hover) {
  .workspace-controls button:hover { color: var(--ink); }
}
.workspace-controls button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow-float); }
.workspace-controls button:disabled { cursor: default; }
@media (prefers-reduced-motion: no-preference) {
  :where(.media-toggle, .media-expand, .workspace-controls button, .dialog-close):active { scale: 0.96; }
}
/* The guide only marks where things are in the real recording; it never alters the recording.
   Region boxes are fractions of the fig-agent frame (left, width); re-measure after re-recording it.
   The spotlight follows the previewed region (hover or focus); the phone zoom follows the selected one. */
[data-workspace] { --rl: 0; --rw: 1; --zl: 0; --zt: 0; --zw: 1; }
[data-preview="chat"] { --rl: 0.066; --rw: 0.273; }
[data-preview="editor"] { --rl: 0.348; --rw: 0.399; }
[data-preview="pdf"] { --rl: 0.756; --rw: 0.235; }
[data-workspace="chat"] { --zl: 0.066; --zw: 0.273; }
[data-workspace="editor"] { --zl: 0.348; --zw: 0.399; }
[data-workspace="pdf"] { --zl: 0.756; --zw: 0.235; }
.workspace-spotlight { position: absolute; z-index: 1; top: 8.7%; bottom: 4.1%; left: calc(var(--rl) * 100%); width: calc(var(--rw) * 100%); border: 2px solid var(--brand); border-radius: 8px; box-shadow: 0 0 0 1600px rgb(38 37 30 / 0.16); opacity: 0; pointer-events: none; transition: left 240ms ease, width 240ms ease, opacity 180ms ease; }
[data-preview]:not([data-preview="overview"]) .workspace-spotlight { opacity: 1; }
/* All notes share one grid cell, so switching keeps the total height and nothing below is pushed. */
.workspace-notes { display: grid; margin-top: 1rem; }
.workspace-note { grid-area: 1 / 1; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1.5rem; visibility: hidden; color: var(--muted); font-size: var(--text-sm); }
.workspace-note[aria-hidden="false"] { visibility: visible; }
.workspace-note strong { margin-right: 0.4em; color: var(--ink); font-weight: 500; }
.workspace-note a { display: inline-flex; align-items: center; gap: 0.35em; white-space: nowrap; text-decoration: none; }
@media (hover: hover) {
  .workspace-note a:hover { text-decoration: underline; }
}
.workspace-hint { font-size: var(--text-xs); white-space: nowrap; visibility: hidden; }
.workspace-ready .workspace-note[aria-hidden="false"] .workspace-hint { visibility: visible; }

/* ---------- Logo strip ---------- */

.logos { padding: 2.1rem 0; }
.logos-title { margin-bottom: 1.25rem; font-size: var(--text-sm); text-align: center; }
.logo-grid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 0.5rem; list-style: none; }
.logo-grid li { display: grid; place-items: center; height: 4.5rem; padding: 0 0.75rem; border-radius: var(--radius); background: var(--card); }
.logo-grid img { width: auto; max-width: 82%; max-height: 2.15rem; object-fit: contain; filter: grayscale(1) contrast(1.1); mix-blend-mode: multiply; opacity: 0.8; transition: filter var(--transition), opacity var(--transition); }
@media (hover: hover) {
  .logo-grid li:hover img { filter: grayscale(0) contrast(1); opacity: 1; }
}

/* ---------- Quick links ---------- */

.quicklinks .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem 1.75rem; padding-block: 1rem; font-size: var(--text-sm); }
.quicklinks p { color: var(--muted); }
.quicklinks ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; list-style: none; }
.quicklinks a { color: var(--ink); text-decoration: none; }
@media (hover: hover) {
  .quicklinks a:hover { color: var(--brand); }
}

/* ---------- Feature rows ---------- */

.feature { padding-block: 2.8rem; content-visibility: auto; contain-intrinsic-block-size: auto 34rem; }
.feature-inner { display: grid; grid-template-columns: minmax(0, 26.25rem) minmax(0, 1fr); align-items: center; }
.feature-media-left .feature-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 26.25rem); }
.feature-media-left .recording { order: -1; }
.feature-text { padding-inline: 1.25rem 2.5rem; }
.feature-media-left .feature-text { padding-inline: 2.5rem 1.25rem; }
.feature-text h2 { font-size: var(--text-title); line-height: 1.4; }
.feature-text p { margin-top: 0.9rem; color: var(--muted); font-size: var(--text-lg); line-height: 1.7; text-wrap: pretty; }
.feature-text p + p:not(.feature-more) { font-size: var(--text-sm); }
.feature-text .feature-more { margin-top: 1rem; font-size: var(--text-base); line-height: 1.5; }
.feature-more a { display: inline-flex; align-items: center; gap: 0.35em; text-decoration: none; }
@media (hover: hover) {
  .feature-more a:hover { text-decoration: underline; }
}
.stage-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 3.25rem; }
.stage-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: var(--text-sm); }
.feature .stage { padding: 0 2.6rem 2.6rem; }
/* 局部取景保留真实帧；放大弹窗始终播放完整画面。 */
[data-clip="fig-inline-edit"] .media { aspect-ratio: 16 / 10; }
[data-clip="fig-inline-edit"] .media-canvas { transform: translateY(-29.5%); }

/* ---------- Testimonial ---------- */

.quote-section { padding-block: var(--section-y); content-visibility: auto; contain-intrinsic-block-size: auto 24rem; }
.quote-card { max-width: 47.5rem; margin: 2.5rem auto 0; padding: 2rem 2.25rem; border-radius: var(--radius); background: var(--card); }
.quote-card blockquote p { font-size: var(--text-title); line-height: 1.45; text-wrap: pretty; }
.quote-card figcaption { margin-top: 1.25rem; color: var(--muted); font-size: var(--text-sm); }
.quote-note { max-width: 43rem; margin: 1rem auto 0; color: var(--muted); font-size: var(--text-xs); line-height: 1.7; }

/* ---------- Card grid ---------- */

.cards-section { padding-block: var(--section-y); content-visibility: auto; contain-intrinsic-block-size: auto 24rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: 1.25rem; list-style: none; }
.card { display: flex; flex-direction: column; padding: 1.25rem; border-radius: var(--radius); background: var(--card); }
.card h3 { font-size: var(--text-base); line-height: 1.5; }
.card p { color: var(--muted); }
.card-number { margin-bottom: 1.5rem; color: var(--muted); font: 400 var(--text-sm)/1.5 var(--font-mono); }
.card-prompt { margin-top: auto; padding-top: 1.25rem; }
.card-prompt span { display: block; padding-top: 0.9rem; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--text-xs); }
.card-prompt p { margin-top: 0.3rem; color: var(--ink); font-size: var(--text-sm); }
.cards-note { margin-top: 1.25rem; color: var(--muted); font-size: var(--text-sm); }

/* ---------- Closing call to action ---------- */

.cta { padding: var(--section-y) 0 8.4rem; text-align: center; content-visibility: auto; contain-intrinsic-block-size: auto 22rem; }
.cta-eyebrow { margin-bottom: 1rem; color: var(--muted); font-size: var(--text-sm); }
.cta h2 { font-size: var(--text-display); line-height: 1.1; }
.cta-lead { margin-top: 1rem; color: var(--muted); }
.cta .actions { justify-content: center; margin-top: 2rem; }
.cta-meta { margin-top: 0.9rem; color: var(--muted); font-size: var(--text-xs); }

/* ---------- Component gallery label (local only) ---------- */

.specimen { margin-top: 3rem; padding-block: 0.5rem; border-top: 1px dashed var(--line-strong); color: var(--muted); font: 400 var(--text-xs)/1.5 var(--font-mono); }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .recording-showcase .stage { padding-inline: 2.5rem; }
  .logo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .feature-inner, .feature-media-left .feature-inner { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .feature-media-left .recording { order: 0; }
  .feature-text, .feature-media-left .feature-text { padding-inline: 0; }
  .cta h2 { font-size: calc(var(--text-display) * 0.677); }
}

@media (max-width: 600px) {
  .hero { padding-top: 3.5rem; }
  .hero h1 { font-size: 2rem; }
  .hero-lead { font-size: 1.125rem; }
  .showcase { margin-top: 2.5rem; }
  .recording-showcase .stage { padding: 0 0.75rem; }
  .workspace-toolbar { grid-template-columns: 1fr auto; gap: 0.5rem; padding-block: 0.75rem; }
  .workspace-controls { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; }
  .workspace-controls button { flex: 1; padding-inline: 0.4rem; }
  .workspace-note a, .workspace-hint { white-space: normal; }
  /* Phones zoom the chosen region to the window width instead of outlining it (DESIGN_BRIEF.md, 手机取景). */
  [data-workspace="chat"] { --zl: 0.015; --zt: 0.087; --zw: 0.365; }
  [data-workspace="editor"] { --zl: 0.348; --zt: 0.08; --zw: 0.375; }
  [data-workspace="pdf"] { --zl: 0.745; --zt: 0.11; --zw: 0.255; }
  .recording-showcase .window { aspect-ratio: 16 / 10; transition: aspect-ratio 260ms ease; }
  .recording-showcase[data-workspace]:not([data-workspace="overview"]) .window { aspect-ratio: 2 / 3; }
  .recording-showcase .media-canvas { transform-origin: 0 0; transition: transform 260ms ease; }
  .recording-showcase[data-workspace]:not([data-workspace="overview"]) .media-canvas { transform: scale(calc(1 / var(--zw))) translate(calc(var(--zl) * -100%), calc(var(--zt) * -100%)); }
  .workspace-spotlight { display: none; }
  .feature .stage { padding: 0 1rem 1.25rem; }
  .stage-toolbar { min-height: 3rem; padding-block: 0.25rem; }
  .logo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .logo-grid li { height: 4rem; }
  .quote-card { padding: 1.5rem; }
  .workspace-controls button { min-height: 36px; }
  .media-toggle { min-width: 36px; min-height: 36px; }
  .media-expand { min-height: 36px; }
  [data-clip="fig-compile"] .media { aspect-ratio: 16 / 10; }
  [data-clip="fig-compile"] .media-canvas { transform-origin: 0 0; transform: scale(1.12) translate(-5.5%, -6%); }
  [data-clip="fig-zotero"] .media { aspect-ratio: 1 / 1.12; }
  [data-clip="fig-zotero"] .media-canvas { transform-origin: 0 0; transform: scale(2.12) translate(-11%, -12%); }
  [data-clip="fig-inline-edit"] .media { aspect-ratio: 1.55; }
  [data-clip="fig-inline-edit"] .media-canvas { transform-origin: 0 0; transform: scale(1.32) translate(-6%, -45%); }
  [data-clip="fig-overleaf"] .media { aspect-ratio: 16 / 10; }
  [data-clip="fig-overleaf"] .media-canvas { transform-origin: 0 0; transform: scale(1.08) translate(-5%, -4%); }
}

@media (max-width: 480px) {
  .workspace-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: var(--radius); }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-controls button, .workspace-spotlight, .recording-showcase .window, .recording-showcase .media-canvas, .media-toggle, .media-expand, .logo-grid img { transition: none; }
  .media-progress::-webkit-progress-value { transition: none; }
  .media-progress::-moz-progress-bar { transition: none; }
  .recording-dialog, .recording-dialog::backdrop { transition-duration: 80ms; }
}

@media (forced-colors: active) {
  .media-toggle, .media-expand, .workspace-controls button, .dialog-close, .recording-dialog { border: 1px solid ButtonText; }
  .workspace-controls button[aria-pressed="true"] { border-color: Highlight; background: Highlight; color: HighlightText; }
}

@media print {
  .workspace-toolbar, .stage-toolbar, .workspace-spotlight, .media-toggle, .media-expand, .media-progress { display: none; }
}
