/* ===============================
   CSS Variables & Global Styles
   =============================== */

:root {
  /* Brand colors */
  --bg: #F7F4EF;
  --primary: #b1aba3;
  --accent-dark: #0A0A0A;
  --text: #3A332C;
  --accent-secondary: #000000;
  --brand-gold: #fdb73e;

  /* Radii */
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  /* Shadows */
  --shadow-soft: 0 10px 30px rgba(10,10,10,.06), 0 2px 10px rgba(10,10,10,.04);
  --shadow-lift: 0 24px 60px rgba(10,10,10,.12);

  /* Layout */
  --container: min(1240px, 94vw);
  --nav-height: 64px;

  /* Media */
  --media-radius: 12px;
  --media-gap: clamp(10px, 1.4vw, 16px);
  --media-border: 1px solid color-mix(in oklab, var(--primary), white 65%);
  --media-bg: #fff;

  /* Safe areas (iOS notch support) */
  --safe-top: env(safe-area-inset-top, 0px);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; scroll-behavior: smooth; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", sans-serif;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* Layout */
.container { width: var(--container); margin: 0 auto; }

/* Typography */
.h2 {
  font-family: "Roboto Serif", system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--accent-dark);
  font-size: clamp(28px, 3.4vw, 48px);
  margin: 0 0 12px;
}
.h2--invert { color: #fff; }

.subhead {
  font-family: "Roboto Serif", ui-serif, Georgia, serif;
  font-weight: 400;
  color: var(--text);
  opacity: .9;
  font-size: clamp(16px, 1.5vw, 20px);
  margin: 0 0 36px;
}
.subhead--invert { color: #fff; opacity: .95; }

/* Buttons */
.btn {
  display: inline-block;
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  padding: 14px 28px;
  font-weight: 700;
  font-size: clamp(15px, 1.4vw, 17px);
  text-align: center;
  transition: transform .15s ease, box-shadow .25s ease, background .25s ease;
  text-decoration: none;
}
.btn--primary {
  background: var(--brand-gold);
  color: var(--accent-dark);
  box-shadow: 0 10px 30px rgba(253,183,62,.35);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(253,183,62,.5); }
.btn--dark {
  background: var(--accent-dark);
  color: #fff;
  box-shadow: 0 10px 30px rgba(10,10,10,.35);
}
.btn--dark:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(10,10,10,.45); }
.btn--ghost {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,.6);
}
.btn--ghost:hover { background: rgba(255,255,255,.1); }

/* Floating CTA button (appears on all pages, opens contact overlay) */
.cta-floating {
  position: fixed;
  right: clamp(12px, 2vw, 24px);
  top: calc(var(--safe-top) + clamp(72px, 10vw, 88px));
  z-index: 600;
  background: var(--accent-secondary);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-soft);
  transform: translateZ(0);
  transition: transform .25s ease, box-shadow .25s ease, opacity .25s ease, visibility .25s ease;
  cursor: pointer;
  font-family: inherit;
}
.cta-floating:hover { transform: scale(1.05); box-shadow: var(--shadow-lift); }
.cta-floating.hide { opacity: 0; visibility: hidden; pointer-events: none; }

/* ---- Contact Overlay ---- */
.contact-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.92);
  z-index: 1000;
  padding: clamp(16px, 4vw, 40px);
  overflow-y: auto;
}
.contact-overlay.open { display: flex; }

.contact-overlay__inner {
  background: #1a1a1a;
  color: #fff;
  width: min(960px, 100%);
  max-width: 100%;
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 52px);
  box-shadow: 0 40px 100px rgba(0,0,0,.6);
  position: relative;
  animation: floatIn .35s ease both;
}

.contact-overlay__close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  color: rgba(255,255,255,.7);
  transition: color .2s ease;
  font-family: inherit;
  z-index: 2;
}
.contact-overlay__close:hover { color: #fff; }

.contact-overlay__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.contact-overlay__form-col { position: relative; }
.contact-overlay__form-col .h2 { margin-bottom: 8px; }
.contact-overlay__form-col .subhead { margin-bottom: 24px; }

/* Profile picture in overlay */
.contact__pfp {
  width: 100%;
  height: auto;
  max-height: 90%;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}

.contact-overlay__pfp-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.contact-overlay__pfp-wrap .contact__pfp {
  margin-bottom: 0;
  border-radius: 0;
}
.contact-overlay__pfp-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
  padding: 20px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.contact-overlay__pfp-caption strong {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.contact-overlay__pfp-caption span {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
}

/* Form hint text */
.form__hint {
  font-size: 13px;
  color: rgba(255,255,255,.55);
  margin: 8px 0 0;
}

/* Toast for overlay form */
.toast {
  margin-top: 10px;
  font-size: 14px;
  color: var(--brand-gold);
  min-height: 20px;
}
.toast.show { display: block; }

/* Social links column */
.contact-overlay__social-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}

/* Divider line above social title */
.contact-overlay__social-divider {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,.22), transparent);
  margin: 4px 0;
}

.contact-overlay__social-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.5);
  margin: 0 0 8px;
  font-weight: 600;
}

.contact-overlay__social-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 4px;
  border-radius: 0;
  background: transparent;
  border: none;
  color: #fff;
  text-decoration: none;
  font-size: clamp(20px, 3.5vw, 26px);
  font-weight: 700;
  transition: opacity .2s ease, transform .2s ease;
}
.contact-overlay__social-link:hover {
  background: transparent;
  border-color: transparent;
  transform: translateX(4px);
  opacity: 0.8;
}
.contact-overlay__social-link svg {
  width: clamp(22px, 3.5vw, 28px);
  height: clamp(22px, 3.5vw, 28px);
  flex-shrink: 0;
  fill: currentColor;
}

/* Big phone number in contact overlay */
.contact-overlay__phone-display {
  font-size: clamp(20px, 3.5vw, 26px);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
  padding: 10px 0 4px;
  text-decoration: none;
  display: block;
  transition: opacity 0.2s ease;
}
.contact-overlay__phone-display:hover { opacity: 0.8; }

@media (max-width: 720px) {
  .contact-overlay__content { grid-template-columns: 1fr; }
  .contact-overlay__social-col { padding-top: 0; }

  /* hide pfp on mobile */
  .contact-overlay__pfp-wrap {
    display: none;
  }

  /* social title, phone and tg above pfp on mobile */
  .contact-overlay__social-title { order: 0; }
  .contact-overlay__phone-display { order: 1; }
  .contact-overlay__social-link { order: 2; }
  .contact-overlay__social-col {
    display: flex;
    flex-direction: column;
  }
}

/* Reveal animations (scroll-triggered via IntersectionObserver) */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in-view { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s ease; }
.reveal--right { opacity: 0; transform: translateX(28px); }
.reveal--right.in-view { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s ease; }
.reveal--left { opacity: 0; transform: translateX(-28px); }
.reveal--left.in-view { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s ease; }

/* Image slide-in animation */
.will-slide { opacity: 0; transform: translateY(-16px); transition: opacity .6s ease, transform .6s ease; }
.will-slide.in-view { opacity: 1; transform: none; }

/* Keyframes */
@keyframes floatIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes gentleTwist { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }

/* Utility */
body.no-scroll { overflow: hidden; }

/* Policy button */
.policy-btn {
  background: none;
  border: 0;
  padding: 4px 6px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  border-radius: 8px;
  transition: transform .25s ease;
}
.policy-btn:hover { transform: scale(1.05); }

/* Policy dialog */
.policy-dialog {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.82);
  z-index: 2100;
  padding: clamp(16px,4vw,40px);
}
.policy-dialog.open { display: flex; }
.policy-dialog__inner {
  background: var(--bg);
  color: var(--text);
  width: min(640px, 100%);
  max-height: 90vh;
  overflow: auto;
  border-radius: var(--radius-lg);
  padding: clamp(24px,3.2vw,36px);
  box-shadow: var(--shadow-lift);
  position: relative;
}
.policy-dialog__close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  color: var(--accent-dark);
}
.policy-dialog__title {
  margin: 0 0 16px;
  font-size: clamp(22px,2.6vw,35px);
  font-family: "Roboto", system-ui, sans-serif;
  font-weight: 800;
}
.policy-dialog__text p {
  margin: 0 0 14px;
  font-size: clamp(14px,1.4vw,18px);
  line-height: 1.55;
}

/* Form elements (used on guide + old contact) */
.label { display: block; font-size: 13px; opacity: .9; margin: 0 0 6px; }
.input,
.textarea {
  width: 100%;
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.input::placeholder,
.textarea::placeholder { color: rgba(255,255,255,.65); }
.input:focus,
.textarea:focus {
  border-color: #fff;
  box-shadow: 0 0 0 4px rgba(255,255,255,.14);
  background: rgba(255,255,255,.22);
}
.form__row { margin-bottom: 14px; }
.textarea { resize: vertical; }
.checkbox {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; margin: 8px 0 14px; color: rgba(255,255,255,.9);
}
.checkbox input { width: 16px; height: 16px; accent-color: #fff; flex-shrink: 0; margin-top: 2px; }

/* Mobile adjustments */
@media (max-width: 780px) {
  .cta-floating { top: calc(var(--safe-top) + 72px); }
}
