/* ============================================================
   BuhoSleep — Design Tokens (Fluent / WinUI 3 inspired)
   ============================================================ */

/* --- Fonts ------------------------------------------------- */
:root {
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-text: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Scale */
  --fs-xs:   0.75rem;
  --fs-sm:   0.8125rem;
  --fs-base: 1rem;
  --fs-md:   1.125rem;
  --fs-lg:   1.25rem;
  --fs-xl:   1.5rem;
  --fs-2xl:  2rem;
  --fs-3xl:  2.5rem;
  --fs-hero: clamp(2.25rem, 4vw, 3.5rem);

  --fw-normal:   400;
  --fw-semibold: 600;
  --fw-bold:     700;

  --lh-tight: 1.2;
  --lh-base:  1.5;
  --lh-loose: 1.7;

  /* Spacing */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Radius (Fluent) */
  --r-sm:   4px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-xl:   16px;
  --r-pill: 999px;

  /* Transitions */
  --ease: cubic-bezier(0.33, 1, 0.68, 1);
  --dur:  0.2s;

  /* Container */
  --container-max: 1100px;
  --container-pad: clamp(1rem, 3vw, 2rem);

  /* Accent */
  --accent-brand: #F5A623;

  /* Owl eye signal colors (match app tray states) */
  --eye-off:          #8B8F98;
  --eye-presentation: #185FA5;
  --eye-background:   #2BA5A5;
  --eye-powersaver:   #4CAF50;
  --eye-highperf:     #EF9F27;
}

/* --- Dark theme (default) ---------------------------------- */
html[data-theme="dark"] {
  --bg:             #1a1a1a;
  --bg-alt:         #141414;
  --bg-card:        #2a2a2a;
  --bg-card-hover:  #323232;
  --bg-nav:         rgba(26, 26, 26, 0.85);
  --bg-hero:        #101010;
  --bg-badge:       rgba(96, 205, 255, 0.12);

  --text:           #f5f5f5;
  --text-secondary: #a0a0a0;
  --text-muted:     #6e6e6e;
  --text-on-accent: #000;

  --accent:         #60CDFF;
  --accent-hover:   #98D8FF;
  --accent-subtle:  rgba(96, 205, 255, 0.08);

  --border:         rgba(255, 255, 255, 0.07);
  --border-hover:   rgba(255, 255, 255, 0.14);
  --border-strong:  rgba(255, 255, 255, 0.2);

  --shadow-card:    0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-nav:     0 1px 0 rgba(255, 255, 255, 0.04);

  --pro-gradient:   linear-gradient(135deg, #F5A623 0%, #FF6B35 100%);
  --pro-text:       #F5A623;
  --pro-badge-bg:   rgba(245, 166, 35, 0.12);

  color-scheme: dark;
}

/* --- Light theme ------------------------------------------- */
html[data-theme="light"] {
  --bg:             #f5f5f5;
  --bg-alt:         #ebebeb;
  --bg-card:        #ffffff;
  --bg-card-hover:  #f9f9f9;
  --bg-nav:         rgba(245, 245, 245, 0.85);
  --bg-hero:        #e8e8e8;
  --bg-badge:       rgba(0, 120, 212, 0.08);

  --text:           #1a1a1a;
  --text-secondary: #616161;
  --text-muted:     #999;
  --text-on-accent: #fff;

  --accent:         #0078D4;
  --accent-hover:   #106EBE;
  --accent-subtle:  rgba(0, 120, 212, 0.06);

  --border:         rgba(0, 0, 0, 0.06);
  --border-hover:   rgba(0, 0, 0, 0.12);
  --border-strong:  rgba(0, 0, 0, 0.18);

  --shadow-card:    0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-nav:     0 1px 0 rgba(0, 0, 0, 0.06);

  --pro-gradient:   linear-gradient(135deg, #E8940A 0%, #D4570A 100%);
  --pro-text:       #C67F07;
  --pro-badge-bg:   rgba(200, 130, 10, 0.1);

  color-scheme: light;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-text);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--text);
  background: var(--bg);
}

img, svg { display: block; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

::selection {
  background: var(--accent);
  color: var(--text-on-accent);
}

/* --- Utilities --------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.text-display {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}

.text-title {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
}

.text-lead {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  line-height: var(--lh-base);
}

/* --- Icon base --------------------------------------------- */
.icon {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  vertical-align: middle;
}
.icon--sm { width: 1em; height: 1em; }
.icon--lg { width: 1.5em; height: 1.5em; }
.icon--xl { width: 2em; height: 2em; }
.icon--feature { width: 2.5rem; height: 2.5rem; }

/* --- Button ------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.5rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-family: var(--font-text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  line-height: 1;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: var(--text-on-accent);
  border-color: var(--accent);
}
.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--text-on-accent);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover {
  background: var(--bg-card);
  border-color: var(--border-hover);
  color: var(--text);
}

.btn--lg {
  padding: 0.75rem 1.75rem;
  font-size: var(--fs-base);
  border-radius: var(--r-md);
}

.btn--sm {
  padding: 0.35rem 0.75rem;
  font-size: var(--fs-xs);
}

.btn--store {
  background: var(--accent);
  color: var(--text-on-accent);
  border-color: var(--accent);
  padding: 0.75rem 2rem;
  font-size: var(--fs-base);
  border-radius: var(--r-md);
  gap: 0.75em;
}
.btn--store:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--text-on-accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 120, 212, 0.25);
}

/* --- Badge ------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.3em 0.8em;
  background: var(--bg-badge);
  color: var(--accent);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}
.badge--pro {
  background: var(--pro-badge-bg);
  color: var(--pro-text);
}
