/* ============================================================
   istrump.online — Main Stylesheet
   Edit this file to change colors, fonts, spacing site-wide.
   ============================================================ */

:root {
  --navy:        #07111f;
  --navy-mid:    #0c1c30;
  --navy-card:   #0f2040;
  --navy-light:  #183254;
  --navy-border: #1e3d6b;
  --red:         #b22222;
  --red-mid:     #cc2222;
  --red-bright:  #e83232;
  --red-hero:    #ff3a3a;
  --gold:        #c9992a;
  --gold-light:  #e8b84b;
  --white:       #eef2f8;
  --white-dim:   #9bacc4;
  --white-muted: #4e6080;
  --green:       #1e7a46;
  --green-light: #28a05c;
  --base-font:   17px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: var(--base-font); }

/* ── High contrast mode ── */
body.hc { --white-dim: #eef2f8; --white-muted: #c8d4e8; }
body.hc .stat-sub, body.hc .panel-sub, body.hc .tagline,
body.hc .hm-day, body.hc .hm-total, body.hc .hm-hlabel,
body.hc .footer-credit, body.hc .footer-legal,
body.hc .footer-bottom-left, body.hc .hero-disclaimer,
body.hc .stat-cta, body.hc .last-updated,
body.hc .sleep-bar-name, body.hc .quiet-dates,
body.hc .quiet-badge, body.hc .changelog-date,
body.hc .changelog-items li, body.hc .donate-note { color: #eef2f8 !important; }

body {
  background: var(--navy);
  color: var(--white);
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Flag stripe ── */
.flag-stripe {
  height: 7px;
  background: repeating-linear-gradient(90deg,
    #b22222 0 38px, #eef2f8 38px 76px, #1a3a7a 76px 114px);
}

/* ── Header ── */
header { background: var(--navy-mid); border-bottom: 2px solid var(--red); }
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 18px 24px 16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.header-left { flex: 1; min-width: 180px; }
.eyebrow {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem;
  letter-spacing: 2.5px; color: var(--gold); text-transform: uppercase; margin-bottom: 4px;
}
.site-title {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 700; color: var(--white); line-height: 1;
}
.site-title em { color: var(--red-bright); font-style: normal; }
.tagline {
  font-family: 'Source Serif 4', serif; font-style: italic;
  font-size: clamp(1rem, 2vw, 1.25rem); color: var(--white-dim); margin-top: 6px;
}
.header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

/* ── Last post badge ── */
.last-post-wrap { position: relative; }
.last-post-badge {
  background: repeating-linear-gradient(45deg, #1a0a00 0 8px, #2a1400 8px 16px);
  border: 2px solid var(--gold); border-radius: 6px; padding: 8px 14px;
  cursor: default; text-align: center; min-width: 110px;
}
.last-post-num {
  font-family: 'Oswald', sans-serif; font-size: 26px; font-weight: 700;
  color: var(--gold-light); line-height: 1;
}
.last-post-label {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem;
  letter-spacing: 1.5px; color: var(--gold); text-transform: uppercase; margin-top: 2px;
}
.last-post-hover {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--navy-card); border: 1px solid var(--navy-border);
  border-left: 3px solid var(--gold); border-radius: 8px;
  padding: 14px 16px; min-width: 260px; z-index: 200;
  font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem;
}
.last-post-hover.active { display: block; }
.lph-time { color: var(--gold-light); font-size: 0.8rem; margin-bottom: 6px; }
.lph-preview { color: var(--white-dim); font-size: 0.8rem; line-height: 1.5; margin-bottom: 8px; font-style: italic; }
.lph-link { color: var(--gold) !important; font-size: 0.75rem; text-decoration: none; display: inline-block; margin-top: 4px; }
.lph-link:hover { color: var(--gold-light) !important; text-decoration: underline; }

.live-badge {
  display: flex; align-items: center; gap: 7px;
  background: var(--navy-card); border: 1px solid var(--navy-border);
  border-radius: 5px; padding: 7px 12px;
  font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem;
  color: var(--white-dim); white-space: nowrap;
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green-light); animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.25} }
.last-updated {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem;
  color: var(--white-muted); text-align: right; margin-top: 4px;
}

/* ── Date bar ── */
.date-bar-wrap {
  background: var(--navy-mid); border-bottom: 1px solid var(--navy-border);
  position: sticky; top: 0; z-index: 100;
}
.date-bar {
  max-width: 1200px; margin: 0 auto; padding: 9px 24px;
  display: flex; align-items: center; gap: 6px;
  overflow-x: auto; scrollbar-width: none;
}
.date-bar::-webkit-scrollbar { display: none; }
.date-label {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem;
  color: var(--white-muted); letter-spacing: 1.5px; text-transform: uppercase;
  white-space: nowrap; margin-right: 4px; flex-shrink: 0;
}
.dbtn {
  background: transparent; border: 1px solid var(--navy-border);
  color: var(--white-dim); font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem; padding: 5px 12px; border-radius: 4px;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: border-color .15s, color .15s;
}
.dbtn:hover { border-color: var(--gold); color: var(--gold); }
.dbtn.active { background: var(--red); border-color: var(--red); color: var(--white); }

/* ── Main ── */
main { max-width: 1200px; margin: 0 auto; padding: 28px 24px 100px; }

.section-label {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem;
  color: var(--gold); letter-spacing: 2px; text-transform: uppercase;
  margin-bottom: 10px; display: flex; align-items: center; gap: 10px;
}
.section-label::after { content:''; flex:1; height:1px; background:var(--navy-light); }

/* ── Share bar ── */
.share-bar { display: flex; align-items: center; gap: 6px; position: absolute; top: 14px; right: 14px; }
.share-btn {
  background: var(--navy-light); border: 1px solid var(--navy-border);
  color: var(--white-muted); font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem; padding: 4px 9px; border-radius: 4px;
  cursor: pointer; transition: all .15s;
}
.share-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ── Hero ── */
.hero {
  background: var(--navy-card); border: 1px solid var(--navy-border);
  border-top: 4px solid var(--red); border-radius: 10px;
  padding: clamp(24px, 3vw, 44px); margin-bottom: 28px;
  display: grid; grid-template-columns: auto 1fr;
  gap: 32px; align-items: center; position: relative;
}
.hero-number {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(80px, 13vw, 128px);
  font-weight: 700; color: var(--red-hero); line-height: 1; white-space: nowrap;
}
.hero-unit { font-size: clamp(28px, 4.5vw, 44px); color: var(--white-muted); font-weight: 400; }
.hero-right h2 {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1.2rem, 2.8vw, 1.8rem);
  font-weight: 600; color: var(--white); margin-bottom: 10px; line-height: 1.2;
}
.hero-right p { font-size: clamp(0.9rem, 1.6vw, 1rem); color: var(--white-dim); line-height: 1.75; }
.hero-right p strong { color: var(--white); font-weight: 400; }
.hero-disclaimer {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem;
  color: var(--white-muted); font-style: italic; margin-top: 14px; line-height: 1.7;
}

/* ── Stat cards ── */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 36px;
}
.stat-card {
  background: var(--navy-card); border: 1px solid var(--navy-border);
  border-radius: 8px; padding: 16px 18px 14px;
  cursor: pointer; transition: border-color .15s, transform .12s;
  position: relative; overflow: hidden;
}
.stat-card::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; }
.stat-card.c-red::before   { background: var(--red-bright); }
.stat-card.c-gold::before  { background: var(--gold); }
.stat-card.c-blue::before  { background: #3a7bd5; }
.stat-card.c-green::before { background: var(--green-light); }
.stat-card.c-dim::before   { background: var(--white-muted); }
.stat-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.stat-lbl {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem;
  color: var(--white-muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px;
}
.stat-val { font-family: 'Oswald', sans-serif; font-size: clamp(1.6rem, 3.5vw, 2.1rem); font-weight: 600; line-height: 1; }
.stat-val.red   { color: var(--red-bright); }
.stat-val.gold  { color: var(--gold-light); }
.stat-val.blue  { color: #6ba3e8; }
.stat-val.green { color: var(--green-light); }
.stat-sub { font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; color: var(--white-muted); margin-top: 5px; }
.stat-cta { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; color: var(--gold); margin-top: 8px; }

/* ── Panels ── */
.panel {
  background: var(--navy-card); border: 1px solid var(--navy-border);
  border-radius: 10px; padding: clamp(18px, 2.5vw, 30px);
  margin-bottom: 28px; scroll-margin-top: 60px; position: relative;
}
.panel-title {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  font-weight: 600; color: var(--white); margin-bottom: 4px;
}
.panel-sub { font-size: 0.875rem; color: var(--white-dim); margin-bottom: 20px; line-height: 1.5; }

/* ── Loading / error ── */
.loading { font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; color: var(--white-muted); padding: 40px; text-align: center; }
.error-msg { font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; color: var(--red-bright); padding: 20px; background: rgba(178,34,34,.08); border-radius: 6px; border: 1px solid var(--red); }

/* ── Heatmap ── */
.heatmap-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hm-table { display: grid; min-width: 640px; }
.hm-header-row, .hm-row { display: grid; grid-template-columns: 74px repeat(24, 1fr) 54px; gap: 1px; margin-bottom: 2px; }
.hm-day, .hm-total { font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; color: var(--white-muted); display: flex; align-items: center; white-space: nowrap; }
.hm-day { justify-content: flex-end; padding-right: 7px; }
.hm-total { justify-content: flex-start; padding-left: 7px; color: var(--white-dim); font-weight: 500; }
.hm-hlabel { font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; color: var(--white-muted); text-align: center; padding-bottom: 3px; }
.hm-cell { height: 28px; border-radius: 0; cursor: default; }
.hm-cell:hover { outline: 2px solid var(--gold-light); z-index: 5; }
.hm-legend { display: flex; align-items: center; gap: 5px; margin-top: 14px; font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; color: var(--white-muted); flex-wrap: wrap; }
.hm-swatch { width: 16px; height: 14px; flex-shrink: 0; }

/* ── Tooltip ── */
.hm-tooltip {
  display: none; position: fixed;
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  border-left: 3px solid var(--red-bright); border-radius: 6px;
  padding: 10px 14px; font-family: 'IBM Plex Mono', monospace;
  color: var(--white); pointer-events: none; z-index: 999; min-width: 170px;
}
.hm-tooltip.visible { display: block; }
.tt-day { color: var(--gold); font-size: 0.8rem; margin-bottom: 4px; }
.tt-count { font-size: 1.5rem; font-weight: 500; color: var(--red-hero); }
.tt-lbl { color: var(--white-muted); font-size: 0.75rem; }

/* ── Charts ── */
.chart-wrap { position: relative; width: 100%; height: clamp(200px, 28vw, 300px); }
.sleep-chart-wrap { position: relative; height: 300px; width: 100%; }

/* ── Mini stats ── */
.mini-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 12px; }
.mini-stat { background: var(--navy-light); border: 1px solid var(--navy-border); border-radius: 8px; padding: 14px 16px; }
.mini-stat-lbl { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; color: var(--white-muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 5px; }
.mini-stat-val { font-family: 'Oswald', sans-serif; font-size: 1.6rem; font-weight: 600; color: var(--white); line-height: 1; }
.mini-stat-val.gold { color: var(--gold-light); }
.mini-stat-val.red  { color: var(--red-bright); }
.mini-stat-sub { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; color: var(--white-muted); margin-top: 4px; }

/* ── Quiet periods ── */
.quiet-list { list-style: none; }
.quiet-item { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--navy-light); font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; flex-wrap: wrap; }
.quiet-item:last-child { border-bottom: none; }
.quiet-gap { font-size: 1rem; font-weight: 500; color: var(--gold-light); min-width: 58px; flex-shrink: 0; }
.quiet-dates { color: var(--white-dim); flex: 1; font-size: 0.8rem; }
.quiet-badge { font-size: 0.72rem; padding: 2px 8px; border-radius: 3px; background: var(--navy-light); border: 1px solid var(--navy-border); color: var(--white-muted); white-space: nowrap; }
.quiet-badge.long { background: rgba(178,34,34,.15); border-color: var(--red); color: var(--red-bright); }

/* ── Modals ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.78); z-index: 1000; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--navy-mid); border: 1px solid var(--navy-border); border-radius: 12px; padding: 28px 28px 24px; max-width: 500px; width: 100%; position: relative; max-height: 90vh; overflow-y: auto; }
.modal-close { position: absolute; top: 12px; right: 14px; background: none; border: none; color: var(--white-muted); font-size: 1.3rem; cursor: pointer; }
.modal-close:hover { color: var(--white); }
.modal h2 { font-family: 'Oswald', sans-serif; font-size: 1.4rem; font-weight: 600; color: var(--white); margin-bottom: 4px; }
.modal-sub { font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; color: var(--white-muted); margin-bottom: 20px; }

/* ── Donate modal ── */
.donate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.donate-tile { background: var(--navy-card); border: 1px solid var(--navy-border); border-radius: 8px; padding: 16px 10px; text-align: center; transition: border-color .15s; }
.donate-tile:hover { border-color: var(--gold); }
.donate-logo { font-family: 'Oswald', sans-serif; font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.donate-logo.venmo   { color: #3D95CE; }
.donate-logo.cashapp { color: #00D632; }
.donate-logo.paypal  { color: #003087; background: #fff; border-radius: 4px; padding: 0 6px; display: inline-block; }
.donate-tile-name { font-family: 'Oswald', sans-serif; font-size: 0.9rem; color: var(--white); margin-bottom: 4px; }
.donate-tile-handle { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; color: var(--gold); margin-bottom: 10px; }
.donate-tile-btn { display: block; background: var(--navy-light); border: 1px solid var(--navy-border); color: var(--white-dim); font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; padding: 6px 0; border-radius: 4px; cursor: pointer; width: 100%; text-decoration: none; transition: all .15s; }
.donate-tile-btn:hover { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.donate-note { font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; color: var(--white-muted); text-align: center; line-height: 1.7; }

/* ── Changelog modal ── */
.changelog-entry { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--navy-light); }
.changelog-entry:last-child { border-bottom: none; margin-bottom: 0; }
.changelog-ver { font-family: 'Oswald', sans-serif; font-size: 1rem; color: var(--gold-light); margin-bottom: 2px; }
.changelog-date { font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; color: var(--white-muted); margin-bottom: 8px; }
.changelog-items { list-style: none; }
.changelog-items li { font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; color: var(--white-dim); padding: 3px 0 3px 14px; position: relative; line-height: 1.5; }
.changelog-items li::before { content: '+'; position: absolute; left: 0; color: var(--green-light); }
.changelog-beta-tag { font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; background: rgba(201,153,42,.15); border: 1px solid var(--gold); color: var(--gold); border-radius: 3px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }

/* ── Share modal ── */
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.share-opt { background: var(--navy-card); border: 1px solid var(--navy-border); border-radius: 8px; padding: 14px; text-align: center; cursor: pointer; font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; color: var(--white-dim); transition: all .15s; }
.share-opt:hover { border-color: var(--gold); color: var(--gold); }
.share-opt-icon { font-size: 1.3rem; margin-bottom: 5px; display: block; }
.share-opt.full-width { grid-column: 1 / -1; }

/* ── Floating controls ── */
.float-cluster { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 500; align-items: flex-end; }
.font-row { display: flex; gap: 6px; }
.float-ctrl { background: var(--navy-card); border: 1px solid var(--navy-border); border-radius: 7px; padding: 7px 10px; font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; color: var(--white-dim); cursor: pointer; transition: all .15s; white-space: nowrap; line-height: 1; }
.float-ctrl:hover { border-color: var(--gold); color: var(--gold); }
.float-ctrl.hc-btn.active { background: #fff; color: #000; border-color: #fff; }
.float-donate { background: var(--navy-card); border: 1px solid var(--gold); border-radius: 7px; padding: 8px 14px; font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; color: var(--gold-light); cursor: pointer; transition: all .15s; }
.float-donate:hover { background: var(--gold); color: var(--navy); }

/* ── Footer ── */
footer { border-top: 1px solid var(--navy-light); padding: 36px 24px 52px; max-width: 1200px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 24px; }
.footer-credit, .footer-legal { font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; color: var(--white-muted); line-height: 1.9; }
.footer-credit a { color: var(--gold); text-decoration: none; }
.footer-credit a:hover { color: var(--gold-light); text-decoration: underline; }
.footer-credit strong { color: var(--white-dim); display: block; margin-bottom: 4px; }
.footer-bottom { border-top: 1px solid var(--navy-light); padding-top: 18px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; }
.footer-bottom-left { font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; color: var(--white-muted); line-height: 1.7; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer-links a, .footer-links button { font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; color: var(--gold); background: none; border: none; cursor: pointer; text-decoration: none; padding: 0; }
.footer-links a:hover, .footer-links button:hover { color: var(--gold-light); text-decoration: underline; }

/* ── Responsive ── */
@media(max-width:580px) { .hero { grid-template-columns: 1fr; gap: 16px; } }
@media(max-width:480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .share-bar { display: none; }
  .float-cluster { bottom: 14px; right: 14px; }
  .donate-grid { grid-template-columns: 1fr; }
}
@media(max-width:600px) { .footer-grid { grid-template-columns: 1fr; gap: 20px; } }
