/* Page layout for wirewell.org. Tokens come from tokens.css, components from bundle.css. */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.wrap { max-width: var(--content-width); margin: 0 auto; padding: 0 var(--space-5); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--space-4); top: var(--space-4); z-index: 10; background: var(--surface-raised); padding: var(--space-2) var(--space-4); border-radius: var(--radius-md); }

/* Header and footer: full-width bars with content capped */
.ww-header { padding: 0; }
.ww-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding-top: var(--space-4); padding-bottom: var(--space-4); width: 100%; }
.ww-footer { padding-left: 0; padding-right: 0; }

/* Logo mark, inlined so it can use the theme tokens */
.mark-tile { fill: var(--panel); }
.mark-wire { stroke: var(--copper); }
.mark-dot { fill: var(--copper); }

/* Sections */
section.band { padding: var(--space-9) 0; }
section.band.sunken { background: var(--surface-sunken); }
@media (max-width: 720px) { section.band { padding: var(--space-8) 0; } }
.band h2 { margin: 0 0 var(--space-3); }
.band .intro { max-width: var(--measure); margin: 0 0 var(--space-7); color: var(--ink-muted); }
p { max-width: var(--measure); }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--space-7); align-items: center; padding: var(--space-8) 0 var(--space-9); }
.hero h1 { margin: var(--space-5) 0 var(--space-4); }
.hero .lead { margin: 0 0 var(--space-6); color: var(--ink); }
.hero .actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.hero-art { width: 100%; max-width: 480px; height: auto; justify-self: end; }
.art-panel { fill: var(--panel); }
.art-sw { fill: var(--on-panel-muted); }
.art-sw.live { fill: var(--signal-on-panel); }
.art-on { fill: var(--signal-on); }
.art-copper { fill: var(--copper); }
.art-tint { fill: var(--accent-soft); }
[data-theme="dark"] .art-panel { stroke: var(--line-strong); stroke-width: 1; }
.prose p { margin: 0 0 var(--space-4); }
.skeleton-row { height: 20px; margin: var(--space-3) 0; border-radius: var(--radius-sm); background: var(--surface-sunken); }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: var(--space-7); padding-top: var(--space-7); }
  .hero-art { justify-self: start; max-width: 360px; }
  .display { font-size: 44px; line-height: 48px; }
}

/* The problem */
.problem { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-7); align-items: center; }
.problem p { margin: 0 0 var(--space-4); }
@media (max-width: 860px) { .problem { grid-template-columns: 1fr; } }

/* Code sample */
.ww-code { margin: 0; }
.code-caption { margin: var(--space-5) 0 0; color: var(--ink-muted); }

/* Rule status line inside each tile */
.ww-rule .status { margin-top: var(--space-3); }
.ww-rule .ww-badge { font-size: 12px; padding: 2px 8px; }

/* Where it stands */
.status-list { margin: 0 0 var(--space-6); padding-left: var(--space-5); max-width: var(--measure); }
.status-list li { margin-bottom: var(--space-2); }
.status-list strong { font-weight: 650; }
p code, li code { font-family: var(--font-mono); font-size: 0.92em; font-weight: 500; background: var(--surface-sunken); padding: 1px 5px; border-radius: var(--radius-sm); }
.sunken p code, .sunken li code { background: var(--surface-raised); }

a { color: var(--accent); text-underline-offset: 3px; }

/* bundle.css only adds dark-mode borders for an explicit data-theme; repeat them for the OS setting */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ww-panel,
  :root:not([data-theme="light"]) .ww-footer { border-color: var(--line-strong); }
  :root:not([data-theme="light"]) .ww-footer { border-top: 1px solid var(--line-strong); }
  :root:not([data-theme="light"]) .ww-code-card { border: 1px solid var(--line); }
}

/* Get updates form */
.signup { display: grid; gap: var(--space-2); max-width: 520px; }
.signup label { font-weight: 650; margin-top: var(--space-3); }
.signup input, .signup textarea { font: inherit; color: var(--ink); background: var(--surface-raised); border: 1.5px solid var(--line-strong); border-radius: var(--radius-md); padding: var(--space-3); min-height: 44px; }
.signup textarea { resize: vertical; }
.signup .cf-turnstile { margin-top: var(--space-4); min-height: 65px; }
.signup .ww-btn { justify-self: start; margin-top: var(--space-3); }
.signup-note { color: var(--ink-muted); margin: var(--space-2) 0 0; }
.signup-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Read by screen readers, not shown: e.g. "(opens in a new tab)" */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
