/* Sleep Health Data Commons — landing page styles.
   Night-to-dawn. Everything is scoped under .shdc so nothing leaks into the
   rest of bdsp.io, and the site's own styles don't bleed in here. */

.shdc {
  --shdc-night:  #0E1A2B;
  --shdc-rem:    #1F3A5F;
  --shdc-dawn:   #F2A65A;
  --shdc-dawn-text: #9A5A14;   /* amber text on light backgrounds (WCAG AA) */
  --shdc-signal: #5FB7C4;      /* data traces / charts only */
  --shdc-mist:   #EEF2F6;
  --shdc-paper:  #FFFFFF;
  --shdc-ink:    #1C2633;
  --shdc-muted:  #5A6778;
  --shdc-line:   #D5DCE5;
  --shdc-font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --shdc-font-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --shdc-font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  background: var(--shdc-mist);
  color: var(--shdc-ink);
  font: 16px/1.6 var(--shdc-font-body);
  -webkit-font-smoothing: antialiased;
}
.shdc *, .shdc *::before, .shdc *::after { box-sizing: border-box; }
.shdc h1, .shdc h2, .shdc h3 {
  font-family: var(--shdc-font-display); font-weight: 600;
  line-height: 1.18; margin: 0; color: var(--shdc-night);
}
.shdc p { margin: 0; max-width: 66ch; }
.shdc a { color: var(--shdc-rem); }
.shdc a:focus-visible, .shdc button:focus-visible, .shdc .shdc-btn:focus-visible {
  outline: 3px solid var(--shdc-dawn); outline-offset: 2px; border-radius: 4px;
}
.shdc .wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }
.shdc .mono { font-family: var(--shdc-font-mono); font-variant-numeric: tabular-nums; }
.shdc .eyebrow {
  font-family: var(--shdc-font-mono); font-size: .78rem; letter-spacing: .09em;
  text-transform: uppercase; color: var(--shdc-dawn-text);
}

/* under-construction banner (temporary, while the design is a first pass) */
.shdc .shdc-construction {
  background: var(--shdc-dawn); color: #3A2403; text-align: center;
  padding: 9px 16px; font-family: var(--shdc-font-body); font-weight: 600;
  font-size: .9rem; letter-spacing: .01em;
}
.shdc .shdc-construction span { font-weight: 400; opacity: .85; }

/* buttons */
.shdc .shdc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--shdc-font-body); font-weight: 600; font-size: 1rem;
  padding: 12px 22px; border-radius: 8px; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: transform .08s ease, background .15s ease;
}
.shdc .shdc-btn:hover { transform: translateY(-1px); }
.shdc .shdc-btn-primary { background: var(--shdc-dawn); color: #3A2403; border-color: var(--shdc-dawn); }
.shdc .shdc-btn-primary:hover { background: #F4B679; }
.shdc .shdc-btn-outline { background: transparent; color: #E6ECF3; border-color: #4A5E79; }
.shdc .shdc-btn-outline:hover { border-color: var(--shdc-dawn); color: #fff; }
.shdc section + section { border-top: 1px solid var(--shdc-line); }
.shdc .sec { padding: 56px 0; }
.shdc .lead { color: var(--shdc-muted); margin-top: 8px; font-size: 1.05rem; }
.shdc h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.shdc h3 { font-size: 1.15rem; }

/* ---- hero (night) ---- */
.shdc-hero { background: var(--shdc-night); color: #E6ECF3; padding: 40px 0 36px; }
.shdc-hero .brandrow { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.shdc-hero .brandrow img { height: 34px; width: auto; }
.shdc-hero .brandrow nav { margin-left: auto; display: flex; gap: 20px; flex-wrap: wrap; }
.shdc-hero .brandrow nav a {
  color: #B9C6D6; text-decoration: none; font-size: .92rem;
}
.shdc-hero .brandrow nav a:hover { color: #fff; }
.shdc-hero h1 {
  font-size: clamp(2rem, 5vw, 3.1rem); color: #fff; margin: 8px 0 14px; max-width: 18ch;
  text-wrap: balance;
}
.shdc-hero .sub { color: #B9C6D6; font-size: 1.1rem; max-width: 60ch; }
.shdc-hero .cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 24px; }
.shdc-hero .hypno { margin-top: 30px; width: 100%; height: auto; display: block; }
.shdc-hero .hero-fig { margin: 28px 0 0; }
.shdc-hero .hero-fig img { display: block; width: 100%; height: auto; border-radius: 8px; }
.shdc-hero .hero-figcap { margin-top: 12px; font-size: .84rem; color: #B9C6D6; max-width: 72ch; }
.shdc-hero .hero-figcap a { color: #B9C6D6; }

/* ---- numbers ---- */
.shdc-numbers .grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-top: 26px; }
.shdc-stat { background: var(--shdc-paper); border: 1px solid var(--shdc-line); border-radius: 12px; padding: 20px; }
.shdc-stat .fig { font-family: var(--shdc-font-mono); font-size: 2.1rem; font-weight: 500; color: var(--shdc-night); line-height: 1; }
.shdc-stat .fig .u { font-size: 1.1rem; color: var(--shdc-dawn-text); }
.shdc-stat .lbl { margin-top: 10px; font-size: .95rem; color: var(--shdc-ink); }
.shdc-stat .goal { display: inline-block; margin-top: 8px; font-family: var(--shdc-font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--shdc-dawn-text); background: #FCEBD8; border-radius: 999px; padding: 2px 8px; }

/* ---- generic grids / cards ---- */
.shdc .grid { display: grid; gap: 18px; margin-top: 26px; }
.shdc .g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.shdc .g3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.shdc .card { background: var(--shdc-paper); border: 1px solid var(--shdc-line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.shdc .card p { font-size: .96rem; }
.shdc .std { font-family: var(--shdc-font-mono); font-size: .76rem; letter-spacing: .03em; color: var(--shdc-rem); }

/* ---- what's inside: modality tiles with traces ---- */
.shdc-inside .tile svg { display: block; width: 100%; height: 44px; margin-bottom: 4px; }
.shdc-inside .tile .trace { fill: none; stroke: var(--shdc-signal); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }

/* ---- open-source toolbox band (night) ---- */
.shdc-toolbox { background: var(--shdc-night); color: #E6ECF3; }
.shdc-toolbox h2 { color: #fff; }
.shdc-toolbox .lead { color: #B9C6D6; }
.shdc-toolbox .shdc-btn-primary { display: inline-flex; }

/* ---- how it works ---- */
.shdc-how .steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-top: 26px; }
.shdc-step { background: var(--shdc-paper); border: 1px solid var(--shdc-line); border-radius: 12px; padding: 18px; position: relative; }
.shdc-step .n { font-family: var(--shdc-font-mono); font-size: .8rem; color: var(--shdc-dawn-text); }
.shdc-step h3 { font-size: 1.02rem; margin: 6px 0; }
.shdc-step p { font-size: .95rem; color: var(--shdc-ink); }

/* ---- two columns (researchers / health systems) ---- */
.shdc-two .card ul { margin: 4px 0 0; padding-left: 1.1em; display: grid; gap: 7px; }
.shdc-two .card li { font-size: .95rem; max-width: 60ch; }
.shdc-two .card .head { display: flex; align-items: center; gap: 10px; }
.shdc-two .card .head .tag { font-family: var(--shdc-font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--shdc-rem); background: #E3EEF7; border-radius: 999px; padding: 2px 10px; }

/* ---- privacy panel ---- */
.shdc-privacy .panel { background: var(--shdc-paper); border: 1px solid var(--shdc-line); border-left: 4px solid var(--shdc-signal); border-radius: 12px; padding: 24px; margin-top: 22px; }
.shdc-privacy .panel .grid { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); margin-top: 4px; }
.shdc-privacy .item h3 { font-size: 1rem; }
.shdc-privacy .item p { font-size: .92rem; color: var(--shdc-muted); }

/* ---- map / network ---- */
.shdc-map .netwrap { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; margin-top: 24px; }
.shdc-map svg { width: 260px; height: 260px; flex: 0 0 auto; }
.shdc-map .legend { font-size: .95rem; color: var(--shdc-muted); }
.shdc-map .legend .dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }
.shdc-map .placeholder-note { font-size: .82rem; color: var(--shdc-muted); font-style: italic; margin-top: 10px; }

/* ---- footer (night) ---- */
.shdc-foot { background: var(--shdc-night); color: #B9C6D6; padding: 40px 0; }
.shdc-foot a { color: #E6ECF3; }
.shdc-foot .cols { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.shdc-foot h3 { color: #fff; font-size: 1rem; margin-bottom: 8px; }
.shdc-foot .fund { font-size: .85rem; color: #8A99AC; max-width: 60ch; }
.shdc-foot .brandrow { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.shdc-foot .brandrow img { height: 30px; }

.shdc .placeholder { outline: 1px dashed #B99; } /* dev aid; harmless */

/* ---- responsive: hero + numbers + buttons fit a phone's first screen ---- */
@media (max-width: 600px) {
  .shdc-hero { padding: 24px 0 26px; }
  .shdc-hero .brandrow nav { display: none; }
  .shdc-hero h1 { font-size: 1.7rem; margin: 6px 0 10px; }
  .shdc-hero .sub { font-size: 1rem; }
  .shdc-hero .cta { margin-top: 18px; }
  .shdc-hero .cta .shdc-btn { flex: 1 1 auto; }
  .shdc-hero .hypno { margin-top: 18px; }
  .shdc-hero .hero-fig { margin-top: 18px; }
  .shdc .sec { padding: 40px 0; }
  .shdc-numbers .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .shdc-stat { padding: 14px; }
  .shdc-stat .fig { font-size: 1.6rem; }
}

/* ---- one slow motion effect; respect reduced-motion ---- */
@media (prefers-reduced-motion: no-preference) {
  .shdc .hypno .trace { stroke-dasharray: 1600; animation: shdc-draw 3.2s ease-out 1 both; }
  @keyframes shdc-draw { from { stroke-dashoffset: 1600; } to { stroke-dashoffset: 0; } }
}
