/* =========================================================
   NAN CLOTHING — SPLIT RIDGE  |  styles.css
   ========================================================= */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@900&family=IBM+Plex+Mono:wght@400;500&family=Inter:wght@400;500&display=swap');

/* ── Design Tokens ── */
:root {
  --red:  #C1272D;
  --ink:  #0A0A0A;
  --bone: #F1ECE2;
  --gray: #6B6B6B;

  /* The mountain-ridge clip-path polygon — identical on bg layer AND text mask */
  --ridge-clip: polygon(
    0% 0%, 42% 0%, 56% 9%, 46% 19%,
    62% 30%, 44% 42%, 60% 53%, 41% 66%,
    55% 78%, 38% 100%, 0% 100%
  );
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden; /* fixed full-viewport layout */
}

body {
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Skip link ── */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  background: var(--red);
  color: var(--bone);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 1rem;
}

/* ============================================================
   BACKGROUND LAYERS
   ============================================================ */

/* Layer 1: ink base — full viewport, fixed */
.bg-ink {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: var(--ink);
}

/* Layer 2: red ridge — same full viewport, clipped to the mountain polygon */
.bg-ridge {
  position: fixed;
  inset: 0;
  z-index: 1;
  background-color: var(--red);
  clip-path: var(--ridge-clip);
  /* subtle inner grain via noise-ish gradient */
  background-image:
    linear-gradient(160deg, rgba(255,255,255,0.04) 0%, transparent 55%);
}

/* ============================================================
   LOGO CHIP — fixed top-left
   ============================================================ */
.logo-chip {
  position: fixed;
  top: 28px;
  left: 28px;
  z-index: 100;
  background: var(--bone);
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.55), 0 1px 4px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.logo-chip img {
  width: 74px;
  height: auto;
  display: block;
  /* logo has white bg — multiply blends to bone card */
  mix-blend-mode: multiply;
}

/* ============================================================
   CENTERED HEADLINE AREA
   ============================================================ */
.headline-area {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: clamp(160px, 22vh, 220px); /* clear the boarding pass */
  pointer-events: none;
  user-select: none;
}

/* Eyebrow label */
.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(0.55rem, 1.1vw, 0.75rem);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone);
  margin-bottom: 0.9rem;
  mix-blend-mode: difference;
}

/* ── Headline wrapper — position context for the two overlapping copies ── */
.headline-wrap {
  position: relative;
  text-align: center;
  line-height: 0.86;
  width: 100%;
}

/* Shared headline typography */
.headline-base,
.headline-mask {
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  font-size: clamp(52px, 11vw, 148px);
  line-height: 0.86;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  display: block;
  white-space: nowrap;
  text-align: center;
  width: 100%;
}

/* Layer A: solid white — always visible behind everything */
.headline-base {
  color: #ffffff;
  position: relative;
  z-index: 0;
  text-align: center;
  width: 100%;
}

/* Layer B: solid ink — FIXED full-viewport, same clip as bg-ridge.
   Because this element is fixed & inset:0, clip-path % values reference
   the exact same viewport dimensions as the red background layer. */
.headline-mask-layer {
  position: fixed;
  inset: 0;
  z-index: 11; /* just above headline-area (z-index: 10) */
  clip-path: var(--ridge-clip);
  /* Center the text identically to the base layer */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: clamp(160px, 22vh, 220px);
  pointer-events: none;
  user-select: none;
}

.headline-mask {
  color: var(--ink);
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  font-size: clamp(52px, 11vw, 148px);
  line-height: 0.86;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  display: block;
  white-space: nowrap;
  text-align: center;
  width: 100%;
}

/* ============================================================
   BOARDING PASS CARD — fixed bottom center
   ============================================================ */
.boarding-pass {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: var(--bone);
  border-radius: 14px;
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.45),
    0 2px 8px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: row;
  max-width: 640px;
  width: calc(100vw - 48px);
  overflow: hidden;
}

/* ── Main section ── */
.bp-main {
  flex: 1;
  padding: 22px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.bp-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray);
}

.bp-tagline {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.78rem, 1.3vw, 0.9rem);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}

/* Dashed divider above form row */
.bp-divider {
  border: none;
  border-top: 1.5px dashed rgba(10, 10, 10, 0.25);
  margin: 2px 0 0;
}

/* Form row */
.bp-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.bp-input {
  flex: 1;
  border: 1.5px solid rgba(10, 10, 10, 0.2);
  border-radius: 7px;
  background: #ffffff;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  color: var(--ink);
  padding: 9px 13px;
  outline: none;
  transition: border-color 0.2s ease;
  min-width: 0;
}

.bp-input::placeholder {
  color: #aaa;
}

.bp-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.15);
}

.bp-button {
  background: var(--ink);
  color: var(--bone);
  border: none;
  border-radius: 7px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 9px 18px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.22s ease, color 0.22s ease;
  flex-shrink: 0;
}

.bp-button:hover {
  background: var(--red);
  color: #ffffff;
}

.bp-button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

/* Feedback message */
.bp-msg {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease;
  color: var(--gray);
}

.bp-msg.visible {
  opacity: 1;
  height: auto;
}

.bp-msg--success { color: #1a6e2e; }
.bp-msg--error   { color: var(--red); }

/* ── Stub section ── */
.bp-stub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px 18px;
  border-left: 1.5px dashed rgba(10, 10, 10, 0.22);
  flex-shrink: 0;
  width: 76px;
}

/* Decorative barcode (SVG rects) */
.bp-barcode {
  display: block;
}

/* Vertical label */
.bp-stub-label {
  writing-mode: vertical-rl;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray);
}

/* ============================================================
   prefers-reduced-motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .bp-button {
    transition: none;
  }
  .bp-input {
    transition: none;
  }
  .bp-msg {
    transition: none;
  }
}

/* ============================================================
   RESPONSIVE ≤ 620px
   ============================================================ */
@media (max-width: 620px) {
  /* Smaller logo chip */
  .logo-chip {
    top: 16px;
    left: 16px;
    padding: 6px 9px;
  }
  .logo-chip img {
    width: 52px;
  }

  /* Boarding pass stacks vertically */
  .boarding-pass {
    flex-direction: column;
    bottom: 20px;
    border-radius: 12px;
    width: calc(100vw - 32px);
  }

  .bp-stub {
    flex-direction: row;
    width: 100%;
    border-left: none;
    border-top: 1.5px dashed rgba(10, 10, 10, 0.22);
    padding: 14px 20px;
    justify-content: space-between;
  }

  .bp-stub-label {
    writing-mode: horizontal-tb;
    letter-spacing: 0.14em;
  }

  /* More bottom padding so headline never overlaps the card */
  .headline-area,
  .headline-mask-layer {
    padding-bottom: clamp(230px, 42vh, 290px);
  }

  .headline-base,
  .headline-mask {
    white-space: normal;
    text-align: center;
  }
}
