/* ==========================================================================
   Refundle — Warm Tactile Kraft-Cardboard Design System
   Zero external dependencies, zero third-party trackers.
   ========================================================================== */

:root {
  --cream: #F5EFE6;
  --cream-deep: #EDE3D4;
  --kraft-light: #DFC29E;
  --kraft-mid: #C8945D;
  --kraft-dark: #AE7842;
  --kraft-crease: #986534;
  --espresso: #231B15;
  --espresso-soft: #4F3F32;
  --espresso-muted: #705C4B;
  --tape: rgba(245, 239, 230, 0.72);
  --tape-edge: rgba(152, 101, 52, 0.35);

  /* Stamp accents */
  --stamp-terra: #A64424;
  --stamp-ochre: #8F5A14;
  --stamp-sage: #2F5D3A;
  --stamp-ink: #231B15;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --shadow-card: 0 2px 0 var(--espresso), 0 10px 24px rgba(35, 27, 21, 0.08);
  --shadow-lift: 0 4px 0 var(--espresso), 0 14px 30px rgba(35, 27, 21, 0.12);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --max-width: 1060px;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--cream);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--espresso);
  background-color: var(--cream);
  /* Subtle warm paper & diagonal packing-tape weave */
  background-image:
    radial-gradient(rgba(35, 27, 21, 0.035) 1px, transparent 0),
    repeating-linear-gradient(
      -45deg,
      rgba(200, 148, 93, 0.045) 0px,
      rgba(200, 148, 93, 0.045) 12px,
      transparent 12px,
      transparent 28px
    );
  background-size: 18px 18px, 40px 40px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--espresso);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--stamp-terra);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Packing tape strip divider */
.tape-bar {
  height: 12px;
  width: 100%;
  background: repeating-linear-gradient(
    -45deg,
    var(--kraft-mid) 0px,
    var(--kraft-mid) 14px,
    var(--kraft-light) 14px,
    var(--kraft-light) 28px
  );
  border-bottom: 2px solid var(--espresso);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(245, 239, 230, 0.93);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--espresso);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--espresso);
}

.brand img,
.brand svg {
  width: 34px;
  height: 34px;
  display: block;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--kraft-light);
  border: 1.5px solid var(--espresso);
  border-radius: 5px;
  padding: 2px 6px;
  margin-left: 2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--espresso-soft);
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--espresso);
  text-decoration: underline;
}

.nav .btn-small {
  background: var(--espresso);
  color: var(--cream);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--espresso);
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.12s ease, background 0.12s ease;
}

.nav .btn-small:hover {
  background: var(--kraft-dark);
  color: var(--cream);
  transform: translateY(-1px);
  text-decoration: none;
}

/* Kraft Box-Flap Card Motif */
.box-card {
  position: relative;
  background: var(--kraft-light);
  border: 2px solid var(--espresso);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.box-card--tan {
  background: var(--kraft-mid);
}

.box-card--cream {
  background: #FAF5ED;
}

/* Interlocking top box-flap crease header */
.box-flap-top {
  position: relative;
  height: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(35, 27, 21, 0.04));
  border-bottom: 2px solid var(--espresso);
  display: flex;
  align-items: center;
  justify-content: center;
}

.box-flap-top::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--espresso);
  transform: translateX(-50%);
}

/* Interlocking notched flap tab */
.box-flap-top::after {
  content: "";
  width: 56px;
  height: 11px;
  background: var(--tape);
  border: 1.5px solid var(--espresso);
  border-radius: 3px;
  position: relative;
  z-index: 2;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(200, 148, 93, 0.28) 0px,
    rgba(200, 148, 93, 0.28) 5px,
    transparent 5px,
    transparent 10px
  );
}

/* Decorative corner tape strip */
.tape-sticker {
  position: relative;
}

.tape-sticker::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%) rotate(-1.6deg);
  width: 96px;
  height: 22px;
  background: rgba(245, 239, 230, 0.82);
  border: 1.5px solid rgba(35, 27, 21, 0.45);
  border-left-style: dashed;
  border-right-style: dashed;
  box-shadow: 0 2px 5px rgba(35, 27, 21, 0.08);
  z-index: 3;
  pointer-events: none;
}

/* Stamp pill */
.stamp {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 10px;
  border: 2px solid var(--espresso);
  border-radius: 6px;
  background: var(--cream);
  color: var(--espresso);
}

.stamp--kraft {
  background: var(--kraft-light);
}

.stamp--sage {
  border-color: var(--stamp-sage);
  color: var(--stamp-sage);
  background: #EDF4EE;
}

.stamp--terra {
  border-color: var(--stamp-terra);
  color: var(--stamp-terra);
  background: #FBF0EC;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  padding: 13px 22px;
  border-radius: var(--radius-md);
  border: 2px solid var(--espresso);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn-primary {
  background: var(--espresso);
  color: var(--cream);
  box-shadow: 0 3px 0 var(--kraft-crease);
}

.btn-primary:hover {
  background: #362920;
  color: var(--cream);
  transform: translateY(-1px);
  box-shadow: 0 4px 0 var(--kraft-crease);
}

.btn-secondary {
  background: var(--cream);
  color: var(--espresso);
  box-shadow: 0 3px 0 var(--espresso);
}

.btn-secondary:hover {
  background: var(--kraft-light);
  color: var(--espresso);
  transform: translateY(-1px);
}

/* Hero */
.hero {
  padding: 56px 0 42px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 34px;
  align-items: center;
}

.hero h1 {
  margin: 14px 0 16px;
  font-size: clamp(2.15rem, 4.4vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 900;
}

.hero h1 .underline-kraft {
  background: linear-gradient(180deg, transparent 62%, var(--kraft-mid) 62%, var(--kraft-mid) 92%, transparent 92%);
  padding: 0 3px;
}

.hero-lead {
  font-size: 1.12rem;
  color: var(--espresso-soft);
  margin: 0 0 24px;
  max-width: 54ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-meta {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.88rem;
  color: var(--espresso-muted);
  font-weight: 600;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Mock Parcel Card inside Hero */
.parcel-preview {
  padding: 20px;
}

.parcel-label-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px dashed rgba(35, 27, 21, 0.35);
  padding-bottom: 12px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
}

.parcel-item {
  background: var(--cream);
  border: 2px solid var(--espresso);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
}

.parcel-item:last-child {
  margin-bottom: 0;
}

.parcel-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.parcel-title {
  font-weight: 800;
  font-size: 1rem;
}

.parcel-price {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.98rem;
}

.parcel-sub {
  font-size: 0.84rem;
  color: var(--espresso-muted);
  margin-top: 3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.parcel-total {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 2px solid var(--espresso);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
}

/* Sections */
.section {
  padding: 46px 0;
}

.section-head {
  margin-bottom: 26px;
}

.section-head h2 {
  margin: 10px 0 8px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.section-head p {
  margin: 0;
  color: var(--espresso-soft);
  max-width: 62ch;
}

/* Four-stage visual strip */
.stages-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  position: relative;
}

.stage-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.stage-body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.stage-num {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--espresso-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stage-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 2px solid var(--espresso);
  background: var(--cream);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stage-card h3 {
  margin: 4px 0 0;
  font-size: 1.12rem;
  line-height: 1.2;
}

.stage-card p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--espresso-soft);
}

.stage-card--done {
  background: #D9DFCE;
}

/* Privacy callout */
.privacy-banner {
  padding: 32px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
  background: var(--kraft-mid);
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(35, 27, 21, 0.04) 0px,
    rgba(35, 27, 21, 0.04) 10px,
    transparent 10px,
    transparent 20px
  );
}

.privacy-seal {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: var(--cream);
  border: 2.5px dashed var(--espresso);
  box-shadow: 0 0 0 4px var(--kraft-light), 0 0 0 6px var(--espresso);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.privacy-banner h2 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  line-height: 1.2;
}

.privacy-banner p {
  margin: 0 0 14px;
  color: var(--espresso);
  max-width: 64ch;
  font-weight: 500;
}

.privacy-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.privacy-pills span {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--cream);
  border: 1.5px solid var(--espresso);
  border-radius: 999px;
  padding: 4px 10px;
}

/* Waitlist section */
.waitlist-card {
  padding: 34px 32px;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.waitlist-card h2 {
  margin: 12px 0 8px;
  font-size: clamp(1.55rem, 3vw, 2.05rem);
}

.waitlist-card > p {
  margin: 0 auto 22px;
  max-width: 52ch;
  color: var(--espresso-soft);
}

.waitlist-form {
  display: flex;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto;
}

.waitlist-form input[type="email"] {
  flex: 1;
  min-width: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 13px 16px;
  border: 2px solid var(--espresso);
  border-radius: var(--radius-md);
  background: var(--cream);
  color: var(--espresso);
  outline: none;
}

.waitlist-form input[type="email"]:focus {
  box-shadow: 0 0 0 3px rgba(200, 148, 93, 0.55);
}

.waitlist-status {
  margin: 14px auto 0;
  max-width: 520px;
  font-size: 0.92rem;
  font-weight: 600;
  min-height: 1.4em;
}

.waitlist-status.is-success {
  color: var(--stamp-sage);
}

.waitlist-status.is-error {
  color: var(--stamp-terra);
}

.waitlist-note {
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--espresso-muted);
}

.waitlist-note code {
  font-family: var(--font-mono);
  background: rgba(35, 27, 21, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.78rem;
}

/* Prose / Legal / Support pages */
.page-hero {
  padding: 44px 0 24px;
}

.page-hero h1 {
  margin: 12px 0 8px;
  font-size: clamp(1.9rem, 3.8vw, 2.7rem);
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.page-hero p {
  margin: 0;
  color: var(--espresso-soft);
  max-width: 62ch;
  font-size: 1.05rem;
}

.prose-card {
  padding: 32px;
  margin-bottom: 24px;
}

.prose-card h2 {
  margin: 26px 0 10px;
  font-size: 1.28rem;
  padding-top: 18px;
  border-top: 2px dashed rgba(35, 27, 21, 0.22);
}

.prose-card h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.prose-card p,
.prose-card li {
  color: var(--espresso-soft);
}

.prose-card ul {
  padding-left: 20px;
}

.prose-card li {
  margin-bottom: 8px;
}

/* FAQ Accordion */
.faq-list {
  display: grid;
  gap: 14px;
}

.faq-item {
  background: #FAF5ED;
  border: 2px solid var(--espresso);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 0 var(--espresso);
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 20px;
  font-weight: 800;
  font-size: 1.04rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--kraft-light);
}

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

.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
  width: 28px;
  height: 28px;
  border: 2px solid var(--espresso);
  border-radius: 7px;
  background: var(--cream);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.faq-item[open] summary {
  border-bottom: 2px solid var(--espresso);
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-answer {
  padding: 18px 20px;
  color: var(--espresso-soft);
}

.faq-answer p {
  margin: 0 0 10px;
}

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

/* Footer */
.site-footer {
  margin-top: 56px;
  border-top: 2px solid var(--espresso);
  background: var(--kraft-light);
}

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

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-weight: 600;
  font-size: 0.94rem;
}

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

/* Responsive */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .stages-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .stages-grid {
    grid-template-columns: 1fr;
  }

  .privacy-banner {
    grid-template-columns: 1fr;
    padding: 24px 20px;
  }

  .waitlist-card {
    padding: 28px 18px;
  }

  .waitlist-form {
    flex-direction: column;
  }

  .prose-card {
    padding: 22px 18px;
  }
}
