/* Fairweather design system, adapted for dhvani.
 * Source of truth: /DESIGN.md. Tokens and fw- components are shared by the
 * marketing site and the product. Light only. No gradients in UI chrome.
 */

:root {
  --fw-primary: #171717;
  --fw-on-primary: #ffffff;
  --fw-secondary: #3f6fd1;
  --fw-secondary-deep: #2f58ae;
  --fw-tertiary: #1db954;
  /* Darkened from #12994A so 13-14px status text meets WCAG AA on white. */
  --fw-tertiary-text: #0f7d3c;
  --fw-tertiary-tint: #e7f8ee;
  --fw-neutral: #f2f2f1;
  --fw-surface: #ffffff;
  --fw-on-surface: #171717;
  --fw-on-surface-muted: #6e6e6b;
  --fw-well: #ececea;
  --fw-well-deep: #d9d9d6;
  --fw-dot: #dcdcd9;
  --fw-cloudlight: #f4e7c8;
  --fw-border: #ebebeb;
  --fw-border-strong: #d9d9d9;
  --fw-focus: #3f6fd1;
  --fw-error: #d14343;
  --fw-error-tint: #fbeaea;
  --fw-radius-sm: 8px;
  --fw-radius-md: 14px;
  --fw-radius-bubble: 18px;
  --fw-radius-window: 24px;
  --fw-radius-card: 32px;
  --fw-radius-full: 999px;
  --fw-shadow-card: 0 1px 2px rgba(23, 23, 23, 0.04),
    0 12px 32px -12px rgba(23, 23, 23, 0.1);
  --fw-shadow-window: 0 -8px 24px rgba(0, 0, 0, 0.08);
  --fw-container: 1200px;
  --fw-container-narrow: 720px;
  --fw-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fw-font-sans: "Albert Sans", "Noto Sans Devanagari", "Noto Sans Bengali",
    "Noto Sans Tamil", "Noto Sans Telugu", "Noto Sans Gujarati",
    "Noto Nastaliq Urdu", "Noto Sans Kannada", "Noto Sans Malayalam",
    "Noto Sans Oriya", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--fw-on-surface);
  font-family: var(--fw-font-sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--fw-secondary);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--fw-secondary-deep);
}

::selection {
  background: var(--fw-primary);
  color: var(--fw-on-primary);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--fw-well-deep);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

:focus-visible {
  outline: 2px solid var(--fw-focus);
  outline-offset: 2px;
  border-radius: var(--fw-radius-sm);
}

.ph {
  font-size: 20px;
  line-height: 1;
}

.fw-icon {
  font-size: 20px;
  line-height: 1;
}

.fw-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Ground */

.fw-ground {
  background-color: var(--fw-neutral);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Ccircle cx='1' cy='1' r='1' fill='%23DCDCD9'/%3E%3C/svg%3E");
  background-size: 8px 8px;
}

.fw-container {
  width: 100%;
  max-width: var(--fw-container);
  margin-inline: auto;
  padding-inline: 24px;
}

.fw-container-narrow {
  width: 100%;
  max-width: var(--fw-container-narrow);
  margin-inline: auto;
  padding-inline: 24px;
}

/* Logo: dhvani wordmark and a simple sound mark, never green. */

.fw-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fw-primary);
  text-decoration: none;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.fw-logo:hover {
  color: var(--fw-primary);
}

.fw-logo-mark {
  width: 27px;
  height: 27px;
  display: inline-grid;
  place-items: center;
  color: var(--fw-primary);
}

.fw-logo-mark svg {
  width: 27px;
  height: 27px;
  display: block;
}

.fw-logo--in-app {
  color: var(--fw-on-surface-muted);
  font-size: 15px;
  font-weight: 500;
}

.fw-logo--in-app .fw-logo-mark,
.fw-logo--in-app .fw-logo-mark svg {
  width: 19px;
  height: 19px;
}

/* Buttons */

.fw-btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: var(--fw-radius-md);
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 150ms var(--fw-ease),
    border-color 150ms var(--fw-ease), color 150ms var(--fw-ease),
    transform 150ms var(--fw-ease), box-shadow 150ms var(--fw-ease);
}

.fw-btn .ph {
  font-size: 19px;
}

.fw-btn:active {
  transform: translateY(1px);
}

.fw-btn--primary {
  background: var(--fw-primary);
  color: var(--fw-on-primary);
  border-color: var(--fw-primary);
}

.fw-btn--primary:hover {
  background: #2a2a2a;
  border-color: #2a2a2a;
  color: var(--fw-on-primary);
}

.fw-btn--key {
  background: var(--fw-surface);
  color: var(--fw-on-surface);
  border-color: var(--fw-border-strong);
  box-shadow: 0 2px 0 var(--fw-well-deep);
}

.fw-btn--key:hover {
  background: var(--fw-surface);
  color: var(--fw-on-surface);
  border-color: #c8c8c4;
}

.fw-btn--key:active {
  box-shadow: 0 1px 0 var(--fw-well-deep);
}

.fw-btn--quiet {
  min-height: 40px;
  padding: 0 12px;
  background: transparent;
  color: var(--fw-on-surface);
  border-color: transparent;
  font-size: 15px;
}

.fw-btn--quiet:hover {
  background: var(--fw-well);
  color: var(--fw-on-surface);
}

.fw-btn--sm {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 14px;
}

.fw-btn--lg {
  min-height: 56px;
  padding: 0 28px;
}

.fw-btn--icon {
  width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 12px;
}

.fw-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

/* Cards */

.fw-card {
  background: var(--fw-surface);
  border: 1px solid var(--fw-border);
  border-radius: var(--fw-radius-card);
  box-shadow: var(--fw-shadow-card);
  overflow: hidden;
}

.fw-card--flat {
  box-shadow: none;
}

.fw-card--link {
  transition: transform 180ms var(--fw-ease), box-shadow 180ms var(--fw-ease);
}

.fw-card--link:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 2px rgba(23, 23, 23, 0.04),
    0 18px 40px -12px rgba(23, 23, 23, 0.14);
}

.fw-card__body {
  padding: 40px;
}

.fw-card__title {
  margin: 0;
  color: var(--fw-on-surface);
  font-size: 26px;
  line-height: 1.22;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.fw-card__text {
  margin: 12px 0 0;
  max-width: 56ch;
  color: var(--fw-on-surface-muted);
  font-size: 18px;
  line-height: 1.5;
}

.fw-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.fw-card--compact .fw-card__body {
  padding: 24px;
}

/* Weather window signature */

.fw-sky {
  position: relative;
  height: 300px;
  overflow: hidden;
  background-color: var(--fw-secondary);
  background-image: var(--sky-image);
  background-position: center;
  background-size: cover;
  image-rendering: pixelated;
}

.fw-sky--tall {
  height: 420px;
}

.fw-sky--hero {
  height: 560px;
}

.fw-window {
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 84%;
  transform: translateX(-50%);
  filter: drop-shadow(0 -8px 24px rgba(0, 0, 0, 0.08));
}

.fw-window__tab {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px;
  border-bottom: 1px solid var(--fw-border);
  border-radius: var(--fw-radius-window) var(--fw-radius-window) 0 0;
  background: var(--fw-surface);
}

.fw-window__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fw-well-deep);
}

.fw-window__dot:nth-child(1) {
  background: #ff5f57;
}

.fw-window__dot:nth-child(2) {
  background: #febc2e;
}

.fw-window__dot:nth-child(3) {
  background: #28c840;
}

.fw-window__panel {
  min-height: 210px;
  padding: 24px;
  border-radius: var(--fw-radius-window) var(--fw-radius-window) 0 0;
  background: var(--fw-surface);
}

.fw-window__tab + .fw-window__panel {
  border-radius: 0;
}

.fw-window--wide {
  width: 90%;
}

.fw-window--wide .fw-window__panel {
  min-height: 330px;
}

/* Channel label and live status */

.fw-channel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fw-tertiary-text);
  font-family: "Fragment Mono", monospace;
  font-size: 13px;
  line-height: 1.2;
}

.fw-channel .ph {
  color: var(--fw-tertiary);
  font-size: 18px;
}

/* Pilot, planned and sample channels are not live, so they are not green. */
.fw-channel--pending,
.fw-channel--pending .ph {
  color: var(--fw-on-surface-muted);
}

.fw-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fw-on-surface-muted);
  font-family: "Fragment Mono", monospace;
  font-size: 13px;
  line-height: 1.3;
}

.fw-live-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--fw-well-deep);
}

.fw-live-dot--on {
  background: var(--fw-tertiary);
  box-shadow: 0 0 0 4px var(--fw-tertiary-tint);
}

.fw-status--live {
  color: var(--fw-tertiary-text);
}

/* Inputs */

.fw-label {
  display: block;
  margin-bottom: 8px;
  color: var(--fw-on-surface);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

.fw-input,
.fw-select,
.fw-textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--fw-radius-md);
  background: var(--fw-well);
  color: var(--fw-on-surface);
  font-size: 17px;
  line-height: 1.5;
  transition: background-color 150ms var(--fw-ease),
    border-color 150ms var(--fw-ease), box-shadow 150ms var(--fw-ease);
}

.fw-textarea {
  min-height: 120px;
  padding-block: 12px;
  resize: vertical;
}

.fw-input::placeholder,
.fw-textarea::placeholder {
  color: var(--fw-on-surface-muted);
}

.fw-input:focus,
.fw-select:focus,
.fw-textarea:focus {
  outline: none;
  background: var(--fw-surface);
  border-color: var(--fw-primary);
  box-shadow: 0 0 0 3px rgba(63, 111, 209, 0.24);
}

.fw-input[aria-invalid="true"],
.fw-textarea[aria-invalid="true"] {
  background: var(--fw-error-tint);
  border-color: var(--fw-error);
}

.fw-hint {
  margin: 8px 0 0;
  color: var(--fw-on-surface-muted);
  font-size: 14px;
}

.fw-hint--error {
  color: var(--fw-error);
}

.fw-input-group {
  position: relative;
}

.fw-input-group .ph {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fw-on-surface-muted);
  pointer-events: none;
}

.fw-input-group .fw-input {
  padding-left: 44px;
}

/* Checkboxes and toggles */

.fw-check {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid var(--fw-border-strong);
  border-radius: 6px;
  background: var(--fw-surface);
  color: var(--fw-on-primary);
  cursor: pointer;
}

.fw-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.fw-check:has(input:checked) {
  background: var(--fw-primary);
  border-color: var(--fw-primary);
}

.fw-check .ph {
  display: none;
  font-size: 14px;
}

.fw-check:has(input:checked) .ph {
  display: block;
}

.fw-toggle {
  position: relative;
  width: 40px;
  height: 24px;
  flex-shrink: 0;
}

.fw-toggle input {
  position: absolute;
  opacity: 0;
}

.fw-toggle__track {
  position: absolute;
  inset: 0;
  border-radius: var(--fw-radius-full);
  background: var(--fw-well-deep);
  cursor: pointer;
  transition: background-color 160ms var(--fw-ease);
}

.fw-toggle__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--fw-surface);
  transition: transform 160ms var(--fw-ease);
}

.fw-toggle input:checked + .fw-toggle__track {
  background: var(--fw-tertiary);
}

.fw-toggle input:checked + .fw-toggle__track::after {
  transform: translateX(16px);
}

.fw-toggle input:focus-visible + .fw-toggle__track {
  outline: 2px solid var(--fw-focus);
  outline-offset: 2px;
}

/* Tabs */

.fw-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: var(--fw-radius-md);
  background: var(--fw-well);
}

.fw-tab {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--fw-on-surface-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.fw-tab[aria-selected="true"] {
  background: var(--fw-surface);
  color: var(--fw-on-surface);
  border-bottom-color: var(--fw-border-strong);
  box-shadow: 0 1px 0 var(--fw-border-strong);
}

/* Tables */

.fw-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 15px;
  line-height: 1.45;
}

.fw-table th {
  padding: 12px 20px;
  color: var(--fw-on-surface-muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.fw-table td {
  padding: 16px 20px;
  border-top: 1px solid var(--fw-border);
  vertical-align: middle;
}

.fw-table tbody tr {
  transition: background-color 120ms var(--fw-ease);
}

.fw-table tbody tr:hover {
  background: #fafaf9;
}

.fw-num {
  font-family: "Fragment Mono", monospace;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Stats */

.fw-stat__value {
  margin: 0;
  color: var(--fw-on-surface);
  font-size: 36px;
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.fw-stat__label {
  margin: 8px 0 0;
  color: var(--fw-on-surface-muted);
  font-size: 15px;
}

/* Conversation */

.fw-thread {
  display: grid;
  gap: 12px;
}

.fw-bubble {
  width: fit-content;
  max-width: 78%;
  padding: 12px 16px;
  border: 1px solid var(--fw-border);
  border-radius: var(--fw-radius-bubble) var(--fw-radius-bubble)
    var(--fw-radius-bubble) 6px;
  background: var(--fw-surface);
  color: var(--fw-on-surface);
  font-size: 15px;
  line-height: 1.45;
}

.fw-bubble--out {
  justify-self: end;
  border-color: transparent;
  border-radius: var(--fw-radius-bubble) var(--fw-radius-bubble) 6px
    var(--fw-radius-bubble);
  background: var(--fw-tertiary-tint);
}

.fw-bubble__meta {
  display: block;
  margin-top: 4px;
  color: var(--fw-on-surface-muted);
  font-family: "Fragment Mono", monospace;
  font-size: 13px;
}

/* Skeletons */

.fw-skeleton-bar,
.fw-skeleton-block {
  display: block;
  border-radius: var(--fw-radius-full);
  background: var(--fw-well);
}

.fw-skeleton-bar {
  height: 10px;
}

.fw-skeleton-block {
  min-height: 56px;
  border-radius: var(--fw-radius-md);
}

.fw-skeleton-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.fw-skeleton-grid .fw-skeleton-bar {
  grid-column: 1 / -1;
}

.fw-skeleton-grid .fw-skeleton-bar:nth-child(2) {
  width: 68%;
}

.fw-skeleton-block--cut {
  min-height: 92px;
  margin-bottom: -52px;
}

/* Locale-aware type. The lang attribute selects the script font. */

:lang(ur) {
  font-family: "Noto Nastaliq Urdu", var(--fw-font-sans);
  line-height: 1.9;
}

:lang(bn) { font-family: "Noto Sans Bengali", var(--fw-font-sans); }
:lang(ta) { font-family: "Noto Sans Tamil", var(--fw-font-sans); }
:lang(te) { font-family: "Noto Sans Telugu", var(--fw-font-sans); }
:lang(gu) { font-family: "Noto Sans Gujarati", var(--fw-font-sans); }
:lang(kn) { font-family: "Noto Sans Kannada", var(--fw-font-sans); }
:lang(ml) { font-family: "Noto Sans Malayalam", var(--fw-font-sans); }
:lang(or) { font-family: "Noto Sans Oriya", var(--fw-font-sans); }
:lang(hi), :lang(mr) { font-family: "Noto Sans Devanagari", var(--fw-font-sans); }

[dir="rtl"] {
  text-align: start;
}

/* Utilities */

.fw-muted {
  color: var(--fw-on-surface-muted);
}

.fw-mono {
  font-family: "Fragment Mono", monospace;
  font-variant-numeric: tabular-nums;
}

.fw-divider {
  border: 0;
  border-top: 1px solid var(--fw-border);
}

@media (max-width: 960px) {
  .fw-card__body {
    padding: 32px;
  }

  .fw-sky--hero {
    height: 420px;
  }
}

@media (max-width: 640px) {
  .fw-card {
    border-radius: 24px;
  }

  .fw-card__body {
    padding: 24px;
  }

  .fw-card__title {
    font-size: 23px;
  }

  .fw-sky--hero {
    height: 340px;
  }

  .fw-sky--tall {
    height: 300px;
  }

  .fw-window__panel {
    min-height: 170px;
    padding: 18px;
  }

  .fw-window--wide .fw-window__panel {
    min-height: 230px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
