/* ==========================================================
   Wild Tide — storefront styles
   Direction: reference 1's cream serif restraint + reference 2's
   full-bleed media. Signature elements: the rope divider and the
   VHS hero with the stacked fading tagline.
   ========================================================== */

:root {
  --cream:      #F6F1E7;  /* page base */
  --sand:       #EAE1CF;  /* solid nav, footer, soft panels */
  --ink:        #211E19;  /* near-black warm text */
  --baby-blue:  #A9C9DA;  /* accent: hovers, selection, flags */
  --deep-blue:  #5E8AA0;  /* accent: links, focus rings */
  --rope:       #8A6F4D;  /* ornament tint */

  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans:  'Jost', 'Helvetica Neue', sans-serif;

  --nav-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

::selection { background: var(--baby-blue); color: var(--ink); }

/* ---------- utility type ---------- */
.eyebrow,
.nav-links a,
.nav-bag,
.card-shop,
.opt-label,
.btn,
.footer-links a {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  padding: 14px 34px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
              border-color 0.25s var(--ease);
}
.btn-solid { background: var(--ink); color: var(--cream); }
.btn-solid:hover:not(:disabled) { background: var(--deep-blue); border-color: var(--deep-blue); }
.btn-outline:hover { background: var(--ink); color: var(--cream); }
.btn-ghost { border-color: rgba(246, 241, 231, 0.9); color: var(--cream); }
.btn-ghost:hover { background: var(--cream); color: var(--ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

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

/* ==========================================================
   NAVBAR — transparent over the hero, cream after scroll.
   ========================================================== */
.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 100;
  background: transparent;
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.nav-inner {
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.nav-links { display: flex; gap: 28px; }
.nav-right { justify-content: flex-end; }
.nav-links a, .nav-bag { text-decoration: none; color: var(--cream); }
.nav-bag {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.bag-count {
  display: inline-block;
  min-width: 18px;
  text-align: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 10px;
  line-height: 16px;
}
.nav-logo {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cream);
  transition: color 0.35s var(--ease);
}

/* Solid state — added on scroll, or always on pages without a hero. */
.site-nav.nav-solid,
.no-hero .site-nav {
  background: var(--sand);
  box-shadow: 0 1px 0 rgba(33, 30, 25, 0.12);
}
.site-nav.nav-solid .nav-links a,
.site-nav.nav-solid .nav-bag,
.site-nav.nav-solid .nav-logo,
.no-hero .site-nav .nav-links a,
.no-hero .site-nav .nav-bag,
.no-hero .site-nav .nav-logo {
  color: var(--ink);
}
.nav-links a:hover { color: var(--baby-blue); }
.site-nav.nav-solid .nav-links a:hover,
.no-hero .site-nav .nav-links a:hover { color: var(--deep-blue); }

/* ==========================================================
   HERO — full-bleed looping video, stacked fading tagline.
   ========================================================== */
.hero {
  position: relative;
  height: 100svh;
  min-height: 540px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--ink); /* shows while poster/video load */
}
.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(33, 30, 25, 0.42) 0%,
    rgba(33, 30, 25, 0.12) 45%,
    rgba(33, 30, 25, 0.38) 100%
  );
}
.hero-copy {
  position: relative;
  text-align: center;
  color: var(--cream);
  padding: 0 20px;
}
.hero-stack {
  margin: 0 0 36px;
  display: grid;
  gap: 2px;
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(26px, 5vw, 56px);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  line-height: 1.18;
}
.hero-stack span:nth-child(2) { opacity: 0.55; }
.hero-stack span:nth-child(3) { opacity: 0.3; }
.hero-stack span:nth-child(4) { opacity: 0.14; }
.hero-scroll-cue {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--cream);
  font-size: 20px;
  animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 8px); }
}

/* ==========================================================
   ROPE DIVIDER — the signature ornament. Swap the SVG for the
   real rope photo (same filename) and everything updates.
   ========================================================== */
.rope-divider {
  width: 120px;
  margin: 0 auto;
  opacity: 0.85;
}
.rope-card { width: 84px; margin: 18px auto 10px; }
.rope-product { width: 96px; margin: 18px 0 26px; }
.rope-footer { width: 100px; margin-bottom: 18px; }

/* ==========================================================
   STORY
   ========================================================== */
.story {
  max-width: 640px;
  margin: 0 auto;
  padding: 110px 24px 90px;
  text-align: center;
}
.story-heading {
  font-weight: 500;
  font-size: clamp(30px, 4vw, 42px);
  letter-spacing: 0.02em;
  margin: 26px 0 18px;
}
.story-body { margin: 0; font-size: 19px; }

/* ==========================================================
   SHOP GRID — reference 1's card anatomy:
   image / rope / name / price / shop now.
   ========================================================== */
.shop {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 130px;
}
.shop-heading {
  text-align: center;
  font-weight: 500;
  font-size: clamp(26px, 3.4vw, 36px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 56px;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 340px));
  gap: 56px;
  justify-content: center;
}
.product-card {
  text-align: center;
  text-decoration: none;
}
.card-media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--sand);
  overflow: hidden;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.product-card:hover .card-media img { transform: scale(1.035); }
.card-flag {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 5px 12px;
  background: var(--baby-blue);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.card-name {
  font-weight: 500;
  font-size: 22px;
  margin: 0 0 4px;
}
.card-price {
  margin: 0 0 12px;
  font-size: 18px;
}
.card-shop {
  display: inline-block;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--ink);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.product-card:hover .card-shop {
  color: var(--deep-blue);
  border-color: var(--deep-blue);
}

/* ==========================================================
   PRODUCT PAGE
   ========================================================== */
.product-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 48px) 24px 110px;
}
.crumb {
  display: inline-block;
  margin-bottom: 30px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
}
.crumb:hover { color: var(--deep-blue); }
.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: start;
}
.product-media {
  aspect-ratio: 4 / 5;
  background: var(--sand);
  overflow: hidden;
}
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-name {
  font-weight: 500;
  font-size: clamp(32px, 4vw, 44px);
  margin: 0 0 6px;
}
.product-price { font-size: 22px; margin: 0; }
.opt-label { margin: 0 0 12px; color: rgba(33, 30, 25, 0.75); }
.opt-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.opt-btn {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 18px;
  background: transparent;
  border: 1px solid rgba(33, 30, 25, 0.4);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.opt-btn:hover:not(:disabled) { border-color: var(--ink); }
.opt-btn.selected { border-color: var(--ink); background: var(--baby-blue); }
.opt-btn.out { text-decoration: line-through; opacity: 0.4; cursor: not-allowed; }
.stock-note {
  min-height: 1.4em;
  margin: -12px 0 18px;
  font-size: 15px;
  font-style: italic;
  color: var(--deep-blue);
}
.add-btn { width: 100%; max-width: 340px; }
.product-desc { margin: 34px 0 14px; }
.product-details {
  margin: 0;
  padding-left: 18px;
  font-size: 16px;
  color: rgba(33, 30, 25, 0.8);
}
.product-details li { margin-bottom: 4px; }

/* ==========================================================
   BAG DRAWER
   ========================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(33, 30, 25, 0.4);
}
.bag-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 200;
  height: 100dvh;
  width: min(400px, 92vw);
  background: var(--cream);
  box-shadow: -8px 0 30px rgba(33, 30, 25, 0.18);
  display: flex;
  flex-direction: column;
  transform: translateX(102%);
  transition: transform 0.4s var(--ease);
}
.bag-drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid rgba(33, 30, 25, 0.12);
}
.drawer-title { font-weight: 500; font-size: 24px; margin: 0; }
.drawer-close {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
}
.drawer-items { flex: 1; overflow-y: auto; padding: 8px 24px; }
.bag-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(33, 30, 25, 0.08);
}
.bag-line-name { font-size: 17px; margin: 0; }
.bag-line-meta {
  margin: 2px 0 0;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(33, 30, 25, 0.65);
}
.bag-line-right { text-align: right; white-space: nowrap; }
.bag-line-price { margin: 0; }
.bag-remove {
  background: none;
  border: none;
  padding: 0;
  margin-top: 4px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(33, 30, 25, 0.55);
  cursor: pointer;
}
.bag-remove:hover { color: var(--deep-blue); }
.drawer-empty { padding: 40px 24px; text-align: center; font-style: italic; }
.drawer-foot { padding: 18px 24px 26px; border-top: 1px solid rgba(33, 30, 25, 0.12); }
.drawer-subtotal {
  display: flex;
  justify-content: space-between;
  font-size: 19px;
  margin-bottom: 4px;
}
.drawer-note {
  margin: 0 0 16px;
  font-size: 14px;
  font-style: italic;
  color: rgba(33, 30, 25, 0.6);
}
.drawer-checkout { width: 100%; }
.drawer-error { margin: 12px 0 0; color: #8C3B2E; font-size: 15px; }

/* ==========================================================
   STATUS PAGES (success / cancel / error)
   ========================================================== */
.status-page {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 90px) 24px 120px;
  text-align: center;
}
.status-heading { font-weight: 500; font-size: clamp(30px, 4vw, 40px); margin: 26px 0 12px; }
.status-body { margin: 0 0 30px; }
.status-items {
  list-style: none;
  margin: 0 0 34px;
  padding: 0;
  text-align: left;
}
.status-items li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(33, 30, 25, 0.1);
}
.status-total { font-weight: 600; }

/* ==========================================================
   FOOTER
   ========================================================== */
.site-footer {
  background: var(--sand);
  text-align: center;
  padding: 64px 24px 40px;
}
.footer-mark {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 4px;
}
.footer-tag { margin: 0 0 26px; font-style: italic; }
.footer-links { display: flex; justify-content: center; gap: 30px; margin-bottom: 28px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--deep-blue); }
.footer-legal { margin: 0; font-size: 14px; color: rgba(33, 30, 25, 0.6); }

/* ==========================================================
   CONTACT PAGE
   ========================================================== */

/* Vertical-stripe background: alternating cream / sand at 10px each */
.contact-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 48px) 24px 80px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--cream)   0px,
    var(--cream)  10px,
    var(--sand)   10px,
    var(--sand)   20px
  );
}

/* Frosted card sits over the stripe background */
.contact-inner {
  width: 100%;
  max-width: 520px;
  background: var(--cream);
  padding: 52px 48px 48px;
  box-shadow: 0 4px 40px rgba(33, 30, 25, 0.10);
  text-align: center;
}

.rope-contact { width: 96px; margin: 0 auto 28px; }

.contact-heading {
  font-weight: 500;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: 0.02em;
  margin: 0 0 12px;
}
.contact-sub {
  margin: 0 0 36px;
  font-size: 17px;
  font-style: italic;
  color: rgba(33, 30, 25, 0.65);
}

.contact-banner {
  padding: 13px 18px;
  margin-bottom: 26px;
  font-size: 15px;
  text-align: left;
}
.contact-banner--success {
  background: rgba(169, 201, 218, 0.22);
  border-left: 3px solid var(--deep-blue);
}
.contact-banner--error {
  background: rgba(140, 59, 46, 0.07);
  border-left: 3px solid #8C3B2E;
  color: #8C3B2E;
}
.contact-error-list { margin: 0; padding-left: 18px; }
.contact-error-list li { margin-bottom: 4px; }

/* Form fields */
.contact-form { text-align: left; }
.cf-field { display: flex; flex-direction: column; margin-bottom: 20px; }

.cf-label {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(33, 30, 25, 0.55);
  margin-bottom: 7px;
}

.cf-input {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink);
  background: var(--sand);           /* warm sand fill — no white */
  border: none;
  border-bottom: 1px solid rgba(33, 30, 25, 0.2);
  padding: 11px 12px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
  outline: none;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}
.cf-input:focus {
  border-bottom-color: var(--deep-blue);
  background: rgba(234, 225, 207, 0.7);
}

.cf-textarea {
  resize: none;                      /* not resizable */
  min-height: 148px;
  line-height: 1.55;
}

.cf-submit { width: 100%; margin-top: 10px; }

@media (max-width: 600px) {
  .contact-inner { padding: 40px 24px 36px; }
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 860px) {
  .product-layout { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 640px) {
  /* Nav becomes two rows: logo+bag / links strip.
     --nav-h grows to cover both rows so page padding offsets stay correct. */
  :root { --nav-h: 102px; }
  .site-nav { height: auto; }
  .nav-inner {
    padding: 0;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: 64px auto;
    grid-template-areas:
      'left logo bag'
      'links links links';
  }
  .nav-logo {
    grid-area: logo;
    font-size: 20px;
    text-align: center;
  }
  .nav-right {
    grid-area: bag;
    padding-right: 16px;
    justify-content: flex-end;
  }
  /* Links strip — full-width second row */
  .nav-left {
    grid-area: links;
    display: flex;
    justify-content: center;
    gap: 0;
    border-top: 1px solid transparent;
    transition: border-color 0.35s var(--ease);
    padding: 0;
  }
  .nav-left a {
    display: block !important;
    padding: 9px 16px;
    font-size: 11px;
  }
  /* Separator appears after scroll or on solid pages */
  .site-nav.nav-solid .nav-left,
  .no-hero .site-nav .nav-left {
    border-top-color: rgba(33, 30, 25, 0.1);
  }
  .nav-left a { color: var(--cream); }
  .site-nav.nav-solid .nav-left a,
  .no-hero .site-nav .nav-left a { color: var(--ink); }

  .product-grid { gap: 40px; }
}

/* ==========================================================
   REDUCED MOTION — kill animation, freeze the hero on its poster.
   navbar.js also pauses the video when this preference is set.
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
