:root {
  color-scheme: dark;
  --bg: #080808;
  --surface: #101010;
  --text: #eceae6;
  --muted: #8a8680;
  --border: rgba(255, 255, 255, 0.1);
  --accent: #d8cfc0;
  --accent-text: #121212;
  --danger: #c4a09a;
  --focus: rgba(216, 207, 192, 0.45);
  --max-width: 1040px;
  --header-height: 72px;
  --radius: 4px;
  font-family: "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
  color: var(--text);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

h2 {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

h3 {
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}

p {
  color: var(--muted);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

/* Layout */
.container {
  width: min(var(--max-width), calc(100% - 48px));
  margin: 0 auto;
}

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(8, 8, 8, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-height);
}

.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}

.brand-logo {
  width: clamp(132px, 16vw, 168px);
  height: auto;
  max-height: 28px;
  object-fit: contain;
  object-position: left center;
}

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

.nav-link {
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--text);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.btn-primary:hover {
  background: #e4ddd0;
  border-color: #e4ddd0;
  color: var(--accent-text);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

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

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.btn-text {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.btn-text:hover {
  color: var(--text);
}

/* Hero */
.hero {
  padding: clamp(72px, 12vh, 128px) 0 clamp(64px, 10vh, 96px);
}

.hero-inner {
  max-width: 640px;
}

.hero-lead {
  margin-top: 20px;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text);
  line-height: 1.55;
}

.hero-status {
  margin-top: 12px;
  font-size: 0.95rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

/* Products */
.products {
  padding: 0 0 clamp(72px, 10vh, 104px);
}

.section-title {
  margin-bottom: 28px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.product-card {
  padding: 28px 24px;
  background: var(--surface);
}

.product-name {
  margin-bottom: 6px;
}

.product-type {
  margin-bottom: 18px;
  font-size: 0.95rem;
}

.product-status {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-actions {
  margin-top: 32px;
}

/* Store note */
.store-note {
  padding: clamp(48px, 8vh, 72px) 0;
  border-top: 1px solid var(--border);
}

.store-note-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 24px;
}

.store-note-inner p {
  max-width: 520px;
  font-size: 0.98rem;
}

/* Newsletter */
.newsletter {
  padding: clamp(48px, 8vh, 72px) 0 clamp(80px, 12vh, 120px);
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--header-height) + 16px);
}

.newsletter-inner {
  max-width: 480px;
}

.newsletter-copy {
  margin-top: 12px;
  margin-bottom: 24px;
}

.newsletter .newsletter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.newsletter .newsletter-form input {
  flex: 1 1 220px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.newsletter .newsletter-form input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.newsletter .newsletter-form input::placeholder {
  color: var(--muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 36px;
}

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

.footer-copy {
  font-size: 0.88rem;
  color: var(--muted);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-nav a {
  font-size: 0.88rem;
  color: var(--muted);
  transition: color 0.15s ease;
}

.footer-nav a:hover {
  color: var(--text);
}

/* Gumroad overlay buttons */
a.gumroad-button,
.gumroad-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 44px !important;
  padding: 0 20px !important;
  border: 1px solid var(--accent) !important;
  border-radius: var(--radius) !important;
  background: var(--accent) !important;
  color: var(--accent-text) !important;
  font-family: inherit !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  box-shadow: none !important;
}

a.gumroad-button:hover,
.gumroad-button:hover {
  background: #e4ddd0 !important;
  border-color: #e4ddd0 !important;
}

/* Legacy / private-beta compatibility */
.page-shell {
  width: min(var(--max-width), calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  min-height: var(--header-height);
  padding: 0 0 20px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  color: var(--text);
  text-decoration: none;
}

.nav-brand-logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.nav-brand-logo img {
  width: clamp(132px, 16vw, 168px);
  height: auto;
  max-height: 28px;
  object-fit: contain;
  object-position: left center;
}

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

.brand-kicker {
  margin-bottom: 14px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-shell .hero {
  padding: 0 0 40px;
}

.page-shell .hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.hero-copy {
  max-width: 640px;
  font-size: 1.05rem;
  line-height: 1.6;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.meta-row span {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.intro-card,
.agreement-card,
.form-card {
  padding: 28px;
  margin-bottom: 24px;
}

.intro-card p,
.agreement-card p,
.form-card p {
  line-height: 1.65;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.75fr);
  gap: 24px;
  align-items: start;
}

.agreement-card h3 {
  margin: 28px 0 8px;
  font-size: 0.95rem;
  color: var(--text);
}

.agreement-card h3:first-of-type {
  margin-top: 0;
}

.small-copy {
  font-size: 0.92rem;
}

.gate-card {
  max-width: 560px;
}

.gate-form,
.page-shell form {
  display: grid;
  gap: 14px;
}

.agreement-card h2,
.intro-card h2,
.form-card h2 {
  margin-bottom: 12px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--bg);
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

textarea {
  resize: vertical;
}

.checkbox-label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}

button,
.gate-form button,
.beta-form button {
  justify-self: start;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 500;
}

button:hover,
.gate-form button:hover,
.beta-form button:hover {
  background: #e4ddd0;
  border-color: #e4ddd0;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 500;
}

.button-link:hover {
  background: #e4ddd0;
  border-color: #e4ddd0;
  color: var(--accent-text);
}

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

.secondary-link:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text);
}

.page-shell .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.compact-actions {
  margin-top: 20px;
}

.form-warning {
  color: var(--danger);
  font-size: 0.9rem;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
}

footer a {
  color: var(--muted);
}

footer a:hover {
  color: var(--text);
}

footer p {
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .container,
  .page-shell {
    width: min(var(--max-width), calc(100% - 32px));
  }

  .header-inner {
    min-height: 64px;
  }

  .site-nav,
  .nav-links {
    gap: 20px;
  }

  .brand-logo,
  .nav-brand-logo img {
    width: 128px;
    max-height: 24px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

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

  .store-note-inner,
  .footer-inner,
  footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn,
  .hero-actions .button-link {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 14px 0;
    min-height: auto;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-end;
  }
}
