/* DIY Attorney — mobile first. Designed and checked at 390px. */

:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #55504a;
  --rule: #e2ddd6;
  --accent: #1a56b8;
  --accent-ink: #ffffff;
  --code-bg: #f3f0ec;
  --code-ink: #24201c;
  --error-bg: #fdeceb;
  --error-ink: #8d2018;
  --draft-bg: #fff4d6;
  --draft-ink: #6b4e00;
  --radius: 8px;
  --measure: 36rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15140f;
    --surface: #1e1c17;
    --ink: #ece7df;
    --ink-soft: #a9a299;
    --rule: #332f29;
    --accent: #7aa7ef;
    --accent-ink: #11100c;
    --code-bg: #26231d;
    --code-ink: #e6e0d6;
    --error-bg: #3a1c19;
    --error-ink: #f3aaa2;
    --draft-bg: #3a2f10;
    --draft-ink: #f0d88a;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--surface);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
}

/* ---------- chrome ---------- */

.nav {
  padding: 1rem;
  border-bottom: 1px solid var(--rule);
}

.brand {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

main {
  flex: 1;
  width: 100%;
  max-width: 54rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.narrow {
  max-width: var(--measure);
}

.center {
  text-align: center;
}

footer {
  border-top: 1px solid var(--rule);
  padding: 1.25rem 1rem 2rem;
  color: var(--ink-soft);
  font-size: 0.8125rem;
}

footer p {
  margin: 0 0 0.5rem;
  max-width: 54rem;
  margin-inline: auto;
}

footer a {
  color: var(--ink-soft);
}

.disclaimer {
  opacity: 0.85;
}

/* ---------- type ---------- */

h1 {
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 2rem 0 0.5rem;
}

h3 {
  font-size: 1.0625rem;
  margin: 1.5rem 0 0.5rem;
}

p {
  margin: 0 0 1rem;
}

.lede {
  font-size: 1.0625rem;
  color: var(--ink-soft);
}

.small {
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.hint {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin: 0.5rem 0 1rem;
}

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

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2rem 0;
}

blockquote {
  margin: 1rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 3px solid var(--rule);
  color: var(--ink-soft);
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
}

.breadcrumb {
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.draft-flag {
  display: inline-block;
  background: var(--draft-bg);
  color: var(--draft-ink);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

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

.hero h1 {
  font-size: 2rem;
}

.cta-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-link {
  color: var(--accent);
}

/* ---------- forms ---------- */

form {
  margin: 1.5rem 0;
}

label {
  display: block;
  font-weight: 600;
  margin: 1rem 0 0.375rem;
}

input[type="text"],
input[type="email"],
input[type="tel"] {
  width: 100%;
  font: inherit;
  padding: 0.75rem;
  min-height: 44px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.check {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  font-weight: 400;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.check input {
  margin-top: 0.25rem;
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
}

form .btn {
  margin-top: 0.5rem;
  width: 100%;
}

/* ---------- notices ---------- */

.notice {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin: 1rem 0;
  font-size: 0.9375rem;
}

.notice-error {
  background: var(--error-bg);
  color: var(--error-ink);
}

.notice-error a {
  color: inherit;
}

/* ---------- video gate ---------- */

.video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.25rem 0 0.5rem;
}

.video-wrap iframe,
.video-wrap > div {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

#continue {
  width: 100%;
}

/* ---------- library ---------- */

.cards {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: grid;
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.125rem;
}

.card h2 {
  margin: 0 0 0.375rem;
  font-size: 1.125rem;
}

.card h2 a {
  text-decoration: none;
}

.card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.tip-nudge {
  margin-top: 2rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

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

.code-block {
  margin: 1.25rem 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--code-bg);
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.375rem 0.375rem 0.375rem 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.code-lang {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.copy-btn {
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  min-height: 36px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.copy-btn.copied {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

pre {
  margin: 0;
  padding: 0.875rem;
  overflow-x: auto;
}

pre code {
  font: 0.8125rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--code-ink);
  white-space: pre;
}

:not(pre) > code {
  font: 0.875em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 0.125em 0.375em;
  border-radius: 4px;
}

/* ---------- tip ---------- */

.qr {
  margin: 1.5rem auto 0.5rem;
  max-width: 220px;
}

.qr svg {
  width: 100%;
  height: auto;
  display: block;
  background: #ffffff;
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
}

/* ---------- wider screens ---------- */

@media (min-width: 40rem) {
  main {
    padding: 2.5rem 1.5rem 4rem;
  }

  h1 {
    font-size: 2rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  form .btn,
  #continue {
    width: auto;
    min-width: 14rem;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

