/* The site's chrome: Geist, the shadcn tokens, the nav, buttons, the live dot and the footer. Shared by
   every v3 page (with site.css) and by the Flights and Weather apps (apps/*/index.html), so they wear the
   same nav and footer. Class selectors only (no element rules), so it sits alongside the apps' Tailwind.
   The tokens match apps/*/src/index.css exactly; dark is :root[data-theme="dark"], which theme.js sets. */

/* Geist, self-hosted (OFL, assets/fonts/Geist-LICENSE.txt) */
@font-face { font-family: 'Geist'; font-style: normal; font-display: swap; font-weight: 100 900; src: url('/assets/fonts/Geist-latin-ext.woff2') format('woff2-variations'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Geist'; font-style: normal; font-display: swap; font-weight: 100 900; src: url('/assets/fonts/Geist-latin.woff2') format('woff2-variations'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --chart-1: oklch(0.646 0.222 41.116);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0.07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);
  --chart-5: oklch(0.769 0.188 70.08);
  --radius: 0.625rem;
  --card-spacing: 16px;   /* shadcn's Card (apps/flights, apps/weather): padding and gaps */

  /* The live dot */
  --live-dot: oklch(0.723 0.219 149.579);

  --shadow-sm: 0 1px 2px 0 oklch(0 0 0 / 5%);
  --shadow-lg: 0 10px 30px -10px oklch(0 0 0 / 18%), 0 2px 6px -2px oklch(0 0 0 / 8%);
  --dot: oklch(0.145 0 0 / 14%);        /* dot pattern */
  --spot: oklch(0.145 0 0 / 5%);        /* card spotlight */
  --bloom-strength: .42;

  --font-sans: 'Geist', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: 20px;

  /* Meridian's project colours: core, outer, accent */
  --m0: #6f5cff; --m1: #c4bcff; --m2: #2f7bff;   /* Themisto: moon violet */
  --tw0: #e5484d; --tw1: #f6c1c3; --tw2: #2f7bff; /* Tailwind: red and blue */
  --gr0: #aeb3bf; --gr1: #d3d6dd; --gr2: #8b91a0; /* TightnessPro: grey */
  --ha0: #18bcf2; --ha1: #b5e8fb; --ha2: #0b8fc4; /* Halo Cards: Home Assistant blue */
  --wu0: #f5c542; --wu1: #f9a86b; --wu2: #f47fa4; /* Watts Up: yellow, orange, pink */
  --logo-glow: rgba(47, 123, 255, .35);

  /* Every box (cards, the hero, the bento, the facts) is drawn like the apps' Card: a 1px ring at 10% of
     the text colour, no shadow */
  --card-ring: 0 0 0 1px color-mix(in oklch, var(--foreground) 10%, transparent);

  /* Meridian's names, pointed at the new tokens, for Watts Up live's own sheet (watts-live.css) */
  --pg: var(--background);
  --surface: var(--card);
  --ink: var(--foreground);
  --ink-2: var(--muted-foreground);
  --line: var(--border);
  --sunken: var(--muted);
  --glass: color-mix(in oklch, var(--card) 80%, transparent);
  --sheet: var(--popover);
  --shadow: var(--shadow-lg);
  --press: var(--shadow-sm);
  --inset: inset 0 0 0 1px var(--border);
  --inset-hero: none;
  --mono: var(--font-mono);
  --title-font: var(--font-sans);
}

:root[data-theme="dark"] {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --chart-1: oklch(0.488 0.243 264.376);
  --chart-2: oklch(0.696 0.17 162.48);
  --chart-3: oklch(0.769 0.188 70.08);
  --chart-4: oklch(0.627 0.265 303.9);
  --chart-5: oklch(0.645 0.246 16.439);
  --shadow-sm: 0 1px 2px 0 oklch(0 0 0 / 30%);
  --shadow-lg: 0 10px 30px -10px oklch(0 0 0 / 60%);
  --dot: oklch(1 0 0 / 13%);
  --spot: oklch(1 0 0 / 6%);
  --bloom-strength: .55;

  --m0: #4a3fd0; --m1: #2a2570; --m2: #2457d6;
  --tw0: #8a1f24; --tw1: #3a1416; --tw2: #2457d6;
  --gr0: #5a606e; --gr1: #3d424d; --gr2: #5a606e;
  --ha0: #0d6f91; --ha1: #0a3445; --ha2: #0b5a78;
  --wu0: #8a6a10; --wu1: #7a3a14; --wu2: #a8325f;
  --logo-glow: rgba(59, 130, 246, .45);
}

@media (max-width: 600px) {
  :root { --gutter: 12px; }
}

/* Theme-specific images and icons */
.only-dark { display: none; }
:root[data-theme="dark"] .only-light { display: none; }
:root[data-theme="dark"] .only-dark { display: block; }

/* Theme switch: theme.js turns transitions off while the theme flips, then cross-fades the whole page */
.theme-swap *, .theme-swap *::before, .theme-swap *::after { transition: none !important; }
.theme-fade::view-transition-old(root), .theme-fade::view-transition-new(root) { animation-duration: .4s; animation-timing-function: ease; }

/* ---- Nav: the brand, then Projects and Live, each a dropdown ---- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklch, var(--background) 80%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.nav-in { max-width: 1140px; height: 56px; margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 8px; flex: none; color: var(--foreground); font-size: 15px; font-weight: 600; letter-spacing: -0.02em; text-decoration: none; }
.brand img { width: 22px; height: 22px; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-item { position: relative; }
.nav-trigger {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
  border: 0; border-radius: calc(var(--radius) * .8); background: none;
  color: var(--muted-foreground); font: 500 14px/1 var(--font-sans); white-space: nowrap; cursor: pointer;
  transition: color .15s, background .15s;
}
.nav-trigger:hover, .nav-trigger.is-current { color: var(--foreground); }
.nav-trigger[aria-expanded="true"] { color: var(--foreground); background: var(--accent); }
.nav-trigger:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent); }
.nav-trigger svg { width: 12px; height: 12px; transition: transform .2s; }
.nav-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav-panel {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 21;
  width: 480px; padding: 6px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--popover); color: var(--popover-foreground); box-shadow: var(--shadow-lg);
  animation: menu-in .18s ease both;
}
.nav-panel[hidden] { display: none; }
.nav-panel--one { width: 300px; grid-template-columns: minmax(0, 1fr); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.nav-entry { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: calc(var(--radius) * .8); color: inherit; text-decoration: none; transition: background .15s; }
.nav-entry:hover, .nav-entry:focus-visible, .nav-entry[aria-current] { background: var(--accent); outline: none; }
.nav-entry strong { display: block; font-size: 14px; font-weight: 500; line-height: 1.4; }
.nav-entry span { display: block; font-size: 13px; line-height: 1.4; color: var(--muted-foreground); }
.nav-entry .ico { flex: none; width: 16px; height: 16px; margin: 3px 6px 0; color: var(--muted-foreground); }
.nav-entry img.ico { width: 28px; height: 28px; margin: 1px 0 0; border-radius: 7px; }
.nav-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* Phones: the dropdowns hang from the whole nav, full width */
@media (max-width: 700px) {
  .nav-in { gap: 12px; }
  .nav-item { position: static; }
  .nav-panel, .nav-panel--one { top: calc(100% + 6px); left: 12px; right: 12px; width: auto; grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .hide-sm { display: none !important; }
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px;
  border: 1px solid transparent; border-radius: calc(var(--radius) * .8);
  font: 500 14px/1 var(--font-sans); white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.btn:focus-visible { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn--lg { height: 40px; padding: 0 24px; }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn--icon { width: 36px; padding: 0; }
.btn--default { background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-sm); }
.btn--default:hover { background: color-mix(in oklch, var(--primary) 90%, transparent); }
.btn--secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn--outline { background: var(--background); border-color: var(--border); color: var(--foreground); box-shadow: var(--shadow-sm); }
:root[data-theme="dark"] .btn--outline { background: color-mix(in oklch, var(--input) 30%, transparent); border-color: var(--input); }
.btn--outline:hover, .btn--ghost:hover { background: var(--accent); }
.btn--ghost { background: transparent; color: var(--foreground); }

/* ---- The live dot ---- */

.live-dot { position: relative; display: inline-block; width: 6px; height: 6px; flex: none; border-radius: 99px; background: var(--live-dot); }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit; animation: ping 1.8s cubic-bezier(0,0,.2,1) infinite; }
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

/* ---- Footer ---- */

.footer { margin-top: 72px; border-top: 1px solid var(--border); }
.footer-in {
  max-width: 1140px; margin: 0 auto; padding: 24px var(--gutter) 32px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  font-size: 13px; color: var(--muted-foreground);
}
.footer a { color: var(--muted-foreground); text-decoration: none; }
.footer a:hover { color: var(--foreground); }
.footer-links { display: flex; gap: 20px; }

@media (max-width: 600px) {
  .footer { margin-top: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-trigger, .nav-trigger svg, .nav-entry, .btn { transition: none; }
  .live-dot::after, .nav-panel { animation: none !important; }
}
