/* Cass Rowan Remedies: shared styles
   Palette: ridge mist paper, bark ink, sage, night sky, necklace gold */
:root {
  --paper: #E8ECE3;
  --paper-deep: #DCE2D5;
  --ink: #2F2A22;
  --ink-soft: #5A5246;
  --sage: #4F6A4E;
  --night: #1D2333;
  --night-soft: #2A3247;
  --gold: #C9A24B;
  --line: #C6CEBC;
  --measure: 66ch;
  --serif: "Literata", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-optical-sizing: auto;
}
img { max-width: 100%; display: block; height: auto; }
a { color: var(--sage); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }
.prose { max-width: var(--measure); }
.wrap.prose { max-width: none; }
.wrap.prose > * { max-width: var(--measure); }

/* Header: the night band */
.site-header { background: var(--night); color: #EDE8DA; }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: 1rem; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 0.75rem;
  color: #EDE8DA; text-decoration: none; font-weight: 600; font-size: 1.15rem;
  letter-spacing: 0.01em;
}
.brand svg { width: 2.75rem; height: auto; }
.constellation.mark line { stroke-width: 14; opacity: 0.7; }
.brand:hover { color: #fff; }
.nav { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: 0.95rem; }
.nav a { color: #CFC9B8; text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--gold); }

/* Constellation drawing */
.constellation line { stroke: var(--gold); stroke-width: 1.4; opacity: 0.55; }
.constellation circle { fill: var(--gold); }

/* Hero */
.hero { background: var(--night); color: #EDE8DA; padding-bottom: 4rem; overflow: hidden; }
.hero .wrap {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 3rem; align-items: center;
  padding-top: 2.5rem;
}
.hero h1 {
  font-size: clamp(2.3rem, 5.2vw, 3.9rem); line-height: 1.08; font-weight: 500;
  margin: 0 0 1.25rem; letter-spacing: -0.01em; max-width: 14ch;
}
.hero p { font-size: 1.2rem; color: #CFC9B8; max-width: 40ch; margin: 0 0 2rem; }
.hero .sky { width: 100%; max-width: 17rem; margin-bottom: 1.75rem; }
.hero figure { margin: 0; position: relative; }
.hero figure img { border-radius: 14rem 14rem 0.5rem 0.5rem; border: 1px solid var(--night-soft); }
.hero figcaption { font-size: 0.85rem; color: #9C9686; margin-top: 0.75rem; }

.button {
  display: inline-block; padding: 0.8rem 1.4rem; border-radius: 0.35rem;
  background: var(--gold); color: var(--night); font-weight: 600; text-decoration: none;
}
.button:hover { background: #DDB862; color: var(--night); }
.button.quiet { background: transparent; color: #EDE8DA; border: 1px solid #5C6377; margin-left: 0.5rem; }
.button.quiet:hover { border-color: var(--gold); color: var(--gold); }

/* Sections */
main section { padding-block: 3.5rem; }
main section + section { border-top: 1px solid var(--line); }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 500; line-height: 1.2; margin: 0 0 1rem; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; margin: 2rem 0 0.5rem; }
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 52ch; }

/* Needs list: plain index, not cards */
.needs { list-style: none; padding: 0; margin: 1.5rem 0 0; columns: 2 16rem; column-gap: 3rem; }
.needs li { break-inside: avoid; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.needs a { font-size: 1.15rem; text-decoration: none; color: var(--ink); }
.needs a:hover { color: var(--sage); }
.needs span { display: block; font-size: 0.9rem; color: var(--ink-soft); }
.needs span a { font-size: 0.9rem; color: var(--sage); text-decoration: underline; }

/* Remedy index */
.remedy-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.remedy-list li {
  display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 2rem;
  padding: 1.25rem 0; border-bottom: 1px solid var(--line);
}
.remedy-list .name { font-size: 1.3rem; font-weight: 500; }
.remedy-list .name a { color: var(--ink); text-decoration: none; }
.remedy-list .name a:hover { color: var(--sage); text-decoration: underline; }
.remedy-list .meta { color: var(--ink-soft); font-size: 0.95rem; grid-column: 1; }
.remedy-list .status { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 0.9rem; color: var(--ink-soft); }
.remedy-list .soon .name { color: var(--ink-soft); }

/* Remedy page */
.remedy-head { padding-block: 3rem 2rem; }
.remedy-head h1 { font-size: clamp(2.1rem, 4.5vw, 3.2rem); font-weight: 500; line-height: 1.1; margin: 0 0 0.75rem; }
.glance {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 1rem 1.25rem; margin: 2rem 0 0; padding: 1.25rem 0;
  border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line);
}
.glance div { margin: 0; }
.glance dt { font-size: 0.85rem; color: var(--ink-soft); }
.glance dd { margin: 0.1rem 0 0; font-weight: 600; }

.remedy-body { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 4rem; padding-bottom: 4rem; }
.remedy-body aside { font-size: 0.95rem; }
.remedy-body aside .card { background: var(--paper-deep); padding: 1.25rem 1.4rem; border-radius: 0.4rem; position: sticky; top: 1.5rem; }
.remedy-body aside h3 { margin-top: 0; font-size: 1.05rem; }

.remedy-body article h2 { margin-top: 2.75rem; }
.remedy-body article > h2:first-child { margin-top: 0; }
.ingredients { padding-left: 1.1rem; }
.ingredients li { margin-bottom: 0.35rem; }
.steps { padding-left: 1.4rem; }
.steps li { margin-bottom: 0.8rem; padding-left: 0.3rem; }
.steps li::marker { font-weight: 700; color: var(--sage); }

.evidence { margin: 1rem 0; padding: 0; list-style: none; }
.evidence li { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.level {
  display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 0.1rem 0.55rem;
  border-radius: 1rem; margin-left: 0.4rem; vertical-align: 0.1em; border: 1px solid currentColor;
}
.level.strong { color: #2E5B34; }
.level.some { color: #6B5A1F; }
.level.traditional { color: #6A4E6E; }
.level.early { color: #5A6B2C; }
.level.none { color: #8A3F2A; }

.caution {
  border-left: 3px solid #A8553A; background: #EFE3DA; padding: 1rem 1.25rem; border-radius: 0 0.4rem 0.4rem 0;
}
.caution h2, .caution h3 { margin-top: 0; }
.caution ul { margin: 0.5rem 0 0; padding-left: 1.1rem; }

.video-slot {
  aspect-ratio: 9 / 16; max-width: 20rem; background: var(--night); color: #9C9686;
  display: grid; place-items: center; text-align: center; padding: 1.5rem; border-radius: 0.5rem; font-size: 0.9rem;
}

details { border-bottom: 1px solid var(--line); padding: 0.75rem 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 0.5rem 0 0; }

.sources li { margin-bottom: 0.4rem; overflow-wrap: anywhere; }

/* Footer */
.site-footer { background: var(--night); color: #A9A393; font-size: 0.9rem; padding-block: 2.5rem; }
.site-footer .wrap { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; }
.site-footer p { margin: 0 0 0.75rem; max-width: 60ch; }
.site-footer a { color: #CFC9B8; }
.site-footer nav { display: flex; flex-direction: column; gap: 0.4rem; }

/* Responsive */
@media (max-width: 52rem) {
  .hero .wrap { grid-template-columns: 1fr; gap: 2rem; }
  .hero figure { max-width: 22rem; }
  .remedy-body { grid-template-columns: 1fr; gap: 2rem; }
  .remedy-body aside .card { position: static; }
  .site-footer .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 30rem) {
  .button.quiet { margin-left: 0; margin-top: 0.75rem; }
}

/* One page-load moment: the constellation draws in */
@media (prefers-reduced-motion: no-preference) {
  .hero .sky line { stroke-dasharray: 200; stroke-dashoffset: 200; animation: draw 1.6s ease-out 0.3s forwards; }
  .hero .sky circle { opacity: 0; animation: appear 0.6s ease-out forwards; }
  .hero .sky circle:nth-of-type(2) { animation-delay: 0.15s; }
  .hero .sky circle:nth-of-type(3) { animation-delay: 0.3s; }
  .hero .sky circle:nth-of-type(4) { animation-delay: 0.45s; }
  .hero .sky circle:nth-of-type(5) { animation-delay: 0.6s; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }
