/* WeatherLabs — the design system of the home, Applications, Explorer and
   Account pages: the site's tokens and light/dark themes (as shared.css),
   buttons with the cursor-following highlight, cards, pills, forms, the
   drawer and toasts. The navigation bar, profile menu, beta notice and
   footer are the site chrome every page shares (../chrome.css). Page
   layouts live in hero.css, apps.css, home.css, applications.css,
   explorer.css and account.css. */

@import url('../chrome.css');

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

/* ---- tokens: light (default) — values from site/shared.css ------------- */
:root {
  --bg: #f7f7f4; --bg2: #ffffff; --bg3: #efefec; --bg4: #e6e6e2;
  --text: #1d1d22; --text2: #585862; --text3: #8a8a94;
  --accent: #1f6fc4; --accent2: #1857a0; --accent-dim: rgba(31, 111, 196, .08);
  --accent-ring: rgba(31, 111, 196, .35); --accent-glow: rgba(31, 111, 196, .45);
  --accent-hover: #2b7fd8; --on-accent: #ffffff; --cyan: #1aa6c4;
  --green: #1d9e4f; --green-dim: rgba(29, 158, 79, .08);
  --amber: #a96f12; --amber-dim: rgba(190, 140, 40, .1);
  --red: #c93a3a; --red-dim: rgba(220, 70, 70, .08);
  --line: rgba(20, 20, 30, .08); --line2: rgba(20, 20, 30, .12); --line3: rgba(20, 20, 30, .18);
  --glass: rgba(255, 255, 255, .86); --glass2: rgba(255, 255, 255, .95);
  --nav-bg: rgba(247, 247, 244, .85);
  --shadow: 0 1px 2px rgba(20, 20, 30, .04), 0 12px 32px -18px rgba(20, 20, 30, .18);
  --shadow-lg: 0 24px 60px -24px rgba(20, 20, 30, .3);

  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --hand: 'Caveat', 'Bradley Hand', 'Segoe Script', cursive;

  --max: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --nav-h: 72px;
  --r-sm: 6px; --r: 10px; --r-lg: 16px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
html[data-theme='dark'] {
  --bg: #0a0a0c; --bg2: #111114; --bg3: #18181c; --bg4: #1e1e24;
  --text: #e8e6e1; --text2: #9a9892; --text3: #6e6d68;
  --accent: #4a9eed; --accent2: #2d7fd4; --accent-dim: rgba(74, 158, 237, .09);
  --accent-ring: rgba(74, 158, 237, .4); --accent-glow: rgba(74, 158, 237, .55);
  --accent-hover: #62b0ff; --on-accent: #06121f; --cyan: #5ee7ff;
  --green: #4ecb71; --green-dim: rgba(78, 203, 113, .09);
  --amber: #e8a838; --amber-dim: rgba(232, 168, 56, .1);
  --red: #e85454; --red-dim: rgba(232, 84, 84, .1);
  --line: rgba(255, 255, 255, .06); --line2: rgba(255, 255, 255, .09); --line3: rgba(255, 255, 255, .15);
  --glass: rgba(10, 10, 12, .82); --glass2: rgba(14, 14, 17, .95);
  --nav-bg: rgba(10, 10, 12, .78);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -18px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
/* the weatherlabs.io hero is a dark "space" scene in both themes */
.on-dark {
  --text: #e8e6e1; --text2: #a3a19b; --text3: #77756f;
  --line: rgba(255, 255, 255, .06); --line2: rgba(255, 255, 255, .1); --line3: rgba(255, 255, 255, .22);
  --accent: #4a9eed; --accent-dim: rgba(74, 158, 237, .09); --accent-ring: rgba(74, 158, 237, .45);
  --accent-glow: rgba(74, 158, 237, .6); --accent-hover: #62b0ff; --on-accent: #06121f;
  color: var(--text);
}

/* ---- base ---------------------------------------------------------------- */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.6; font-weight: 400; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent); color: var(--on-accent); }
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 300; padding: 10px 14px; background: var(--accent); color: var(--on-accent); border-radius: 8px; }
.skip:focus { top: 12px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }
.muted { color: var(--text2); }
.faint { color: var(--text3); }
.num { font-variant-numeric: tabular-nums; }

/* ---- type ---------------------------------------------------------------- */
.section { padding-block: clamp(72px, 9vw, 128px); position: relative; }
.section--tight { padding-block: clamp(56px, 6vw, 88px); }
.section--alt { background: var(--bg2); }
.section-label { display: inline-flex; align-items: center; gap: 10px; font-size: .68rem; letter-spacing: .32em; text-transform: uppercase; color: var(--accent); font-weight: 500; margin-bottom: 1rem; }
.section-label::before { content: ''; width: 22px; height: 1px; background: currentColor; opacity: .7; }
.section-title { font-family: var(--serif); font-size: clamp(2.1rem, 4.4vw, 3.4rem); font-weight: 300; line-height: 1.12; letter-spacing: .005em; max-width: 760px; }
.section-title em { font-style: italic; color: var(--accent); }
.section-desc { font-size: 1.02rem; color: var(--text2); line-height: 1.8; max-width: 600px; font-weight: 300; margin-top: 1.1rem; }
.section-head { margin-bottom: clamp(32px, 4.5vw, 56px); }
.section-head--split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px 64px; align-items: end; }
.section-head--split .section-desc { margin-top: 0; }
@media (max-width: 860px) { .section-head--split { grid-template-columns: 1fr; } }
.h3 { font-family: var(--serif); font-size: 1.45rem; font-weight: 400; line-height: 1.2; }
.kicker { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text3); }

/* ---- buttons: the highlight in WeatherLabs blue ----------------------- */
.btn { --h: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--h); padding: 0 20px; border-radius: 9px; font-family: var(--sans); font-size: 15px; font-weight: 500; letter-spacing: .005em; white-space: nowrap; color: var(--text); transition: background .2s var(--ease), color .2s, box-shadow .25s var(--ease), transform .2s var(--ease); }
.btn svg { width: 17px; height: 17px; transition: transform .25s var(--ease); }
.btn:hover .ic-move { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 1px var(--accent-ring) inset, 0 8px 30px -10px var(--accent-glow); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); box-shadow: 0 0 0 1px rgba(255, 255, 255, .25) inset, 0 10px 40px -6px var(--accent-glow); }
.btn-ghost { background: var(--accent-dim); box-shadow: 0 0 0 1px var(--line2) inset; backdrop-filter: blur(8px); }
.btn-ghost:hover { box-shadow: 0 0 0 1px var(--accent-ring) inset, 0 8px 28px -14px var(--accent-glow); color: var(--text); }
.btn-quiet { color: var(--text2); padding: 0 12px; }
.btn-quiet:hover { color: var(--text); background: var(--accent-dim); }
.btn-danger { color: var(--red); box-shadow: 0 0 0 1px var(--line2) inset; }
.btn-danger:hover { background: var(--red-dim); box-shadow: 0 0 0 1px var(--red) inset; }
.btn-sm { --h: 38px; padding: 0 14px; font-size: 14px; gap: 8px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 640px) { .btn-sm { --h: 44px; } }

/* ---- cards with the cursor-following highlight ---------------------------- */
.card { position: relative; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); isolation: isolate; transition: border-color .3s, box-shadow .3s; }
.card:hover { box-shadow: var(--shadow); }
.glow { --mx: 50%; --my: 50%; }
.glow::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: radial-gradient(420px circle at var(--mx) var(--my), var(--accent-dim), transparent 50%); opacity: 0; transition: opacity .35s var(--ease); pointer-events: none; }
.glow::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: radial-gradient(260px circle at var(--mx) var(--my), var(--accent), color-mix(in srgb, var(--cyan) 40%, transparent) 40%, transparent 70%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; opacity: 0; transition: opacity .35s var(--ease); pointer-events: none; }
.glow:hover::before, .glow:hover::after, .glow:focus-within::after { opacity: 1; }

/* ---- pills, status, chips ------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 99px; font-family: var(--mono); font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: var(--accent-dim); border: 1px solid var(--accent-ring); white-space: nowrap; }
.pill--green { color: var(--green); background: var(--green-dim); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.pill--amber { color: var(--amber); background: var(--amber-dim); border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.pill--red { color: var(--red); background: var(--red-dim); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.pill--plain { color: var(--text2); background: transparent; border-color: var(--line2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; flex: none; }
.dot.live { animation: pulse 2s ease-in-out infinite; }
.dot--amber { background: var(--amber); }
.dot--ring { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text3); }
.dot--sample { background: var(--amber); }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.7); } }
/* status: never colour alone — always a word beside the dot */
.status { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text2); white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line2); font-size: 14px; color: var(--text2); transition: all .2s; }
.chip:hover { color: var(--text); border-color: var(--accent-ring); }
.chip[aria-pressed='true'], .chip[aria-selected='true'], .chip.is-on { color: var(--on-accent); background: var(--accent); border-color: var(--accent); box-shadow: 0 6px 20px -10px var(--accent-glow); }
.chip .count { font-family: var(--mono); font-size: .66rem; opacity: .7; }
@media (max-width: 640px) { .chip { min-height: 44px; } }

/* ---- forms ---------------------------------------------------------------- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: .64rem; letter-spacing: .2em; text-transform: uppercase; color: var(--text3); font-weight: 500; }
.input, .select, .textarea { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); font-size: 15px; transition: border-color .2s, box-shadow .2s; }
.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
input[type='range'] { accent-color: var(--accent); }

/* switch */
.switch { position: relative; width: 46px; height: 26px; border-radius: 99px; background: var(--bg4); box-shadow: inset 0 0 0 1px var(--line2); transition: background .2s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s var(--ease); }
.switch[aria-checked='true'] { background: var(--accent); box-shadow: 0 4px 16px -6px var(--accent-glow); }
.switch[aria-checked='true']::after { transform: translateX(20px); }

/* ---- drawer & dialog ------------------------------------------------------ */
.scrim { position: fixed; inset: 0; z-index: 150; background: rgba(5, 8, 14, .45); backdrop-filter: blur(3px); opacity: 0; transition: opacity .3s var(--ease); }
.scrim.is-open { opacity: 1; }
.drawer { position: fixed; z-index: 160; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--bg2); border-left: 1px solid var(--line2); box-shadow: var(--shadow-lg); transform: translateX(104%); transition: transform .45s var(--ease); display: flex; flex-direction: column; }
.drawer.is-open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 22px; overflow-y: auto; flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; display: inline-grid; place-items: center; color: var(--text2); }
.icon-btn:hover { color: var(--text); background: var(--accent-dim); }
.icon-btn svg { width: 20px; height: 20px; }
@media (max-width: 640px) { .icon-btn { width: 44px; height: 44px; } }

/* ---- toast ---------------------------------------------------------------- */
.toasts { position: fixed; z-index: 400; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 14px; box-shadow: var(--shadow-lg); animation: toast-in .35s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---- live / sample badge --------------------------------------------------- */
.live-badge { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--green); }
.live-badge.is-sample { color: var(--amber); }
.live-badge.is-sample .dot { background: var(--amber); animation: none; }
.skeleton { display: inline-block; min-width: 3ch; border-radius: 4px; color: transparent !important; background: linear-gradient(90deg, var(--bg3), var(--bg4), var(--bg3)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---- reveal ---------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .1s; } .reveal-d2 { transition-delay: .2s; } .reveal-d3 { transition-delay: .3s; }

/* ---- page header for inner pages ----------------------------------------- */
.page-head { padding: calc(var(--nav-h) + clamp(40px, 6vw, 80px)) 0 clamp(32px, 4vw, 48px); border-bottom: 1px solid var(--line); }
.page-head h1 { font-family: var(--serif); font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 300; line-height: 1.04; letter-spacing: .01em; }
.page-head h1 em { font-style: italic; color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
