/* Page layouts. Shared palette, typography, header and actions: theme.css. */

/* ---------- hero (Univer-inspired centered canvas) ---------- */

.hero {
  position: relative;
  width: 100%;
  padding: clamp(56px, 6.2vw, 84px) var(--gutter) 56px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(22, 21, 28, 0.046) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(22, 21, 28, 0.046) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 76% 78% at 50% 44%, #000 36%, transparent 100%);
  mask-image: radial-gradient(ellipse 76% 78% at 50% 44%, #000 36%, transparent 100%);
}

.hero-top {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}

.hero-frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
  padding: clamp(12px, 1.8vw, 20px) clamp(16px, 2.8vw, 32px);
  border: 1px solid rgba(36, 85, 223, 0.36);
  background: rgba(255, 255, 255, 0.52);
}

.hero-frame::before,
.hero-frame::after,
.hero-frame-corners::before,
.hero-frame-corners::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--surface);
  border: 1.5px solid var(--cobalt);
  pointer-events: none;
}

.hero-frame::before {
  top: -3.5px;
  left: -3.5px;
}

.hero-frame::after {
  top: -3.5px;
  right: -3.5px;
}

.hero-frame-corners::before {
  bottom: -3.5px;
  left: -3.5px;
}

.hero-frame-corners::after {
  bottom: -3.5px;
  right: -3.5px;
}

.hero h1 {
  font-size: clamp(32px, 5.4vw, 72px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.028em;
  color: var(--ink);
}

.hero-emphasis {
  color: var(--cobalt);
}

.hero-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  padding-bottom: 0;
}

.hero-lede {
  max-width: 54ch;
  margin: 0 auto;
  color: var(--text);
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.62;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.hero-hosts {
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

/* ---------- sections ---------- */

.section {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(56px, 6.5vw, 88px) var(--gutter) 0;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 18px 56px;
  align-items: end;
  margin-bottom: 34px;
}

.section-head h2 {
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.022em;
}

.section-head p {
  max-width: 46ch;
  margin: 0;
  color: var(--text);
  font-size: 16.5px;
  line-height: 1.55;
}

/* ---------- concise 3-step summary (light typography, zero decorative cards) ---------- */

.steps {
  border-top: 1px solid var(--hair);
}

.steps-head {
  margin-bottom: 28px;
}

.steps-head h2 {
  font-size: clamp(26px, 3vw, 36px);
  font-stretch: 96%;
  line-height: 1.1;
  letter-spacing: -0.022em;
}

.step-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 32px;
  margin: 0;
  padding: 24px 0 0;
  list-style: none;
  border-top: 1px solid var(--hair);
}

.step-item {
  min-width: 0;
}

.step-item:not(:first-child) {
  padding-left: 28px;
  border-left: 1px solid var(--hair);
}

.step-num {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font: 500 12.5px/1 var(--mono);
  letter-spacing: 0.04em;
}

.step-item h3 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.step-item p {
  max-width: 34ch;
  margin: 8px 0 0;
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.55;
}

.section-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 28px 0 0;
}

.dot-sep {
  color: var(--muted);
}

/* ---------- 3 curated design previews ---------- */

.designs {
  margin-top: 0;
  border-top: 0;
}

.design-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 22px;
}

.design {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: baseline;
}

.design-screen {
  grid-column: 1 / -1;
  position: relative;
  display: block;
  overflow: hidden;
  margin-bottom: 8px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--hair);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.design:hover .design-screen {
  transform: translateY(-2px);
  border-color: var(--hair-strong);
  box-shadow: 0 14px 28px -20px rgba(22, 21, 28, 0.22);
}

.design-screen iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 900px;
  border: 0;
  transform-origin: 0 0;
  pointer-events: none;
}

.design-name {
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.design-kind {
  color: var(--muted);
  font-size: 13.5px;
  text-align: right;
}

.section-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 28px 0 0;
}

/* ---------- compact install ---------- */

.install {
  padding-bottom: clamp(56px, 7vw, 88px);
}

.install-compact {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 24px 44px;
  align-items: center;
  padding: clamp(22px, 3vw, 32px);
  border-radius: 14px;
  border: 1px solid var(--hair);
  background: var(--surface);
}

.install-intro h2 {
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.022em;
}

.install-intro p {
  max-width: 38ch;
  margin: 10px 0 0;
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.55;
}

.install-panel {
  min-width: 0;
}

.install-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 18px;
  border-radius: 14px;
  background: var(--ink);
}

.install-bar code {
  flex: 1;
  min-width: 0;
  color: #f2f3f6;
  font: 13px/1.6 var(--mono);
  overflow-wrap: anywhere;
  user-select: all;
}

.copy {
  flex: none;
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.copy:hover {
  background: #e9eaee;
}

.install-scope {
  margin: 10px 4px 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.install-scope a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--hair-strong);
  text-underline-offset: 3px;
}

.install-scope a:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

/* ---------- dedicated interactive examples page (/examples/ & /zh/examples/) ---------- */

.examples-hero {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) var(--gutter) 0;
}

.examples-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 20px 56px;
  align-items: end;
}

.examples-head h1 {
  font-size: clamp(38px, 5vw, 68px);
  font-stretch: 94%;
  line-height: 1;
  letter-spacing: -0.03em;
}

.stage {
  position: relative;
  margin-top: clamp(32px, 4.5vw, 48px);
  padding: clamp(16px, 2.2vw, 28px);
  border-radius: 24px;
  background: var(--wash);
}

.prompt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px 14px 20px;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 1px 0 var(--hair), 0 10px 28px -18px rgba(15, 17, 21, 0.22);
}

.prompt-who {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
}

.prompt-text {
  flex: 1;
  min-width: 0;
  min-height: 1.5em;
  margin: 0;
  font-size: clamp(15.5px, 1.5vw, 19.5px);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--ink);
  opacity: 0;
}

.is-typing .caret {
  opacity: 1;
  animation: blink 0.9s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.prompt-enter {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--wash);
  color: var(--muted);
  font-size: 15px;
}

.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 2px 16px;
}

.examples > span {
  margin-right: 4px;
  color: var(--muted);
  font-size: 13.5px;
}

.examples button {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--hair-strong);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  transition: background-color 140ms ease, color 140ms ease;
}

.examples button:hover {
  box-shadow: inset 0 0 0 1px var(--ink);
  color: var(--ink);
}

.examples button[aria-pressed='true'] {
  background: var(--ink);
  box-shadow: none;
  color: #fff;
}

.result {
  overflow: hidden;
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(15, 17, 21, 0.08), 0 24px 48px -28px rgba(15, 17, 21, 0.3);
}

.result-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--hair);
  font-size: 13px;
}

.dots {
  display: flex;
  gap: 6px;
  flex: none;
}

.dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--hair-strong);
}

.result-url {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--wash);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-status {
  margin-left: auto;
  color: var(--signal);
  font-weight: 600;
  white-space: nowrap;
}

.is-building .result-status {
  color: var(--muted);
}

.result-studio {
  flex: none;
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--hair-strong);
  text-underline-offset: 3px;
  white-space: nowrap;
}

.result-studio:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

.result-screen {
  position: relative;
  overflow: hidden;
  background: #fff;
  transition: opacity 160ms ease;
}

.is-building .result-screen {
  opacity: 0.4;
}

.result-screen iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 900px;
  border: 0;
  transform-origin: 0 0;
  pointer-events: none;
}

.stage-disclaimer {
  margin: 14px 4px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.examples-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  margin-top: 28px;
}

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .site-header {
    gap: 14px;
  }

  .site-header > nav:not(.mobile-nav) {
    gap: 14px;
  }

  .site-header > nav:not(.mobile-nav) a {
    font-size: 13.5px;
  }

  .header-tools {
    gap: 6px;
  }

  .lang-switch {
    padding: 0 10px;
    font-size: 13px;
  }

  .header-cta {
    padding: 0 13px;
    font-size: 13px;
  }

  .section-head,
  .examples-head,
  .install-compact {
    grid-template-columns: minmax(0, 1fr);
  }

  .design-kind {
    display: none;
  }

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

@media (max-width: 720px) {
  .site-header {
    gap: 10px;
    height: 56px;
  }

  .site-header > nav:not(.mobile-nav) {
    display: none;
  }

  .header-tools {
    margin-left: auto;
    gap: 8px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .design-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }

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

  .design-kind {
    display: block;
  }

  .result-status {
    display: none;
  }

  .result-studio {
    margin-left: auto;
  }

  .colophon {
    margin-left: 0;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 15.5px;
  }

  .site-header {
    padding-inline: 14px;
  }

  .brand {
    gap: 7px;
    font-size: 16px;
  }

  .brand svg {
    width: 18px;
    height: 18px;
  }

  .header-cta {
    display: none;
  }

  .lang-switch,
  .nav-toggle {
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }

  .hero {
    padding: 40px 16px 36px;
  }

  .hero-frame {
    padding: 12px 14px;
  }

  .hero h1 {
    font-size: clamp(31px, 9.2vw, 40px);
    line-height: 1.08;
  }

  .hero-actions {
    width: 100%;
    gap: 10px;
  }

  .hero-actions .button,
  .hero-actions .button-secondary {
    height: 42px;
    padding: 0 18px;
    font-size: 14.5px;
  }

  .prompt {
    align-items: flex-start;
    padding: 12px 14px;
  }

  .prompt-enter {
    display: none;
  }

  .dots {
    display: none;
  }

  .install-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }

  .copy {
    width: 100%;
  }
}

/* ---------- Chinese typography ---------- */

:lang(zh) h1,
:lang(zh) h2,
:lang(zh) h3,
:lang(zh) strong,
:lang(zh) .kicker,
:lang(zh) .prompt-text {
  letter-spacing: 0;
  font-stretch: 100%;
  text-transform: none;
}

:lang(zh) h1,
:lang(zh) h2 {
  line-height: 1.18;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

:lang(zh) .hero h1 {
  font-size: clamp(28px, 4.8vw, 62px);
  font-weight: 600;
}

:lang(zh) .section-head h2 {
  font-size: clamp(26px, 3vw, 38px);
}

:lang(zh) body,
:lang(zh) .hero-lede,
:lang(zh) .section-head p,
:lang(zh) .step-item p {
  line-height: 1.72;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Complete homepage: clear groups, short summaries, native disclosure. */
.home-module-groups { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:32px; }
.home-module-group { min-width:0; }
.home-module-group header { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:14px; }
.home-module-group h3 { font-size:18px; font-weight:500; margin:0; }
.module-availability { color:#2c6951; font-size:11px; white-space:nowrap; }
.module-availability.is-preview { color:#8a6326; }
.home-module-group details,.faq-list details { border-top:1px solid var(--hair); }
.home-module-group summary,.faq-list summary { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:56px; cursor:pointer; list-style:none; font-size:14px; }
.home-module-group summary::-webkit-details-marker,.faq-list summary::-webkit-details-marker { display:none; }
.home-module-group summary::after,.faq-list summary::after { content:'+'; flex:none; font-size:18px; color:var(--muted); }
.home-module-group details[open] summary::after,.faq-list details[open] summary::after { content:'−'; }
.home-module-group summary:hover,.faq-list summary:hover { color:var(--cobalt); }
.home-module-group details p,.faq-list details p { margin:0 0 18px; color:var(--muted); font-size:14px; line-height:1.7; max-width:62ch; }
.home-module-boundary { margin:18px 0 0; font-size:12px; color:var(--muted); }
.home-cases .stage { margin:0; box-shadow:none; background:transparent; padding:0; }
.home-cases .prompt { min-height:100px; }
.home-cases .prompt-text { font-size:clamp(18px,2.1vw,25px); }
.home-cases .result-screen { max-height:510px; }
.home-cases .section-head { align-items:center; }
.home-cases .section-head > a { justify-self:end; }
.home-faq { display:grid; grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr); gap:24px 64px; }
.home-faq h2 { margin:0; font-size:clamp(28px,3.2vw,40px); line-height:1.2; font-weight:500; letter-spacing:-.022em; }
.faq-list { min-width:0; }
.faq-list summary { min-height:64px; font-size:15px; }
.product-home .site-header > nav:not(.mobile-nav) { gap:18px; }
@media(max-width:1000px) and (min-width:721px) { .product-home .primary-nav a[href="https://github.com/AniChikage/opc-harness"],.product-home .primary-nav a[href="/designs/"] { display:none; } }
@media(max-width:800px) { .home-module-groups { grid-template-columns:1fr; gap:28px; } .home-faq { grid-template-columns:1fr; } .home-cases .section-head > a { justify-self:start; } }
@media(max-width:520px) { .home-cases .result-bar { flex-wrap:wrap; } .home-cases .prompt { min-height:145px; } .home-cases .result-studio { min-height:34px; } }

/* Shared type scale and vertical footer navigation. */
.product-home .hero h1 { font-size:clamp(30px,4.5vw,60px); line-height:1.12; }
.product-home .section-head h2,.product-home .home-faq h2 { font-size:clamp(24px,2.3vw,30px); line-height:1.25; }
.product-home .hero-lede,.product-home .section-head p { font-size:15px; }
.product-home .home-cases .prompt-text { font-size:clamp(16px,1.5vw,20px); }
.legal-page { max-width:800px; padding:50px var(--gutter) 70px; margin:auto; }
.legal-page h1 { margin:24px 0 32px; font-size:34px; font-weight:500; }
.legal-page h2 { margin:26px 0 9px; font-size:19px; font-weight:500; }
.legal-page p { margin:0 0 14px; font-size:14px; line-height:1.8; color:var(--text); }
.legal-references a { text-decoration:underline; text-underline-offset:3px; }


.product-home .install-intro h2 { font-size:clamp(24px,2.3vw,30px); line-height:1.25; }

/* Design wall: eight purposes at a glance, plus every collection with its count. */
.design-purposes { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 26px; }
.design-purposes a { display:inline-flex; align-items:center; gap:7px; min-height:34px; padding:0 12px; border-radius:999px; box-shadow:inset 0 0 0 1px var(--hair-strong); color:var(--text); font-size:13px; transition:box-shadow 140ms ease,color 140ms ease; }
.design-purposes a:hover { box-shadow:inset 0 0 0 1px var(--ink); color:var(--ink); }
.design-purposes span { color:var(--muted); font-size:11.5px; font-variant-numeric:tabular-nums; }
.design-wall { grid-template-columns:repeat(4,minmax(0,1fr)); gap:24px 18px; }
.design-wall .design-screen { border-radius:9px; }
.design-wall .design-name { font-size:15px; }
.design-wall .design-kind { font-size:12px; }
@media(max-width:1000px){ .design-wall { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:720px){
 .design-purposes { flex-wrap:nowrap; overflow-x:auto; margin-inline:calc(var(--gutter,18px) * -1); padding-inline:var(--gutter,18px); scrollbar-width:none; }
 .design-purposes::-webkit-scrollbar { display:none; }
 .design-purposes a { flex:none; }
 .design-wall { grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px 12px; }
 .design-wall .design { grid-template-columns:minmax(0,1fr); }
 .design-wall .design-kind { display:none; }
}

/* One quiet footnote style for the remaining honesty notes. */
.home-cases .stage-disclaimer { margin:12px 0 0; font-size:12px; }
@media(max-width:560px){ .home-cases .result-screen { max-height:none; } }
@media(max-width:520px){ .home-cases .prompt { min-height:0; } }
