/* Frequency design system. Modelled on Apple's HIG: system colours, three text strengths,
   hairline separators, translucent materials, one accent. Light and dark. */

:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  --bg: #ffffff;
  --bg-2: #f5f5f7;
  --bg-3: #ebebef;
  --elevated: #ffffff;
  --label: #1d1d1f;
  --label-2: rgba(60, 60, 67, 0.72);
  --label-3: rgba(60, 60, 67, 0.45);
  --separator: rgba(60, 60, 67, 0.14);
  --fill: rgba(120, 120, 128, 0.12);
  --fill-2: rgba(120, 120, 128, 0.2);
  --material: rgba(255, 255, 255, 0.72);
  --material-thick: rgba(246, 246, 248, 0.86);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 28px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.05), 0 24px 60px rgba(0, 0, 0, 0.14);

  --blue: #0071e3;
  --blue-hover: #0077ed;
  --green: #28cd41;
  --orange: #ff9500;
  --red: #ff3b30;
  --purple: #af52de;
  --code-bg: #f6f6f8;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 28px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-2: #0d0d0f;
    --bg-3: #1c1c1e;
    --elevated: #1c1c1e;
    --label: #f5f5f7;
    --label-2: rgba(235, 235, 245, 0.68);
    --label-3: rgba(235, 235, 245, 0.38);
    --separator: rgba(84, 84, 88, 0.55);
    --fill: rgba(120, 120, 128, 0.22);
    --fill-2: rgba(120, 120, 128, 0.34);
    --material: rgba(28, 28, 30, 0.7);
    --material-thick: rgba(22, 22, 24, 0.86);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 28px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 24px 60px rgba(0, 0, 0, 0.6);
    --blue: #0a84ff;
    --blue-hover: #409cff;
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --purple: #bf5af2;
    --code-bg: #141416;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  /* OLED: true black canvas, near-black surfaces, quiet hairlines */
  --bg: #000000; --bg-2: #000000; --bg-3: #0f0f11; --elevated: #0b0b0c;
  --label: #f5f5f7; --label-2: rgba(235, 235, 245, 0.66); --label-3: rgba(235, 235, 245, 0.36);
  --separator: rgba(255, 255, 255, 0.08); --fill: rgba(255, 255, 255, 0.06); --fill-2: rgba(255, 255, 255, 0.11);
  --material: rgba(10, 10, 11, 0.72); --material-thick: rgba(8, 8, 9, 0.9);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 8px 28px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.6), 0 24px 60px rgba(0, 0, 0, 0.85);
  --blue: #0a84ff; --blue-hover: #409cff; --green: #30d158; --orange: #ff9f0a; --red: #ff453a; --purple: #bf5af2;
  --code-bg: #0a0a0b; --brand: linear-gradient(90deg, #b08cff, #7ce4ff 30%, #a8ffb0 55%, #ffd58a 78%, #ff8fc8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.47;
  letter-spacing: -0.011em;
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }
button { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--blue) 28%, transparent); }

/* ---- controls ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 18px; border-radius: 980px; border: 0;
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em; cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease), opacity 0.2s;
  white-space: nowrap; text-decoration: none !important;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-secondary { background: var(--fill); color: var(--label); }
.btn-secondary:hover { background: var(--fill-2); }
.btn-lg { height: 46px; padding: 0 26px; font-size: 17px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.link-arrow { font-size: 17px; }
.link-arrow::after { content: " ›"; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--label-2); }
.input {
  height: 44px; padding: 0 14px; width: 100%;
  border-radius: var(--r); border: 1px solid var(--separator);
  background: var(--elevated); color: var(--label); font: inherit; font-size: 16px;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 22%, transparent); }
.input::placeholder { color: var(--label-3); }

.material {
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.hairline-b { border-bottom: 0.5px solid var(--separator); }

.avatar {
  --c: var(--blue);
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 78%, #fff), var(--c));
  color: #fff; font-weight: 600; font-size: 13px; letter-spacing: 0;
  user-select: none;
}

.kbd {
  font-family: var(--font); font-size: 11px; font-weight: 500; color: var(--label-2);
  padding: 1px 6px; border-radius: 5px; border: 0.5px solid var(--separator); background: var(--fill);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
