/* advocate.jlg — ideas funnel for the transition.
   Editorial serif, narrow measure, purple structure + green action.
   One restrained system: type scale, soft depth, quiet motion. */

:root {
  /* Surfaces */
  --paper:      #f5f4f8;   /* cool off-white — page */
  --surface:    #ffffff;   /* raised neutral — inputs, cards, panels */
  --paper-edge: #ebe9f1;   /* faint wash for grouped blocks */

  /* Ink + accents */
  --ink:        #221646;   /* deep purple — body text */
  --ink-soft:   #3a2c63;   /* secondary headings */
  --purple:     #4a2fb0;   /* purple accent — links, structure */
  --purple-2:   #5b3fd6;   /* lighter purple — hover, focus ring */
  --green:      #0a7a2e;   /* green accent — actions, confirms */
  --green-deep: #075f23;   /* green hover */
  --green-soft: #e8f3ec;   /* soft green wash */
  --green-edge: #bfdfca;   /* green hairline */
  --muted:      #56506e;   /* secondary text — tuned to ~5:1 on paper */
  --rule:       #dcdbe4;   /* neutral hairline */

  /* Depth */
  --shadow-sm:  0 1px 2px rgba(34, 22, 70, 0.06);
  --shadow-md:  0 2px 8px rgba(34, 22, 70, 0.08);
  --shadow-lg:  0 10px 28px rgba(34, 22, 70, 0.12);

  /* Type */
  --serif: "Newsreader", Georgia, "Times New Roman", Times, serif;
  --measure: 38rem;       /* reading column */
  --wide:    66rem;       /* card-grid column */

  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  font-optical-sizing: auto;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--measure); margin: 0 auto; padding: 3rem 1.3rem 4.5rem; }

/* ---- Masthead / nameplate ------------------------------------------------ */
.masthead {
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 0.7rem;
  margin-bottom: 2rem;
}
.masthead h1 {
  font-size: 2rem; font-weight: 500; line-height: 1.1;
  margin: 0; letter-spacing: -0.01em; color: var(--ink);
}
.masthead .sub {
  font-size: 1rem; color: var(--muted); margin-top: 0.25rem;
  font-style: italic;
}
nav.bar { font-size: 0.95rem; margin-top: 0.9rem; display: flex; gap: 1.4rem; }
nav.bar a { text-decoration: none; color: var(--muted); border-bottom: 1px solid transparent; padding-bottom: 1px; }
nav.bar a:hover { color: var(--purple); border-bottom-color: var(--purple); }
nav.bar a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ---- Text ---------------------------------------------------------------- */
a { color: var(--purple); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; transition: color 0.15s var(--ease); }
a:visited { color: var(--purple); }
a:hover { color: var(--green); }

main p { margin: 0.85rem 0; }
.lead { font-size: 1.18rem; line-height: 1.55; color: var(--ink); margin: 0 0 1.2rem; }

h2 { font-size: 1.3rem; font-weight: 600; margin: 2.4rem 0 0.6rem; color: var(--ink-soft); letter-spacing: -0.005em; }
h3 { font-size: 1.1rem; font-weight: 600; margin: 1.2rem 0 0.3rem; color: var(--ink); }

.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.2rem 0; }

/* The call-to-action row on the landing page */
.cta {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 1.05rem; font-weight: 600;
  background: var(--green); color: #fff; text-decoration: none;
  padding: 0.7rem 1.4rem; border-radius: 8px;
  box-shadow: var(--shadow-sm); transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}
.cta:visited { color: #fff; }
.cta:hover { background: var(--green-deep); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.cta .arrow { transition: transform 0.2s var(--ease); }
.cta:hover .arrow { transform: translateX(3px); }

/* "How it works" steps on the landing page */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 1rem 0 0; }
.steps li {
  counter-increment: step; position: relative;
  padding: 0.55rem 0 0.55rem 2.4rem; border-bottom: 1px solid var(--rule);
  color: var(--ink); font-size: 0.98rem;
}
.steps li:last-child { border-bottom: 0; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0.5rem;
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--paper-edge); color: var(--purple);
  font-size: 0.82rem; font-weight: 600; line-height: 1.6rem; text-align: center;
}

/* ---- Forms --------------------------------------------------------------- */
label { display: block; font-weight: 600; margin: 1.3rem 0 0.35rem; font-size: 0.95rem; color: var(--ink-soft); }
input[type=text], input[type=email], textarea, select {
  width: 100%; font-family: inherit; font-size: 1rem;
  padding: 0.6rem 0.7rem; border: 1px solid var(--rule);
  background: var(--surface); color: var(--ink); border-radius: 7px;
  box-shadow: inset 0 1px 2px rgba(34, 22, 70, 0.04);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--purple-2);
  box-shadow: 0 0 0 3px rgba(91, 63, 214, 0.18);
}
textarea { min-height: 9rem; resize: vertical; line-height: 1.55; }

button, .btn {
  font-family: inherit; font-size: 1rem; font-weight: 600;
  padding: 0.6rem 1.4rem; margin-top: 1.3rem;
  background: var(--green); color: #fff; border: 1px solid var(--green);
  cursor: pointer; border-radius: 8px; box-shadow: var(--shadow-sm);
  transition: background 0.15s var(--ease), transform 0.1s var(--ease);
}
button:hover, .btn:hover { background: var(--green-deep); border-color: var(--green-deep); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.6; cursor: progress; }

/* idea / problem / both choice */
fieldset.choice { border: 0; padding: 0; margin: 1.3rem 0 0; }
fieldset.choice legend { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.5rem; padding: 0; color: var(--ink-soft); }
label.inline { display: flex; align-items: center; font-weight: 400; margin: 0.3rem 0; font-size: 1rem; cursor: pointer; }
label.inline input { width: auto; margin-right: 0.55rem; accent-color: var(--purple); }

/* honeypot — visually hidden, off to bots' delight */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* char counter */
.counter { font-size: 0.8rem; color: var(--muted); text-align: right; margin: 0.3rem 0 0; }

/* status lines */
#status, #gate-status { margin-top: 1rem; min-height: 1.2em; }
.error { color: #b21f14; font-weight: 600; }
.ok { color: var(--green); font-weight: 600; }

/* ---- Footer -------------------------------------------------------------- */
footer.site {
  margin-top: 3.5rem; border-top: 1px solid var(--rule);
  padding-top: 1rem; font-size: 0.85rem; color: var(--muted);
  text-align: center;
}

/* ---- Utilities ----------------------------------------------------------- */
.hidden { display: none !important; }
.tag { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }

/* ============================================================
   JLG proposal viewer
   ============================================================ */

/* Password gate */
.gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.gate-box {
  max-width: 380px; width: 100%; text-align: center;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 2.4rem 2rem 2rem;
  animation: rise 0.4s var(--ease) both;
}
.gate-box h1 { font-size: 1.7rem; font-weight: 500; margin: 0 0 0.3rem; color: var(--ink); }
.gate-box .gate-note { font-size: 0.85rem; color: var(--muted); margin: 0.2rem 0 1.2rem; }
.gate-box input[type=password] { text-align: center; margin-top: 0.4rem; }
.gate-box button { width: 100%; margin-top: 0.9rem; }
.gate-box .fine { font-size: 0.78rem; color: var(--muted); margin: 1.3rem 0 0; line-height: 1.5; }

/* The browse view gets a wider column than the reading pages */
body.page-cards #viewer.wrap { max-width: var(--wide); }

/* Filters */
.filters-wrap { margin: 1.4rem 0 0.4rem; }
.filter-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.9rem; margin: 0.3rem 0; }
.filter-row .filter-label {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); font-weight: 600; min-width: 4.5rem;
}
.filters button.chip-filter {
  font-family: inherit; font-size: 0.85rem; font-weight: 500;
  background: transparent; color: var(--muted); border: 1px solid transparent;
  padding: 0.15rem 0.6rem; margin: 0; border-radius: 999px; cursor: pointer;
  box-shadow: none; transition: all 0.12s var(--ease);
}
.filters button.chip-filter:hover { color: var(--ink); background: var(--paper-edge); }
.filters button.chip-filter[aria-pressed="true"] {
  color: #fff; background: var(--purple); border-color: var(--purple);
}
.viewer-meta { color: var(--muted); font-size: 0.9rem; margin: 0.6rem 0 0; }

/* Card grid */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.1rem; margin-top: 1.3rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--green);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  padding: 1.1rem 1.2rem 1.2rem;
  display: flex; flex-direction: column;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
  animation: rise 0.45s var(--ease) both;
  animation-delay: var(--d, 0ms);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card:target { box-shadow: 0 0 0 2px var(--purple-2), var(--shadow-md); }
.card h3 { margin: 0.55rem 0 0.4rem; color: var(--ink); font-size: 1.18rem; line-height: 1.25; font-weight: 600; }
.card .pitch { margin: 0.2rem 0 0.8rem; font-size: 1rem; }
.card p { font-size: 0.95rem; margin: 0.4rem 0; }
.card-foot { margin-top: auto; padding-top: 0.7rem; }

.card-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.chip {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;
  padding: 0.16rem 0.5rem; border-radius: 999px; white-space: nowrap;
}
.chip-topic { background: #ece6fb; color: var(--purple); border: 1px solid #d8ccf4; }
.chip-agency { background: var(--green-soft); color: var(--green-deep); border: 1px solid var(--green-edge); }
.card-label {
  font-weight: 600; font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--green); margin-right: 0.35rem;
}
.card-permalink {
  margin-left: auto; font-size: 0.95rem; text-decoration: none; color: var(--muted);
  opacity: 0; transition: opacity 0.15s var(--ease), color 0.15s var(--ease);
}
.card:hover .card-permalink, .card-permalink:focus { opacity: 1; }
.card-permalink:hover { color: var(--purple); }

.empty { color: var(--muted); font-style: italic; padding: 1.4rem 0; }

/* ---- "Read the full brief" trigger --------------------------------------- */
.brief-open {
  /* reset the global button styling — this is a quiet text link */
  background: none; border: 0; box-shadow: none; border-radius: 0;
  padding: 0; margin: 0.7rem 0 0; font: inherit; font-size: 0.9rem; font-weight: 600;
  color: var(--purple); cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.3rem;
}
.brief-open:hover { background: none; color: var(--green); }
.brief-open:focus-visible { outline: 2px solid var(--purple-2); outline-offset: 3px; border-radius: 3px; }
.brief-arrow { transition: transform 0.18s var(--ease); }
.brief-open:hover .brief-arrow { transform: translateX(3px); }

/* ---- Full-brief modal ----------------------------------------------------- */
body.modal-lock { overflow: hidden; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 12, 44, 0.55);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 1.1rem 3rem; overflow-y: auto;
  opacity: 0; transition: opacity 0.22s var(--ease);
}
.modal-backdrop.open { opacity: 1; }
.modal-backdrop[hidden] { display: none; }

.modal {
  background: var(--surface); width: 100%; max-width: 760px;
  border-radius: 16px; border-top: 4px solid var(--green);
  box-shadow: var(--shadow-lg);
  padding: 2rem 2.4rem 2.4rem; margin: auto;
  position: relative;
  transform: translateY(14px) scale(0.985);
  transition: transform 0.26s var(--ease);
}
.modal-backdrop.open .modal { transform: none; }
.modal:focus { outline: none; }

.modal-close {
  position: absolute; top: 0.7rem; right: 0.9rem;
  background: none; border: 0; box-shadow: none; border-radius: 6px;
  font-size: 1.7rem; line-height: 1; color: var(--muted);
  padding: 0.1rem 0.4rem; margin: 0; cursor: pointer;
}
.modal-close:hover { background: var(--paper-edge); color: var(--ink); }
.modal-close:focus-visible { outline: 2px solid var(--purple-2); outline-offset: 1px; }

.modal h2 {
  margin: 0.7rem 0 0.5rem; font-size: 1.7rem; font-weight: 600;
  line-height: 1.2; color: var(--ink); letter-spacing: -0.01em;
}
.modal-pitch { font-size: 1.18rem; line-height: 1.5; color: var(--ink-soft); margin: 0 0 1.1rem; }
.modal-meta {
  background: var(--green-soft); border: 1px solid var(--green-edge);
  border-radius: 9px; padding: 0.7rem 1rem; margin: 0 0 1.3rem;
}
.modal-meta p { font-size: 0.95rem; margin: 0.3rem 0; }
.modal-brief { max-width: 64ch; }
.modal-brief p { font-size: 1.04rem; line-height: 1.68; color: var(--ink); margin: 0 0 1rem; }
.modal-brief > :last-child { margin-bottom: 0; }
.modal-brief h3 { font-size: 1.18rem; font-weight: 600; color: var(--ink-soft); margin: 1.5rem 0 0.5rem; }
.modal-brief h4 { font-size: 1.02rem; font-weight: 600; color: var(--ink-soft); margin: 1.3rem 0 0.4rem; }
.modal-brief ul, .modal-brief ol { margin: 0.6rem 0 1rem; padding-left: 1.4rem; }
.modal-brief li { font-size: 1.02rem; line-height: 1.6; margin: 0.25rem 0; }
.modal-brief li::marker { color: var(--purple); }
.modal-brief strong { font-weight: 600; color: var(--ink); }
.modal-brief em { font-style: italic; }
.modal-brief a { color: var(--purple); text-decoration: underline; text-underline-offset: 2px; }
.modal-brief a:hover { color: var(--green); }
.modal-brief blockquote {
  margin: 1rem 0; padding: 0.4rem 0 0.4rem 1rem;
  border-left: 3px solid var(--green); color: var(--ink-soft); font-style: italic;
}
.modal-brief code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em;
  background: var(--paper-edge); padding: 0.1rem 0.35rem; border-radius: 4px;
}

/* Small confirmation dialog (submission received) */
#thanks { align-items: center; }   /* short dialog → vertically centered */
.modal.modal-sm { max-width: 440px; text-align: center; }
.modal-sm h2 { font-size: 1.4rem; margin: 0.3rem 0 0.5rem; }
.modal-sm p { margin: 0 auto; max-width: 32ch; }
.thanks-check {
  width: 3rem; height: 3rem; margin: 0.3rem auto 0.9rem; border-radius: 50%;
  background: var(--green-soft); border: 1px solid var(--green-edge); color: var(--green);
  display: flex; align-items: center; justify-content: center; font-size: 1.45rem; font-weight: 700;
}
.modal-sm .btn { margin-top: 1.3rem; }

@media (max-width: 520px) {
  .modal { padding: 1.6rem 1.3rem 1.8rem; border-radius: 12px; }
  .modal h2 { font-size: 1.45rem; }
  .modal-pitch { font-size: 1.08rem; }
}
@media (prefers-reduced-motion: reduce) {
  .modal-backdrop, .modal { transition: none; }
}

/* ---- Motion -------------------------------------------------------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---- Small screens ------------------------------------------------------- */
@media (max-width: 480px) {
  body { font-size: 17px; }
  .wrap { padding: 2rem 1.1rem 3.5rem; }
  .masthead h1 { font-size: 1.7rem; }
}
