/* Brass Key — brasskey.app
 *
 * Colors are lifted from Sources/App/DesignSystem/Theme.swift so the site and
 * the app are the same product. Dark is Vault (near-black and brass); light is
 * Daylight (warm paper and sage). The site follows the reader's system setting
 * for the same reason the app defaults to Auto: nobody should have to think
 * about it.
 */

:root {
  --bg: #faf9f5;
  --surface: #ffffff;
  --hairline: #e4e1d8;
  --text: #1b1b18;
  --text-2: #6b6a64;
  --text-3: #8a8880;
  --accent: #3e6f63;
  --accent-soft: #eaf1ee;
  --on-accent: #ffffff;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f11;
    --surface: #18181b;
    --hairline: #2a2a2e;
    --text: #f2efe8;
    --text-2: #8e8a80;
    --text-3: #6e6a62;
    --accent: #c89b4a;
    --accent-soft: #17140e;
    --on-accent: #14110c;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.wrap {
  width: 100%;
  max-width: 62rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.prose { max-width: var(--measure); }

section { padding-block: clamp(3rem, 9vw, 5.5rem); }

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

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.012em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 6.5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.1rem); margin-top: 2.2em; }
h3 { font-size: 1.2rem; margin-top: 2em; }
h2:first-child, h3:first-child { margin-top: 0; }

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

.lead {
  font-size: clamp(1.15rem, 2.6vw, 1.35rem);
  line-height: 1.55;
  color: var(--text-2);
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

strong { font-weight: 650; color: var(--text); }

ul { padding-left: 1.15em; margin: 0 0 1.15em; }
li { margin-bottom: 0.5em; }
li::marker { color: var(--accent); }

/* ---------------------------------------------------------------- header */

.masthead {
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  z-index: 10;
}

.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
  flex-wrap: wrap;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.wordmark svg { display: block; flex: none; }

nav { display: flex; gap: clamp(0.9rem, 3vw, 1.6rem); font-size: 0.95rem; }
nav a { color: var(--text-2); text-decoration: none; }
nav a:hover, nav a[aria-current="page"] { color: var(--text); }

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

.hero { padding-block: clamp(3.5rem, 11vw, 7rem) clamp(2.5rem, 8vw, 4.5rem); }
.hero h1 { margin-bottom: 0.45em; }

.pill {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text-2);
  margin-bottom: 1.5rem;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.25rem;
  margin-top: 2rem;
}

.button {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 0.6rem;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
}

.button:hover { filter: brightness(1.07); }

.button.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--hairline);
}

.note { font-size: 0.92rem; color: var(--text-3); }

/* -------------------------------------------------------------- features */

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 0.85rem;
  padding: 1.5rem;
}

.card h3 { margin: 0 0 0.45em; font-size: 1.1rem; }
.card p { color: var(--text-2); font-size: 0.97rem; margin: 0; }

.card-icon {
  width: 2rem; height: 2rem;
  margin-bottom: 0.9rem;
  color: var(--accent);
}

/* ------------------------------------------------------------- statement */

.statement {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: var(--accent-soft);
}

.statement p {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 3.4vw, 1.75rem);
  line-height: 1.4;
  max-width: 40rem;
}

/* ------------------------------------------------------------------ plan */

.plans { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.plan { background: var(--surface); border: 1px solid var(--hairline); border-radius: 0.85rem; padding: 1.75rem; }
.plan.featured { border-color: var(--accent); }
.plan .price { font-family: var(--serif); font-size: 2rem; margin: 0.2em 0 0.1em; }
.plan .price span { font-family: var(--sans); font-size: 0.95rem; color: var(--text-2); font-weight: 400; }
.plan ul { margin-top: 1rem; }

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

.legal-meta {
  font-size: 0.92rem;
  color: var(--text-3);
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
  margin-bottom: 2.5rem;
}

.legal h2 { font-size: 1.35rem; }

.plain {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 0.75rem;
  padding: 1.25rem 1.4rem;
  margin: 1.5rem 0;
}

.plain p { margin: 0; }

table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.97rem; }
th, td { text-align: left; padding: 0.7rem 0.5rem; border-bottom: 1px solid var(--hairline); vertical-align: top; }
th { font-weight: 650; }
td:first-child { white-space: nowrap; padding-right: 1.5rem; }

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

footer {
  border-top: 1px solid var(--hairline);
  padding-block: 2.5rem 3.5rem;
  color: var(--text-3);
  font-size: 0.92rem;
}

footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }
footer nav { flex-wrap: wrap; }

/* ------------------------------------------------------- accessibility */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 0.3rem;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--gutter);
  top: 0.6rem;
  z-index: 20;
  background: var(--surface);
  padding: 0.6rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
