/* Carmen Teresa Luengo — static site styles.
   No external fonts or scripts: everything is served from 'self' so the CSP can stay strict. */

/* Light is the default. Dark only applies when theme.js sets data-theme="dark" (user's explicit choice). */
:root {
  color-scheme: light;

  --bg: #fbf8f4;
  --surface: #ffffff;
  --surface-2: #f4ede5;
  --ink: #1f1a17;
  --muted: #5e5650;
  --line: #e7dfd6;
  /* Text-safe orange: 5.4:1 on --bg, 4.9:1 on --surface-2. The brighter brand orange is only used for non-text decoration. */
  --accent: #b83c0a;
  --accent-strong: #9a3412;
  --brand: #f08a24;
  --on-accent: #ffffff;
  --focus: #1d4ed8;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --step--1: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.45vw, 1.45rem);
  --step-2: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  --step-3: clamp(1.9rem, 1.5rem + 1.8vw, 3rem);
  --step-4: clamp(2.3rem, 1.7rem + 3vw, 4.1rem);

  --radius: 14px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --measure: 68ch;
  --shadow: 0 1px 2px rgb(31 26 23 / 0.06), 0 8px 24px rgb(31 26 23 / 0.06);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141110;
  --surface: #1d1916;
  --surface-2: #26201c;
  --ink: #f3ede7;
  --muted: #b5aba2;
  --line: #362e28;
  --accent: #fb923c;
  --accent-strong: #fdba74;
  --brand: #f08a24;
  --on-accent: #1a0e05;
  --focus: #93c5fd;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.25);
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

p { margin: 0 0 1.1em; text-wrap: pretty; }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--accent-strong); text-decoration-thickness: 2px; }

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.container {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.prose { max-width: var(--measure); }
.prose ul { padding-left: 1.2em; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.35em; }
.prose li::marker { color: var(--accent); }
.prose h2 { font-size: var(--step-2); margin-top: 1.6em; }

.eyebrow {
  display: inline-block;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.lede { font-size: var(--step-1); color: var(--muted); line-height: 1.55; max-width: 40ch; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 0.85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.1;
}
.brand:hover { color: var(--ink); }
.brand small {
  display: block;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.brand-mark { width: 2.25rem; height: 2.25rem; flex: none; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover { color: var(--ink); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }

.site-nav { margin-left: auto; }

/* Rendered with [hidden] so it never shows when JavaScript is off; theme.js reveals it. */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle svg { width: 1.15rem; height: 1.15rem; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* On phones the wrapped nav is two rows tall; pinning it would eat a third of the viewport. */
@media (max-width: 47.99rem) {
  .site-header { position: static; }
  .theme-toggle { order: 1; }
  .site-nav { order: 2; width: 100%; margin-inline: -0.6rem; }
  .site-nav a { padding: 0.35rem 0.6rem; font-size: 0.9rem; }
  .site-header .container { column-gap: 0.75rem; }
}

/* Keeps brand + theme button on one row down to 320px-wide phones. */
@media (max-width: 24rem) {
  .brand { font-size: 1rem; gap: 0.5rem; }
  .brand small { font-size: 0.62rem; }
  .brand-mark { width: 2rem; height: 2rem; }
}

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

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0.7rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.button:hover { background: var(--accent-strong); color: var(--on-accent); text-decoration: none; }
.button--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.button--ghost:hover { background: var(--surface-2); color: var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  .button:active { transform: translateY(1px); }
}

/* ---------- Sections ---------- */

main { display: block; }

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section--tint { background: var(--surface-2); }
.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head p { color: var(--muted); }

.page-hero { padding-block: clamp(3rem, 7vw, 5.5rem) clamp(1.5rem, 3vw, 2.5rem); }
.page-hero h1 { max-width: 20ch; }
.page-hero + .section:not(.section--tint) { padding-top: 0; }

/* Home hero */
.hero {
  display: grid;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding-block: clamp(2.5rem, 7vw, 6rem);
}
@media (min-width: 52rem) {
  .hero { grid-template-columns: 1.15fr 0.85fr; }
}

.portrait {
  margin: 0;
  max-width: 26rem;
  justify-self: center;
}
.portrait img {
  border-radius: calc(var(--radius) * 1.6);
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
@media (max-width: 51.99rem) {
  .portrait { max-width: 20rem; }
}

/* Credentials strip */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
}
.facts li { padding: 1.25rem 1.4rem; background: var(--surface); }
.facts strong { display: block; font-family: var(--serif); font-size: var(--step-1); }
.facts span { color: var(--muted); font-size: var(--step--1); }

/* Cards */
.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  padding: 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.card h3 { margin-bottom: 0.45em; }
.card p { color: var(--muted); margin-bottom: 0; }
.card .num {
  font-family: var(--serif);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

/* Post cards: the whole card is the link target via a stretched pseudo-element. */
.post-card { position: relative; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.post-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.post-card h3 a:focus-visible { outline: none; }
.post-card:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.post-card time { font-size: var(--step--1); color: var(--muted); margin-bottom: 0.6rem; }
.post-card .more { margin-top: auto; padding-top: 1.2rem; font-weight: 600; color: var(--accent); }

/* Split layout */
.split { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (min-width: 52rem) {
  .split { grid-template-columns: 0.8fr 1.2fr; }
  .split--sticky > :first-child { position: sticky; top: 6rem; }
}

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.checklist + p { margin-top: 1.5rem; }
.checklist li {
  position: relative;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 1.15rem;
  width: 0.95rem;
  height: 0.55rem;
  border-left: 2.5px solid var(--accent);
  border-bottom: 2.5px solid var(--accent);
  transform: rotate(-45deg);
}

/* Quote / testimonials */
.quote {
  margin: 0;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border-radius: calc(var(--radius) * 1.4);
  background: var(--surface);
  border: 1px solid var(--line);
}
.quote blockquote { margin: 0; }
.quote blockquote p {
  font-family: var(--serif);
  font-size: var(--step-1);
  line-height: 1.5;
}
.quote blockquote p:first-child::before {
  content: "\201C";
  display: block;
  height: 0.55em;
  font-size: 3.4em;
  line-height: 1;
  color: var(--brand);
}
.quote ul { margin: 0 0 1.1em; padding-left: 1.2em; font-size: var(--step-0); }
.quote figcaption {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--step--1);
  line-height: 1.4;
}
.quote figcaption strong { display: block; color: var(--ink); font-size: var(--step-0); }
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent);
  font-family: var(--serif);
  font-weight: 600;
}
.stack { display: grid; gap: 1.5rem; }

.pull {
  max-width: 52rem;
  margin-inline: auto;
  text-align: center;
  font-family: var(--serif);
  font-size: var(--step-2);
  line-height: 1.4;
}
.pull cite { display: block; margin-top: 1rem; font-family: var(--sans); font-size: var(--step--1); font-style: normal; color: var(--muted); }

/* FAQ */
.faq { display: grid; gap: 0.75rem; max-width: 50rem; }
.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.4rem;
  cursor: pointer;
  font-family: var(--serif);
  font-size: var(--step-1);
  font-weight: 600;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--accent);
}
.faq details[open] summary::after { content: "\2212"; }
.faq summary:focus-visible { outline-offset: -3px; border-radius: var(--radius); }
.faq .answer { padding: 0 1.4rem 1.2rem; color: var(--muted); }

/* Contact */
.contact-list { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.contact-list li {
  display: grid;
  gap: 0.15rem;
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.contact-list span { font-size: var(--step--1); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.contact-list a, .contact-list address { font-family: var(--serif); font-size: var(--step-1); font-style: normal; }

/* CTA band */
.cta {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  padding: clamp(2rem, 5vw, 3.5rem);
  border-radius: calc(var(--radius) * 1.6);
  background: var(--ink);
  color: var(--bg);
}
.cta h2 { margin: 0 0 0.3em; }
.cta p { margin: 0; color: color-mix(in srgb, var(--bg) 78%, var(--ink)); }
.cta .button { background: var(--brand); color: #1a0e05; }
.cta .button:hover { background: #ffa552; color: #1a0e05; }
@media (min-width: 52rem) { .cta { grid-template-columns: 1fr auto; } }

/* Article */
.article-header { padding-block: clamp(3rem, 7vw, 5rem) 1.5rem; }
.article-header h1 { font-size: var(--step-3); max-width: 24ch; }
.article-meta { color: var(--muted); font-size: var(--step--1); }
.article-body { padding-bottom: clamp(3rem, 7vw, 5rem); }
.article-body .prose > p:first-of-type { font-size: var(--step-1); line-height: 1.55; color: var(--ink); }
.back { display: inline-block; margin-top: 2rem; font-weight: 600; }

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

.site-footer {
  margin-top: clamp(3rem, 7vw, 5rem);
  padding-block: 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--step--1);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }
.site-footer p { margin: 0; }

@media print {
  .site-header, .site-footer, .cta, .skip-link { display: none; }
  body { background: #fff; color: #000; }
}
