/* =========================================================
   Air Cast — Legal & Support pages
   Shared stylesheet
   ========================================================= */

:root {
  /* Palette */
  --bg: #faf8f3;
  --bg-elev: #ffffff;
  --bg-subtle: #f1ede4;
  --ink: #14141a;
  --ink-2: #3a3a45;
  --ink-3: #6b6b75;
  --ink-4: #a8a8b0;
  --rule: #e6e1d6;
  --rule-strong: #d9d2c2;
  --accent: #1a4fd8;
  --accent-ink: #ffffff;
  --accent-soft: #e6ecfb;
  --warm: #c54a1a;
  --success: #1f7a4d;
  --danger: #b3261e;

  /* Typography */
  --font-display: "Fraunces", "Times New Roman", serif;
  --font-body: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Layout */
  --container: 1120px;
  --content: 720px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle paper grain on body */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08  0 0 0 0 0.08  0 0 0 0 0.10  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

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

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
a:hover {
  border-bottom-color: var(--accent);
}

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

.content {
  max-width: var(--content);
  margin: 0 auto;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--rule);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand:hover {
  border: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--bg);
  border-radius: 7px;
  box-shadow: 0 4px 14px -6px rgba(20, 20, 26, 0.5);
}
.brand-mark svg {
  width: 16px;
  height: 16px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  font-style: italic;
  letter-spacing: -0.015em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s var(--ease);
}
.nav-links a:hover {
  color: var(--ink);
  background: var(--bg-subtle);
}
.nav-links a.active {
  color: var(--ink);
  background: var(--bg-elev);
  border-color: var(--rule);
}

/* ---------- Page header ---------- */
.page-head {
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--rule);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  margin-bottom: 20px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--ink-3);
}

.page-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
  color: var(--ink);
  font-feature-settings: "ss01";
}
.page-title em {
  font-style: italic;
  color: var(--accent);
}

.page-lede {
  max-width: 640px;
  font-size: 1.075rem;
  color: var(--ink-2);
  margin: 0 0 24px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: 0.01em;
}
.meta span strong {
  color: var(--ink);
  font-weight: 500;
}

/* ---------- Article ---------- */
.article {
  padding: 56px 0 96px;
}

.toc {
  margin: 0 0 48px;
  padding: 22px 26px;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.toc-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  margin: 0 0 14px;
}
.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 28px;
}
.toc li {
  counter-increment: toc;
  position: relative;
  padding-left: 32px;
}
.toc li::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
}
.toc a {
  color: var(--ink-2);
  border: none;
  font-size: 14.5px;
}
.toc a:hover {
  color: var(--accent);
}

.section {
  margin: 0 0 44px;
  scroll-margin-top: 90px;
}

.section-num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-4);
  margin: 0 0 8px;
}

.section h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.6vw, 1.875rem);
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0 0 18px;
  color: var(--ink);
}

.section h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.005em;
  margin: 28px 0 10px;
  color: var(--ink);
}

.section p {
  margin: 0 0 16px;
  color: var(--ink-2);
}

.section ul {
  margin: 0 0 16px;
  padding-left: 0;
  list-style: none;
}
.section ul li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 8px;
  color: var(--ink-2);
}
.section ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 12px;
  width: 8px;
  height: 1px;
  background: var(--ink-4);
}

.section strong {
  color: var(--ink);
  font-weight: 600;
}

.callout {
  margin: 24px 0;
  padding: 18px 22px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
  font-size: 0.95rem;
}
.callout strong {
  display: block;
  margin-bottom: 4px;
}

/* ---------- Contact / Form ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 56px;
  align-items: start;
  padding: 56px 0 96px;
}

.contact-aside h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
}
.contact-aside p {
  color: var(--ink-2);
  margin: 0 0 24px;
}
.info-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.info-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  align-items: start;
}
.info-list dt,
.info-list .k {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  padding-top: 2px;
}
.info-list .v {
  color: var(--ink);
  font-size: 0.95rem;
}

.form-card {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow:
    0 1px 0 rgba(20, 20, 26, 0.02),
    0 16px 40px -24px rgba(20, 20, 26, 0.12);
}

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

.field {
  margin: 0 0 18px;
  display: block;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.005em;
}
.field label .req {
  color: var(--warm);
  margin-left: 2px;
}
.field .hint {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.4;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease),
    background 0.2s var(--ease);
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-4);
}
.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--ink-3);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elev);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4.5l4 4 4-4' fill='none' stroke='%2314141a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  padding-right: 38px;
}

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

.field.invalid input,
.field.invalid select,
.field.invalid textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 12%, transparent);
}
.field .error {
  display: none;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--danger);
}
.field.invalid .error {
  display: block;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0 22px;
  cursor: pointer;
  user-select: none;
}
.checkbox input {
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  accent-color: var(--accent);
}
.checkbox span {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.5;
}

.btn {
  --bg-btn: var(--ink);
  --fg-btn: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--bg-btn);
  background: var(--bg-btn);
  color: var(--fg-btn);
  font: inherit;
  font-weight: 500;
  font-size: 15px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}
.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn:active {
  transform: translateY(1px);
}
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.btn svg {
  width: 16px;
  height: 16px;
}

.btn-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.btn-row .note {
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 40px 0 56px;
  margin-top: auto;
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font-size: 14px;
}
.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--ink-3);
  font-size: 14px;
  border: none;
}
.footer-links a:hover {
  color: var(--ink);
}
.footer-copy {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-4);
  letter-spacing: 0.04em;
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 40px 0 72px;
  }
  .toc ol {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 18px;
  }
  .page-head {
    padding: 48px 0 32px;
  }
  .article {
    padding: 36px 0 64px;
  }
  .form-card {
    padding: 24px;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .nav-links {
    gap: 2px;
  }
  .nav-links a {
    padding: 8px 10px;
    font-size: 13px;
  }
  .brand-name {
    font-size: 16px;
  }
  .info-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .meta {
    gap: 14px;
    flex-direction: column;
  }
}

/* ---------- Success state ---------- */
.success-state {
  text-align: center;
  padding: 60px 24px;
}
.success-state .check {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  background: var(--success);
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.success-state h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}
.success-state p {
  color: var(--ink-2);
  margin: 0 0 24px;
}
