/* The Great Untangling — Jacob Ford */

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

:root {
  --ink: #0c0b0a;
  --ink-soft: #161412;
  --ink-muted: #2a2622;
  --surface: #1e1b18;
  --surface-raised: #262220;
  --border: rgba(245, 240, 232, 0.08);
  --border-strong: rgba(245, 240, 232, 0.14);

  --text: #f5f0e8;
  --text-muted: #a89f94;
  --text-faint: #6b635a;

  --accent: #c4a574;
  --accent-light: #d4bc94;
  --accent-dark: #9a7d52;

  --serif: "Cormorant Garamond", "Georgia", serif;
  --sans: "DM Sans", system-ui, sans-serif;

  --container: min(1120px, calc(100% - 3rem));
  --header-h: 5rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 2px;
  --radius-lg: 4px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--ink);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

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

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

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

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10000;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.875rem;
}

.skip-link:focus {
  top: 1rem;
}

/* Typography */
.eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
}

h3 {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
}

.prose p + p {
  margin-top: 1.25rem;
}

.prose p {
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.75;
}

.section-lead {
  max-width: 36rem;
  margin-top: 1.25rem;
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.7;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: rgba(12, 11, 10, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: var(--container);
  margin-inline: auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  flex-shrink: 0;
  width: 4.25rem;
  height: 4.25rem;
  object-fit: contain;
  display: block;
}

.logo-icon-sm {
  width: 3rem;
  height: 3rem;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.logo-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.logo-sub {
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav a {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  transition: color 0.25s;
}

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

.nav-cta {
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--border-strong);
  color: var(--text) !important;
  transition: border-color 0.25s, background 0.25s !important;
}

.nav-cta:hover {
  border-color: var(--accent);
  background: rgba(196, 165, 116, 0.08);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
}

.menu-toggle span {
  display: block;
  height: 1px;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.3s;
}

.menu-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.9375rem 1.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.3s var(--ease), border-color 0.3s, color 0.3s, transform 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: var(--ink);
  border: 1px solid var(--accent);
}

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

.btn-outline {
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

.btn-ghost {
  color: var(--text-muted);
  padding-inline: 1rem;
}

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

.btn-lg {
  padding: 1.125rem 2.25rem;
  font-size: 0.875rem;
}

/* Hero */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding-bottom: 5rem;
  padding-top: calc(var(--header-h) + 3rem);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to bottom, rgba(12, 11, 10, 0.55) 0%, rgba(12, 11, 10, 0.35) 40%, rgba(12, 11, 10, 0.92) 100%),
    linear-gradient(to right, rgba(12, 11, 10, 0.7) 0%, transparent 60%);
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 400;
  max-width: 14ch;
  margin-bottom: 1.75rem;
}

.hero-title em {
  font-style: italic;
  color: var(--accent-light);
}

.hero-lead {
  max-width: 32rem;
  font-size: clamp(1rem, 1.8vw, 1.1875rem);
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  right: max(1.5rem, calc((100% - 1120px) / 2));
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.scroll-line {
  width: 1px;
  height: 3rem;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(0.8); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* Sections */
.section {
  padding: clamp(5rem, 10vw, 8rem) 0;
}

.section-header {
  margin-bottom: clamp(3rem, 6vw, 4.5rem);
  max-width: 40rem;
}

/* Who This Is For */
.section-for {
  background: var(--ink-soft);
}

.for-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.for-card {
  padding: clamp(2rem, 4vw, 3rem);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.4s var(--ease);
}

.for-card:hover {
  border-color: var(--border-strong);
}

.for-number {
  display: block;
  font-family: var(--serif);
  font-size: 2.5rem;
  font-weight: 400;
  color: var(--accent-dark);
  opacity: 0.6;
  line-height: 1;
  margin-bottom: 1.5rem;
}

.for-card h3 {
  margin-bottom: 1rem;
}

.for-card p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.75;
}

/* Story */
.story-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.story-image-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface);
}

.story-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 38% center;
}

.story-image-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--border-strong);
  pointer-events: none;
}

.story-pull {
  margin-top: -2.5rem;
  margin-left: 1.5rem;
  margin-right: -1.5rem;
  position: relative;
  z-index: 1;
  padding: 2rem;
  background: var(--surface-raised);
  border-left: 2px solid var(--accent);
}

.story-pull p {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-style: italic;
  line-height: 1.45;
  color: var(--text);
}

.story-content h2 {
  margin-bottom: 2rem;
}

/* Pricing */
.section-work {
  background: var(--ink-soft);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: stretch;
}

.pricing-card {
  display: flex;
  flex-direction: column;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
}

.pricing-card-featured {
  background: var(--surface-raised);
  border-color: rgba(196, 165, 116, 0.25);
  box-shadow: 0 0 0 1px rgba(196, 165, 116, 0.08);
}

.pricing-badge {
  position: absolute;
  top: -0.75rem;
  left: 1.5rem;
  padding: 0.35rem 0.875rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--ink);
}

.pricing-tier {
  margin-bottom: 1.25rem;
}

.pricing-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.pricing-price {
  display: block;
  font-family: var(--serif);
  font-size: 2.75rem;
  font-weight: 500;
  line-height: 1;
  color: var(--text);
}

.pricing-period {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
}

.pricing-card h3 {
  font-size: 1.35rem;
}

.pricing-desc {
  flex: 1;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.pricing-note {
  font-size: 0.8125rem;
  color: var(--text-faint);
  font-style: italic;
  margin-bottom: 1.5rem;
}

.pricing-card .btn {
  margin-top: auto;
  justify-content: center;
  width: 100%;
}

/* Ceremony modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 11, 10, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-panel {
  position: relative;
  width: min(720px, 100%);
  max-height: min(90vh, 720px);
  overflow-y: auto;
  padding: clamp(2rem, 4vw, 3rem);
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: color 0.2s, border-color 0.2s;
}

.modal-close:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.modal-cta {
  width: 100%;
  justify-content: center;
  margin-top: 2rem;
}

body.modal-open {
  overflow: hidden;
}

/* Payment */
.payment-header {
  margin-bottom: 2rem;
  padding-right: 2.5rem;
}

.payment-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.payment-option {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.payment-option:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.payment-option h3 {
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
  color: var(--accent-light);
}

.payment-option p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Journey */
.section-journey {
  position: relative;
  overflow: hidden;
}

.journey-bg {
  position: absolute;
  inset: 0;
}

.journey-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.journey-overlay {
  position: absolute;
  inset: 0;
  background: rgba(12, 11, 10, 0.88);
}

.journey-content {
  position: relative;
  z-index: 1;
}

.journey-steps {
  list-style: none;
  display: grid;
  gap: 0;
  max-width: 42rem;
}

.journey-step {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1.5rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}

.journey-step:last-child {
  border-bottom: none;
}

.step-num {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
  padding-top: 0.15rem;
}

.step-body h3 {
  font-size: 1.25rem;
  margin-bottom: 0.625rem;
}

.step-body p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* Quote */
.section-quote {
  padding: clamp(4rem, 8vw, 6rem) 0;
  text-align: center;
}

.big-quote p {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.35;
  color: var(--text);
  max-width: 20ch;
  margin-inline: auto;
}

.big-quote p::before {
  content: "\201C";
  display: block;
  font-size: 3rem;
  color: var(--accent-dark);
  line-height: 1;
  margin-bottom: 0.5rem;
}

/* CTA */
.section-cta {
  padding-bottom: clamp(5rem, 10vw, 8rem);
}

.cta-panel {
  text-align: center;
  padding: clamp(3rem, 7vw, 5rem) clamp(2rem, 5vw, 4rem);
  background: var(--surface);
  border: 1px solid var(--border);
}

.cta-panel h2 {
  margin-bottom: 1.25rem;
}

.cta-lead {
  max-width: 32rem;
  margin: 0 auto 2.5rem;
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.cta-note {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--text-faint);
}

.cta-note code {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  background: var(--ink-muted);
  border-radius: 2px;
}

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

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.footer-brand p {
  font-size: 0.8125rem;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(1.75rem);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal:nth-child(4) { transition-delay: 0.24s; }

/* Responsive */
@media (max-width: 960px) {
  .for-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

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

  .story-pull {
    margin-left: 0;
    margin-right: 0;
    margin-top: 1.5rem;
  }
}

@media (max-width: 768px) {
  :root {
    --container: calc(100% - 2rem);
  }

  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem;
    background: rgba(12, 11, 10, 0.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s var(--ease), opacity 0.4s;
  }

  .nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav a {
    padding: 1rem 0.5rem;
    border-bottom: 1px solid var(--border);
  }

  .nav-cta {
    margin-top: 0.5rem;
    text-align: center;
    border-bottom: none !important;
  }

  .menu-toggle {
    display: flex;
  }

  .hero-scroll {
    display: none;
  }

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

  .hero-actions .btn {
    justify-content: center;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .scroll-line {
    animation: none;
  }
}
