/* =====================================================================
   Daily Rebuild Guide — shared styles (every public page)
   Flat colour only: no gradients, no glows. Mobile first.
   ===================================================================== */

@font-face {
  font-family: 'Roboto Condensed';
  src: url('../fonts/roboto-condensed.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito Sans';
  src: url('../fonts/nunito-sans.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
/* Metric-matched stand-ins while the real fonts load, so text barely moves. */
@font-face { font-family: 'RC Fallback'; src: local('Arial Narrow'), local('ArialNarrow'), local('Arial'); size-adjust: 92%; ascent-override: 102%; }
@font-face { font-family: 'NS Fallback'; src: local('Segoe UI'), local('Arial'); size-adjust: 101%; ascent-override: 98%; }

:root {
  --teal: #156971;
  --teal-2: #399f8b;
  --cream: #f9f3e8;
  --paper: #fffdf8;
  --ink: #0f4f55;
  --ink-soft: #3d5c5f;
  --mint: #d5efe8;
  --orange: #ff5f1f;      /* DRG accent: hover on the "Get the free app" buttons */
  --on-orange: #16302f;   /* text on orange: 4.6:1 (cream would be 2.8:1) */
  --orange-text: #b93c0c; /* link hover on light backgrounds: 5.1:1 on cream, 4.7:1 on mint */
  --orange-light: #ffcfb5; /* link hover on teal (footer, bands): 4.5:1 */
  --line: rgba(21, 105, 113, .18);
  --head: 'Roboto Condensed', 'RC Fallback', 'Arial Narrow', sans-serif;
  --body: 'Nunito Sans', 'NS Fallback', system-ui, sans-serif;
  --gutter: clamp(16px, 5vw, 72px);
  --radius: 18px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
/* No underlines anywhere: links in running text are bold instead (teal alone is too close
   to the body text colour), and every link turns orange on hover / keyboard focus. */
a { color: var(--teal); text-decoration: none; transition: color .2s var(--ease); }
a:hover, a:focus-visible { color: var(--orange-text); }
.page p a:not(.btn), .page td a, .prose li a, .legacy li a, .app-install li a, .note a { font-weight: 700; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 700; line-height: 1.08; letter-spacing: .005em; margin: 0 0 .5em; color: var(--teal); text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 6vw, 4.25rem); text-transform: uppercase; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.6rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }
h4 { font-size: 1.15rem; }
p, ul, ol { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--teal-2); outline-offset: 3px; border-radius: 4px; }
.sr-only, .visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: .7em 1.1em; border-radius: 10px; background: var(--teal); color: var(--cream); font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }
.icon { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .75em 1.4em; border: 2px solid var(--teal); border-radius: 99px;
  background: transparent; color: var(--teal);
  font: 700 1rem/1.2 var(--head); letter-spacing: .04em; text-transform: uppercase; text-decoration: none;
  cursor: pointer; transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--teal); color: var(--cream); }
.btn--primary:hover { background: var(--ink); border-color: var(--ink); }
.btn--line:hover { background: var(--teal); color: var(--cream); }
.btn--lg { min-height: 56px; padding: .9em 1.8em; font-size: 1.1rem; }
.btn--sm { min-height: 40px; padding: .5em 1em; font-size: .9rem; }

/* ---------- Header ---------- */
.site-header { position: relative; z-index: 30; background: var(--cream); border-bottom: 1px solid var(--line); }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1320px; margin: 0 auto; padding: 12px var(--gutter);
  padding-top: max(12px, env(safe-area-inset-top));
}
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--teal); text-decoration: none; }
.logo img { width: 40px; height: 40px; }
.logo__name { font: 700 1.1rem/1 var(--head); letter-spacing: .06em; text-transform: uppercase; }
.main-nav ul { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; margin: 0; padding: 0; list-style: none; }
.main-nav a:not(.btn) { color: var(--ink); font: 600 1rem/1 var(--head); letter-spacing: .05em; text-transform: uppercase; text-decoration: none; padding: .5em 0; border-bottom: 2px solid transparent; transition: border-color .2s var(--ease); }
.main-nav a:not(.btn):hover, .main-nav a:not(.btn):focus-visible, .main-nav a[aria-current="page"] { color: var(--orange-text); }
.main-nav .btn { min-height: 42px; padding: .55em 1.1em; font-size: .9rem; }
.nav-toggle { display: none; }

/* Collapsed menu on small screens, only when JS runs (class set in <head>, so no layout shift). */
@media (max-width: 959px) {
  .js .site-header .nav-toggle {
    display: inline-flex; align-items: center; gap: .4em; min-height: 44px; padding: .4em .9em;
    border: 2px solid currentColor; border-radius: 99px; background: none; color: inherit;
    font: 700 .9rem/1 var(--head); letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
  }
  .js .site-header { color: var(--teal); }
  .js .site-header .main-nav { --ink: #0f4f55; }
  .js .site-header .main-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    padding: 8px var(--gutter) 24px; background: var(--cream); border-bottom: 1px solid var(--line);
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s .2s;
  }
  .js .site-header.is-open .main-nav { visibility: visible; opacity: 1; transform: none; transition: opacity .2s var(--ease), transform .2s var(--ease); }
  .js .site-header .main-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .js .site-header .main-nav a:not(.btn) { display: block; padding: .95em 0; border-bottom: 1px solid var(--line); color: var(--ink); }
  .js .site-header .main-nav__cta { margin-top: 18px; }
  .js .site-header .main-nav .btn { width: 100%; min-height: 50px; }
  .logo__name { font-size: 1rem; }
}
@media (min-width: 960px) { .main-nav ul { flex-wrap: nowrap; } }

/* ---------- Page body ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: clamp(40px, 7vw, 88px) var(--gutter) clamp(48px, 8vw, 104px); }
.page--narrow { max-width: 820px; }
.page-head { margin-bottom: clamp(28px, 4vw, 48px); }
.page-head p { max-width: 60ch; font-size: 1.15rem; color: var(--ink-soft); }
.eyebrow, .kicker { display: inline-block; margin-bottom: .8em; font: 700 .85rem/1 var(--head); letter-spacing: .16em; text-transform: uppercase; color: var(--teal); }
.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.4em; }
.prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose img { border-radius: 12px; }
.note { padding: 18px 20px; border-left: 4px solid var(--teal-2); background: var(--paper); border-radius: 0 12px 12px 0; }
.crumbs { margin-bottom: 18px; font-size: .95rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: .4em; margin: 0; padding: 0; list-style: none; }
.crumbs li + li::before { content: '/'; margin-right: .4em; color: var(--ink-soft); }

/* Cards shared by home closing, habits, topics */
.card-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); margin: 0; padding: 0; list-style: none; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 6px; height: 100%;
  padding: 22px 22px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  color: var(--ink); text-decoration: none; transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.tile:hover { border-color: var(--teal); transform: translateY(-2px); }
.tile h2, .tile h3 { margin: 0; font-size: 1.45rem; }
.tile p { margin: 0; color: var(--ink-soft); }
.tile .icon { margin-top: auto; padding-top: 10px; width: 1.6em; height: 1.6em; color: var(--teal); box-sizing: content-box; }

/* Callout to the app at the bottom of inner pages */
.join-band { margin-top: clamp(40px, 6vw, 72px); padding: clamp(26px, 4vw, 44px); border-radius: var(--radius); background: var(--teal); color: var(--cream); }
.join-band h2 { color: var(--cream); }
.join-band p { max-width: 58ch; }
.join-band p a { color: var(--cream); font-weight: 700; }
.join-band p a:hover, .join-band p a:focus-visible { color: var(--orange-light); }
.join-band .btn--primary { background: var(--cream); color: var(--teal); border-color: var(--cream); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 700; }
input[type="email"], input[type="text"], textarea {
  width: 100%; min-height: 48px; padding: .7em .9em; border: 1.5px solid rgba(15, 79, 85, .45); border-radius: 12px;
  background: var(--paper); color: var(--ink); font: inherit; font-size: 1rem;
}
input:focus-visible, textarea:focus-visible { outline: 3px solid var(--teal-2); outline-offset: 1px; border-color: var(--teal); }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; }
.inline-form input { flex: 1 1 240px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { padding: 12px 16px; border-radius: 12px; background: var(--mint); color: var(--ink); font-weight: 600; }
.form-msg--error { background: #f6dcd6; color: #7a2516; }

/* ---------- Footer ---------- */
.site-footer { background: var(--teal); color: var(--cream); }
.site-footer__inner { max-width: 1320px; margin: 0 auto; padding: clamp(40px, 6vw, 64px) var(--gutter) max(28px, env(safe-area-inset-bottom)); }
.site-footer a { color: var(--cream); text-decoration: none; transition: color .2s var(--ease); }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--orange-light); }
.footer-nav { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); padding-bottom: 36px; margin-bottom: 26px; border-bottom: 1px solid rgba(249, 243, 232, .2); }
.footer-nav h2 { margin: 0 0 .8em; color: var(--cream); font-size: 1rem; letter-spacing: .14em; text-transform: uppercase; }
.footer-nav ul { margin: 0; padding: 0; list-style: none; }
.footer-nav li { margin: 0 0 .45em; }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; }
.footer-legal { margin: 0; font-size: .95rem; }
.footer-credit { display: block; margin-top: .3em; }
/* Bold, never underlined: keeps the credit link distinct without colour alone. */
.footer-credit a { font-weight: 800; }
@media (min-width: 720px) {
  .footer-credit { display: inline; margin: 0 0 0 .9em; padding-left: .9em; border-left: 1px solid rgba(249, 243, 232, .4); }
}
.social { display: flex; gap: 10px; margin: 0; padding: 0; list-style: none; }
.social a { display: inline-flex; align-items: center; gap: .45em; min-height: 44px; padding: .4em .9em; border: 1px solid rgba(249, 243, 232, .45); border-radius: 99px; font-weight: 600; font-size: .95rem; }
.social a:hover { border-color: var(--orange-light); }
.social .icon { fill: none; stroke: currentColor; stroke-width: 1.7; }

/* ---------- Cookie banner (markup and script unchanged from the old site) ---------- */
#cookie-banner {
  position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 200;
  display: none; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 20px;
  max-width: 760px; margin: 0 auto; padding: 16px 20px; border-radius: 16px;
  background: var(--ink); color: var(--cream);
}
#cookie-banner p { margin: 0; max-width: 46ch; font-size: .95rem; line-height: 1.5; }
.cookie-banner__actions { display: flex; gap: 10px; }
.cookie-btn { min-height: 44px; padding: .55em 1.2em; border-radius: 99px; font: 700 .9rem/1 var(--head); letter-spacing: .05em; text-transform: uppercase; cursor: pointer; }
#accept-btn { border: 2px solid var(--cream); background: var(--cream); color: var(--ink); }
#decline-btn { border: 2px solid rgba(249, 243, 232, .6); background: transparent; color: var(--cream); }
#cookie-banner .cookie-btn:hover { opacity: .9; }

/* ---------- Carried-over pages (old markup, new look) ---------- */
.legacy .section { padding: 0; margin: 0 0 clamp(36px, 5vw, 56px); }
.legacy .container { max-width: none; padding: 0; }
.legacy .section__title { font-size: clamp(2rem, 4.6vw, 3.4rem); }
.legacy h1.section__title { text-transform: uppercase; }
.legacy .section__lead { max-width: 60ch; font-size: 1.15rem; color: var(--ink-soft); }
.legacy .section__lead--spaced { margin-bottom: 2em; }
.legacy .eyebrow--accent { color: var(--teal); }
.legacy .privacy-text { max-width: 70ch; margin-bottom: 1.6em; }
.legacy .privacy-text h3 { margin-top: .3em; }
.legacy .privacy-text ul { padding-left: 1.2em; }
.legacy .privacy-text li { margin-bottom: .45em; }
.legacy .card { padding: clamp(22px, 4vw, 40px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.legacy .cta-card { display: grid; gap: 28px; align-items: center; background: var(--teal); border: 0; color: var(--cream); }
.legacy .cta-card .section__title, .legacy .cta-card .section__lead { color: var(--cream); }
.legacy .cta-card .btn--neon { background: var(--cream); border-color: var(--cream); color: var(--teal); }
.legacy .cta-card .hero__note { color: var(--cream); }
@media (min-width: 860px) { .legacy .cta-card { grid-template-columns: 1.2fr 1fr; } }
.legacy .feature__media img { border-radius: 14px; }
.legacy .hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 1.2em; }
.legacy .hero__note { margin: 0; font-size: .95rem; color: var(--ink-soft); }
.legacy .btn--neon { background: var(--teal); color: var(--cream); }
.legacy .btn--neon:hover { background: var(--ink); border-color: var(--ink); }
.legacy .btn--ghost:hover { background: var(--teal); color: var(--cream); }
.legacy .text-center { text-align: center; }
.legacy .grid-3, .legacy .newsletter-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.legacy .badge { display: inline-block; padding: .25em .7em; border-radius: 99px; background: var(--mint); color: var(--ink); font: 700 .8rem/1.3 var(--head); letter-spacing: .08em; text-transform: uppercase; }

/* Motion off: nothing moves for people who ask for that. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
.legacy [data-legacy="media-narrow"] { max-width: 420px; margin-bottom: 2rem; }
.post-tile img { width: calc(100% + 44px); max-width: none; margin: -22px -22px 12px; border-radius: var(--radius) var(--radius) 0 0; aspect-ratio: 600 / 335; object-fit: cover; }
.signup { margin: 0 0 clamp(36px, 5vw, 56px); padding: clamp(22px, 4vw, 36px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.signup h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.see-also { margin-top: 28px; color: var(--ink-soft); }
.more { margin-top: clamp(40px, 6vw, 64px); }
.more h2 { font-size: 1.5rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Legal line in the footer (every page) */
.footer-policies { flex-basis: 100%; order: 3; }
.footer-policies ul { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-size: .95rem; }
.footer-cookie-settings { padding: 0; border: 0; background: none; color: var(--cream); font: inherit; cursor: pointer; }
.footer-cookie-settings:hover, .footer-cookie-settings:focus-visible { color: var(--mint); }
.footer-policies a, .footer-cookie-settings { display: inline-block; min-height: 24px; padding: 2px 0; }

/* Tables in legal pages */
.prose table { width: 100%; margin: 0 0 1.4em; border-collapse: collapse; font-size: 1rem; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose thead th { color: var(--teal); font: 700 .85rem/1.3 var(--head); letter-spacing: .1em; text-transform: uppercase; border-bottom-width: 2px; }
.prose tbody th { width: 9em; color: var(--teal); font-weight: 700; }
@media (max-width: 640px) {
  .prose table, .prose thead, .prose tbody, .prose tr, .prose th, .prose td { display: block; }
  .prose thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .prose tbody tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .prose td, .prose tbody th { padding: 2px 0; border: 0; width: auto; }
}

/* The DRG app: /app page, the band on habit pages, the line under blog posts */
.app-section { margin-top: clamp(40px, 6vw, 72px); }
.app-section h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.app-lede { max-width: 60ch; font-size: 1.15rem; }
.app-lede--soft { color: var(--ink-soft); }
.app-steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); margin: 0 0 24px; padding: 0; list-style: none; counter-reset: step; }
.app-steps li { counter-increment: step; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.app-steps h3 { margin: 0 0 .4em; font-size: 1.5rem; text-transform: uppercase; }
.app-steps h3::before { content: counter(step) ". "; color: var(--teal-2); }
.app-steps p { margin: 0; }
.app-features { display: grid; gap: 12px 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); margin: 0; padding: 0; list-style: none; }
.app-features li { padding: 14px 0 14px 18px; border-left: 3px solid var(--teal-2); }
.app-install { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); align-items: start; }
.app-install__col { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.app-install__col h3 { margin-top: 0; font-size: 1.3rem; }
.app-install__col ol { margin: 0; padding-left: 1.2em; }
.app-install__col li + li { margin-top: .5em; }
.app-qr { margin: 0; padding: 22px; border-radius: var(--radius); background: var(--mint); text-align: center; }
.app-qr img { display: block; width: 180px; height: 180px; margin: 0 auto 12px; border-radius: 8px; }
.app-qr figcaption { max-width: 26ch; margin: 0 auto; font-size: .95rem; }
@media (hover: none) and (pointer: coarse) { .app-qr { display: none; } }
.app-band { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; margin-top: clamp(40px, 6vw, 64px); padding: clamp(22px, 4vw, 36px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--mint); }
.app-band__text { flex: 1 1 320px; }
.app-band h2 { margin: 0 0 .3em; font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.app-band p { margin: 0; max-width: 56ch; }
.app-band .btn-row { align-items: center; }
.app-band__more { font-weight: 700; }
.join-band + .app-band, .app-band + .join-band { margin-top: 24px; }
.app-line { margin: 24px 0 0; padding: 16px 20px; border-left: 4px solid var(--teal-2); background: var(--paper); border-radius: 0 12px 12px 0; }
.app-line a { font-weight: 700; }
.app-guide { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; padding: clamp(22px, 4vw, 32px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.app-guide__text { flex: 1 1 320px; }
.app-guide h3 { margin: 0 0 .3em; font-size: 1.3rem; }
.app-guide p { margin: 0; max-width: 56ch; }
.app-guide__action { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.app-guide__meta { font-size: .9rem; color: var(--ink-soft); }
.app-guide-link { margin-top: 14px; font-weight: 700; }

/* Every "Get the free app" button turns DRG orange on hover / keyboard focus
   (the cream ones used to fade to mint, which read as white on the teal bands). */
.main-nav__cta .btn:hover, .main-nav__cta .btn:focus-visible,
.closing .btn--primary:hover, .closing .btn--primary:focus-visible,
.join-band .btn--primary:hover, .join-band .btn--primary:focus-visible,
.legacy .cta-card .btn--neon:hover, .legacy .cta-card .btn--neon:focus-visible { background: var(--orange); border-color: var(--orange); color: var(--on-orange); }
