/* roughout.co.uk marketing site — plain CSS, no framework/build step,
   matching the product's own no-build-step philosophy (see ../README.md).
   Reuses the app's own colour tokens (css/render/app.css, loaded before
   this file) for accents rather than inventing a separate site palette —
   the site and the tool should read as the same object. Site-only
   concerns (spacing, type scale, layout) get their own --site- prefixed
   tokens below so they never collide with the vendored render tokens. */

* {
  box-sizing: border-box;
}

:root {
  --site-max-width: 1080px;
  --site-gap: 1.5rem;
  --site-radius: 10px;
  --site-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --site-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--site-sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
}

a {
  color: var(--accent);
}

.wrap {
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Top nav ---------- */

.site-nav {
  border-bottom: 1px solid var(--border);
}

.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.site-nav .logo {
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--fg);
}

.site-nav .logo .dot {
  color: var(--border-blue);
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.site-nav a {
  text-decoration: none;
  color: var(--fg);
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--accent);
}

.site-nav .nav-cta {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border-radius: var(--site-radius);
  background: var(--border-blue);
  color: #fff !important;
  font-weight: 600;
}

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

.hero {
  padding: 4rem 0 2rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 1rem;
}

.hero .lede {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto 2rem;
}

.cta-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--site-radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid transparent;
}

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

.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--fg);
}

.btn-secondary[aria-disabled="true"] {
  color: var(--muted);
  cursor: default;
}

.cta-note {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Live demo ---------- */

.demo {
  padding: 1rem 0 4rem;
}

.demo-frame {
  border: 1px solid var(--border);
  border-radius: var(--site-radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--editor-bg);
}

.demo-hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.demo-editor,
.demo-preview {
  min-height: 320px;
}

.demo-editor textarea {
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: none;
  resize: none;
  padding: 1.25rem;
  font-family: var(--site-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  background: var(--editor-bg);
  color: var(--fg);
}

.demo-editor textarea:focus {
  outline: none;
}

.demo-preview {
  border-left: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  /* Sequence/gantt renderers size the <svg> to its actual content (no
     viewBox — see js/render/{sequence,gantt}-renderer.js), unlike
     diagram-renderer.js's freeform output which sets a matching viewBox
     and so scales cleanly to any box. Forcing width/height:100% on an
     svg with no viewBox clips it rather than scaling it (SVG's default
     overflow is hidden) — scrolling the *pane* instead, at the diagram's
     real size, keeps every mode legible instead of silently cropping the
     wider two. */
  overflow: auto;
}

/* Same two properties css/render/app.css's own #canvas rule sets — kept
   as a class here (not that id) since features.html embeds several
   demos on one page and ids must stay unique. See that rule's own
   comment for why user-select:none matters (stops a connector-drag
   gesture from triggering native text selection over shape labels). */
.demo-svg {
  display: block;
  user-select: none;
  -webkit-user-select: none;
}

.feature-intro {
  padding: 3rem 0 1rem;
  text-align: center;
}

.feature-intro h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  margin: 0 0 1rem;
}

.feature-intro .lede {
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.demo-section {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}

.demo-section .demo-copy {
  max-width: 640px;
  margin: 0 auto 1.5rem;
  text-align: center;
}

.demo-section h2 {
  margin: 0 0 0.5rem;
}

.demo-section .demo-copy p {
  color: var(--muted);
  margin: 0;
}

.philosophy {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.philosophy .wrap {
  max-width: 720px;
}

.philosophy h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}

.philosophy .point {
  margin-bottom: 1.5rem;
}

.philosophy .point h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.philosophy .point p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 720px) {
  .demo-frame {
    grid-template-columns: 1fr;
  }
  .demo-preview {
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

/* Gantt charts are inherently wide (a timeline), unlike the roughly
   square freeform/sequence examples — a 50/50 editor/preview split
   leaves too little room and forces horizontal scrolling even for a
   short example. Stack instead, so the preview gets the full width. */
.demo-frame.wide {
  grid-template-columns: 1fr;
}

.demo-frame.wide .demo-editor textarea {
  min-height: 160px;
}

.demo-frame.wide .demo-preview {
  border-left: none;
  border-top: 1px solid var(--border);
  justify-content: flex-start;
}

/* ---------- Value props ---------- */

.value-props {
  padding: 2rem 0 4rem;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--site-gap);
}

.value-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
}

.value-card p {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
}

@media (max-width: 720px) {
  .value-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Diagram types ---------- */

.diagram-types {
  padding: 2rem 0 4rem;
  border-top: 1px solid var(--border);
}

.diagram-types h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--site-gap);
}

.type-card {
  border: 1px solid var(--border);
  border-radius: var(--site-radius);
  padding: 1.25rem;
}

.type-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.type-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .type-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .type-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Mac app page ---------- */

.native-points {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}

.native-points h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.native-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--site-gap);
}

.native-grid .point h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.native-grid .point p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 640px) {
  .native-grid {
    grid-template-columns: 1fr;
  }
}

.mac-only {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}

.mac-only .wrap {
  max-width: 680px;
}

.mac-only h2 {
  margin-bottom: 0.5rem;
}

.mac-only .badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--border-purple);
  border: 1px solid var(--border-purple);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  margin-bottom: 0.75rem;
}

.code-block {
  background: var(--editor-bg);
  border: 1px solid var(--border);
  border-radius: var(--site-radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.code-block code {
  font-family: var(--site-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre;
  color: var(--fg);
}

.screenshot {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--site-radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  margin: 1.5rem 0 0.5rem;
  display: block;
}

/* ---------- Legal pages (terms/privacy) ---------- */

.legal {
  padding: 3rem 0 4rem;
}

.legal .wrap {
  max-width: 720px;
}

.legal h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  margin: 0 0 0.5rem;
}

.legal .updated {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 2rem;
}

.legal .draft-notice {
  background: var(--editor-bg);
  border: 1px solid var(--border);
  border-radius: var(--site-radius);
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.legal h2 {
  font-size: 1.15rem;
  margin: 2rem 0 0.75rem;
}

.legal p,
.legal li {
  color: var(--fg);
  font-size: 0.98rem;
}

.legal ul {
  padding-left: 1.25rem;
}

.legal a {
  color: var(--accent);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
}

.site-footer a {
  color: var(--muted);
}

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