/* ============================================================
   NOISY WATERS STYLE - Southern Ecosystem Design System v1
   noisywaters.art | the Reading Shelf | coastsalish.art
   Palette B, Sound Forward. Wool, deep Sound green, red ochre.
   Variable names kept from heceta-style.css for compatibility:
   --red carries the Sound green primary, --blue carries ochre.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&family=Work+Sans:wght@400;500;600;700&display=swap');

/* ---------- Tokens ---------- */
:root {
    --cream:  #f4f2ec;
    --paper:  #fdfcf8;
    --ink:    #191c1a;
    --red:    #3d5f58;
    --green:  #55604a;
    --blue:   #a34a2a;
    --cedar:  #6f5a41;
    --teal:   #5c8a80;
    --yellow: #9fb8ae;
    --night:  #1d2422;

    --tint-green: color-mix(in srgb, var(--green) 14%, var(--cream));
    --tint-cedar: color-mix(in srgb, var(--cedar) 16%, var(--cream));
    --tint-blue:  color-mix(in srgb, var(--blue) 10%, var(--cream));
    --tint-red:   color-mix(in srgb, var(--red) 8%, var(--cream));
    --line:       color-mix(in srgb, var(--cedar) 38%, var(--cream));

    --serif:   'Source Serif 4', Georgia, 'Times New Roman', serif;
    --display: 'Lora', Georgia, serif;
    --sans:    'Work Sans', -apple-system, 'Segoe UI', Arial, sans-serif;

    --col: 900px;
}

/* ---------- Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.75;
    color: var(--ink);
    background-color: var(--cream);
    padding: 2.25rem 1.5rem 0;
}

/* The woven band: red, cedar, teal, yellow */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: linear-gradient(90deg,
        var(--red) 0 25%, var(--cedar) 25% 50%,
        var(--teal) 50% 75%, var(--yellow) 75% 100%);
    z-index: 1000;
}

.container, .hi-page {
    max-width: var(--col);
    margin: 0 auto;
}

/* ---------- Headings ---------- */
h1, h2 {
    font-family: var(--display);
    color: var(--red);
    line-height: 1.2;
    font-weight: 700;
}

h1 { font-size: 2.3rem; margin-bottom: 0.4rem; letter-spacing: -0.01em; }

h2 {
    font-size: 1.45rem;
    margin-top: 2.75rem;
    margin-bottom: 0.8rem;
}

h3, h4 {
    font-family: var(--display);
    color: var(--ink);
    font-weight: 600;
}

h3 { font-size: 1.15rem; margin-top: 1.9rem; margin-bottom: 0.5rem; }
h4 { font-size: 1rem;   margin-top: 1.3rem; margin-bottom: 0.4rem; }

/* Kicker line above h1 */
.course-label {
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: color-mix(in srgb, var(--cedar) 70%, var(--ink));
    margin-bottom: 0.4rem;
}

.subtitle {
    font-size: 1.1rem;
    font-style: italic;
    color: color-mix(in srgb, var(--ink) 62%, var(--cream));
    margin-bottom: 2.25rem;
}

/* ---------- Body text ---------- */
p { margin-bottom: 1.2rem; }
em { font-style: italic; }
strong { font-weight: 600; }

a {
    color: var(--blue);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--blue) 35%, transparent);
    text-underline-offset: 3px;
    transition: color 120ms ease;
}

a:hover {
    color: color-mix(in srgb, var(--blue) 70%, var(--ink));
    text-decoration-color: var(--blue);
}

ul, ol { margin-bottom: 1.2rem; padding-left: 1.5rem; }
li { margin-bottom: 0.45rem; }
li ul, li ol { margin-top: 0.3rem; margin-bottom: 0.3rem; }

blockquote {
    border-left: 3px solid var(--line);
    padding-left: 1.2rem;
    margin: 1.5rem 0;
    font-style: italic;
}

/* ---------- Summary / lede panel ---------- */
.reading-summary, .lede {
    background: var(--paper);
    border: 1px solid var(--line);
    border-left: 5px solid var(--red);
    border-radius: 0 8px 8px 0;
    padding: 1.2rem 1.4rem;
    margin: 0 0 2.25rem;
    font-size: 0.99rem;
}
.reading-summary p:last-child, .lede p:last-child { margin-bottom: 0; }

/* ---------- Callouts ---------- */
.callout {
    background: var(--tint-green);
    border-left: 5px solid var(--green);
    border-radius: 0 8px 8px 0;
    padding: 1.15rem 1.35rem;
    margin: 1.9rem 0;
    font-size: 0.98rem;
}

.warm-callout {
    background: var(--tint-cedar);
    border-left: 5px solid var(--cedar);
    border-radius: 0 8px 8px 0;
    padding: 1.15rem 1.35rem;
    margin: 1.9rem 0;
    font-size: 0.98rem;
}

.callout p:last-child, .warm-callout p:last-child { margin-bottom: 0; }

/* ---------- Raven speaks (the signature) ----------
   Covers new .raven-callout and the guides' .raven-blurb */
.raven-callout, .raven-blurb {
    background: var(--night);
    color: var(--cream);
    border-left: 5px solid var(--teal);
    border-radius: 0 10px 10px 0;
    padding: 1.4rem 1.6rem;
    margin: 2.1rem 0;
    font-style: italic;
    line-height: 1.85;
    font-size: 1.02rem;
}

.raven-callout p, .raven-blurb p { margin-bottom: 0.85rem; }
.raven-callout p:last-of-type, .raven-blurb p:last-of-type { margin-bottom: 0; }

.raven-callout a, .raven-blurb a {
    color: var(--teal);
    text-decoration-color: color-mix(in srgb, var(--teal) 45%, transparent);
}

.raven-attribution {
    font-style: normal;
    font-family: var(--sans);
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    color: var(--yellow);
    margin-top: 1rem;
    text-align: right;
}

/* ---------- Section boxes (guides) ---------- */
.section-box {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.35rem 1.55rem;
    margin: 1.6rem 0;
}

.section-box h2:first-child, .section-box h3:first-child { margin-top: 0; }

/* ---------- Labels and chips ---------- */
.phase-label {
    display: inline-block;
    font-family: var(--sans);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.32rem 0.85rem;
    border-radius: 999px;
    margin-bottom: 0.8rem;
}

.phase-chaos               { background: var(--tint-cedar); color: color-mix(in srgb, var(--cedar) 60%, var(--ink)); border: 1px solid var(--cedar); }
.phase-world-building      { background: var(--tint-green); color: color-mix(in srgb, var(--green) 55%, var(--ink)); border: 1px solid var(--green); }
.phase-human-responsibility{ background: var(--tint-red);   color: var(--red);   border: 1px solid var(--red); }
.phase-return              { background: var(--tint-blue);  color: color-mix(in srgb, var(--blue) 70%, var(--ink));  border: 1px solid var(--blue); }

.key-term {
    background: var(--tint-green);
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
}

/* ---------- Banners ---------- */
.guide-nav, .cross-ref {
    background: var(--tint-blue);
    border: 1px solid color-mix(in srgb, var(--blue) 40%, var(--cream));
    border-radius: 8px;
    padding: 0.85rem 1.25rem;
    margin: 0 0 2rem;
    font-size: 0.94rem;
    font-family: var(--sans);
}

.guide-nav a, .cross-ref a { font-weight: 600; }

/* ---------- Tables ---------- */
.terms-table, .comparison-table, table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.6rem 0;
    font-size: 0.95rem;
}

.terms-table th, .comparison-table th, table th {
    font-family: var(--sans);
    background: var(--red);
    color: var(--cream);
    text-align: left;
    padding: 0.65rem 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.terms-table td, .comparison-table td, table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.terms-table tr:nth-child(even) td,
.comparison-table tr:nth-child(even) td,
table tr:nth-child(even) td {
    background: color-mix(in srgb, var(--paper) 60%, var(--cream));
}

/* Definition-list key terms (guides) */
dl.terms-table { display: block; }
dl.terms-table dt { font-weight: 600; margin-top: 1rem; color: var(--red); }
dl.terms-table dd { margin-left: 0; padding-left: 1rem; border-left: 3px solid var(--line); margin-top: 0.25rem; }

/* ---------- Resource lists ---------- */
.resource-list { list-style: none; padding-left: 0; }
.resource-list li { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.resource-list li:last-child { border-bottom: none; }
.resource-title { font-weight: 600; }
.resource-meta { font-family: var(--sans); font-size: 0.85rem; color: color-mix(in srgb, var(--ink) 55%, var(--cream)); margin-top: 0.2rem; }

/* ---------- The ladder (keep going block) ---------- */
.ladder {
    background: var(--paper);
    border: 1px solid var(--line);
    border-top: 4px solid var(--yellow);
    border-radius: 0 0 10px 10px;
    padding: 1.3rem 1.5rem;
    margin: 2.5rem 0 1.5rem;
}

.ladder h3 { margin-top: 0; }

/* ---------- Separator, references, footer ---------- */
.separator {
    border: none;
    border-top: 1px solid var(--line);
    margin: 2.75rem 0;
}

.references { margin: 1rem 0 1.75rem; font-size: 0.95rem; }
.references p {
    padding-left: 2rem;
    text-indent: -2rem;
    margin-bottom: 0.7rem;
    line-height: 1.55;
}
.references a { word-break: break-word; }

.footer, .site-footer {
    background: var(--night);
    color: var(--cream);
    font-family: var(--sans);
    font-size: 0.85rem;
    margin: 3.5rem -1.5rem 0;
    padding: 2rem 1.5rem 2.5rem;
}

.footer a, .site-footer a { color: var(--teal); }
.footer p { margin-bottom: 0.4rem; max-width: var(--col); margin-left: auto; margin-right: auto; }

/* ---------- Site header (hecetaisland.com) ---------- */
.site-header {
    max-width: var(--col);
    margin: 0 auto 2.5rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--line);
}

.site-title {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -0.01em;
}

a.site-title:hover { color: var(--red); }

.site-tagline {
    font-family: var(--sans);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: color-mix(in srgb, var(--cedar) 70%, var(--ink));
    margin-top: 0.15rem;
}

.site-nav { margin-top: 0.9rem; font-family: var(--sans); font-size: 0.92rem; }
.site-nav a {
    color: var(--ink);
    text-decoration: none;
    margin-right: 1.1rem;
    font-weight: 500;
}
.site-nav a:hover { color: var(--red); }
.site-nav a.nav-shelf { color: var(--red); font-weight: 700; }

/* ---------- Images ---------- */
img { max-width: 100%; height: auto; border-radius: 6px; }
figcaption {
    font-family: var(--sans);
    font-size: 0.83rem;
    color: color-mix(in srgb, var(--ink) 55%, var(--cream));
    margin-top: 0.45rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    body { font-size: 16.5px; padding: 1.5rem 1rem 0; }
    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.25rem; }
    .callout, .warm-callout, .raven-callout, .raven-blurb, .section-box { padding: 1rem 1.1rem; }
    .footer, .site-footer { margin: 2.5rem -1rem 0; padding: 1.5rem 1rem 2rem; }
    .terms-table, .comparison-table { font-size: 0.88rem; }
    .terms-table th, .terms-table td, .comparison-table th, .comparison-table td { padding: 0.45rem 0.6rem; }
}

@media (max-width: 420px) {
    h1 { font-size: 1.45rem; }
    .terms-table, .comparison-table { display: block; overflow-x: auto; }
}

/* ---------- Print ---------- */
@media print {
    body { background: #fff; color: #000; font-size: 11pt; line-height: 1.5; padding: 0; }
    body::before { display: none; }
    .container, .hi-page { max-width: 100%; }
    a { color: #000; }
    a[href^="http"]:after { content: " (" attr(href) ")"; font-size: 0.8em; color: #444; }
    .raven-callout, .raven-blurb { background: #fff; color: #000; border: 1px solid #333; border-left: 4px solid #333; }
    .raven-attribution { color: #000; }
    .callout, .warm-callout, .section-box { border: 1px solid #999; break-inside: avoid; }
    table th, .terms-table th, .comparison-table th { background: #ddd; color: #000; }
    h1, h2, h3, h4 { break-after: avoid; color: #000; }
    .footer, .site-footer { background: #fff; color: #000; border-top: 1px solid #999; }
}
