/* ============================================================
   SOREL TECHNO — Home (index.html)
   3D scene, panels, sections, member one-pager overlay.
   Depends on: tokens.css, base.css
   ============================================================ */

html, body { height: 100%; overflow: hidden; }

/* ---------- 3D scene ---------- */
.scene { position: fixed; inset: 0; perspective: 1200px; perspective-origin: 50% 45%; }
.world {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform var(--dur-cam) var(--ease-cam);
}

.panel {
  position: absolute; top: 50%; left: 50%;
  width: var(--panel-w); height: var(--panel-h);
  transform-style: preserve-3d;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--panel-pad);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  backface-visibility: hidden;
  box-shadow: var(--shadow-card);
}
.panel::before {
  content: "";
  position: absolute; top: 0;
  left: var(--panel-pad); right: var(--panel-pad);
  height: 3px; border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--river), var(--melt));
}

/* home hero: no card — text sits on the page background */
.panel--bare { background: none; border: none; box-shadow: none; width: min(94vw, 1400px); }
.panel--bare::before { display: none; }

/* ---------- headings ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}

/* hero title: the two currents flow INSIDE the glyphs (SVG clip).
   The glyph bed + thin edge keep the letters legible at all times,
   whatever the flux position or theme. */
.hero-lettres { width: min(56vw, 820px); height: auto; overflow: visible; }
.hero-lettres .glyphes {
  font-family: var(--font-display);
  font-weight: 900;
  font-variation-settings: 'wdth' 120;
  font-size: 150px;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.hero-lettres .glyphe-bed { fill: var(--glyph-bed); stroke: var(--glyph-edge); stroke-width: 1.5; }
.hero-lettres .flux { fill: none; stroke-linecap: round; }
/* dashes flow along the paths; every dash cycle sums to 400 = the loop
   offset (seamless wrap) and the paths start/end far off the glyph zone,
   so dash tips are born and die outside the hero */
.hero-lettres .f1 { stroke: var(--river); stroke-width: 96; opacity: .9; stroke-dasharray: 260 140; animation: flux-couler 12s linear infinite; }
.hero-lettres .f2 { stroke: var(--melt); stroke-width: 80; opacity: .85; stroke-dasharray: 220 180; animation: flux-couler 16s linear infinite reverse; }
.hero-lettres .f3 { stroke: var(--ribbon-river); stroke-width: 40; opacity: .7; stroke-dasharray: 250 150; animation: flux-couler 9s linear infinite; }
@keyframes flux-couler { to { stroke-dashoffset: -400; } }

h2 {
  font-size: clamp(1.7rem, 3.6vw, 3.1rem);
  font-weight: 800;
  font-variation-settings: 'wdth' 112;
  letter-spacing: -.02em;
  text-transform: uppercase;
  line-height: 1.02;
  margin-bottom: 24px;
}


/* ---------- hud ---------- */
.hud {
  position: fixed; bottom: 22px; left: var(--gutter); right: var(--gutter);
  z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--ink-60);
  letter-spacing: .12em;
}
.hud .dots { display: flex; gap: 9px; }
.hud .dots i {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1px solid var(--hairline);
  transition: all .4s;
}
.hud .dots i.on { background: var(--river); border-color: var(--river); }

/* ---------- mission modules ---------- */
.mods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px; }
.mod {
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 26px 22px;
  background: var(--paper);
  transition: border-color .35s, transform .35s var(--ease);
}
.mod:hover { border-color: var(--river); transform: translateY(-4px); }
.mod .k { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .2em; color: var(--river); }
.mod h3 {
  font-size: 1.05rem; font-weight: 800;
  font-variation-settings: 'wdth' 110;
  margin: 12px 0 9px;
  text-transform: uppercase;
}
.mod p { color: var(--ink-60); font-size: .88rem; line-height: 1.6; }

/* ---------- events ---------- */
.evl { border-top: 1px solid var(--hairline); }
.ev {
  display: grid; grid-template-columns: 130px 1fr auto; gap: 20px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--hairline);
  transition: padding-left .35s var(--ease);
}
.ev:hover { padding-left: 12px; }
.ev .d { font-family: var(--font-mono); font-size: .68rem; color: var(--melt); letter-spacing: .08em; }
.ev .t { font-size: 1.15rem; font-weight: 700; }
.ev .k {
  font-family: var(--font-mono); font-size: .62rem; color: var(--ink-60);
  letter-spacing: .14em; text-transform: uppercase;
  background: var(--mist); border-radius: 999px; padding: 6px 14px;
}

/* ---------- team tiles ---------- */
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 6px; }
.tile {
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 24px 20px;
  background: var(--paper);
  position: relative; overflow: hidden;
  cursor: pointer;
  transition: border-color .35s;
}
.tile::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  height: 3px; width: 0;
  background: linear-gradient(90deg, var(--river), var(--melt));
  transition: width .5s var(--ease);
}
.tile:hover::after, .tile:focus-visible::after { width: 100%; }
.tile:focus-visible { outline: 2px solid var(--river); outline-offset: 2px; }
.tile .r { font-family: var(--font-mono); font-size: .58rem; letter-spacing: .16em; text-transform: uppercase; color: var(--river); }
.tile h3 { font-size: 1.05rem; font-weight: 800; font-variation-settings: 'wdth' 110; margin: 11px 0 8px; }
.tile p { color: var(--ink-60); font-size: .82rem; line-height: 1.55; }
.tile .more { font-family: var(--font-mono); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; color: var(--melt); display: inline-block; margin-top: 12px; }

.members-link {
  display: inline-block; margin-top: 22px;
  text-decoration: none;
  font-family: var(--font-mono); font-size: .7rem;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--river);
  border-bottom: 1px solid var(--river); padding-bottom: 4px;
  transition: color var(--dur-ui), border-color var(--dur-ui);
}
.members-link:hover, .members-link:focus-visible { color: var(--melt); border-color: var(--melt); outline: none; }

/* ---------- join ---------- */
.cta {
  display: inline-flex; align-items: center; gap: 12px;
  margin-top: 30px;
  background: var(--river); color: var(--paper);
  border: none; border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 800; font-size: .95rem;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 18px 30px;
  cursor: pointer;
  transition: background var(--dur-ui), transform var(--dur-ui) var(--ease), box-shadow var(--dur-ui);
}
.cta:hover { background: var(--melt); transform: translateY(-3px); box-shadow: 0 14px 34px -14px rgba(212, 85, 26, .5); }

.partner { margin-top: 26px; font-family: var(--font-mono); font-size: .7rem; color: var(--ink-60); letter-spacing: .1em; line-height: 2; }
.partner b { color: var(--ink); }

/* member one-pager overlay: see member-page.css */

/* ---------- reduced motion / mobile ---------- */
@media (prefers-reduced-motion: reduce) {
  .world { transition: none; }
  .hint { animation: none; }
  /* static composition, still fully readable */
  .hero-lettres .flux { animation: none; }
}

/* ---------- mobile: full-screen slides, swipe navigation ---------- */
@media (max-width: 900px) {
  /* slides keep the one-screen-at-a-time experience of the desktop site:
     the world is a horizontal strip, each panel is one viewport, and
     main.js translates the strip on swipe */
  .scene { position: fixed; inset: 0; perspective: none; }
  .world {
    position: absolute; inset: 0;
    display: flex;
    transform-style: flat;
    transition: transform .55s var(--ease);
  }
  .panel {
    position: relative; top: auto; left: auto;
    flex: 0 0 100vw;
    width: 100vw; height: 100%;
    transform: none !important;
    margin: 0; border-radius: 0; border: none; box-shadow: none;
    background: none;
    padding: 110px 7vw 90px;
    justify-content: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .panel::before { left: 7vw; right: 7vw; top: 96px; }
  .panel--bare { width: 100vw; padding-top: 22vh; }
  .panel--bare::before { display: none; }

  /* header floats above the slides (overrides base.css static mobile header) */
  header.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 25; }

  .mods, .grid4 { grid-template-columns: 1fr; }
  .rivers { position: fixed; }

  /* side navigation: vertical dots on the right edge, like the desktop hud */
  .hud { left: auto; right: 10px; bottom: 50%; transform: translateY(50%); width: auto; }
  .hud .dots { flex-direction: column; gap: 12px; }
  .hud .dots i { width: 7px; height: 7px; }
  .hud .dots i.on { height: 22px; border-radius: 999px; }

  /* swipe incentive: animated chevrons, hidden after the first swipe */
  .swipe-hint {
    position: fixed; bottom: 26px; left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-mono); font-size: .64rem;
    letter-spacing: .22em; text-transform: uppercase;
    color: var(--river);
    white-space: nowrap;
    pointer-events: none;
    transition: opacity .5s;
  }
  .swipe-hint::before, .swipe-hint::after {
    content: "⟶";
    color: var(--melt);
    animation: swipe-nudge 1.6s ease-in-out infinite;
  }
  .swipe-hint::before { content: "⟵"; animation-name: swipe-nudge-l; }
  .swipe-hint.off { opacity: 0; }
  @keyframes swipe-nudge { 0%, 100% { transform: translateX(0); opacity: .4; } 50% { transform: translateX(6px); opacity: 1; } }
  @keyframes swipe-nudge-l { 0%, 100% { transform: translateX(0); opacity: .4; } 50% { transform: translateX(-6px); opacity: 1; } }

  /* event rows stack instead of the 3-column grid */
  .ev { grid-template-columns: 1fr; gap: 6px; padding: 16px 0; }
  .ev .k { justify-self: start; }

}
/* desktop: the swipe hint doesn't exist */
@media (min-width: 901px) {
  .swipe-hint { display: none; }
}
