/* ==========================================================================
   Jaleo Group — site.css
   Global tokens, reset, structural grid system, header, footer.
   Page-specific section styles live in home.css (or [page].css per page).
   ========================================================================== */

/* ---- Fonts ----
   Wix Madefor Display (headings) and Montserrat (body), both free via
   Google Fonts — no licensed/self-hosted files needed.
*/
@import url('https://fonts.googleapis.com/css2?family=Wix+Madefor+Display:wght@500;600;700&family=Montserrat:wght@400;500;600;700&family=Dancing+Script:wght@700&display=swap');

/* ---- Tokens ---- */
:root {
  /* Base palette — Bending Spoons-inspired: charcoal canvas, white type, one accent */
  --bg: #1D1D1F; /* charcoal, not pure black — matches screenshot + CheckWaldo's --ink token */
  --header-bg: #000000; /* top bar is pure black, distinct from the charcoal used elsewhere */
  --canvas: #FBFAF7; /* light section background */
  --highlight: #FEEFA3; /* pale yellow — used for the About lead sentence reveal */
  --ink: #FFFFFF;
  --ink-muted: rgba(255, 255, 255, 0.6);
  --accent: #0057FF; /* placeholder electric blue — confirm exact hex against Figma */
  --lime: #C6FF3D;   /* placeholder lime green for About Jaleo/Josh section — confirm against Figma */
  --grid: rgba(255, 255, 255, 0.14); /* hairline strokes, tuned for dark bg */
  --grid-on-light: rgba(29, 29, 31, 0.14); /* hairline strokes on light sections */
  --card-bg: #FFFFFF;

  /* Type */
  --font-display: 'Wix Madefor Display', sans-serif;
  --font-body: 'Montserrat', sans-serif;

  /* Shape — two radii for cards/badges, one for buttons */
  --radius-card: 8px;
  --radius-pill: 999px;
  --radius-btn: 6px; /* squared off — a deliberate corner, not a rounded pill */

  /* Spacing */
  --gutter-desktop: 60px;
  --gutter-mobile: 24px;
}

/* ---- Reset ---- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h2 {
  font-size: clamp(28px, 4vw, 46px);
}

/* ---- Light section pattern ----
   Background flips to --canvas, text to dark, and hairlines must switch to
   the dark-on-light variant or they'd be invisible (per design system notes).
*/
.light-section {
  background: var(--canvas);
  color: var(--bg);
}

.light-section .grid-frame {
  border-left-color: var(--grid-on-light);
  border-right-color: var(--grid-on-light);
}

.light-section .grid-row {
  border-bottom-color: var(--grid-on-light);
}

/* ---- Three-tier grid system ----
   .grid-outer  → horizontal inset only, no visual styling
   .grid-frame  → vertical hairlines (border-left / border-right)
   .grid-row    → horizontal hairlines (border-bottom), the content row
*/
.grid-outer {
  padding-left: var(--gutter-desktop);
  padding-right: var(--gutter-desktop);
}

.grid-frame {
  border-left: 1px solid var(--grid);
  border-right: 1px solid var(--grid);
}

.grid-row {
  border-bottom: 1px solid var(--grid);
}

@media (max-width: 768px) {
  .grid-outer {
    padding-left: var(--gutter-mobile);
    padding-right: var(--gutter-mobile);
  }
}

/* ---- Buttons / CTAs ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
}

.btn-primary {
  background: var(--accent);
  color: var(--ink);
}

.btn-white {
  background: #FFFFFF;
  color: var(--bg);
}

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--header-bg); /* full black */
  font-size: 14px;
  font-weight: 500;
}

.icon-arrow {
  display: inline-flex;
  align-items: center;
}

.icon-arrow svg {
  width: 14px;
  height: 14px;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  color: var(--ink);
  border-bottom: 1px solid var(--grid); /* full-bleed edge-to-edge, sits outside grid-outer's padding */
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, backdrop-filter 0.2s ease;
}

.site-header.scrolled {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
}

/* When the header is sitting over a light section, flip to a white bar
   with dark text/icons instead of black-on-black */
.site-header.on-light {
  background: var(--canvas);
  color: var(--bg);
  border-bottom-color: var(--grid-on-light);
}

.site-header.on-light.scrolled {
  background: rgba(251, 250, 247, 0.85);
}

.site-header.on-light .btn-white {
  background: var(--header-bg);
  color: #FFFFFF;
}

.header-inner {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.site-header .logo {
  display: flex;
  align-items: center;
  color: inherit; /* logo mark uses currentColor — flips with the header's on-light state automatically */
}

.site-header .logo-mark {
  height: 22px;
  width: auto;
  display: block;
}

.site-header nav {
  display: flex;
  gap: 32px;
  font-size: 13px;
  font-weight: 500;
  flex: 1;
  justify-content: flex-start;
  margin-left: 48px;
}

.site-header nav a {
  position: relative;
  padding-bottom: 4px;
}

.site-header nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.site-header nav a:hover::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-dropdown {
  position: relative;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid currentColor;
  opacity: 0.85;
  border-radius: var(--radius-pill);
  color: currentColor;
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.lang-toggle .globe-icon {
  width: 15px;
  height: 15px;
}

.lang-toggle .chevron-icon {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}

.lang-toggle[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

/* Dropdown panel: fixed light-card style regardless of header state,
   since a floating menu reads better as its own surface than trying to
   inherit the header's light/dark flip */
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: #FFFFFF;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 60;
}

.lang-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: block;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--bg);
}

.lang-option:hover {
  background: rgba(0, 0, 0, 0.05);
}

.lang-option.active {
  font-weight: 600;
  color: var(--header-bg);
}

.header-actions .btn {
  padding: 10px 22px;
  font-size: 14px;
}

/* ---- Burger menu (mobile only) ---- */
.menu-toggle {
  display: none;
  width: 20px;
  height: 12px;
  position: relative;
  z-index: 150; /* stays above the full-screen nav overlay (z-index 100) so the X is visible */
  background: transparent;
  border: none;
  color: inherit; /* buttons don't reliably inherit color via cascade — force it */
  cursor: pointer;
  padding: 0;
}

.menu-toggle .menu-line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.25s ease, top 0.25s ease, opacity 0.2s ease;
}

.menu-toggle .menu-line:nth-child(1) { top: 0; }
.menu-toggle .menu-line:nth-child(2) { top: 10px; }

/* Transform into a tight X when nav is open */
.menu-toggle[aria-expanded="true"] .menu-line:nth-child(1) {
  top: 5px;
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-line:nth-child(2) {
  top: 5px;
  transform: rotate(-45deg);
}

@media (max-width: 768px) {
  .menu-toggle { display: block; }

  .header-actions .btn-white { display: none; }

  .site-header nav {
    position: fixed;
    inset: 0;
    top: 0;
    margin-left: 0;
    background: var(--bg);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 36px;
    font-size: 24px;
    display: none;
    z-index: 100;
  }

  .site-header nav.nav-open {
    display: flex;
  }

  /* Scroll lock while nav is open — set on both html and body for cross-browser reliability */
  html.nav-open,
  body.nav-open {
    overflow: hidden;
    height: 100%;
  }
}

/* ---- Legal pages (Privacy, Terms) ----
   No grid lines here on purpose — a plain centered column, not the
   hairline-frame pattern used elsewhere on the site. */
.legal-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 100px 24px 120px;
  text-align: left;
}

/* ---- Contact page ---- */
.contact-page {
  max-width: 520px;
  margin: 0 auto;
  padding: 100px 24px 140px;
}

.contact-page h1 {
  font-size: clamp(32px, 4vw, 44px);
}

.contact-intro {
  margin-top: 12px;
  color: rgba(29, 29, 31, 0.6);
  font-size: 16px;
}

.contact-form {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(29, 29, 31, 0.8);
}

.form-field input,
.form-field textarea {
  border: 1px solid rgba(29, 29, 31, 0.15);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--bg);
  background: #FFFFFF;
  transition: border-color 0.15s ease;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-field textarea {
  resize: vertical;
  min-height: 100px;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: rgba(29, 29, 31, 0.7);
  cursor: pointer;
}

.checkbox-field input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  flex: none;
  accent-color: var(--accent);
  cursor: pointer;
}

.checkbox-field a {
  color: var(--bg);
  text-decoration: underline;
}

.contact-submit {
  align-self: flex-start;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}

.contact-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .contact-page {
    padding: 70px var(--gutter-mobile) 90px;
  }
}

.legal-content {
  margin-top: 0;
}

.legal-content .updated {
  color: rgba(29, 29, 31, 0.5);
  font-size: 13px;
  margin-top: 12px;
}

.legal-content .pending-notice {
  margin-top: 24px;
  padding: 16px 20px;
  border: 1px solid rgba(29, 29, 31, 0.2);
  border-radius: var(--radius-card);
  background: rgba(0, 0, 0, 0.03);
  font-size: 14px;
  color: rgba(29, 29, 31, 0.75);
}

.legal-content .pending-notice strong {
  color: var(--header-bg);
}

.legal-content h2 {
  font-size: 20px;
  margin-top: 40px;
}

.legal-content p,
.legal-content li {
  margin-top: 14px;
  color: rgba(29, 29, 31, 0.7);
  line-height: 1.6;
}

.legal-content ul {
  margin-top: 14px;
  padding-left: 20px;
}

.legal-content li {
  margin-top: 8px;
}

.legal-content a {
  color: var(--header-bg);
  text-decoration: underline;
}

@media (max-width: 768px) {
  .legal-page {
    padding: 60px var(--gutter-mobile) 80px;
  }
}

/* ---- 404 page ---- */
.not-found-content {
  padding: 140px 40px;
  text-align: center;
}

.not-found-content h1 {
  font-size: clamp(48px, 8vw, 96px);
}

.not-found-content p {
  margin-top: 16px;
  color: rgba(29, 29, 31, 0.6);
}

.not-found-content .btn {
  margin-top: 32px;
}

/* ---- Footer ---- */
.site-footer {
  background: var(--header-bg);
  color: var(--ink);
  padding-bottom: 40px;
}

.footer-top {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  padding-top: 64px;
}

.footer-logo-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-icon-mark {
  width: auto;
  display: block;
  /* height is set dynamically via JS to match .footer-logo-mark's actual
     rendered height — CSS alone can't sync one element's height to a
     responsive sibling's computed height */
}

.site-footer .wordmark {
  line-height: 0;
}

.site-footer .footer-logo-mark {
  width: clamp(220px, 30vw, 480px);
  height: auto;
  display: block;
}

.site-footer .tagline {
  font-size: 14px;
  color: var(--ink-muted);
  margin-top: 8px;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--grid);
  font-size: 13px;
  color: var(--ink-muted);
  gap: 24px;
  flex-wrap: wrap;
}

.footer-legal {
  display: flex;
  gap: 20px;
}

.footer-legal a {
  color: var(--ink-muted);
}

.footer-socials {
  display: flex;
  gap: 16px;
}

.footer-socials a {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.footer-socials svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 768px) {
  .site-footer .footer-logo-mark {
    width: clamp(160px, 55vw, 280px);
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-socials {
    order: -1; /* social icons above the legal row */
  }
}
