/* BetterSleepMetrics — shared styling for static article pages.
   Mirrors the brand tokens defined in tailwind.config.js so article
   pages look native to the React homepage without coupling to the build. */

:root {
  --cream: #f8f6f1;
  --cream-2: #f0ede5;
  --ink: #1c2826;
  --teal: #3f5e62;
  --teal-deep: #0d1616;
  --pale-teal: #e9efed;
  --light: #f6f2ea;
  --wood: #c9a87c;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    Georgia, serif;
  --sans: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(63, 94, 98, 0.22);
  color: var(--ink);
}

a {
  color: var(--teal);
}

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

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

/* ---- Site header ---- */
.site-header {
  border-bottom: 1px solid rgba(28, 40, 38, 0.08);
  background: rgba(248, 246, 241, 0.85);
  backdrop-filter: saturate(140%) blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.wordmark {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.wordmark span {
  color: var(--wood);
}
.site-header nav {
  display: flex;
  gap: 1.4rem;
  font-size: 0.92rem;
}
.site-header nav a {
  color: rgba(28, 40, 38, 0.7);
  text-decoration: none;
  transition: color 0.2s;
}
.site-header nav a:hover {
  color: var(--ink);
}

/* ---- Article ---- */
.article {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) 1.5rem 3rem;
}

.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--teal);
  margin: 0 0 1rem;
}

.article h1 {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  line-height: 1.08;
  margin: 0 0 1rem;
  text-wrap: balance;
}

.article .lede {
  font-size: 1.2rem;
  line-height: 1.55;
  color: rgba(28, 40, 38, 0.78);
  margin: 0 0 2rem;
}

.article h2 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.15;
  margin: 2.6rem 0 0.8rem;
  text-wrap: balance;
}

.article h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  margin: 1.8rem 0 0.6rem;
}

.article p {
  margin: 0 0 1.15rem;
}

.article a {
  color: var(--teal);
  text-decoration: underline;
  text-decoration-color: rgba(63, 94, 98, 0.4);
  text-underline-offset: 3px;
}
.article a:hover {
  text-decoration-color: var(--teal);
}

.article ul {
  margin: 0 0 1.15rem;
  padding-left: 1.3rem;
}
.article li {
  margin: 0 0 0.5rem;
}

.meta {
  font-size: 0.85rem;
  color: rgba(28, 40, 38, 0.55);
  margin: 0 0 2.2rem;
}

/* Callout / disclaimer */
.note {
  background: var(--pale-teal);
  border-left: 3px solid var(--teal);
  border-radius: 0 10px 10px 0;
  padding: 1rem 1.2rem;
  font-size: 0.95rem;
  color: rgba(28, 40, 38, 0.8);
  margin: 2rem 0;
}

/* FAQ */
.faq {
  margin-top: 3rem;
  border-top: 1px solid rgba(28, 40, 38, 0.1);
  padding-top: 2rem;
}
.faq h2 {
  margin-top: 0;
}
.faq details {
  border-bottom: 1px solid rgba(28, 40, 38, 0.1);
  padding: 1rem 0;
}
.faq summary {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "+";
  color: var(--teal);
  font-size: 1.4rem;
  font-weight: 400;
  transition: transform 0.2s;
}
.faq details[open] summary::after {
  transform: rotate(45deg);
}
.faq details p {
  margin: 0.8rem 0 0;
  color: rgba(28, 40, 38, 0.8);
}

/* Read next */
.read-next {
  margin-top: 3rem;
  border-top: 1px solid rgba(28, 40, 38, 0.1);
  padding-top: 2rem;
}
.read-next h2 {
  margin-top: 0;
}
.read-next ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.8rem;
}
.read-next a {
  display: block;
  text-decoration: none;
  background: var(--cream-2);
  border: 1px solid rgba(28, 40, 38, 0.08);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  color: var(--ink);
  transition:
    transform 0.25s,
    box-shadow 0.25s;
}
.read-next a:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -28px rgba(13, 22, 22, 0.5);
}
.read-next .title {
  font-family: var(--serif);
  font-size: 1.1rem;
  display: block;
}
.read-next .blurb {
  font-size: 0.92rem;
  color: rgba(28, 40, 38, 0.7);
  margin-top: 0.25rem;
  display: block;
}

/* ---- Footer (matches React Footer.tsx) ---- */
.site-footer {
  background: var(--ink);
  color: rgba(246, 242, 234, 0.8);
  margin-top: 4rem;
}
.site-footer__disclaimer {
  border-bottom: 1px solid rgba(246, 242, 234, 0.1);
}
.site-footer__disclaimer .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.85rem;
  line-height: 1.65;
  color: rgba(246, 242, 234, 0.55);
}
.site-footer__disclaimer .mark {
  color: var(--wood);
}
.site-footer__grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  display: grid;
  gap: 3rem;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .site-footer__grid {
    grid-template-columns: 1.6fr 1fr 1.4fr;
  }
}
.site-footer h2.brand {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--light);
  margin: 0;
  font-weight: 600;
}
.site-footer h2.brand span {
  color: var(--wood);
}
.site-footer p.tag {
  margin: 1rem 0 0;
  max-width: 34rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: rgba(246, 242, 234, 0.55);
}
.site-footer h3 {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(246, 242, 234, 0.4);
  margin: 0 0 1.25rem;
}
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.site-footer ul a {
  color: rgba(246, 242, 234, 0.75);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.site-footer ul a:hover {
  color: var(--light);
}
.site-footer a.email {
  color: var(--wood);
  text-decoration: underline;
  text-decoration-color: rgba(201, 168, 124, 0.4);
  text-underline-offset: 4px;
  font-weight: 500;
  font-size: 0.95rem;
}
.site-footer a.email:hover {
  color: var(--light);
}
.site-footer__bar {
  border-top: 1px solid rgba(246, 242, 234, 0.1);
}
.site-footer__bar .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  font-size: 0.82rem;
  color: rgba(246, 242, 234, 0.45);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
