/* Reticle guide.
 *
 * The palette is not invented. Every accent below is a SKY130 mask colour the
 * editor really renders, read off the shipped layer palette: poly red, diff
 * green, li1 amber, met1 blue, met2 magenta, nwell violet, on the canvas's own
 * near-black. A guide to a layout tool should be coloured by the layers.
 *
 * The display face is monospace on purpose. This product's own vocabulary is
 * monospace: layer names, DBU coordinates, the status bar, the command palette.
 * A serif display face would be someone else's guide. */

:root {
  /* substrate */
  --sub:        #090c11;
  --sub-panel:  #10151d;
  --sub-raised: #161d27;
  --rule:       #1f2833;
  --rule-soft:  #171e28;

  /* masks */
  --poly:  #e5484d;
  --diff:  #3fb950;
  --li1:   #e8a33d;
  --met1:  #4a90d9;
  --met2:  #d94a9c;
  --met3:  #3fbfa8;
  --nwell: #8b7ab8;

  /* ink */
  --ink:      #dbe2ec;
  --ink-mid:  #97a2b1;
  --ink-dim:  #6b7684;

  --mono: ui-monospace, "Cascadia Code", "SF Mono", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gut: clamp(1.25rem, 4vw, 3rem);
  --max: 1180px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--sub);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* The DBU lattice the canvas draws under every design. */
  background-image:
    linear-gradient(var(--rule-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule-soft) 1px, transparent 1px);
  background-size: 56px 56px, 56px 56px;
}

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gut); }

a { color: var(--li1); text-decoration-color: color-mix(in srgb, var(--li1) 40%, transparent); text-underline-offset: 3px; }
a:hover { color: #f5b95a; }

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

/* ---------- masthead ---------- */

.masthead {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.65rem var(--gut);
  background: color-mix(in srgb, var(--sub) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.82rem;
}
.masthead .mark { color: var(--ink); font-weight: 700; letter-spacing: -0.02em; }
.masthead .mark span { color: var(--poly); }
.masthead nav { display: flex; gap: 1.1rem; margin-left: auto; flex-wrap: wrap; }
.masthead nav a { color: var(--ink-mid); text-decoration: none; }
.masthead nav a:hover { color: var(--ink); }
.masthead .ver { color: var(--ink-dim); }

/* ---------- hero ---------- */

.hero { padding: clamp(3rem, 8vw, 6rem) 0 2rem; }
.hero h1 {
  font-family: var(--mono);
  font-size: clamp(2rem, 5.6vw, 3.9rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
  font-weight: 700;
  margin: 0 0 1.1rem;
  max-width: 20ch;
}
.hero h1 em { font-style: normal; color: var(--poly); }
.hero .lede { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--ink-mid); max-width: 62ch; margin: 0 0 2rem; }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--mono); font-size: 0.9rem; font-weight: 600;
  padding: 0.72rem 1.15rem; border-radius: 3px; text-decoration: none;
  border: 1px solid transparent; transition: transform .12s ease, background .12s ease;
}
.btn-primary { background: var(--poly); color: #14080a; }
.btn-primary:hover { background: #f2585d; color: #14080a; transform: translateY(-1px); }
.btn-ghost { border-color: var(--rule); color: var(--ink); background: var(--sub-panel); }
.btn-ghost:hover { border-color: var(--ink-dim); color: var(--ink); transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }

.shot {
  margin-top: 2.75rem;
  border: 1px solid var(--rule);
  border-radius: 5px;
  overflow: hidden;
  background: var(--sub-panel);
  box-shadow: 0 24px 70px -30px #000;
}
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption {
  font-family: var(--mono); font-size: 0.76rem; color: var(--ink-dim);
  padding: 0.6rem 0.9rem; border-top: 1px solid var(--rule);
}

/* ---------- the signature: a status-bar eyebrow, like the app's own ---------- */

.statusbar {
  display: flex; flex-wrap: wrap; align-items: stretch;
  font-family: var(--mono); font-size: 0.76rem;
  border: 1px solid var(--rule); border-radius: 4px;
  background: var(--sub-panel);
  margin: 0 0 1.75rem;
  overflow: hidden;
}
.statusbar span { padding: 0.42rem 0.85rem; border-right: 1px solid var(--rule); color: var(--ink-dim); white-space: nowrap; }
.statusbar span:last-child { border-right: 0; }
.statusbar .lead { color: var(--ink); font-weight: 700; }
.statusbar .swatch { display: inline-block; width: 9px; height: 9px; border-radius: 1px; margin-right: 0.45rem; vertical-align: -1px; }

section { padding: clamp(2.25rem, 4.5vw, 3.5rem) 0; border-top: 1px solid var(--rule-soft); }
section h2 {
  font-family: var(--mono); font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.035em; font-weight: 700; margin: 0 0 0.7rem;
}
section .intro { color: var(--ink-mid); max-width: 68ch; margin: 0 0 2.25rem; }

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

.grid { display: grid; gap: 1.1rem; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(265px, 1fr)); }
/* 440px floor keeps this to two columns at the content width, so a captured UI
 * clip stays large enough to actually read. At 330px it fell to three. */
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); }

.card {
  border: 1px solid var(--rule); border-radius: 5px;
  background: var(--sub-panel); padding: 1.35rem;
  transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: var(--ink-dim); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .card:hover { transform: none; } }
.card h3 { font-family: var(--mono); font-size: 1rem; margin: 0 0 0.5rem; letter-spacing: -0.02em; }
.card p { margin: 0; color: var(--ink-mid); font-size: 0.95rem; }
.card .tag {
  display: inline-block; font-family: var(--mono); font-size: 0.7rem;
  padding: 0.12rem 0.45rem; border-radius: 2px; margin-bottom: 0.7rem;
  border: 1px solid var(--rule);
}

/* media cards carry a captured GIF of the real UI */
.media { border: 1px solid var(--rule); border-radius: 5px; overflow: hidden; background: var(--sub-panel); }
.media img { display: block; width: 100%; height: auto; border-bottom: 1px solid var(--rule); }
.media .body { padding: 1.1rem 1.25rem 1.35rem; }
.media h3 { font-family: var(--mono); font-size: 0.98rem; margin: 0 0 0.4rem; }
.media p { margin: 0; color: var(--ink-mid); font-size: 0.92rem; }

/* ---------- code ---------- */

pre, code { font-family: var(--mono); }
pre {
  background: #06090d; border: 1px solid var(--rule); border-radius: 4px;
  padding: 1rem 1.15rem; overflow-x: auto; font-size: 0.86rem; line-height: 1.6;
  color: var(--ink); margin: 0 0 1rem;
}
pre .c { color: var(--ink-dim); }
pre .k { color: var(--li1); }
:not(pre) > code {
  background: var(--sub-raised); border: 1px solid var(--rule);
  padding: 0.1rem 0.35rem; border-radius: 3px; font-size: 0.88em; color: var(--ink);
}

/* ---------- tabs ---------- */

.tabs { display: flex; gap: 0.4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tab {
  font-family: var(--mono); font-size: 0.84rem; cursor: pointer;
  background: var(--sub-panel); color: var(--ink-mid);
  border: 1px solid var(--rule); border-radius: 3px; padding: 0.45rem 0.9rem;
}
.tab[aria-selected="true"] { color: var(--sub); background: var(--li1); border-color: var(--li1); font-weight: 700; }
.panel[hidden] { display: none; }

/* ---------- table ---------- */

.table-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: 5px; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; min-width: 560px; }
th, td { text-align: left; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--rule-soft); }
th { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-dim); background: var(--sub-panel); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
td.yes { color: var(--diff); font-family: var(--mono); }
td.no  { color: var(--ink-dim); font-family: var(--mono); }

/* ---------- notes ---------- */

.note {
  border-left: 2px solid var(--met1); background: var(--sub-panel);
  padding: 1rem 1.25rem; border-radius: 0 4px 4px 0; margin: 1.5rem 0;
  color: var(--ink-mid); font-size: 0.95rem;
}
.note strong { color: var(--ink); }
.note.warn { border-left-color: var(--li1); }
.note.limit { border-left-color: var(--poly); }

/* ---------- mermaid ---------- */

.diagram {
  border: 1px solid var(--rule); border-radius: 5px; background: var(--sub-panel);
  padding: 1.5rem 1rem; overflow-x: auto; margin: 0 0 1rem;
}
.diagram svg { display: block; margin-inline: auto; max-width: 100%; height: auto; }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--rule); padding: 2.5rem 0 4rem;
  font-family: var(--mono); font-size: 0.83rem; color: var(--ink-dim);
}
footer a { color: var(--ink-mid); }
footer .cols { display: flex; flex-wrap: wrap; gap: 2.5rem; }

/* ---------- reveal ---------- */

.reveal { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
