/* ===========================================================
   Knitify — Brand System
   Palette is grounded in the app icon (terracotta + amber on
   warm paper) and the in-app yarn swatches (plum, sky, gold).
   =========================================================== */

:root {
  /* Core palette */
  --cream:        #F7F0E4;
  --cream-deep:   #EFE5D2;
  --paper:        #FBF6EC;
  --terracotta:   #C0593A;
  --terracotta-d: #9C4126;
  --amber:        #E8A53A;
  --amber-soft:   #F2C672;
  --plum:         #2A1F2D;
  --plum-soft:    #4A3A4F;
  --ink:          #1F1714;
  --ink-2:        #4D3F38;
  --ink-3:        #80726A;
  --line:         #E5D8C2;
  --line-soft:    #EDE2CD;
  --sky:          #8FB8D6;
  --sage:         #9DAE8B;

  /* Type */
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-sans:    'Inter', system-ui, -apple-system, Helvetica, Arial, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 36px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(42, 31, 45, 0.06);
  --shadow-md: 0 12px 32px rgba(42, 31, 45, 0.08), 0 2px 6px rgba(42, 31, 45, 0.04);
  --shadow-lg: 0 30px 80px rgba(42, 31, 45, 0.14), 0 8px 24px rgba(42, 31, 45, 0.06);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
button { font: inherit; }
a { color: inherit; }

html {
  scroll-behavior: smooth;
  background: var(--cream);
}

body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: var(--terracotta); color: var(--paper); }

/* Layout */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}

/* Type utilities */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terracotta-d);
  font-weight: 500;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.display {
  font-family: var(--font-display);
  font-weight: 600;
  font-style: normal;
  letter-spacing: -0.03em;
  line-height: 1.02;
  color: var(--plum);
  text-wrap: balance;
}
.display em {
  font-style: normal;
  color: var(--terracotta);
}

.lede {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
  max-width: 56ch;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.005em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--terracotta) 0%, var(--terracotta-d) 100%);
  color: var(--paper);
  box-shadow: 0 4px 16px rgba(192, 89, 58, 0.35), 0 1px 3px rgba(192, 89, 58, 0.2);
  border-color: var(--terracotta-d);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #d4633f 0%, var(--terracotta) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(192, 89, 58, 0.45), 0 2px 6px rgba(192, 89, 58, 0.25);
}
.btn-ghost {
  background: transparent;
  color: var(--plum);
  border-color: var(--line);
}
.btn-ghost:hover {
  background: var(--cream-deep);
  border-color: var(--ink-3);
}

/* ── Store Buttons ── */
.btn-store {
  background: var(--plum);
  color: var(--paper);
  height: 60px;
  padding: 0 20px 0 16px;
  gap: 13px;
  text-align: left;
  border-color: rgba(247, 240, 228, 0.08);
  border-radius: 16px;
  box-shadow:
    0 4px 16px rgba(42, 31, 45, 0.22),
    inset 0 1px 0 rgba(247, 240, 228, 0.07);
  position: relative;
  overflow: hidden;
}
.btn-store::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 0%, rgba(247, 240, 228, 0.07) 0%, transparent 60%);
  pointer-events: none;
}
.btn-store:hover {
  background: #3A2D3F;
  transform: translateY(-2px);
  box-shadow:
    0 8px 28px rgba(42, 31, 45, 0.32),
    inset 0 1px 0 rgba(247, 240, 228, 0.1);
}
.btn-store .store-glyph {
  width: 26px; height: 26px;
  flex: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}
.btn-store .store-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.btn-store .store-tiny {
  font-size: 9.5px;
  font-weight: 500;
  opacity: 0.65;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-family: var(--font-sans);
}
.btn-store .store-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1;
}

/* ===========================================================
   Navigation
   =========================================================== */
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 18px 0;
  background: linear-gradient(to bottom, rgba(247,240,228,0.95), rgba(247,240,228,0.65) 70%, rgba(247,240,228,0));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--plum);
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--cream-deep);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.brand-mark svg { width: 26px; height: 26px; }
.brand-mark--img { background: none; border: none; padding: 0; }
.brand-mark--img img { width: 40px; height: 40px; border-radius: 10px; display: block; object-fit: cover; }
.brand-mark--footer img { border-radius: 10px; opacity: 0.9; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 10px;
  transition: background .18s ease, color .18s ease;
}
.nav-links a:not(.nav-cta):hover {
  color: var(--plum);
  background: var(--cream-deep);
}
/* Nav CTA — higher specificity than .nav-links a */
.nav-links a.nav-cta {
  margin-left: 8px;
  background: linear-gradient(135deg, var(--terracotta) 0%, var(--terracotta-d) 100%);
  color: var(--paper);
  border: 1px solid var(--terracotta-d);
  border-radius: var(--r-pill);
  box-shadow: 0 3px 14px rgba(192, 89, 58, 0.35);
  font-size: 14px;
  height: 40px;
  padding: 0 20px;
  font-weight: 600;
}
.nav-links a.nav-cta:hover {
  background: linear-gradient(135deg, #d4633f 0%, var(--terracotta) 100%);
  color: var(--paper);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(192, 89, 58, 0.45);
}

/* ===========================================================
   Footer (shared)
   =========================================================== */
.footer {
  background: var(--plum);
  color: rgba(247, 240, 228, 0.75);
  padding: 88px 0 32px;
  margin-top: 120px;
  position: relative;
  overflow: hidden;
}
.footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(247, 240, 228, 0.08) 1px, transparent 0);
  background-size: 18px 18px;
  opacity: 0.5;
  pointer-events: none;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 56px;
  margin-bottom: 72px;
  position: relative;
}
.footer-brand .brand-name { color: var(--paper); }
.footer-brand .brand-mark { background: rgba(247, 240, 228, 0.08); border-color: rgba(247, 240, 228, 0.14); }
.footer-tag {
  margin-top: 18px;
  font-size: 15px;
  max-width: 32ch;
  line-height: 1.5;
}
.footer-col h4 {
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  margin: 0 0 18px;
  opacity: 0.6;
}
.footer-col a {
  display: block;
  text-decoration: none;
  color: rgba(247, 240, 228, 0.78);
  font-size: 15px;
  padding: 6px 0;
  transition: color .18s ease;
}
.footer-col a:hover { color: var(--amber-soft); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  border-top: 1px solid rgba(247, 240, 228, 0.12);
  font-size: 13px;
  position: relative;
}
.footer-bottom .made {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  opacity: 0.7;
}
.footer-glyph {
  font-family: var(--font-sans);
  color: var(--terracotta);
  opacity: 1;
  font-size: 14px;
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-bottom { flex-direction: column; gap: 12px; align-items: flex-start; }
}

/* ===========================================================
   Content pages (legal/support)
   =========================================================== */
.page-hero {
  padding: 80px 0 40px;
  text-align: center;
}
.page-hero .eyebrow { justify-content: center; }
.page-hero .eyebrow::before { display: none; }
.page-hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(48px, 7vw, 88px);
  letter-spacing: -0.025em;
  line-height: 0.98;
  color: var(--plum);
  margin: 18px 0 14px;
}
.page-hero h1 em {
  font-style: normal;
  color: var(--terracotta);
}
.page-hero p { color: var(--ink-2); font-size: 17px; }

/* Support page */
.support-section {
  padding: 0 0 80px;
}
.support-contact-card {
  max-width: 680px;
  margin: 0 auto;
  background:
    radial-gradient(ellipse 80% 80% at 80% 0%, rgba(232, 165, 58, 0.2), transparent 60%),
    radial-gradient(ellipse 60% 60% at 0% 100%, rgba(192, 89, 58, 0.25), transparent 60%),
    var(--plum);
  color: var(--paper);
  border-radius: var(--r-xl);
  transition: transform .28s ease, box-shadow .28s ease;
  padding: 56px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.support-contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px rgba(59, 36, 42, 0.35);
}
.support-contact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(247, 240, 228, 0.06) 1px, transparent 0);
  background-size: 16px 16px;
  opacity: 0.5;
  pointer-events: none;
}
.support-contact-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: rgba(247, 240, 228, 0.08);
  border: 1px solid rgba(247, 240, 228, 0.12);
  display: grid;
  place-items: center;
  margin: 0 auto 28px;
  color: var(--amber-soft);
  position: relative;
}
.support-contact-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--paper);
  margin: 0 0 12px;
  position: relative;
}
.support-contact-desc {
  color: rgba(247, 240, 228, 0.7);
  font-size: 16px;
  line-height: 1.6;
  max-width: 44ch;
  margin: 0 auto 32px;
  position: relative;
}
.support-email-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 28px;
  border-radius: var(--r-pill);
  background: var(--terracotta);
  color: var(--paper);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(192, 89, 58, 0.4);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  position: relative;
}
.support-email-link:hover {
  background: #d4633f;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(192, 89, 58, 0.5);
}
.support-faq { border-top: 1px solid var(--line); }

/* Active nav link */
.nav-active {
  color: var(--terracotta) !important;
  font-weight: 600 !important;
}
@media (max-width: 760px) {
  .support-contact-card { padding: 40px 24px; }
}

/* FAQ link accent */
.faq-head .lede a {
  color: var(--terracotta);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.faq-head .lede a:hover {
  color: var(--terracotta-d);
}


.legal-shell {
  max-width: 760px;
  margin: 0 auto 80px;
  padding: 56px 56px 64px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
}
.legal-shell h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -0.015em;
  color: var(--plum);
  margin: 40px 0 14px;
}
.legal-shell h2:first-of-type { margin-top: 0; }
.legal-shell h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--plum);
  margin: 24px 0 8px;
}
.legal-shell p, .legal-shell li {
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.65;
}
.legal-shell p { margin: 0 0 14px; }
.legal-shell ul {
  margin: 0 0 18px;
  padding-left: 18px;
}
.legal-shell li { margin-bottom: 6px; }
.legal-shell li::marker { color: var(--terracotta); }
.legal-shell strong { color: var(--plum); font-weight: 600; }
.legal-shell a { color: var(--terracotta-d); text-decoration: underline; text-decoration-color: var(--amber-soft); text-underline-offset: 3px; }
.legal-shell a:hover { color: var(--terracotta); }
.legal-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--cream);
  border-radius: var(--r-md);
  border: 1px dashed var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-bottom: 36px;
}
.legal-meta span { color: var(--plum); font-weight: 500; }

/* Legal tables */
.legal-shell table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: auto;
  display: block;
}
.legal-shell thead th {
  text-align: left;
  font-weight: 600;
  color: var(--plum);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 14px;
  border-bottom: 2px solid var(--line);
  background: var(--cream);
  white-space: nowrap;
}
.legal-shell tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: top;
}
.legal-shell tbody tr:last-child td { border-bottom: none; }
.legal-shell tbody td strong { color: var(--plum); }
.legal-shell tbody td a { font-size: 13px; }

@media (max-width: 720px) {
  .container { padding: 0 20px; }
  .legal-shell { padding: 32px 24px; border-radius: var(--r-lg); }
  .nav-links a:not(.btn) { display: none; }
  .legal-shell table { font-size: 13px; }
}
