:root {
  color-scheme: light;
  --paper: #f7f0e6;
  --paper-strong: #efe1cd;
  --ink-900: #1f1a14;
  --ink-700: #3a3128;
  --ink-500: #6a5d4f;
  --ink-300: #b8a794;
  --accent-warm: #c25a2e;
  --accent-teal: #2f7d74;
  --accent-gold: #e1b35b;
  --card: rgba(255, 255, 255, 0.78);
  --card-border: rgba(58, 49, 40, 0.12);
  --shadow: 0 24px 48px rgba(31, 26, 20, 0.08);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink-900);
  background: radial-gradient(circle at 10% 10%, rgba(225, 179, 91, 0.18), transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(47, 125, 116, 0.18), transparent 45%),
    linear-gradient(135deg, var(--paper) 0%, #f3e3d0 45%, #e8efe9 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(120deg, rgba(31, 26, 20, 0.03), transparent 30%),
    linear-gradient(320deg, rgba(31, 26, 20, 0.04), transparent 40%);
  pointer-events: none;
  z-index: -1;
}

a {
  color: inherit;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  padding: 1.6rem 1.2rem;
  background: rgba(31, 26, 20, 0.94);
  color: #f7f0e6;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: block;
  object-fit: cover;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.brand-title {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  color: #f7f0e6;
}

.brand-subtitle {
  font-size: 0.82rem;
  color: rgba(247, 240, 230, 0.7);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-nav a {
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(247, 240, 230, 0.82);
  transition: transform 0.2s ease, background 0.2s ease;
}

.sidebar-nav a:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-card {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: grid;
  gap: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.kofi-slot {
  display: flex;
  justify-content: center;
}

.dashboard-main {
  padding: 2.4rem clamp(1.5rem, 3vw, 3.2rem) 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.dashboard-main > section,
.dashboard-main > footer {
  width: min(1100px, 100%);
  margin: 0 auto;
}

.dashboard-header {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 2rem;
  align-items: start;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.7rem;
  color: var(--ink-500);
}

.dashboard-header h1 {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(2.1rem, 3vw, 3rem);
  line-height: 1.05;
  margin: 0.6rem 0 1rem;
}

.lead {
  font-size: 1.05rem;
  color: var(--ink-700);
  margin: 0;
}

.header-panel {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.header-panel label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.4rem;
}

.region-note {
  margin-top: 0.6rem;
  color: var(--ink-500);
  font-size: 0.85rem;
}

.insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.4rem;
}

.notice-card {
  background: rgba(31, 26, 20, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem 1.4rem;
  color: var(--ink-700);
}

.fact-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}

.fact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.converter-section {
  padding-top: 1.5rem;
}

.section-head h2 {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 1.6rem;
  margin: 0 0 0.4rem;
}

.section-head p {
  margin: 0 0 1.2rem;
}

.converter-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.input-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.unit-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.input-combo {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
}

.output-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}

.output-tile {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(31, 26, 20, 0.08);
}

.output-label {
  font-size: 0.8rem;
  color: var(--ink-500);
}

.output-value {
  font-size: 1.05rem;
  font-weight: 600;
}

.section-actions {
  margin-top: 1.2rem;
  display: flex;
  justify-content: flex-end;
}

.result-box {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 0.9rem;
  border-radius: var(--radius-sm);
  background: rgba(31, 26, 20, 0.06);
  border: 1px solid rgba(31, 26, 20, 0.12);
  font-weight: 600;
}

label {
  font-weight: 600;
  color: var(--ink-700);
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(31, 26, 20, 0.18);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink-900);
}

input:focus,
select:focus {
  outline: 2px solid rgba(194, 90, 46, 0.4);
  border-color: rgba(194, 90, 46, 0.6);
}

.btn {
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: none;
  background: var(--accent-warm);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.ghost {
  background: transparent;
  color: var(--ink-700);
  border: 1px solid rgba(31, 26, 20, 0.18);
}

.sidebar .btn.ghost {
  color: rgba(247, 240, 230, 0.9);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(31, 26, 20, 0.12);
}

.live-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
}

.live-dot.is-live {
  background: var(--accent-teal);
  box-shadow: 0 0 0 6px rgba(47, 125, 116, 0.2);
  animation: pulse 1.6s ease-in-out infinite;
}

.small {
  font-size: 0.85rem;
}

.muted {
  color: var(--ink-500);
}

.sidebar .muted {
  color: rgba(247, 240, 230, 0.6);
}

.site-footer {
  padding: 0.5rem 0 1.8rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

.footer-title {
  font-weight: 700;
  margin: 0 0 0.4rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-links a {
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--ink-700);
}

.kofi-slot.kofi-footer {
  justify-content: flex-start;
}

.dashboard-main > section {
  animation: rise 0.7s ease both;
}

.dashboard-main > section:nth-of-type(2) {
  animation-delay: 0.05s;
}

.dashboard-main > section:nth-of-type(3) {
  animation-delay: 0.1s;
}

.dashboard-main > section:nth-of-type(4) {
  animation-delay: 0.15s;
}

.dashboard-main > section:nth-of-type(5) {
  animation-delay: 0.2s;
}

.dashboard-main > section:nth-of-type(6) {
  animation-delay: 0.25s;
}

.dashboard-main > section:nth-of-type(7) {
  animation-delay: 0.3s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 125, 116, 0.2);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(47, 125, 116, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(47, 125, 116, 0);
  }
}

@media (max-width: 1040px) {
  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: column;
    padding: 1.2rem;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar-nav a {
    flex: 1 1 130px;
  }

  .dashboard-main {
    padding-top: 1.6rem;
  }

  .dashboard-header {
    grid-template-columns: 1fr;
  }

  .insight-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .dashboard-main {
    padding: 1.6rem 1.2rem 2.5rem;
  }

  .sidebar-nav a {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
