/* Dyaan design system — the single source of truth for colour, type, glass and glow.
   Every heading in the product sets an explicit colour; nothing inherits a default. */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* The hidden attribute must always win over class display rules (fixes dead Ask box etc.). */
[hidden] { display: none !important; }

:root {
  /* base */
  --bg: #080b12;
  --bg-deep: #05070c;

  /* glass surfaces */
  --glass: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .014));
  --glass-border: rgba(255, 255, 255, .09);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, .06);

  /* accent */
  --accent: linear-gradient(140deg, #7BA5F5, #3D6BC4);
  --accent-from: #7BA5F5;
  --accent-to: #3D6BC4;
  --accent-ink: #0A1426;

  /* text */
  --text-heading: #F6F9FF;
  --text-body: #E9EDF6;
  --text-secondary: #aeb9d1;
  --text-muted: #79859f;

  /* status */
  --mint: #5FE3C8;
  --rose: #FF6B8A;
  --fire: #FF6B3D;

  /* type */
  --font-ui: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* geometry */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --pad: 18px;
  --shadow-soft: 0 18px 44px rgba(0, 0, 0, .42);
  --glow-accent: 0 0 0 1px rgba(123, 165, 245, .32), 0 12px 34px rgba(61, 107, 196, .34);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Buttons never inherit the page font on their own — reset once so every button-style
   component (e.g. the hub category cards) uses the product typeface, not Arial. */
button, input, select, textarea { font-family: inherit; }
input, select, textarea { text-overflow: ellipsis; }

h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: -.015em;
  margin: 0;
}

p { color: var(--text-body); margin: 0; }
a { color: var(--accent-from); text-decoration: none; }
a:hover { color: #a3c1fa; }
small, .dy-secondary { color: var(--text-secondary); }
.dy-muted { color: var(--text-muted); }
.dy-mint { color: var(--mint); }
.dy-rose { color: var(--rose); }
.dy-fire { color: var(--fire); }

/* ── glass ───────────────────────────────────────────────────────────────── */
.dy-glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-inset);
  border-radius: var(--radius);
}

.dy-glass-lg { border-radius: var(--radius-lg); }

.dy-glass-raised {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-inset), var(--shadow-soft);
  border-radius: var(--radius-lg);
}

/* ── nav ─────────────────────────────────────────────────────────────────── */
.dy-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 14px 28px;
  background: var(--glass);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--glass-inset);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.dy-wordmark {
  display: inline-block;
  width: 132px;
  height: 32px;
  background: url("/brand/dyaan-lockup-light.png") left center / contain no-repeat;
  font-size: 0;
  color: transparent;
  text-decoration: none;
}

.dy-wordmark .mark { display: none; }

/* ── buttons ─────────────────────────────────────────────────────────────── */
.dy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 11px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  box-shadow: var(--glass-inset);
  color: var(--text-body);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

/* Icons are inline SVG drawn in the button's own colour: no icon font to load, nothing for the CSP
   to refuse, and they stay crisp at any zoom (the ASCII stand-ins "▭"/"⤓" they replace rendered
   differently on every platform). */
.ico { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dy-btn-sm .ico { width: 14px; height: 14px; }

.dy-btn:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, .18); }
.dy-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.dy-btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: rgba(123, 165, 245, .5);
  box-shadow: var(--glow-accent);
}

.dy-btn-accent:hover { box-shadow: 0 0 0 1px rgba(123, 165, 245, .5), 0 16px 42px rgba(61, 107, 196, .5); }
.dy-btn-lg { padding: 14px 26px; font-size: 15px; }
.dy-btn-sm { padding: 7px 13px; font-size: 12.5px; border-radius: 9px; }

/* ── glowing icon chips ──────────────────────────────────────────────────── */
.dy-chip {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-inset);
  font-size: 20px;
  line-height: 1;
}

.dy-chip-fire   { background: radial-gradient(120% 120% at 30% 20%, rgba(255, 107, 61, .42), rgba(255, 107, 61, .06) 70%); color: var(--fire); }
.dy-chip-water  { background: radial-gradient(120% 120% at 30% 20%, rgba(123, 165, 245, .42), rgba(61, 107, 196, .06) 70%); color: var(--accent-from); }
.dy-chip-veg    { background: radial-gradient(120% 120% at 30% 20%, rgba(95, 227, 200, .42), rgba(95, 227, 200, .06) 70%); color: var(--mint); }
.dy-chip-change { background: radial-gradient(120% 120% at 30% 20%, rgba(255, 107, 138, .42), rgba(255, 107, 138, .06) 70%); color: var(--rose); }
.dy-chip-draw   { background: radial-gradient(120% 120% at 30% 20%, rgba(174, 185, 209, .38), rgba(174, 185, 209, .05) 70%); color: var(--text-secondary); }
.dy-chip-proof  { background: radial-gradient(120% 120% at 30% 20%, rgba(246, 249, 255, .3), rgba(246, 249, 255, .04) 70%); color: var(--text-heading); }
.dy-chip-ai     { background: radial-gradient(120% 120% at 30% 20%, rgba(127, 119, 221, .42), rgba(127, 119, 221, .06) 70%); color: #AFA9EC; }

/* ── data / labels ───────────────────────────────────────────────────────── */
.dy-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dy-data { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-body); }

/* A label/value cell. Defined here rather than in app.css because the account page uses it too, and
   without the column layout the label ran straight into its value ("EMAILyou@example.com"). */
.metric-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 9px; }
.metric-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, .028);
  box-shadow: var(--glass-inset);
  min-width: 0;
}
.metric-cell .dy-label { line-height: 1.2; }
.metric-cell .dy-metric { font-size: 21px; }
.metric-cell .dy-data { font-size: 14px; overflow-wrap: anywhere; }

/* A KPI is the headline of its card: the number carries the weight, the label steps back to a quiet
   caption, and tabular figures keep a row of them optically aligned. Shared by the analysis and
   report pages so a figure looks the same wherever it is quoted. */
.an-kpis, .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(184px, 1fr)); gap: 12px; }
.kpi { position: relative; background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 16px 18px 15px; box-shadow: var(--glass-inset); overflow: hidden; }
.kpi::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--accent); opacity: .5; }
.kpi .k { font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
/* A headline number sizes itself to the card: a fixed 34px turns "446–691 m" into a wrapped line
   with the unit orphaned underneath. */
.kpi .v { font-size: clamp(23px, 2.15vw, 34px); line-height: 1.06; font-weight: 600; letter-spacing: -.022em; color: var(--text-heading); margin-top: 7px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--text-secondary); margin-top: 5px; }
@media (max-width: 720px) { .kpi .v { font-size: 27px; } }

.dy-metric {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-heading);
  letter-spacing: -.02em;
}

.dy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  box-shadow: var(--glass-inset);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--text-secondary);
}

.dy-divider { height: 1px; background: var(--glass-border); border: 0; margin: 0; }

/* ── ambient background wash ─────────────────────────────────────────────── */
.dy-aurora {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60% 44% at 18% -6%, rgba(123, 165, 245, .17), transparent 70%),
    radial-gradient(48% 38% at 88% 6%, rgba(95, 227, 200, .09), transparent 72%),
    radial-gradient(52% 40% at 62% 104%, rgba(61, 107, 196, .13), transparent 72%);
}

/* ── forms ───────────────────────────────────────────────────────────────── */
.dy-field { display: flex; flex-direction: column; gap: 7px; }

.dy-input {
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, .04);
  box-shadow: var(--glass-inset);
  color: var(--text-body);
  font-family: var(--font-ui);
  font-size: 14px;
}

.dy-input::placeholder { color: var(--text-muted); }
.dy-input:focus { outline: none; border-color: rgba(123, 165, 245, .55); box-shadow: var(--glass-inset), 0 0 0 3px rgba(123, 165, 245, .16); }

.dy-note {
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  box-shadow: var(--glass-inset);
  color: var(--text-secondary);
  font-size: 13px;
}

.dy-note-error { border-color: rgba(255, 107, 138, .42); color: var(--rose); }
.dy-note-ok { border-color: rgba(95, 227, 200, .42); color: var(--mint); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }
