/*
 * LinkDish public site: shared foundation for every page.
 * Tokens, light and dark themes, header, navigation, buttons, forms, FAQ, final call,
 * footer, mobile dock and motion. Page families add marketing.css (home + landing
 * pages) or info.css (support, privacy, invite, 404).
 *
 * Colors are semantic custom properties that mirror apps/web/src/styles/tokens.css.
 * Components use tokens only, so the dark theme is a token swap.
 */

@font-face {
  font-display: swap;
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 700;
  src: url("/assets/fonts/Fraunces-Bold.woff2") format("woff2");
}

@font-face {
  font-display: swap;
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 600;
  src: url("/assets/fonts/Fraunces-SemiBoldItalic.woff2") format("woff2");
}

:root {
  color-scheme: light;

  --bg: #f4efe7;
  --canvas: #fbf7f0;
  --surface: #fffdf8;
  --surface-raised: #fffefb;
  --tint: #efe7da;
  --ink: #1f211d;
  --muted: #6e685f;
  --subtle: #857d71;
  --border: #ddd2c3;
  --border-subtle: #e8dfd2;
  --border-strong: #bfb19d;

  --primary: #29443b;
  --primary-hover: #1f352e;
  --on-primary: #fffdf8;
  --primary-soft: #dde7df;
  --on-primary-soft: #29443b;
  --tomato: #b95233;
  --tomato-hover: #a2462a;
  --on-tomato: #fffdf8;
  --tomato-soft: #f3ddd3;
  --on-tomato-soft: #8e3b22;
  --butter: #e9bd5a;
  --butter-soft: #f7e9c8;
  --on-butter-soft: #5c4613;

  /* Deep forest band behind the final call and the recommended plan. */
  --band: #29443b;
  --band-ink: #fbf7f0;
  --band-muted: #cbd8d0;
  --band-line: rgba(251, 247, 240, 0.22);
  /* Phone frame in the product mocks. */
  --device: #1d1c1a;

  --success: #2f6b4a;
  --danger: #a23a2a;
  --focus: #29443b;
  --header-bg: rgba(251, 247, 240, 0.86);
  /* Check mark drawn on --primary fills (lists, plan features, done items). */
  --check-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fffdf8' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E");

  --shadow-rgb: 93, 86, 75;
  --shadow-sm: 0 1px 2px rgba(var(--shadow-rgb), 0.06), 0 4px 12px rgba(var(--shadow-rgb), 0.07);
  --shadow-md: 0 2px 4px rgba(var(--shadow-rgb), 0.05), 0 12px 28px rgba(var(--shadow-rgb), 0.1);
  --shadow-lg: 0 2px 6px rgba(var(--shadow-rgb), 0.07), 0 22px 60px rgba(var(--shadow-rgb), 0.16);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius-sm: 12px;
  --radius-button: 14px;
  --radius-card: 20px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --shell: min(calc(100% - 48px), 1180px);
  --header-height: 72px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg: #1a1816;
    --canvas: #1f1d1a;
    --surface: #24221e;
    --surface-raised: #2c2925;
    --tint: #34302b;
    --ink: #f3ece0;
    --muted: #b3aa9b;
    --subtle: #8f877a;
    --border: #3a3631;
    --border-subtle: #2f2c28;
    --border-strong: #58524a;

    --primary: #a9cbb9;
    --primary-hover: #bdd9ca;
    --on-primary: #13241d;
    --primary-soft: #2a3a33;
    --on-primary-soft: #cfe3d7;
    --tomato: #e0795a;
    --tomato-hover: #ea8c6f;
    --on-tomato: #2a120a;
    --tomato-soft: #3d2620;
    --on-tomato-soft: #f2b9a4;
    --butter: #e9bd5a;
    --butter-soft: #3a3020;
    --on-butter-soft: #f2d387;

    --band: #203a31;
    --band-ink: #f3ece0;
    --band-muted: #b9ccc1;
    --band-line: rgba(243, 236, 224, 0.2);
    --device: #0b0a09;

    --success: #8fd0a8;
    --danger: #f19a86;
    --focus: #a9cbb9;
    --header-bg: rgba(31, 29, 26, 0.86);
    --check-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2313241d' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E");

    --shadow-rgb: 0, 0, 0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.28);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.38);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.35), 0 24px 64px rgba(0, 0, 0, 0.5);
  }
}

/* Reset ------------------------------------------------------------------ */

[hidden] {
  display: none !important;
}

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

h1,
h2,
h3,
p,
figure {
  margin-top: 0;
}

figure {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  border-radius: 8px;
}

::selection {
  background: color-mix(in srgb, var(--butter) 55%, transparent);
  color: var(--ink);
}

.num {
  font-variant-numeric: lining-nums tabular-nums;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  transform: translateY(-160%);
  border-radius: 10px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

/* Only shown once site scripts are running, or only without them. */
html:not(.js) .js-only,
html.js .no-js-only {
  display: none !important;
}

/* Layout helpers ---------------------------------------------------------- */

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.section {
  padding-block: clamp(76px, 9vw, 132px);
}

.section-surface {
  background: var(--surface);
}

.section-canvas {
  background: var(--canvas);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}

.eyebrow-tomato {
  color: var(--on-tomato-soft);
}

.section-head {
  max-width: 760px;
  margin-bottom: clamp(40px, 6vw, 64px);
}

.section-head-center {
  margin-inline: auto;
  text-align: center;
}

.section-title {
  margin-bottom: 20px;
  font-size: clamp(2.5rem, 1.55rem + 3.6vw, 4.9rem);
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.section-title em,
.display em {
  color: var(--primary);
  font-weight: 600;
}

.mark {
  box-shadow: inset 0 -0.12em 0 var(--butter);
}

.section-lede {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 0.96rem + 0.3vw, 1.16rem);
  line-height: 1.65;
}

.section-head-center .section-lede {
  margin-inline: auto;
}

.text-link {
  color: var(--primary);
  font-weight: 750;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.text-link:hover {
  text-decoration-thickness: 2px;
}

/* Header and navigation --------------------------------------------------- */

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 10px max(24px, calc((100% - 1180px) / 2));
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 11px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-nav > a:not(.button) {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  transition: color 150ms ease;
}

.site-nav > a:not(.button):hover,
.site-nav > a[aria-current="page"] {
  color: var(--ink);
}

.menu-toggle {
  display: none;
}

/* Buttons ------------------------------------------------------------------ */

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 750;
  line-height: 1.1;
  text-align: center;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button .icon {
  width: 1.15em;
  height: 1.15em;
}

.button-small {
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 12px;
  font-size: 0.86rem;
}

.button-primary {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow:
    0 1px 2px rgba(var(--shadow-rgb), 0.12),
    0 6px 16px rgba(41, 68, 59, 0.16);
  color: var(--on-primary);
}

.button-primary:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
}

.button-tomato {
  border-color: var(--tomato);
  background: var(--tomato);
  box-shadow:
    0 1px 2px rgba(185, 82, 51, 0.2),
    0 6px 16px rgba(185, 82, 51, 0.22);
  color: var(--on-tomato);
}

.button-tomato:hover {
  border-color: var(--tomato-hover);
  background: var(--tomato-hover);
}

.button-secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--primary);
}

.button-secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface-raised);
}

.button-light {
  border-color: var(--band-ink);
  background: var(--band-ink);
  color: var(--band);
}

.button-light:hover {
  background: var(--butter-soft);
  color: var(--ink);
}

.button-outline-light {
  border-color: var(--band-line);
  background: transparent;
  color: var(--band-ink);
}

.button-outline-light:hover {
  border-color: var(--band-ink);
  background: rgba(255, 255, 255, 0.06);
}

.button[disabled] {
  cursor: wait;
  opacity: 0.6;
  transform: none;
}

/* Forms --------------------------------------------------------------------- */

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 750;
}

.input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.input::placeholder {
  color: color-mix(in srgb, var(--muted) 80%, transparent);
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent);
}

.form-status {
  min-height: 1.5em;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.form-status.success {
  color: var(--success);
}

.form-status.error {
  color: var(--danger);
}

.form-status a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Breadcrumbs ---------------------------------------------------------------- */

.breadcrumbs {
  margin-block: 0;
  padding-top: clamp(28px, 4vw, 44px);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li + li::before {
  margin-right: 6px;
  color: var(--subtle);
  content: "/";
}

.breadcrumbs a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* FAQ ----------------------------------------------------------------------- */

.faq {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(40px, 7vw, 110px);
}

.faq-head {
  align-self: start;
}

.faq-list {
  min-width: 0;
  border-top: 1px solid var(--border);
}

.faq-list details {
  border-bottom: 1px solid var(--border);
}

.faq-list summary {
  position: relative;
  padding: 24px 52px 24px 0;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  position: absolute;
  top: 50%;
  right: 4px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--on-primary-soft);
  content: "+";
  font-family: var(--font-ui);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1;
}

.faq-list details[open] summary::after {
  content: "\2013";
}

.faq-list details > div,
.faq-list details > p {
  max-width: 660px;
  margin: -6px 0 24px;
  padding-right: 40px;
  color: var(--muted);
}

.faq-list details p {
  margin-bottom: 12px;
}

.faq-list details p:last-child {
  margin-bottom: 0;
}

.faq-list a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Final call --------------------------------------------------------------------- */

.final-call {
  position: relative;
  overflow: hidden;
  padding: clamp(88px, 11vw, 150px) 24px;
  background:
    radial-gradient(circle at 8% 12%, rgba(185, 82, 51, 0.62), transparent 30%),
    radial-gradient(circle at 92% 90%, rgba(233, 189, 90, 0.22), transparent 30%), var(--band);
  color: var(--band-ink);
  text-align: center;
}

.final-call-inner {
  position: relative;
  max-width: 880px;
  margin-inline: auto;
}

.final-call h2 {
  margin-bottom: 22px;
  color: var(--band-ink);
  font-size: clamp(2.8rem, 1.6rem + 4.6vw, 5.6rem);
  letter-spacing: -0.055em;
  line-height: 0.93;
}

.final-call h2 em {
  color: var(--butter);
  font-weight: 600;
}

.final-call p {
  max-width: 560px;
  margin: 0 auto 30px;
  color: var(--band-muted);
  font-size: 1.08rem;
}

.final-actions,
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.final-actions {
  justify-content: center;
}

/* Footer --------------------------------------------------------------------------- */

.site-footer {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) repeat(3, minmax(0, 1fr));
  gap: 40px;
  padding: 72px max(24px, calc((100% - 1180px) / 2)) 30px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer-brand > p {
  max-width: 280px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.footer-column h2 {
  margin: 0 0 6px;
  color: var(--primary);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-column a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

.footer-column a:hover {
  color: var(--ink);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  justify-content: space-between;
  gap: 10px 24px;
  margin: 12px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
}

/* Mobile CTA dock ---------------------------------------------------------------------- */

.mobile-dock {
  display: none;
}

/* Motion ------------------------------------------------------------------------------- */

.motion-ready [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 520ms var(--ease-out),
    transform 520ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.motion-ready [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Responsive ---------------------------------------------------------------------------- */

@media (max-width: 1040px) {
  .site-footer {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .faq {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 820px) {
  :root {
    --shell: min(calc(100% - 32px), 720px);
    --header-height: 64px;
  }

  body.has-dock {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  .site-header {
    padding: 8px 16px;
  }

  .menu-toggle {
    display: grid;
    width: 44px;
    height: 44px;
    place-content: center;
    gap: 5px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    cursor: pointer;
  }

  .menu-toggle > span:not(.sr-only) {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: var(--primary);
    transition: transform 160ms ease;
  }

  .site-header.is-menu-open .menu-toggle > span:nth-child(2) {
    transform: translateY(3.5px) rotate(45deg);
  }

  .site-header.is-menu-open .menu-toggle > span:nth-child(3) {
    transform: translateY(-3.5px) rotate(-45deg);
  }

  .site-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    align-items: stretch;
    gap: 0;
    max-height: calc(100svh - var(--header-height));
    padding: 8px 16px 18px;
    overflow-y: auto;
    border-bottom: 1px solid var(--border);
    background: var(--canvas);
    box-shadow: var(--shadow-md);
  }

  .site-header.is-menu-open .site-nav {
    display: grid;
  }

  .site-nav > a:not(.button) {
    min-height: 48px;
    padding: 13px 4px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--ink);
    font-size: 1rem;
  }

  .site-nav .button {
    margin-top: 12px;
  }

  .site-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px 20px;
    padding: 56px 20px 26px;
  }

  .mobile-dock {
    position: fixed;
    z-index: 120;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--canvas) 94%, transparent);
    box-shadow: 0 -8px 24px rgba(var(--shadow-rgb), 0.12);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    transition:
      transform 220ms var(--ease-out),
      visibility 220ms;
  }

  .mobile-dock.is-hidden {
    visibility: hidden;
    transform: translateY(110%);
  }

  .mobile-dock .button {
    min-height: 46px;
    padding-inline: 12px;
    font-size: 0.9rem;
  }
}

@media (max-width: 560px) {
  .site-footer {
    grid-template-columns: 1fr 1fr;
  }

  .footer-bottom {
    flex-direction: column;
  }

  .final-actions .button,
  .cta-row .button {
    width: 100%;
  }

  .faq-list summary {
    font-size: 1.1rem;
  }

  .faq-list details > div,
  .faq-list details > p {
    padding-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .motion-ready [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
