/* skemo.net landing page: layout and components. Fonts, colours, header, buttons and footer: brand.css. */

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.lead { font-size: 1.15rem; line-height: 1.6; color: var(--ink-2); max-width: 44em; }
p { margin: 0 0 1em; }
h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.45rem); letter-spacing: -0.03em; }
h3 { font-size: 1.05rem; letter-spacing: -0.01em; }

/* Sections */
section { padding: 88px 0; }
section + section { border-top: 1px solid var(--line); }
section.alt { background: var(--bg-2); }
.section-head { max-width: 46em; margin-bottom: 40px; }

/* Hero: a dotted plane, like the canvas a diagram is laid on */
.hero { position: relative; padding: 84px 0 72px; overflow: hidden;
        background-image: radial-gradient(var(--dots) 1px, transparent 1.2px); background-size: 22px 22px; }
.hero::after { content: ""; position: absolute; inset: auto -10% -40% 40%; height: 70%; pointer-events: none;
               background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 14%, transparent), transparent); }
.hero .wrap { position: relative; z-index: 1; }
.hero h1 em { font-style: normal; color: var(--accent-ink); }
.hero .lead { font-size: 1.2rem; margin-top: 8px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 30px 0 0; }
.install-line { display: inline-flex; align-items: center; gap: 10px; margin-top: 22px; padding: 8px 14px; border-radius: 10px;
                background: var(--surface); border: 1px solid var(--line); font: .82rem/1.4 var(--mono); color: var(--ink-2); max-width: 100%; overflow-x: auto; white-space: nowrap; }
.install-line b { color: var(--accent-ink); font-weight: 400; }

/* A window: the frame around a rendered diagram */
.window { margin-top: 52px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.window-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2);
              font: .78rem/1 var(--mono); color: var(--muted); }
.window-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.window-bar span { margin-left: 8px; }
.window .diagram { padding: 20px; }

/* Diagrams: rendered by skemo, light and dark versions */
.diagram { margin: 0; overflow-x: auto; }
.diagram svg { display: block; width: 100%; height: auto; margin: 0 auto; border-radius: 8px; }

.pair { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: stretch; }
.pair > * { min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.panel .label { padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.panel .diagram { padding: 18px; margin: auto 0; }
.panel .code { border-radius: 0; flex: 1; }
.panel .note { padding: 10px 16px; border-top: 1px solid var(--line); font-size: .88rem; color: var(--muted); margin: 0; }
.code { margin: 0; padding: 18px 20px; font-size: .84rem; }
.label { font: 500 .74rem/1.3 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0; }

/* What you can draw: one tile per documentation page */
.draw { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.draw a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
          text-decoration: none; color: var(--ink); min-width: 0; transition: border-color .15s, transform .15s; }
.draw a:hover { border-color: var(--accent); transform: translateY(-1px); }
.draw strong { display: flex; align-items: center; gap: 10px; font-size: 1rem; }
.draw strong svg { width: 18px; height: 18px; stroke: var(--accent-ink); flex: none; }
.draw span { display: block; color: var(--muted); font-size: .9rem; margin-top: 5px; }

/* Why skemo */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line);
        border-radius: var(--radius-lg); overflow: hidden; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; background: none; border: 0; border-radius: 0; overflow: visible; }
.grid > * { min-width: 0; }
.tile { background: var(--surface); padding: 26px; }
.tile p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.tile h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tile h3 svg { width: 20px; height: 20px; stroke: var(--accent-ink); flex: none; }

/* Key figures */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 8px; }
.figure { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.figure b { display: block; font-size: 2.3rem; line-height: 1.05; letter-spacing: -0.04em; color: var(--ink); margin-bottom: 6px; }
.figure span { color: var(--muted); font-size: .9rem; }

/* Token chart */
.chart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; margin-top: 24px; }
.legend { display: flex; gap: 20px; flex-wrap: wrap; font-size: .88rem; color: var(--ink-2); margin-bottom: 16px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.swatch.skemo, .bar.skemo { background: var(--accent); }
.swatch.svg, .bar.svg { background: var(--line-2); }
.bar-row { display: grid; grid-template-columns: 6.5em minmax(0, 1fr) 11em; gap: 12px; align-items: center; padding: 5px 6px; border-radius: 6px; }
.bar-row:hover, .bar-row:focus { background: var(--bg); outline: none; }
.bar-name { font: .82rem var(--mono); color: var(--ink-2); }
.bar-track { display: flex; flex-direction: column; gap: 3px; }
.bar { display: block; height: 8px; border-radius: 0 4px 4px 0; min-width: 3px; }
.bar-value { font-size: .84rem; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.table-view { margin-top: 16px; font-size: .9rem; }
.table-view summary { cursor: pointer; color: var(--accent-ink); font-weight: 500; }
table { border-collapse: collapse; width: 100%; margin-top: 12px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; }
tfoot td { font-weight: 700; }

/* A diagram and its source as two tabs (radio buttons, no script) */
.tabbed > input { position: absolute; opacity: 0; pointer-events: none; }
.tabbed > label { display: inline-block; padding: 4px 12px; margin: 0 2px 12px 0; border: 1px solid var(--line); border-radius: 8px;
                  font-size: .82rem; font-weight: 500; color: var(--muted); background: var(--surface-2); cursor: pointer; }
.tabbed > input:checked + label { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.tabbed > input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.tabbed > .t-fig:checked ~ .p-src, .tabbed > .t-src:checked ~ .p-fig { display: none; }

.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.gallery figure { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; margin: 0; min-width: 0; }
.gallery figure.wide { grid-column: 1 / -1; }
.gallery figcaption { font-size: .88rem; color: var(--muted); padding: 10px 4px 0; }
.gallery figcaption a { font-weight: 500; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 16px; max-width: 52em; }
.steps li { counter-increment: step; position: relative; padding-left: 48px; min-width: 0; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%;
                    border: 1px solid var(--accent); color: var(--accent-ink); font: 500 .85rem/28px var(--mono); text-align: center; }
.steps .code { margin-top: 10px; }

.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; max-width: 52em; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.02rem; }
.faq details p { margin: 12px 0 0; color: var(--ink-2); }

@media (max-width: 900px) {
  section { padding: 60px 0; }
  .pair, .grid, .grid.two, .gallery, .draw { grid-template-columns: minmax(0, 1fr); }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bar-row { grid-template-columns: 5.5em minmax(0, 1fr); }
  .bar-value { grid-column: 2; text-align: left; }
  .diagram svg.wide { min-width: 560px; }   /* wide diagrams scroll sideways instead of shrinking to illegible */
}

/* A section's lead paragraph sits above its content */
.wrap > .lead { margin-bottom: 40px; }
