/* ============================================================
   Cleverly Lingo — legal pages (privacy, 404)
   Dark theme matching the landing design system. JS-free.
   ============================================================ */

@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk-var-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg: #0a0b10;
  --text: #f4f5f9;
  --text-secondary: #a9aebe;
  --text-tertiary: #767b8c;

  --accent: #8b9bf8;
  --accent-strong: #7c8cf8;
  --accent-ink: #10131f;

  --glass: rgba(255, 255, 255, 0.04);
  --glass-strong: rgba(255, 255, 255, 0.07);
  --hairline: rgba(255, 255, 255, 0.09);
  --hairline-soft: rgba(255, 255, 255, 0.06);

  --amber: #e8c079;

  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

/* the hidden attribute must always win — author `display` rules
   (e.g. .form-card { display: flex }) otherwise override the UA default */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background:
    radial-gradient(900px 480px at 78% -160px, rgba(124, 140, 248, 0.13), transparent 70%),
    radial-gradient(700px 420px at 12% -120px, rgba(43, 58, 122, 0.22), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: rgba(124, 140, 248, 0.35);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 6px;
}

.shell {
  width: min(1160px, calc(100% - 48px));
  margin-inline: auto;
}

/* ---------- film grain ---------- */

.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 60;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 300px 300px;
}

/* ---------- nav (static glass, no JS needed) ---------- */

.site-nav {
  position: fixed;
  top: 20px;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding-inline: 24px;
}

.nav-pill {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 10px 12px 10px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline-soft);
  background: rgba(13, 14, 21, 0.72);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand-icon {
  display: block;
  border-radius: 9px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 4px 14px rgba(0, 0, 0, 0.4);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
}

.nav-links a {
  color: var(--text-secondary);
  transition: color 0.25s ease;
}

.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: var(--accent-ink);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.25s var(--ease-out-expo), box-shadow 0.25s var(--ease-out-expo);
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(124, 140, 248, 0.25);
  text-decoration: none;
  color: var(--accent-ink);
}

@media (max-width: 720px) {
  .nav-links .nav-link {
    display: none;
  }
}

/* ---------- legal layout ---------- */

.legal-main {
  max-width: 760px;
  margin-inline: auto;
  padding: 160px 24px 90px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.legal-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(38px, 5.4vw, 58px);
  font-weight: 640;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.legal-meta span {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline-soft);
  background: var(--glass);
}

.legal-meta strong {
  color: var(--text-secondary);
  font-weight: 550;
}

.draft-notice {
  margin-top: 34px;
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid rgba(232, 192, 121, 0.28);
  background: rgba(232, 192, 121, 0.07);
  color: var(--amber);
  font-size: 14px;
  line-height: 1.6;
}

/* ---------- article typography ---------- */

.legal-article {
  margin-top: 26px;
  font-size: 15.5px;
  color: var(--text-secondary);
}

.legal-article h2 {
  margin: 54px 0 16px;
  padding-top: 34px;
  border-top: 1px solid var(--hairline-soft);
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 620;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}

.legal-article h3 {
  margin: 32px 0 10px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.legal-article p {
  margin: 0 0 16px;
}

.legal-article strong {
  color: var(--text);
  font-weight: 600;
}

.legal-article ul {
  margin: 0 0 18px;
  padding: 0 0 0 4px;
  list-style: none;
}

.legal-article li {
  position: relative;
  margin: 0 0 10px;
  padding-left: 22px;
}

.legal-article li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(139, 155, 248, 0.55);
}

/* ---------- support page ---------- */

.support-main {
  max-width: 1000px;
}

.support-lede {
  margin: 22px 0 0;
  max-width: 520px;
  font-size: 16.5px;
  color: var(--text-secondary);
}

.support-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 22px;
  margin-top: 46px;
  align-items: start;
}

.form-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 34px;
  border-radius: 24px;
  border: 1px solid var(--hairline-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.form-field label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: 13px;
  border: 1px solid var(--hairline);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-field textarea {
  resize: vertical;
  min-height: 140px;
}

.form-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='m1 1.5 5 5 5-5' stroke='%23767b8c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--text-tertiary);
}

.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
  outline: none;
  border-color: rgba(139, 155, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(124, 140, 248, 0.18);
}

.form-card .btn-solid {
  align-self: flex-start;
  border: 0;
  cursor: pointer;
}

.form-error {
  margin: -6px 0 0;
  font-size: 13.5px;
  color: #ef9a9a;
}

.form-hint {
  margin: -4px 0 0;
  font-size: 13px;
  color: var(--text-tertiary);
}

.form-hint strong {
  color: var(--text-secondary);
  font-weight: 550;
}

/* honeypot — visually removed, still in the form for bots */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.form-success {
  align-items: flex-start;
  gap: 0;
}

.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  border-radius: 50%;
  border: 1px solid rgba(139, 155, 248, 0.4);
  background: rgba(124, 140, 248, 0.12);
  color: var(--accent);
  box-shadow: 0 0 0 8px rgba(124, 140, 248, 0.05);
}

.form-success h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 620;
  letter-spacing: -0.02em;
  color: var(--text);
}

.form-success p {
  margin: 0;
  max-width: 44ch;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.form-success strong {
  color: var(--accent);
  font-weight: 550;
}

.form-success .btn-ghost {
  margin-top: 26px;
  cursor: pointer;
  font-family: var(--font-body);
}

.form-card .btn-solid:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.support-aside {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.aside-card {
  padding: 26px 28px;
  border-radius: 24px;
  border: 1px solid var(--hairline-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012));
}

.aside-card h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.aside-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.copy-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.copy-row a {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 550;
}

.copy-btn {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline);
  background: var(--glass);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.copy-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.aside-note {
  min-height: 18px;
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--accent);
}

@media (max-width: 860px) {
  .support-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-card {
    padding: 26px;
  }
}

/* ---------- 404 hero ---------- */

.notfound {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px 0 60px;
}

.notfound h1 {
  margin: 18px 0 0;
  font-family: var(--font-display);
  font-size: clamp(42px, 6vw, 72px);
  font-weight: 640;
  line-height: 1.04;
  letter-spacing: -0.035em;
  max-width: 14ch;
}

.notfound .lede {
  margin: 22px 0 0;
  max-width: 480px;
  font-size: 17px;
  color: var(--text-secondary);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 38px;
}

.btn-solid {
  display: inline-flex;
  align-items: center;
  padding: 14px 26px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #e9ebf4 100%);
  color: #0c0e15;
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 620;
  letter-spacing: -0.01em;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 14px 38px rgba(0, 0, 0, 0.45),
    0 4px 14px rgba(124, 140, 248, 0.18);
  transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s var(--ease-out-expo);
}

.btn-solid:hover {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 18px 48px rgba(0, 0, 0, 0.5),
    0 6px 26px rgba(124, 140, 248, 0.38);
  text-decoration: none;
  color: #0c0e15;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 14px 24px;
  border-radius: 16px;
  border: 1px solid var(--hairline);
  background: var(--glass);
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 550;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--glass-strong);
  text-decoration: none;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--hairline-soft);
  padding: 36px 0 44px;
  font-size: 13.5px;
  color: var(--text-tertiary);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand img {
  border-radius: 7px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-tertiary);
  transition: color 0.25s ease;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: none;
}

@media (max-width: 720px) {
  .legal-main {
    padding-top: 130px;
  }
}
