/* ============================================================
   scotts.house — shares the family design system (teal accent)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Palette (shared neutrals) */
  --bg:             #FDFAF5;
  --surface:        #FFFFFF;
  --surface-tinted: #FAF7F2;
  --border:         #EDE9E3;
  --border-strong:  #D6CFC6;
  --text:           #1C1917;
  --text-muted:     #78716C;
  --text-faint:     #A8A29E;

  /* Accent — teal */
  --accent:         #0D9488;
  --accent-hover:   #0F766E;
  --accent-tint:    #F0FDFA;
  --accent-tint2:   #CCFBF1;
  --accent-glow:    rgba(13,148,136,.55);
  --accent-glow2:   rgba(15,118,110,.4);
  --accent-light:   #5EEAD4;

  /* Status colors */
  --status-online:  #16A34A;
  --status-offline: #DC2626;
  --status-loading: #D97706;

  /* Type */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Shape */
  --radius-sm:  6px;
  --radius:     12px;
  --radius-lg:  18px;

  /* Shadow */
  --shadow-sm:  0 2px 8px rgba(0,0,0,.07);
  --shadow-md:  0 8px 24px rgba(0,0,0,.09);
  --shadow-lg:  0 20px 48px rgba(0,0,0,.12);

  --max-width: 1200px;
  --gutter:    clamp(1rem, 4vw, 2rem);
}

html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .85em;
  background: var(--accent-tint);
  color: var(--accent-hover);
  padding: .1em .4em;
  border-radius: var(--radius-sm);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(253, 250, 245, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1.5rem;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.logo-mark { width: 28px; height: 28px; color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: .25rem; }
.site-nav a {
  padding: .4rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color .15s, background .15s;
}
.site-nav a:hover { color: var(--text); background: var(--surface-tinted); }
.site-nav a.active { color: var(--accent); }

/* Divider before off-site (family) links */
.nav-divider {
  width: 1px;
  height: 20px;
  background: var(--border-strong);
  margin: 0 .5rem;
  flex-shrink: 0;
}

/* ── Main ── */
.site-main { flex: 1; }

/* ── Hero ── */
.hero {
  position: relative;
  background: var(--text);
  color: #fff;
  padding: clamp(4rem, 10vw, 7rem) 0 clamp(3rem, 7vw, 5rem);
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.hero-glow--1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  top: -180px; right: -80px;
}
.hero-glow--2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--accent-glow2) 0%, transparent 70%);
  bottom: -120px; left: 5%;
}
.hero-inner { position: relative; z-index: 1; max-width: 680px; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  margin-bottom: 1.25rem;
  padding: .3rem .8rem;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 1.25rem;
  letter-spacing: -.02em;
}
.hero-title em { font-style: italic; color: var(--accent-light); }
.hero-sub {
  font-size: clamp(.9rem, 1.5vw, 1.1rem);
  color: rgba(255,255,255,.65);
  line-height: 1.7;
}

/* ── Section ── */
.section { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.section-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: .4rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

/* ── Status bar ── */
.status-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  padding: .85rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}
.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--status-loading);
}
.status-bar[data-state="loading"] .status-dot { background: var(--status-loading); animation: pulse 1.2s ease-in-out infinite; }
.status-bar[data-state="online"]  .status-dot { background: var(--status-online); box-shadow: 0 0 0 4px rgba(22,163,74,.15); }
.status-bar[data-state="offline"] .status-dot { background: var(--status-offline); box-shadow: 0 0 0 4px rgba(220,38,38,.12); }
.status-bar__text { font-size: .9rem; color: var(--text-muted); font-weight: 500; }
.status-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.status-interval {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.status-interval__select {
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: .3rem .5rem;
  cursor: pointer;
}
.status-interval__select:hover { border-color: var(--accent); }
.status-refresh {
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-tint);
  border: 1px solid var(--accent-tint2);
  border-radius: var(--radius-sm);
  padding: .35rem .8rem;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.status-refresh:hover { background: var(--accent-tint2); color: var(--accent-hover); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ── Rooms ── */
.rooms { display: flex; flex-direction: column; gap: 2.25rem; }
.room { scroll-margin-top: 84px; }
.room-head {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--border);
}
.room-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.room-count {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-faint);
}
.room-error {
  font-size: .9rem;
  color: var(--text-muted);
  background: var(--surface-tinted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
}

/* ── Entity tiles ── */
.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}
.entity-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: 1.1rem 1.2rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.entity-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--border-strong);
}
.entity-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.entity-card__head {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .35rem;
  color: var(--text-faint);
}
.entity-icon { width: 20px; height: 20px; flex: 0 0 auto; }
.entity-card__kind {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.entity-card__dot {
  margin-left: auto;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--border-strong);
  flex: 0 0 auto;
}
.entity-card__name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.3;
}
.entity-card__value {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
}
.entity-card__unit {
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: .25rem;
}
.entity-card__detail {
  font-size: .8rem;
  color: var(--text-faint);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tone accents — left rail + status dot */
.entity-card[data-tone="active"]::before      { background: var(--accent); }
.entity-card[data-tone="active"] .entity-card__dot {
  background: var(--status-online);
  box-shadow: 0 0 0 3px rgba(22,163,74,.16);
}
.entity-card[data-tone="active"] .entity-card__head { color: var(--accent); }
.entity-card[data-tone="inactive"]::before    { background: var(--border-strong); }
.entity-card[data-tone="neutral"]::before      { background: var(--accent-light); }
.entity-card[data-tone="neutral"] .entity-card__dot { background: var(--accent-light); }
.entity-card[data-tone="unavailable"] {
  opacity: .72;
}
.entity-card[data-tone="unavailable"]::before  { background: var(--status-offline); }
.entity-card[data-tone="unavailable"] .entity-card__dot { background: var(--status-offline); }
.entity-card[data-tone="unavailable"] .entity-card__value { color: var(--text-muted); }

.status-empty {
  font-size: .92rem;
  color: var(--text-muted);
  background: var(--surface-tinted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
}

/* ── Footer ── */
.site-footer {
  background: #1C1917;
  color: rgba(255,255,255,.7);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 1.25rem;
}
.site-logo--footer { color: rgba(255,255,255,.9); }
.site-logo--footer .logo-mark { color: var(--accent-light); }
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a { color: rgba(255,255,255,.65); font-size: .875rem; }
.footer-links a:hover { color: #fff; }
.footer-bottom { font-size: .78rem; color: rgba(255,255,255,.3); text-align: center; }
