/* ═══════════════════════════════════════════════════════
   tobiro.css  –  Shared stylesheet
   ═══════════════════════════════════════════════════════ */

/* ── TOKENS ─────────────────────────────────────────── */
:root {
  --teal:        #1a9e8f;
  --teal-bright: #22c9b6;
  --teal-dim:    #0f6b60;
  --orange:      #ff8c5a;

  --bg:          #0d1117;
  --bg-card:     #161b22;
  --bg-subtle:   #1c2430;
  --border:      rgba(255,255,255,0.07);
  --text-1:      #e6edf3;
  --text-2:      #8b949e;
  --text-3:      #484f58;
  --shadow:      0 8px 32px rgba(0,0,0,0.5);
  --dot:         rgba(255,255,255,0.04);

  /* Highcharts */
  --hc-bg:       #161b22;
  --hc-text:     #8b949e;
  --hc-axis:     #484f58;
  --hc-grid:     rgba(255,255,255,0.05);
}
[data-theme="light"] {
  --bg:          #f0f2f5;
  --bg-card:     #ffffff;
  --bg-subtle:   #e8eaed;
  --border:      rgba(0,0,0,0.08);
  --text-1:      #1a1f2e;
  --text-2:      #5a6272;
  --text-3:      #b0b8c8;
  --shadow:      0 8px 32px rgba(0,0,0,0.1);
  --dot:         rgba(0,0,0,0.04);

  --hc-bg:       #ffffff;
  --hc-text:     #5a6272;
  --hc-axis:     #b0b8c8;
  --hc-grid:     rgba(0,0,0,0.05);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--text-1);
  min-height: 100vh;
  padding: 0 1rem 3rem;
  transition: background-color 0.3s, color 0.3s;
}

a { color: inherit; text-decoration: none; }

/* ── PAGE WRAPPER ────────────────────────────────────── */
.page-wrap {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

/* ── HEADER ──────────────────────────────────────────── */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0 2rem;
}
.logo {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--teal-bright);
  font-weight: 600;
}

/* ── THEME TOGGLE ────────────────────────────────────── */
.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.3rem;
  display: flex;
  gap: 0.2rem;
}
.theme-toggle button {
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 99px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: background 0.2s;
  color: var(--text-2);
}
.theme-toggle button.active { background: var(--teal); color: #fff; }

/* ── CARD ────────────────────────────────────────────── */
.card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: fadeUp 0.45s ease both;
  margin-bottom: 1.25rem;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── HERO (index only) ───────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--teal-dim) 0%, var(--teal) 60%, var(--teal-bright) 100%);
  padding: 2.5rem 2rem 2rem;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.hero-loc {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 0.5rem;
}
.hero-loc::before { content: '▲ '; font-size: 0.55rem; }
.temp-display {
  font-family: 'Courier New', monospace;
  font-size: clamp(3.5rem, 12vw, 5.5rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.9rem;
}
.temp-display sup { font-size: 0.32em; vertical-align: super; font-weight: 400; opacity: 0.8; }
.hero-meta { font-size: 0.73rem; color: rgba(255,255,255,0.6); letter-spacing: 0.04em; }

/* ── PAGE TITLE (non-hero pages) ─────────────────────── */
.page-title-bar {
  background: linear-gradient(135deg, var(--teal-dim) 0%, var(--teal) 100%);
  padding: 1.6rem 2rem;
}
.page-title-bar h1 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.page-title-bar p {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
  margin-top: 0.25rem;
  letter-spacing: 0.08em;
}

/* ── TABS ────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-bar a {
  padding: 0.85rem 1.2rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.tab-bar a.active,
.tab-bar a:hover {
  color: var(--teal-bright);
  border-bottom-color: var(--teal-bright);
}

/* ── CARD BODY ───────────────────────────────────────── */
.card-body { padding: 1.75rem 2rem; }

/* ── DATA GRID ───────────────────────────────────────── */
.data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.data-block {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  transition: border-color 0.2s;
}
.data-block:hover { border-color: var(--teal-dim); }
.data-block.full { grid-column: 1 / -1; }
.data-label {
  font-size: 0.63rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.6rem;
}
.data-values { display: flex; gap: 1rem; }
.val-item { flex: 1; }
.val-tag { font-size: 0.59rem; color: var(--text-3); letter-spacing: 0.1em; text-transform: uppercase; }
.val-num {
  font-family: 'Courier New', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.02em;
}
.val-num.hi { color: var(--orange); }
.val-num.lo { color: var(--teal-bright); }
.val-num.neu { color: var(--text-1); }

/* ── HUMIDITY BAR ────────────────────────────────────── */
.hum-row { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.3rem; }
.hum-bar-wrap { flex: 1; height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.hum-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--teal-bright));
  border-radius: 99px;
  transition: width 1.2s ease;
}
.hum-val {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--teal-bright);
  white-space: nowrap;
}
.hum-arrow {
  font-size: 1.1rem;
  color: var(--teal-bright);
  line-height: 1;
}

/* ── DIVIDER + STATUS ────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 1.25rem 0; }
.status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.68rem;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--teal-bright);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.25} }

/* ── CHART CONTAINER ─────────────────────────────────── */
.chart-wrap {
  padding: 1.5rem 1.75rem 1.75rem;
}
.chart-inner {
  width: 100%;
  height: 340px;
}
.chart-title {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1rem;
  font-weight: 600;
}

/* ── STATISTICS ──────────────────────────────────────── */
.stat-section { margin-bottom: 1.5rem; }
.stat-section-title {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal-bright);
  font-weight: 600;
  margin-bottom: 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.stat-row:last-child { border-bottom: none; }
.stat-key { color: var(--text-2); font-size: 0.8rem; }
.stat-val {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--text-1);
  font-weight: 600;
  text-align: right;
}
.stat-val.hi { color: var(--orange); }
.stat-val.lo { color: var(--teal-bright); }
.stat-val.neutral { color: var(--text-1); }

/* ── FOOTER ──────────────────────────────────────────── */
footer {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.63rem;
  color: var(--text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 540px) {
  .hero, .page-title-bar { padding: 1.75rem 1.25rem 1.5rem; }
  .card-body, .chart-wrap { padding: 1.25rem; }
  .data-grid { grid-template-columns: 1fr; }
  .tab-bar a { padding: 0.75rem 0.9rem; font-size: 0.63rem; }
  .chart-inner { height: 260px; }
}
