/* =========================================================
   components.css - Buttons, accordions, dialogs, animations
   ========================================================= */

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: var(--w-semi);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 14px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
  background: transparent;
  color: var(--ink);
  min-height: 48px;
  line-height: 1;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--grad-accent);
  color: #fff;
  border-color: transparent;
}
.btn--primary:hover {
  background: var(--grad-accent-hover);
  border-color: var(--gold);
  color: #fff;
}

.btn--outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn--outline:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn--on-night {
  color: var(--night-text);
  border-color: var(--night-text);
  background: transparent;
}
.btn--on-night:hover {
  background: var(--night-text);
  color: var(--night);
}

.btn--lg {
  padding: 17px 30px;
  font-size: 12px;
  min-height: 54px;
}

.btn--arrow::after {
  content: '\2192';
  font-family: var(--font-body);
  font-size: 1.2em;
  line-height: 1;
  display: inline-block;
  transition: transform var(--dur-fast) var(--ease);
}
.btn--arrow:hover::after { transform: translateX(4px); }

.btn [data-lucide] {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

/* =========================================================
   ACCORDION
   ========================================================= */
.accordion {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--rule);
}

.accordion__item {
  border-bottom: 1px solid var(--rule);
}

.accordion__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: var(--s-4) 0;
  background: transparent;
  border: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: var(--w-display);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease);
  letter-spacing: -0.01em;
}
.accordion__head:hover { color: var(--gold-ink); }
.accordion__icon {
  font-size: 24px;
  font-weight: var(--w-regular);
  color: var(--ink-mute);
  flex-shrink: 0;
  margin-left: var(--s-3);
  transition: transform var(--dur) var(--ease);
  display: inline-block;
  width: 24px;
  text-align: center;
  line-height: 1;
}
.accordion__item.is-open .accordion__icon { transform: rotate(45deg); }
.accordion__body {
  height: 0;
  overflow: hidden;
}
.accordion__body p {
  padding: 0 0 var(--s-4);
  color: var(--ink-soft);
  font-size: var(--fs-body);
  line-height: 1.6;
  max-width: 60ch;
  margin: 0;
}

/* =========================================================
   LEDGER (used in Invest card + dialog)
   ========================================================= */
.ledger {
  font-family: var(--font-mono);
  font-size: 13px;
}
.ledger__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  gap: var(--s-3);
}
.ledger__row:last-child { border-bottom: 0; }
.ledger__label {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-soft);
}
.ledger__value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: var(--w-semi);
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ledger__value--accent { color: var(--gold-ink); }

/* =========================================================
   DIALOG
   ========================================================= */
dialog {
  position: relative;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  padding: 0;
  max-width: 720px;
  width: calc(100vw - 48px);
  max-height: 92vh;
  margin: auto;
  font-family: var(--font-body);
  border-radius: var(--radius);
  overflow: hidden;
}
dialog[open] {
  display: flex;
  flex-direction: column;
}
dialog::backdrop {
  background: rgba(18, 18, 18, 0.55);
  backdrop-filter: blur(4px);
  transition: opacity var(--dur) var(--ease);
}

.dialog__head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-5) var(--s-6) var(--s-4);
  /* perforation under the head - every dialog is a ticket stub */
  border-bottom: 2px dashed var(--rule);
  overflow: hidden;
}
/* Ghosted window number behind the head, clipped letterpress-style */
.dialog__ghost {
  position: absolute;
  right: 72px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: var(--w-bold);
  font-size: 72px;
  line-height: 1;
  color: rgba(18, 18, 18, 0.05);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
@supports (-webkit-text-stroke: 1px #000) {
  .dialog__ghost {
    color: transparent;
    -webkit-text-stroke: 1px rgba(18, 18, 18, 0.14);
  }
}
/* Rubber stamp, rotated, fixed to the dialog frame */
.dialog__stamp {
  position: absolute;
  right: var(--s-6);
  top: 108px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: var(--w-medium);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-ink);
  border: 2px solid currentColor;
  border-radius: 3px;
  padding: 4px 10px;
  transform: rotate(-7deg);
  opacity: 0.6;
  pointer-events: none;
  user-select: none;
}
/* Stub footer - the tear-off bottom of the dialog ticket */
.dialog__stub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-3) var(--s-6);
  border-top: 2px dashed var(--rule);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.dialog__stub-barcode {
  width: 72px;
  height: 16px;
  opacity: 0.5;
  background: repeating-linear-gradient(90deg,
    currentColor 0 2px, transparent 2px 4px,
    currentColor 4px 5px, transparent 5px 9px,
    currentColor 9px 11px, transparent 11px 13px);
}
.dialog__stub-serial { color: var(--gold-ink); }

/* First Class dialog - night theme for the investment window */
.dialog--night {
  background: var(--night);
  color: var(--night-text);
  border-color: var(--night-elev);
}
.dialog--night .dialog__head { border-bottom-color: var(--rule-night); }
.dialog--night .dialog__title,
.dialog--night .dialog__body h3 { color: var(--night-text); }
.dialog--night .dialog__body,
.dialog--night .dialog__body p,
.dialog--night .dialog__body li { color: var(--night-mute); }
.dialog--night .dialog__body strong { color: var(--night-text); }
.dialog--night .dialog__standfirst { color: var(--night-text); border-bottom-color: var(--rule-night); }
.dialog--night .dialog__close { color: var(--night-text); border-color: var(--rule-night); }
.dialog--night .ledger__row { border-bottom-color: var(--rule-night); }
.dialog--night .ledger__label { color: var(--night-mute); }
.dialog--night .ledger__value { color: var(--night-text); }
.dialog--night .dialog__disclaimer { background: var(--night-elev); color: var(--night-mute); }
.dialog--night .dialog__stub { border-top-color: var(--rule-night); color: var(--night-mute); }
.dialog--night .dialog__stub-serial { color: var(--gold-bright); }
.dialog--night .kicker { color: var(--gold-bright); }
.dialog--night .ledger__value--accent { color: var(--gold-bright); }
.dialog--night .dialog__disclaimer strong { color: var(--gold-bright); }
.dialog--night .dialog__ghost { color: rgba(245, 240, 229, 0.06); }
@supports (-webkit-text-stroke: 1px #000) {
  .dialog--night .dialog__ghost {
    color: transparent;
    -webkit-text-stroke: 1px rgba(245, 240, 229, 0.22);
  }
}
.dialog--night .dialog__stamp { color: var(--gold-bright); }
.dialog--night .btn--outline { color: var(--night-text); border-color: var(--night-text); }
.dialog--night .btn--outline:hover { background: var(--night-text); color: var(--night); }
.dialog__title {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: var(--w-display);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-top: 4px;
}
.dialog__close {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  font-family: var(--font-mono);
  border-radius: 50%;
  flex-shrink: 0;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.dialog__close:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.dialog__body {
  padding: var(--s-5) var(--s-6) var(--s-6);
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  font-size: var(--fs-body);
  line-height: 1.6;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-mute) transparent;
}
.dialog__body::-webkit-scrollbar { width: 8px; }
.dialog__body::-webkit-scrollbar-track { background: transparent; }
.dialog__body::-webkit-scrollbar-thumb { background: var(--ink-mute); border-radius: 4px; }
.dialog__body h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: var(--w-display);
  color: var(--ink);
  margin-top: var(--s-5);
  margin-bottom: var(--s-3);
}
.dialog__body h3:first-child { margin-top: 0; }
.dialog__body p { margin-bottom: var(--s-3); }
.dialog__body ul {
  margin: var(--s-3) 0 var(--s-4);
  padding-left: 0;
  list-style: none;
}
.dialog__body ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
  line-height: 1.55;
}
.dialog__body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 8px;
  height: 1px;
  background: var(--gold-ink);
}

.dialog__standfirst {
  font-family: var(--font-quote);
  font-size: 17px;
  line-height: 1.45;
  font-style: italic;
  color: var(--ink);
  padding-bottom: var(--s-4);
  margin: 0 0 var(--s-4);
  border-bottom: 1px solid var(--rule);
}

.dialog__disclaimer {
  margin: var(--s-4) 0;
  padding: var(--s-4);
  background: var(--paper-soft);
  border-left: 3px solid var(--gold);
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-mute);
  font-style: italic;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.dialog__disclaimer strong {
  font-style: normal;
  color: var(--gold-ink);
  font-weight: var(--w-semi);
  margin-right: 4px;
}

.dialog__cta {
  display: flex;
  gap: var(--s-3);
  margin-top: var(--s-5);
  flex-wrap: wrap;
}

.kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: var(--w-medium);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold-ink);
  margin-bottom: var(--s-2);
}
/* =========================================================
   REVEAL / STAGGER ANIMATIONS
   Now driven entirely by GSAP (ScrollTrigger) in js/main.js.
   No CSS needed here - GSAP sets initial states and tweens
   them in, and gsap.matchMedia handles reduced-motion.
   ========================================================= */

/* =========================================================
   SKIP LINK
   ========================================================= */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--s-3);
  background: var(--grad-accent);
  color: #fff;
  padding: 12px 20px;
  font-size: var(--fs-caption);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: var(--w-semi);
  z-index: 1000;
  text-decoration: none;
  border-radius: var(--radius);
}
.skip-link:focus-visible {
  top: var(--s-3);
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* =========================================================
   BACK TO TOP
   ========================================================= */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: var(--grad-accent);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), background var(--dur-fast) var(--ease);
  z-index: 90;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.back-to-top:hover { background: var(--accent-deep); }
.back-to-top [data-lucide] { width: 20px; height: 20px; stroke-width: 2; }

/* =========================================================
   INLINE LINK-BUTTON
   ========================================================= */
.btn-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--gold-ink);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(138, 109, 54, 0.4);
  text-underline-offset: 4px;
  transition: color var(--dur-fast) var(--ease);
}
.btn-link:hover { color: var(--gold-ink); }

/* =========================================================
   CONTACT FORM - fields inside the message dialog
   ========================================================= */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4) var(--s-4);
  margin-top: var(--s-4);
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.field .req { color: var(--accent-ink); margin-left: 2px; }
.field .opt { color: var(--ink-mute); text-transform: none; letter-spacing: 0; font-size: 9px; }
.field input,
.field textarea {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201, 169, 107, 0.22);
}
.field textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.dialog__thanks {
  text-align: center;
  padding: var(--s-7) var(--s-3);
}
.dialog__thanks-mark {
  width: 52px;
  height: 52px;
  margin: 0 auto var(--s-4);
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-ink);
  font-size: 24px;
}
.dialog__thanks h3 { margin-top: 0; }
.dialog__thanks p { margin-inline: auto; }
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   MODAL-OPEN state - fixed-body scroll lock. overflow:hidden
   on html OR body propagates to the root scroller and resets
   scroll position in Chrome, so the body is fixed in place
   instead (JS offsets it by -scrollY and restores on close).
   ========================================================= */
body.is-modal-open {
  position: fixed;
  left: 0;
  right: 0;
  overflow: hidden;
}
