/* ==========================================================================
   OpenCard Landing Page
   Type system & palette matched to Paper.design source of truth
   ========================================================================== */

/* --- Reset & Base --- */

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

:root {
  /* Colors */
  --cream: #fcfaf4;
  --warm-white: #f1ecdf;
  --stone: #d6d3cd;
  --peach: #f1ae87;
  --terracotta: #dd785c;
  --terracotta-dark: #c4654a;
  --terracotta-shadow: #b45840;
  --black: #1a1a18;
  --gray: #6b6860;

  /* Fonts — GT Ultra VF (single family, axes controlled per element) */
  --font: 'GT Ultra', 'Playfair Display', Georgia, serif;

  /* Subfamily axis values (CNTR) */
  --cntr-standard: 0;
  --cntr-median: 50;
  --cntr-fine: 100;

  /* Type scale (desktop) */
  --display-size: 120px;
  --display-lh: 100%;
  --display-ls: -2px;

  --h1-size: 60px;
  --h1-lh: 110%;
  --h1-ls: -3px;

  --h2-size: 36px;
  --h2-lh: 120%;
  --h2-ls: -1.5px;

  --h3-size: 24px;
  --h3-lh: 130%;
  --h3-ls: -1px;

  --subhead-size: 24px;
  --subhead-lh: 140%;

  --body-size: 17px;
  --body-lh: 150%;

  --small-size: 14px;
  --small-lh: 150%;
  --small-ls: 0.2px;

  --nav-size: 16px;
  --button-size: 17px;
}

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

body {
  font-family: var(--font);
  font-weight: 300;
  font-size: var(--body-size);
  line-height: var(--body-lh);
  color: var(--black);
  background-color: var(--cream);
  font-variation-settings: 'CNTR' var(--cntr-standard), 'slnt' 0;
}

/* --- Typography classes --- */

.display {
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--display-size);
  line-height: var(--display-lh);
  letter-spacing: var(--display-ls);
  color: var(--black);
  font-variation-settings: 'CNTR' var(--cntr-median), 'slnt' 0;
}

.display em {
  font-weight: 700;
  font-style: italic;
  font-variation-settings: 'CNTR' var(--cntr-median), 'slnt' 12;
  color: var(--terracotta);
}

.h1 {
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--h1-size);
  line-height: var(--h1-lh);
  letter-spacing: var(--h1-ls);
  color: var(--black);
  font-variation-settings: 'CNTR' var(--cntr-median), 'slnt' 0;
}

.h2 {
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--h2-size);
  line-height: var(--h2-lh);
  letter-spacing: var(--h2-ls);
  color: var(--black);
}

.h3 {
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--h3-size);
  line-height: var(--h3-lh);
  letter-spacing: var(--h3-ls);
  color: var(--black);
}

.subhead {
  font-family: var(--font);
  font-weight: 300;
  font-size: var(--subhead-size);
  line-height: var(--subhead-lh);
  color: var(--gray);
}

.body-text {
  font-family: var(--font);
  font-weight: 300;
  font-size: var(--body-size);
  line-height: var(--body-lh);
  color: var(--black);
  max-width: 600px;
}

.small-text {
  font-family: var(--font);
  font-weight: 300;
  font-size: var(--small-size);
  line-height: var(--small-lh);
  letter-spacing: var(--small-ls);
  color: var(--gray);
}

/* --- Nav --- */

.nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 48px 64px 24px;
}

.nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
}

.nav-wordmark {
  height: 18px;
  width: auto;
}

.nav-icon {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-logo {
  width: auto;
  height: 36px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.btn-nav {
  font-size: 14px;
  padding: 10px 24px;
  text-decoration: none;
}

/* --- Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--button-size);
  line-height: 100%;
  text-decoration: none;
  border: none;
  cursor: pointer;
  position: relative;
}

.btn-primary {
  background-color: var(--terracotta);
  color: #fff;
  padding: 16px 32px;
  border-radius: 10px;
  border: 1.5px solid var(--terracotta-dark);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  box-shadow: 0 4px 0 0 var(--terracotta-shadow);
}

.btn-primary:hover {
  background-color: var(--terracotta-dark);
}

.btn-primary:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 0 var(--terracotta-shadow);
}

.btn-dark {
  background-color: var(--black);
  color: #fff;
  padding: 16px 32px;
  border-radius: 10px;
  border: 1.5px solid #111110;
  box-shadow: 0 4px 0 0 #000000;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-dark:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 0 #000000;
}

.btn-outline {
  background-color: var(--cream);
  color: var(--black);
  padding: 16px 32px;
  border-radius: 10px;
  border: 1.5px solid var(--stone);
  box-shadow: 0 4px 0 0 #c4c0b8;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-outline:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 0 #c4c0b8;
}

/* --- Hero --- */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 64px 60px;
  background-color: var(--cream);
  position: relative;
}


.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
  max-width: 1200px;
  padding-top: 40px;
}

.hero-headline {
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--display-size);
  line-height: 100%;
  letter-spacing: var(--display-ls);
  color: var(--black);
  text-align: center;
  font-variation-settings: 'CNTR' var(--cntr-median), 'slnt' 0;
}

.hero-headline em {
  font-weight: 700;
  font-style: normal;
  color: var(--terracotta);
  font-variation-settings: 'wght' 700, 'slnt' 12, 'CNTR' 50;
}

/* --- VF stagger animation for "rules" --- */

@keyframes vf-letter-in {
  0% {
    font-variation-settings: 'wght' 100, 'slnt' 0, 'CNTR' 0;
    opacity: 0.2;
  }
  60% {
    font-variation-settings: 'wght' 800, 'slnt' 14, 'CNTR' 60;
    opacity: 1;
  }
  100% {
    font-variation-settings: 'wght' 700, 'slnt' 12, 'CNTR' 50;
    opacity: 1;
  }
}

.vf-stagger span {
  display: inline-block;
  font-variation-settings: 'wght' 100, 'slnt' 0, 'CNTR' 0;
  opacity: 0.2;
}

/* Only animate after fonts are loaded */
.fonts-ready .vf-stagger span {
  animation: vf-letter-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fonts-ready .vf-stagger span:nth-child(1) { animation-delay: 0.1s; }
.fonts-ready .vf-stagger span:nth-child(2) { animation-delay: 0.18s; }
.fonts-ready .vf-stagger span:nth-child(3) { animation-delay: 0.26s; }
.fonts-ready .vf-stagger span:nth-child(4) { animation-delay: 0.34s; }
.fonts-ready .vf-stagger span:nth-child(5) { animation-delay: 0.42s; }

/* --- Rules Stack --- */

.hero-card {
  margin-top: 24px;
}

.card-stack {
  position: relative;
  width: 520px;
  perspective: 600px;
  transform-style: preserve-3d;
}

.card-stack .rule-panel {
  display: block;
  width: 100%;
  aspect-ratio: 440 / 297;
  border-radius: 20px;
  background: var(--warm-white);
  border: 1.5px solid var(--stone);
  transform: rotateX(20deg) scaleY(0.85);
  transform-origin: center center;
  box-sizing: border-box;
  overflow: hidden;
}

.rule-panel-fg {
  position: relative;
  z-index: 7;
  padding: 28px 36px;
  background: var(--cream);
  transition: scale 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.rule-panel-bg {
  position: relative;
  transition: scale 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  padding: 24px 32px;
}

.rule-bg-1 { opacity: 0.85; }
.rule-bg-2 { opacity: 0.7; }
.rule-bg-3 { opacity: 0.55; }
.rule-bg-4 { opacity: 0.4; }
.rule-bg-5 { opacity: 0.28; }
.rule-bg-6 { opacity: 0.18; }

.card-stack .rule-panel:hover {
  scale: 1.04;
  z-index: 10;
}

.rule-bg-1 { z-index: 6; margin-top: -335px; transform: rotateX(20deg) scaleY(0.85) scale(0.97); }
.rule-bg-2 { z-index: 5; margin-top: -335px; transform: rotateX(20deg) scaleY(0.85) scale(0.94); }
.rule-bg-3 { z-index: 4; margin-top: -335px; transform: rotateX(20deg) scaleY(0.85) scale(0.91); }
.rule-bg-4 { z-index: 3; margin-top: -335px; transform: rotateX(20deg) scaleY(0.85) scale(0.88); }
.rule-bg-5 { z-index: 2; margin-top: -335px; transform: rotateX(20deg) scaleY(0.85) scale(0.85); }
.rule-bg-6 { z-index: 1; margin-top: -335px; transform: rotateX(20deg) scaleY(0.85) scale(0.82); }

.hero-card {
  position: static;
}

/* --- Rule Panel Content --- */

.rule-panel-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.rule-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.rule-label {
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gray);
}

.rule-active {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
  font-size: 12px;
  color: var(--gray);
}

.rule-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--terracotta);
  flex-shrink: 0;
}

.rule-name {
  font-family: var(--font);
  font-size: 32px;
  font-weight: 700;
  color: var(--black);
  line-height: 1.1;
  margin-bottom: 10px;
  font-variation-settings: 'wght' 700, 'CNTR' 50;
}

.rule-limits {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.rule-budget {
  font-family: var(--font);
  font-size: 14px;
  color: var(--black);
}

.rule-sep {
  color: var(--stone);
}

.rule-scope {
  font-family: var(--font);
  font-size: 14px;
  color: var(--gray);
}

.rule-divider {
  height: 1px;
  background: var(--stone);
  margin-bottom: 18px;
}

.rule-tx {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rule-tx-merchant {
  font-family: var(--font);
  font-size: 14px;
  color: var(--black);
  flex: 1;
}

.rule-tx-amount {
  font-family: var(--font);
  font-size: 14px;
  color: var(--gray);
}

.rule-tx-verdict {
  font-family: var(--font);
  font-size: 12px;
  color: var(--terracotta);
  background: rgba(221, 120, 92, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

/* --- Rules Entry (JS-driven, see animation.js) --- */

/* --- Scroll Fade-in --- */

.fade-in {
  display: inline-block;
}

/* --- Sticky Blocks --- */

.sticky-block {
  min-height: 150vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticky-block > * {
  position: sticky;
  top: 20vh;
}

/* --- Features (What You Get) --- */

.features {
  padding: 30vh 64px;
  background-color: var(--warm-white);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.features-headline {
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--display-size);
  line-height: var(--display-lh);
  letter-spacing: var(--display-ls);
  color: var(--black);
  text-align: center;
  font-variation-settings: 'CNTR' var(--cntr-median), 'slnt' 0;
}

.features-list {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 700px;
  width: 100%;
}

.feature-icon {
  width: 154px;
  height: 154px;
  background-color: var(--peach);
}

.feature-title {
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--h1-size);
  line-height: var(--h1-lh);
  letter-spacing: var(--h1-ls);
  color: var(--black);
  text-align: center;
  width: 100%;
  font-variation-settings: 'CNTR' var(--cntr-median), 'slnt' 0;
}

.feature-body {
  font-family: var(--font);
  font-weight: 300;
  font-size: var(--subhead-size);
  line-height: var(--subhead-lh);
  color: var(--black);
  text-align: center;
  max-width: 700px;
}

/* --- Apply for Access --- */

.apply {
  padding: 30vh 64px;
  background-color: var(--cream);
  display: flex;
  justify-content: center;
}

.apply-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  max-width: 600px;
  width: 100%;
}

.apply-headline {
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--h1-size);
  line-height: var(--h1-lh);
  letter-spacing: var(--h1-ls);
  color: var(--black);
  text-align: center;
  font-variation-settings: 'CNTR' var(--cntr-median), 'slnt' 0;
}

.apply-subhead {
  font-family: var(--font);
  font-weight: 300;
  font-size: var(--body-size);
  line-height: var(--body-lh);
  color: var(--gray);
  text-align: center;
  max-width: 480px;
}

.apply-form {
  width: 100%;
  max-width: 580px;
  margin-top: 24px;
}

.apply-input-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 10px 10px 10px 28px;
  border: 1.5px solid var(--stone);
  border-radius: 14px;
  background-color: var(--cream);
  font-variation-settings: 'CNTR' var(--cntr-standard), 'slnt' 0;
}

.apply-input {
  flex: 1;
  font-family: var(--font);
  font-weight: 300;
  font-size: 16px;
  border: none;
  background: transparent;
  color: var(--black);
  outline: none;
}

.apply-input::placeholder {
  color: var(--gray);
}

.apply-input-group .btn-primary {
  padding: 14px 28px;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: none;
}

.waitlist-msg {
  font-family: var(--font);
  font-weight: 300;
  font-size: var(--small-size);
  line-height: var(--small-lh);
  color: var(--terracotta);
  text-align: center;
  margin-top: 8px;
  font-variation-settings: 'CNTR' var(--cntr-standard), 'slnt' 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-weight: 400;
  font-size: 12px;
  color: #fff;
  background-color: var(--black);
  padding: 6px 14px;
  border-radius: 100px;
}

/* --- Confirmation --- */

.confirmation {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 64px;
  background-color: var(--cream);
  font-variation-settings: 'CNTR' var(--cntr-standard), 'slnt' 0;
}

.confirmation-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 500px;
  text-align: center;
}

.confirmation-icon {
  width: 64px;
  height: auto;
  margin-bottom: 8px;
}

.confirmation-headline {
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--h1-size);
  line-height: var(--h1-lh);
  letter-spacing: var(--h1-ls);
  color: var(--black);
  font-variation-settings: 'CNTR' var(--cntr-median), 'slnt' 0;
}

.confirmation-body {
  font-family: var(--font);
  font-weight: 300;
  font-size: var(--subhead-size);
  line-height: var(--subhead-lh);
  color: var(--gray);
}

/* --- Footer --- */

.footer {
  padding: 32px 64px;
  background-color: var(--cream);
  border-top: 1px solid var(--stone);
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-logo {
  width: 24px;
  height: auto;
}

.footer-wordmark {
  height: 18px;
  width: auto;
}

.footer-copy {
  font-family: var(--font);
  font-weight: 300;
  font-size: var(--small-size);
  letter-spacing: var(--small-ls);
  color: var(--gray);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.footer-links a {
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--small-size);
  color: var(--black);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--terracotta);
}

/* --- Responsive --- */

@media (max-width: 768px) {
  :root {
    --display-size: 64px;
    --display-ls: -2px;
    --h1-size: 42px;
    --h1-ls: -2px;
    --h2-size: 30px;
    --h3-size: 22px;
    --subhead-size: 20px;
  }

  .nav { padding: 32px 24px 20px; }
  .hero { padding: 80px 24px 60px; }
  .features { padding: 100px 24px; }
  .apply { padding: 100px 24px; }
  .footer { padding: 32px 24px; }

  .features-headline { margin-bottom: 80px; }
  .features-list { gap: 80px; }
  .feature-icon { width: 120px; height: 120px; }

  .card-stack { width: 380px; }
  .rule-bg-1,
  .rule-bg-2,
  .rule-bg-3,
  .rule-bg-4,
  .rule-bg-5,
  .rule-bg-6 { margin-top: -230px; }
  font-variation-settings: 'CNTR' var(--cntr-median), 'slnt' 0;
}

@media (max-width: 480px) {
  :root {
    --display-size: 44px;
    --display-ls: -1.5px;
    --h1-size: 32px;
    --h1-ls: -1.5px;
    --h2-size: 26px;
    --h3-size: 20px;
    --subhead-size: 18px;
    --body-size: 16px;
    --small-size: 13px;
  }

  .card-stack { width: 300px; }
  .rule-bg-1,
  .rule-bg-2,
  .rule-bg-3,
  .rule-bg-4,
  .rule-bg-5,
  .rule-bg-6 { margin-top: -185px; }

  .features-headline { margin-bottom: 60px; }
  .features-list { gap: 64px; }
  .feature-icon { width: 100px; height: 100px; }

  .apply-input-group {
    flex-direction: column;
    padding: 10px;
  font-variation-settings: 'CNTR' var(--cntr-median), 'slnt' 0;
  }

  .apply-input {
    width: 100%;
    padding: 14px 16px;
  }

  .apply-input-group .btn-primary {
    width: 100%;
  }

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

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}
