/* =====================================================
   Ligamina showcase — Swiss / International Typographic
   ===================================================== */

:root {
  --paper: #ffffff;
  --ink: #111111;
  --red: #e63312;
  --muted: #6f6f6f;
  --soft: #dcdcdc;
  --max: 1180px;
  --header-h: 64px;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  scroll-padding-top: var(--header-h);
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; background: none; border: 0; cursor: pointer; color: inherit; }
svg { display: block; }

::selection { background: var(--red); color: #fff; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

[v-cloak] { display: none !important; }

/* Both locales share one grid cell. The invisible layer still determines the
   cell's size, keeping line wrapping and surrounding layout stable on toggle. */
.i18n-text {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  vertical-align: baseline;
}

.i18n-text-block { display: grid; width: 100%; }

.i18n-layer {
  grid-area: 1 / 1;
  min-width: 0;
  visibility: hidden;
}

:lang(zh-CN) .i18n-layer[lang="zh-CN"],
:lang(en) .i18n-layer[lang="en"] { visibility: visible; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 36px);
}

section { scroll-margin-top: 0; }

/* ============ HEADER ============ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .06em;
}

.brand-mark { width: 13px; height: 13px; background: var(--red); }

.site-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  width: 420px;
  margin-left: auto;
}

.site-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  padding-bottom: 5px;
  border-bottom: 1px solid transparent;
  text-align: center;
  white-space: nowrap;
  opacity: .85;
  transition: color .15s ease, opacity .15s ease, border-color .15s ease;
}

.site-nav a:hover { color: var(--red); opacity: 1; }
.site-nav a.active { color: var(--red); border-color: var(--red); opacity: 1; }

.header-tools { display: flex; align-items: center; gap: 18px; }

.lang-switch { display: flex; align-items: baseline; }

.lang-switch button {
  font-size: 12px;
  letter-spacing: .08em;
  padding: 3px 2px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  transition: color .15s ease;
}

.lang-switch button.active { color: var(--red); border-color: var(--red); }

.lang-sep { color: #c9c9c9; margin: 0 5px; font-size: 12px; }

.gh-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  transition: color .15s ease;
}

.gh-link svg { display: block; width: 20px; height: 20px; }

.gh-link:hover { color: var(--red); }

/* ============ HERO ============ */

.page-view {
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  display: flex;
  flex-direction: column;
}

.page-view > .hero,
.page-view > .section { flex: 1; width: 100%; }

.screen-section {
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

@keyframes page-content-enter {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes page-visual-enter {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.screen-section.is-entered .hero-copy,
.screen-section.is-entered .section-head {
  animation: page-content-enter .82s cubic-bezier(.2, .7, .25, 1) both;
}

.screen-section.is-entered .about-copy .prose {
  animation: page-content-enter .82s cubic-bezier(.2, .7, .25, 1) .1s both;
}

.screen-section.is-entered .hero-figure,
.screen-section.is-entered .about-figure {
  animation: page-visual-enter .98s cubic-bezier(.2, .7, .25, 1) .1s both;
}

.features-section.is-entered .card.is-visible {
  animation: page-content-enter .82s cubic-bezier(.2, .7, .25, 1) both;
}

.features-section.is-entered .card.is-visible:nth-child(1) { animation-delay: .08s; }
.features-section.is-entered .card.is-visible:nth-child(2) { animation-delay: .16s; }
.features-section.is-entered .card.is-visible:nth-child(3) { animation-delay: .24s; }
.features-section.is-entered .card.is-visible:nth-child(4) { animation-delay: .32s; }
.features-section.is-entered .card.is-visible:nth-child(5) { animation-delay: .4s; }
.features-section.is-entered .card.is-visible:nth-child(6) { animation-delay: .48s; }

.screen-section.is-entered .arch-flowchart > *,
.screen-section.is-entered .steps > li {
  animation: page-content-enter .82s cubic-bezier(.2, .7, .25, 1) both;
}

.screen-section.is-entered .arch-flowchart > :nth-child(1),
.screen-section.is-entered .steps > :nth-child(1) { animation-delay: .06s; }
.screen-section.is-entered .arch-flowchart > :nth-child(2),
.screen-section.is-entered .steps > :nth-child(2) { animation-delay: .12s; }
.screen-section.is-entered .arch-flowchart > :nth-child(3),
.screen-section.is-entered .steps > :nth-child(3) { animation-delay: .18s; }
.screen-section.is-entered .arch-flowchart > :nth-child(4),
.screen-section.is-entered .steps > :nth-child(4) { animation-delay: .24s; }
.screen-section.is-entered .arch-flowchart > :nth-child(5) { animation-delay: .3s; }

.screen-section.is-entered .site-footer .container {
  animation: page-content-enter .82s cubic-bezier(.2, .7, .25, 1) .3s both;
}

/* the hero owns the entire first screen; everything else waits below the fold */
.hero {
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 0 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--muted);
  margin-bottom: 28px;
}

.kicker::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--red);
  flex: none;
}

.hero-title {
  /* cap sized so the title never bleeds into the figure column */
  font-size: clamp(48px, 10.5vw, 132px);
  line-height: .9;
  letter-spacing: -.04em;
  font-weight: 700;
}

.accent { color: var(--red); }

.hero-tagline {
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 700;
  line-height: 1.35;
  margin-top: 28px;
  max-width: 34ch;
}

.hero-sub {
  color: var(--muted);
  max-width: 56ch;
  line-height: 1.75;
  margin-top: 16px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

.btn {
  display: inline-block;
  border: 1px solid var(--ink);
  padding: 14px 24px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 600;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.btn:hover { background: var(--ink); color: var(--paper); }

.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }

.btn-primary:hover { background: var(--ink); border-color: var(--ink); }

.hero-figure { justify-self: end; width: 100%; max-width: 440px; }

.net { width: 100%; height: auto; font-family: inherit; }

/* node orbits are driven by JS (app.js) — CORE stays fixed while the
   three hosts circle it on three different radial sine waves */

/* ============ SECTIONS ============ */

.section { padding: 72px 0 24px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 24px;
  border-top: 2px solid var(--ink);
  padding-top: 20px;
  margin-bottom: 44px;
}

.sec-no {
  font-size: 13px;
  font-weight: 700;
  color: var(--red);
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
}

.section-head h1,
.section-head h2 {
  flex: 1;
  min-width: 0;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -.02em;
  font-weight: 700;
  line-height: 1.1;
}

.section-head h1 .i18n-text,
.section-head h2 .i18n-text { display: grid; width: 100%; }

/* --- about prose --- */

.about-section.section {
  display: flex;
  align-items: center;
  padding: clamp(40px, 5vh, 72px) 0;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  align-items: center;
  gap: clamp(36px, 6vw, 84px);
  width: 100%;
}

.about-copy { min-width: 0; }

.about-section .section-head { margin-bottom: 30px; }

.about-section .prose p {
  max-width: 62ch;
  margin-bottom: 16px;
}

/* --- centered feature page --- */

.features-section.section {
  display: flex;
  flex-direction: column;
  padding: clamp(40px, 5vh, 72px) 0;
}

.features-section > .container {
  width: 100%;
  margin-block: auto;
}

.features-section .section-head {
  display: block;
  position: relative;
  text-align: center;
}

.features-section .section-head .sec-no {
  position: absolute;
  top: 20px;
  left: 0;
}

.features-section .section-head h1 {
  width: 100%;
  text-align: center;
}

.features-section .card { text-align: center; }

.features-section .card p {
  max-width: 34ch;
  margin-inline: auto;
}

.about-figure {
  width: 100%;
  max-width: 560px;
  margin: 0;
  justify-self: end;
}

.about-diagram { width: 100%; height: auto; overflow: visible; }

.about-grid path {
  fill: none;
  stroke: #e8e8e8;
  stroke-width: 1;
  stroke-dasharray: 2 8;
}

.about-connectors path {
  fill: none;
  stroke: #a9a9a9;
  stroke-width: 1.5;
}

.about-connectors circle { fill: var(--red); }

.about-hosts rect {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.4;
}

.about-micro {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.2px;
}

.about-host-name {
  fill: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .8px;
}

.about-core circle:first-child { fill: var(--red); }

.about-core-ring {
  fill: none;
  stroke: var(--red);
  stroke-width: 1.5;
  stroke-dasharray: 2 7;
  opacity: .55;
}

.about-core-kicker,
.about-core-name,
.about-core-meta {
  fill: var(--paper);
  text-anchor: middle;
}

.about-core-kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.7px;
}

.about-core-name { font-size: 16px; font-weight: 700; letter-spacing: .5px; }

.about-core-meta {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.3px;
  opacity: .78;
}

.about-output rect {
  fill: #f7f7f7;
  stroke: #d4d4d4;
  stroke-width: 1.2;
}

.about-output-title {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
}

.about-output-code {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
}

.about-check {
  fill: none;
  stroke: var(--red);
  stroke-width: 2;
}

.about-diagram-caption {
  fill: var(--ink);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.3px;
}

.about-diagram-index {
  fill: var(--red);
  font-family: var(--mono);
  font-size: 10px;
}

.prose p {
  max-width: 68ch;
  line-height: 1.8;
  color: #222;
  margin-bottom: 18px;
  font-size: 16px;
}

.prose code, .step-desc code {
  font-family: var(--mono);
  font-size: .88em;
  background: #f2f2f2;
  border: 1px solid #e3e3e3;
  padding: 1px 6px;
  white-space: nowrap;
}

.prose em { font-style: normal; border-bottom: 2px solid var(--red); }

/* --- feature cards --- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 44px;
  row-gap: 52px;
}

.card { border-top: 1px solid var(--ink); padding-top: 20px; }

.card-no {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--red);
  letter-spacing: .08em;
}

.card h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 12px 0 10px;
  letter-spacing: -.01em;
}

.card p { font-size: 14px; color: var(--muted); line-height: 1.75; }

.card:hover h3 { color: var(--red); transition: color .15s ease; }

/* --- architecture --- */

.arch-flowchart { display: grid; }

.tier-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--muted);
  margin-bottom: 12px;
}

.tier-grid { display: grid; gap: 16px; }

.tier-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.tier-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.node {
  border: 1px solid var(--ink);
  padding: 20px;
  font-weight: 600;
  font-size: 15px;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.arch-flow-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 0;
}

.arch-flow-direction {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 16px;
  border-left: 2px solid var(--red);
  background: #f5f5f5;
  color: #414141;
  font-size: 12px;
  line-height: 1.45;
}

.flow-arrow {
  flex: none;
  color: var(--red);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.arch-core {
  padding: clamp(20px, 3vw, 32px);
  background: var(--ink);
  color: var(--paper);
}

.arch-core-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.core-eyebrow {
  color: #ff795f;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.arch-core-head h3 { font-size: 22px; line-height: 1.2; }

.core-summary {
  max-width: 52ch;
  color: #c5c5c5;
  font-size: 13px;
  line-height: 1.6;
}

.arch-components {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.arch-component {
  min-height: 128px;
  padding: 15px 16px;
  border: 1px solid #555;
  background: #191919;
}

.arch-component-no {
  display: block;
  color: #ff795f;
  font-family: var(--mono);
  font-size: 11px;
  margin-bottom: 10px;
}

.arch-component h4 { font-size: 14px; line-height: 1.35; }

.arch-component p {
  margin-top: 7px;
  color: #b5b5b5;
  font-size: 12px;
  line-height: 1.55;
}

.node-meta { font-size: 12px; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }

.node-host { min-height: 92px; border-top: 2px solid var(--red); }

.arch-note { margin-top: 16px; font-size: 13px; color: var(--muted); }

/* --- quick start --- */

.steps li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--soft);
}

.steps li:first-child { border-top: 0; padding-top: 0; }

.step-no {
  font-size: 26px;
  font-weight: 700;
  color: var(--red);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

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

.step-body h3 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }

.step-desc { font-size: 14px; color: var(--muted); margin-top: 6px; max-width: 64ch; }

.code-block {
  position: relative;
  max-width: 720px;
  margin-top: 14px;
  background: var(--ink);
  color: #f5f5f5;
}

.code-copy {
  position: absolute;
  top: 10px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, .4);
  color: inherit;
  font-size: 12px;
  line-height: 1.2;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.code-copy:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.code-copy svg { width: 14px; height: 14px; flex: 0 0 auto; }

.code {
  background: transparent;
  color: inherit;
  padding: 44px 20px 16px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.8;
  overflow-x: auto;
  direction: ltr;
  margin-top: 0;
  max-width: none;
}

.code code { font-family: inherit; }

/* ============ FOOTER ============ */

.site-footer {
  background: var(--ink);
  color: var(--paper);
  margin-top: 0;
  padding: 56px 0 32px;
}

.footer-title {
  font-size: clamp(52px, 10vw, 120px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: .9;
}

.site-footer .accent { color: var(--red); }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 40px;
  margin-top: 34px;
}

.footer-links a {
  font-size: 14px;
  font-weight: 600;
  color: var(--paper);
  border-bottom: 1px solid rgba(255, 255, 255, .35);
  padding-bottom: 3px;
  transition: color .15s ease, border-color .15s ease;
}

.footer-links a:hover { color: var(--red); border-color: var(--red); }

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, .25);
  margin-top: 36px;
  padding-top: 18px;
  font-size: 12px;
  color: #b5b5b5;
}

/* ============ ZH TYPOGRAPHY TWEAKS ============ */

.section-head h1 .i18n-layer[lang="zh-CN"],
.section-head h2 .i18n-layer[lang="zh-CN"],
.card h3 .i18n-layer[lang="zh-CN"],
.step-body h3 .i18n-layer[lang="zh-CN"] { letter-spacing: 0; }

.prose .i18n-layer[lang="zh-CN"],
.hero-sub .i18n-layer[lang="zh-CN"],
.card p .i18n-layer[lang="zh-CN"] { line-height: 1.9; }

/* Keep the same line measure for both localized hero taglines. */
.hero-tagline { max-width: 34ch; }

.kicker .i18n-layer[lang="zh-CN"],
.tier-label .i18n-layer[lang="zh-CN"] { letter-spacing: .12em; }

/* ============ RESPONSIVE ============ */

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure { order: -1; justify-self: start; max-width: 380px; }
  .about-layout { gap: 32px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .arch-components { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  :root { --header-h: 96px; }
  .site-header-inner {
    height: var(--header-h);
    flex-wrap: wrap;
    justify-content: space-between;
    align-content: center;
    gap: 0;
  }
  .brand { order: 1; }
  .header-tools { order: 2; gap: 10px; }
  .site-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    order: 3;
    width: 100%;
    gap: clamp(4px, 1vw, 8px);
    margin-left: 0;
    padding-top: 5px;
  }
  .site-nav a { font-size: 10px; letter-spacing: .06em; }
  .about-layout { grid-template-columns: 1fr; gap: 28px; }
  .about-section.section { padding: 32px 0; }
  .about-figure { justify-self: center; max-width: 420px; }
  .about-section .section-head { margin-bottom: 18px; }
  .about-section .prose p { font-size: 15px; line-height: 1.65; margin-bottom: 12px; }
  .about-section .prose .i18n-layer[lang="zh-CN"] { line-height: 1.6; }
  .tier-grid.cols-2, .tier-grid.cols-3 { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; row-gap: 40px; }
}

@media (max-width: 640px) {
  .site-header-inner { gap: 0; }
  .header-tools { gap: 8px; }
  .gh-link { width: 34px; height: 34px; }
  .gh-link svg { width: 18px; height: 18px; }
  .lang-switch button, .lang-sep { font-size: 11px; }
  .site-nav a { font-size: clamp(8px, 2vw, 9px); letter-spacing: 0; }
  .arch-flow-pair, .arch-components { grid-template-columns: 1fr; }
  .about-layout { gap: 12px; }
  .about-section.section { padding: 24px 0; }
  .about-section .section-head { margin-bottom: 14px; }
  .about-section .prose p { font-size: 14px; line-height: 1.55; margin-bottom: 10px; }
  .about-section .prose .i18n-layer[lang="zh-CN"] { line-height: 1.55; }
  .about-figure { max-width: 310px; }
  .about-micro { font-size: 12px; }
  .about-host-name { font-size: 18px; }
  .about-output-title { font-size: 16px; }
  .about-output-code { font-size: 10px; }
  .arch-core-head { align-items: stretch; flex-direction: column; gap: 10px; }
  .core-summary { width: 100%; }
  .steps li { grid-template-columns: 44px minmax(0, 1fr); gap: 16px; }
  .hero-actions .btn { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
