/* ==========================================================================
   UrbanPyx design system — manuscript-inspired editorial
   Palette: Parchment / Ink / Rubric Red / Gold Leaf / Stone
   Rubrication rule: red is ONLY links, buttons, drop caps, eyebrows.
   ========================================================================== */

:root {
  --parchment: #FAF6EE;
  --ink: #1C1917;
  --rubric: #9B2226;
  --gold: #B8860B;
  --stone: #6B6258;
  --measure: 68ch;
  --max-width: 1100px;
}

* { box-sizing: border-box; border-radius: 0 !important; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 18px;
  line-height: 1.65;
}

/* ---------- Typography ---------- */

h1, h2, h3, .display {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
h3 { font-size: 1.25rem; }

p { max-width: var(--measure); }

a {
  color: var(--rubric);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 2px; }

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

.eyebrow {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rubric);
  margin: 0 0 0.9rem;
}

.meta, .caption {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13.5px;
  color: var(--stone);
  letter-spacing: 0.01em;
}

.standfirst {
  font-size: 1.15rem;
  color: var(--stone);
  max-width: var(--measure);
}

/* ---------- Layout ---------- */

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 3.5rem 0; }

.rule-gold {
  border: 0;
  border-top: 1px solid var(--gold);
  margin: 0;
}

.hairline { border: 0; border-top: 1px solid rgba(28, 25, 23, 0.18); margin: 0; }

/* ---------- Masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--gold);
  padding: 1.1rem 0;
}

.masthead .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}
.wordmark img { height: 34px; width: auto; }
.wordmark .name {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1;
}
.wordmark .tag {
  display: block;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--stone);
  margin-top: 3px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.4rem;
  margin-left: auto;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.3rem 0;
}
.site-nav a:hover, .site-nav a[aria-current="page"] {
  color: var(--rubric);
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* ---------- Buttons ---------- */

.btn, button.btn {
  display: inline-block;
  background: var(--rubric);
  color: var(--parchment);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--rubric);
  padding: 0.85rem 1.5rem;
  cursor: pointer;
  box-shadow: none;
}
.btn:hover { background: #821B1F; border-color: #821B1F; }

.btn-quiet {
  background: transparent;
  color: var(--rubric);
  border: 1px solid var(--rubric);
}
.btn-quiet:hover { background: rgba(155, 34, 38, 0.06); color: var(--rubric); }

/* ---------- Forms ---------- */

.subscribe-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  max-width: 480px;
}
.subscribe-form input[type="email"], .field {
  flex: 1 1 240px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 15px;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--ink);
  background: #FFFDF8;
  color: var(--ink);
}

label {
  display: block;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

textarea.field { width: 100%; min-height: 7rem; resize: vertical; }

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

.hero { padding: 4.5rem 0 3.5rem; }
.hero h1 { max-width: 21ch; }
.hero .standfirst { margin: 1.2rem 0 1.8rem; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.fade-up { animation: fadeUp 0.7s ease-out both; }

/* ---------- Essay list (editorial, not cards) ---------- */

.essay-list { list-style: none; margin: 0; padding: 0; }
.essay-list li {
  padding: 1.6rem 0;
  border-bottom: 1px solid rgba(28, 25, 23, 0.18);
}
.essay-list li:first-child { border-top: 1px solid rgba(28, 25, 23, 0.18); }
.essay-list .meta { margin-bottom: 0.3rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.essay-list h3 { margin: 0 0 0.3rem; font-size: 1.45rem; }
.essay-list h3 a { color: var(--ink); text-decoration: none; }
.essay-list h3 a:hover { color: var(--rubric); text-decoration: underline; }
.essay-list .dek { margin: 0; color: var(--stone); }

.tag-pill {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
}

.members-mark {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rubric);
  border: 1px solid var(--rubric);
  padding: 1px 6px;
}

/* ---------- Essay page ---------- */

.essay-body { max-width: var(--measure); margin: 0 auto; }
.essay-header { max-width: var(--measure); margin: 0 auto 2.5rem; }
.essay-body > p:first-of-type::first-letter {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 4.4rem;
  line-height: 0.8;
  float: left;
  color: var(--rubric);
  padding: 0.35rem 0.6rem 0 0;
}

blockquote.pull {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1.4;
  margin: 2.5rem 0;
  padding: 1.2rem 0;
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  max-width: var(--measure);
}

/* ---------- Bands ---------- */

.band {
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  padding: 3rem 0;
  text-align: center;
}
.band p { margin-left: auto; margin-right: auto; }

.grounding-band {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.25rem;
  line-height: 1.55;
}

/* ---------- Tool rows ---------- */

.tool-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem 2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(28, 25, 23, 0.18);
}
.tool-row:first-of-type { border-top: 1px solid rgba(28, 25, 23, 0.18); }
.tool-row h3 { margin: 0; flex: 0 0 16rem; }
.tool-row p { margin: 0; flex: 1 1 24rem; }

/* ---------- Tables ---------- */

table {
  border-collapse: collapse;
  width: 100%;
  max-width: 720px;
  font-size: 16px;
}
th {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  border-bottom: 1px solid var(--ink);
  padding: 0.6rem 0.8rem 0.6rem 0;
}
td {
  border-bottom: 1px solid rgba(28, 25, 23, 0.18);
  padding: 0.7rem 0.8rem 0.7rem 0;
  vertical-align: top;
}

/* ---------- Steps / lists ---------- */

ol.steps { counter-reset: step; list-style: none; padding: 0; max-width: var(--measure); }
ol.steps li { counter-increment: step; padding: 1rem 0 1rem 3.2rem; position: relative; border-bottom: 1px solid rgba(28,25,23,0.14); }
ol.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 1rem;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--gold);
}

ul.plain { list-style: none; padding: 0; max-width: var(--measure); }
ul.plain li { padding: 0.45rem 0; border-bottom: 1px solid rgba(28,25,23,0.12); }

/* ---------- FAQ ---------- */

details {
  border-bottom: 1px solid rgba(28,25,23,0.18);
  padding: 0.9rem 0;
  max-width: var(--measure);
}
details summary {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
}

/* ---------- Scorecard ---------- */

.q-block { margin: 2rem 0; padding-bottom: 1.5rem; border-bottom: 1px solid rgba(28,25,23,0.14); max-width: var(--measure); }
.q-block fieldset { border: 0; padding: 0; margin: 0; }
.q-block legend {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.15rem;
  margin-bottom: 0.7rem;
}
.q-block label {
  display: block;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 16.5px;
  font-weight: 400;
  letter-spacing: 0;
  padding: 0.45rem 0;
  cursor: pointer;
}
.q-block input[type="radio"] { accent-color: var(--rubric); margin-right: 0.55rem; }

#score-result { display: none; border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); padding: 2rem 0; margin-top: 2rem; }

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

footer {
  border-top: 1px solid var(--gold);
  margin-top: 4rem;
  padding: 3rem 0 2.5rem;
}
footer .wrap { display: flex; flex-wrap: wrap; gap: 2.5rem 4rem; align-items: flex-start; }
footer img.footer-logo { height: 44px; width: auto; opacity: 0.85; }
footer nav { display: flex; flex-direction: column; gap: 0.5rem; font-family: "Inter", system-ui, sans-serif; font-size: 13px; letter-spacing: 0.06em; }
footer nav a { color: var(--ink); text-decoration: none; }
footer nav a:hover { color: var(--rubric); text-decoration: underline; }
.footer-legal { font-family: "Inter", system-ui, sans-serif; font-size: 12.5px; color: var(--stone); margin-top: 2rem; }

/* ---------- Folio dateline ---------- */

.folio {
  border-bottom: 1px solid rgba(28, 25, 23, 0.18);
  padding: 0.45rem 0;
}
.folio .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
}

/* ---------- Illustrations ---------- */

.ill {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(28, 25, 23, 0.25);
}

/* ---------- Lead feature ---------- */

.lead-feature {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3rem;
  align-items: center;
  padding: 3.2rem 0 3rem;
}
.lead-feature h2 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.08;
  margin: 0.4rem 0 0.8rem;
}
.lead-feature h2 a { color: var(--ink); text-decoration: none; }
.lead-feature h2 a:hover { color: var(--rubric); }
.lead-feature .dek { color: var(--stone); font-size: 1.12rem; margin: 0 0 1.2rem; }

/* ---------- Byline ---------- */

.byline {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  color: var(--stone);
}
.byline img {
  width: 26px;
  height: 26px;
  object-fit: cover;
  border: 1px solid rgba(28, 25, 23, 0.3);
  background: #fff;
}
.byline .name { color: var(--ink); font-weight: 500; }

/* ---------- Feature grid ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 2.4rem;
  padding: 2.6rem 0;
}
.feature-grid > article {
  padding: 0 2.4rem 0 0;
  border-right: 1px solid rgba(28, 25, 23, 0.16);
}
.feature-grid > article:last-child { border-right: 0; padding-right: 0; }
.feature-card .ill { margin-bottom: 1rem; }
.feature-card .eyebrow { margin-bottom: 0.45rem; }
.feature-card h3 { font-size: 1.3rem; line-height: 1.2; margin: 0 0 0.45rem; }
.feature-card h3 a { color: var(--ink); text-decoration: none; }
.feature-card h3 a:hover { color: var(--rubric); }
.feature-card .dek { color: var(--stone); font-size: 0.98rem; margin: 0 0 0.9rem; }

/* ---------- Fleuron divider ---------- */

.fleuron {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin: 0;
  color: var(--gold);
  font-size: 1.1rem;
  line-height: 1;
}
.fleuron::before, .fleuron::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--gold);
}

/* ---------- Columns (the four departments) ---------- */

.columns-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0 2.2rem;
}
.columns-grid > div {
  border-top: 2px solid var(--ink);
  padding-top: 0.9rem;
}
.columns-grid h3 { font-size: 1.2rem; margin: 0 0 0.35rem; }
.columns-grid p { font-size: 0.95rem; color: var(--stone); margin: 0 0 0.7rem; }
.columns-grid .col-link {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.tool-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.2rem;
}
.tool-cards > article { border: 1px solid rgba(28, 25, 23, 0.25); }
.tool-cards .ill { border: 0; border-bottom: 1px solid rgba(28, 25, 23, 0.25); }
.tool-cards .pad { padding: 1.1rem 1.2rem 1.3rem; }
.tool-cards h3 { font-size: 1.18rem; margin: 0 0 0.35rem; }
.tool-cards p { font-size: 0.95rem; color: var(--stone); margin: 0 0 1rem; }
.tool-cards .status {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 0.5rem;
}

/* ---------- Essay list with thumbnails ---------- */

.essay-list--art li {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.7rem;
  align-items: center;
}
.essay-list--art .ill { margin: 0; }
@media (max-width: 640px) {
  .essay-list--art li { grid-template-columns: 110px 1fr; gap: 1.1rem; }
}

/* ---------- Essay header art ---------- */

.essay-art { max-width: var(--measure); margin: 0 auto 2.2rem; }

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

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2.5rem;
}
.footer-grid h4 {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
  margin: 0 0 0.8rem;
}
.footer-motto {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--stone);
  margin-top: 0.8rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .lead-feature { grid-template-columns: 1fr; gap: 1.8rem; }
  .lead-feature .lead-art { order: -1; }
  .feature-grid { grid-template-columns: 1fr; gap: 2rem; }
  .feature-grid > article { border-right: 0; border-bottom: 1px solid rgba(28,25,23,0.16); padding: 0 0 2rem; }
  .feature-grid > article:last-child { border-bottom: 0; padding-bottom: 0; }
  .columns-grid { grid-template-columns: 1fr 1fr; gap: 2rem 1.6rem; }
  .tool-cards { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

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

@media (max-width: 640px) {
  body { font-size: 17px; }
  section { padding: 2.5rem 0; }
  .hero { padding: 3rem 0 2.5rem; }
  .masthead .wrap { flex-direction: column; align-items: flex-start; }
  .site-nav { margin-left: 0; }
  .tool-row h3 { flex-basis: 100%; }
}
