/* Adsmith — graphite workbench, one ember accent; the ads are the color. */
:root {
  --iron: #1b1d22;        /* chrome */
  --iron-2: #26292f;
  --bench: #eef0f2;       /* working canvas */
  --card: #ffffff;
  --ink: #17181c;
  --smoke: #6b6e76;
  --line: #d5d8dc;
  --ember: #e8542f;       /* the one accent */
  --ember-dark: #c23e1e;
  --ok: #2e7d4f;
  --warn: #b95000;
  --bad: #c22929;
  --display: "Avenir Next Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { background: var(--bench); }
body {
  margin: 0; font-family: var(--body); color: var(--ink);
  font-size: 1rem; line-height: 1.55; min-height: 100svh;
  display: flex; flex-direction: column;
}
:focus-visible { outline: 3px solid var(--ember); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── chrome ── */
.bar {
  background: var(--iron); color: #fff; display: flex; align-items: center;
  justify-content: space-between; padding: 0.7rem 1.2rem;
}
.wordmark {
  font-family: var(--display); font-weight: 700; letter-spacing: 0.22em;
  font-size: 1.15rem; color: inherit; text-decoration: none;
}
.wordmark span { color: var(--ember); }
.bar-right { display: flex; align-items: center; gap: 0.8rem; }
.chip {
  font-family: var(--mono); font-size: 0.8rem; background: var(--iron-2);
  border: 1px solid #3a3e46; border-radius: 999px; padding: 0.25rem 0.7rem;
}

.rail {
  list-style: none; display: flex; gap: 0; margin: 0; padding: 0 1.2rem;
  background: var(--iron); border-bottom: 3px solid var(--ember);
}
.rail li {
  font-family: var(--display); text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.85rem; color: #8b8f98; padding: 0.55rem 1.2rem 0.5rem 0;
}
.rail li b { font-weight: 700; margin-right: 0.35rem; }
.rail li.on { color: #fff; }
.rail li.on b { color: var(--ember); }

main { flex: 1; width: 100%; max-width: 68rem; margin: 0 auto; padding: 2rem 1.2rem 4rem; }
.foot {
  background: var(--iron); color: #8b8f98; font-size: 0.8rem;
  padding: 0.8rem 1.2rem; text-align: center;
}

/* ── step 1 ── */
h1 {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.02em; font-size: clamp(2rem, 5.5vw, 3.4rem);
  line-height: 1.02; margin: 1.2rem 0 0.6rem;
}
.lede { color: var(--smoke); max-width: 44rem; margin: 0 0 2rem; }
h2, h3 {
  font-family: var(--display); text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 700; margin: 0;
}
h2 { font-size: 1.5rem; }
h3 { font-size: 1.05rem; }

form#describe-form { max-width: 44rem; }
label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 1rem; }
.opt { color: var(--smoke); font-weight: 400; }
input, textarea {
  display: block; width: 100%; margin-top: 0.35rem; font: inherit;
  padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 6px;
  background: var(--card); color: var(--ink);
}
textarea { resize: vertical; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 40rem) { .two-col { grid-template-columns: 1fr; } }

.actions { display: flex; gap: 0.8rem; align-items: center; margin-top: 1.2rem; flex-wrap: wrap; }
.primary {
  font: 600 1rem var(--body); background: var(--ember); color: #fff;
  border: none; border-radius: 6px; padding: 0.75rem 1.5rem; cursor: pointer;
}
.primary:hover { background: var(--ember-dark); }
.primary[disabled] { opacity: 0.6; cursor: wait; }
.ghost-btn {
  font: 600 0.95rem var(--body); background: none; color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px; padding: 0.7rem 1.2rem; cursor: pointer;
}
.bar .ghost-btn { color: #fff; border-color: #3a3e46; }
.ghost-btn:hover { border-color: var(--smoke); }
.status { min-height: 1.4em; color: var(--smoke); font-size: 0.9rem; }
.status.err { color: var(--bad); }

/* ── step 2 knobs ── */
.workrow { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.knobs { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.knob { font-size: 0.8rem; font-weight: 600; margin: 0; }
.knob input { margin-top: 0.25rem; }
.knob input[type="color"] { padding: 0.15rem; width: 3rem; height: 2.4rem; }
#k-brand { width: 11rem; font-family: var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.ratio-knob span { display: block; margin-bottom: 0.25rem; }
.seg {
  font: 600 0.85rem var(--mono); border: 1px solid var(--line); background: var(--card);
  padding: 0.45rem 0.8rem; cursor: pointer;
}
.seg:first-of-type { border-radius: 6px 0 0 6px; }
.seg:last-of-type { border-radius: 0 6px 6px 0; margin-left: -1px; }
.seg.on { background: var(--iron); color: #fff; border-color: var(--iron); }
.palette-block { margin: 0.9rem 0 0.2rem; }
.palette-label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 0.35rem; }
.palette-row { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.swatch {
  width: 3.6rem; height: 2.1rem; border-radius: 6px; border: 2px solid var(--line);
  cursor: pointer; padding: 0;
  /* stripes painted via inline background gradient (paper | accent | coal) */
}
.swatch:hover { border-color: var(--smoke); }
.swatch.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--bench), 0 0 0 4px var(--ink); }
.palette-name { display: block; margin-top: 0.4rem; font-size: 0.8rem; color: var(--smoke); }
.knob select {
  display: block; margin-top: 0.25rem; font: inherit; padding: 0.5rem 0.6rem;
  border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink);
}
.hint a { color: inherit; }
.hint { color: var(--smoke); font-size: 0.9rem; margin: 0.3rem 0 1.2rem; max-width: 46rem; }

/* ── tiles ── */
.tile-row {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1.3rem; align-items: start;
}
@media (max-width: 40rem) { .tile-row { grid-template-columns: 1fr 1fr; gap: 0.8rem; } }

.tile-wrap { container-type: inline-size; }

/* the ad tile: all internal sizes in cqw so it renders identically at any width,
   on the page and in the PNG export (see exportTile in app.js) */
.tile {
  aspect-ratio: 4 / 5; border-radius: 2.2cqw; overflow: hidden;
  display: flex; flex-direction: column; padding: 6.2cqw 5.8cqw 5.3cqw;
  border: 1px solid var(--line);
}
.tile.sq { aspect-ratio: 1 / 1; }
.tile .t-eyebrow { font-family: var(--t-body, var(--body)); font-size: 3.6cqw; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 2.7cqw; }
.tile .t-headline { font-family: var(--t-display, var(--body)); font-weight: var(--t-display-weight, 300); font-size: 7.2cqw; line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 2.2cqw; text-wrap: balance; }
.tile .t-body { font-family: var(--t-body, var(--body)); font-size: 4.2cqw; line-height: 1.45; margin: 0; }
.tile .t-foot { margin-top: auto; padding-top: 4cqw; }
.tile .t-tagline { font-family: var(--t-body, var(--body)); font-size: 3.6cqw; margin: 0; }
.tile .t-lockup { font-size: 3.6cqw; font-weight: 600; letter-spacing: 0.14em; margin: 1.6cqw 0 0; text-transform: uppercase; }

/* editing affordances */
.tile [contenteditable] { outline: none; border-radius: 2px; cursor: text; }
.tile [contenteditable]:hover { box-shadow: 0 0 0 1px var(--ember); }
.tile [contenteditable]:focus { box-shadow: 0 0 0 2px var(--ember); }

/* gauges under each tile */
.gauges { margin: 0.5rem 0 0; font-family: var(--mono); font-size: 0.72rem; color: var(--smoke); }
.gauge { display: flex; align-items: center; gap: 0.5rem; padding: 0.1rem 0; }
.gauge .g-name { width: 5.5rem; }
.gauge .g-bar { flex: 1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.gauge .g-fill { height: 100%; background: var(--ok); width: 0%; }
.gauge.warn .g-fill { background: var(--warn); }
.gauge.over .g-fill { background: var(--bad); }
.gauge .g-count { width: 3.4rem; text-align: right; }
.gauge.over .g-count { color: var(--bad); font-weight: 700; }

.ground-pick { margin-top: 0.4rem; display: flex; gap: 0.4rem; }
.ground-dot { width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.ground-dot.on { border-color: var(--ink); }

/* watermark + capture deterrence for signed-out preview */
.tile-locked { position: relative; user-select: none; -webkit-user-select: none; }
.tile-locked .tile * { user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.tile-locked::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 2.2cqw;
  background-image: repeating-linear-gradient(-32deg,
    transparent 0 5.5cqw,
    rgba(127,127,127,0.28) 5.5cqw 5.6cqw);
}
.tile-locked .wm {
  position: absolute; inset: 0; display: grid; place-content: center; pointer-events: none;
  transform: rotate(-32deg); font-family: var(--mono); font-weight: 700;
  font-size: 5cqw; letter-spacing: 0.3em; color: rgba(127,127,127,0.55);
  text-transform: uppercase; white-space: nowrap;
}

/* step 3 */
.balance { font-family: var(--mono); font-size: 0.9rem; }
.dl-row { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.dl-btn {
  font: 600 0.8rem var(--mono); border: 1px solid var(--line); background: var(--card);
  border-radius: 6px; padding: 0.45rem 0.7rem; cursor: pointer;
}
.dl-btn:hover { border-color: var(--ember); color: var(--ember); }
.titles-block { margin-top: 2rem; }
.titles-block ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.titles-block li { margin: 0.3rem 0; }
.titles-block .len { font-family: var(--mono); font-size: 0.75rem; color: var(--smoke); }

/* modals */
dialog {
  border: none; border-radius: 10px; padding: 1.6rem;
  width: min(26rem, 92vw); box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}
dialog::backdrop { background: rgba(23,24,28,0.55); }
.modal-lede { color: var(--smoke); font-size: 0.9rem; margin: 0.3rem 0 1rem; }
.packs { display: grid; gap: 0.7rem; }
.pack {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  border: 1px solid var(--line); border-radius: 8px; padding: 0.8rem 1rem;
  cursor: pointer; background: var(--card); font: inherit; text-align: left; width: 100%;
}
.pack:hover { border-color: var(--ember); }
.pack b { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.06em; }
.pack .p-blurb { display: block; color: var(--smoke); font-size: 0.8rem; }
.pack .p-price { font-family: var(--mono); white-space: nowrap; }

/* ── landing page ── */
.landing .hero { padding-top: 1rem; }
.landing h1 { font-size: clamp(2.4rem, 7vw, 4.2rem); }
.hero-tiles { margin-top: 2.5rem; max-width: 58rem; }
.band { border-top: 1px solid var(--line); margin-top: 2.6rem; padding-top: 2rem; max-width: 46rem; }
.band h2 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.band p { color: var(--smoke); margin: 0.4rem 0 0; }
.band p b { color: var(--ink); }
.faq dl { margin: 1rem 0 0; }
.faq dt { font-weight: 600; margin-top: 1rem; }
.faq dd { margin: 0.2rem 0 0; color: var(--smoke); }
a.primary, a.ghost-btn { text-decoration: none; display: inline-block; }
