/* ===========================================================
   Groop — pre-launch landing page
   Palette and type are fixed brand assets. Do not drift.
   =========================================================== */

/* ---------- tokens ---------- */
:root {
  --bg: #0b0b0c;
  --surface: #141416;
  --surface-2: #121214;
  --well: #0c0c0e;
  --text: #ece7de;
  --text-mute: #a39d93;
  --accent: #c45c3e;
  --accent-soft: #f3dcd4;
  --accent-ink: #1a100e;
  --line: rgba(236, 231, 222, 0.14);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --radius-m: 0.6rem;
  --radius-l: 1.25rem;
  --shadow-m: 0 24px 60px rgba(0, 0, 0, 0.45);

  --wrap: 70rem;
  --header-h: 4.25rem;
}

/* ---------- reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 200;
  padding: 0.75rem 1rem;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-m);
}

.skip:focus {
  top: 1rem;
}

/* ---------- layout ---------- */
.wrap {
  width: min(var(--wrap), 100% - clamp(2rem, 6vw, 4rem));
  margin-inline: auto;
}

/* ---------- type ---------- */
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0 0 1rem;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 8vw, 5.6rem);
  font-weight: 400;
}

h2 {
  font-size: clamp(1.8rem, 4.4vw, 3.1rem);
}

h3 {
  font-size: 1.35rem;
}

.lede {
  margin: 0 0 1.75rem;
  max-width: 40rem;
  color: var(--text-mute);
  font-weight: 300;
  font-size: 1.125rem;
  text-wrap: pretty;
}

.lede.narrow {
  max-width: 36rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--text-mute);
}

.pulse {
  width: 0.45rem;
  height: 0.45rem;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(196, 92, 62, 0.6);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 10px rgba(196, 92, 62, 0);
  }
}

.file-name {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--text-mute);
}

/* ---------- lockup: infinity mark + "Groop" ---------- */

/* The mark sits beside the word, never inside it. Everything scales from
   the element's own font-size, so one set of rules covers header, hero and
   footer and only the size class changes. */
.lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
}

.lockup-sm {
  font-size: 1.25rem;
}

/* block-level so it starts its own line under the eyebrow */
.lockup-lg {
  display: flex;
  width: fit-content;
  font-size: clamp(2.2rem, 7vw, 3.75rem);
  margin: 0 0 1.1rem;
}

/* The mark is 2:1, so a cap-height of 0.66em makes it read at about 1em
   overall next to the word. align-items centres it on the line box; the
   nudge lifts it onto the cap-height of "Groop", which sits higher than
   that centre because of the descender on the p. */
.lockup-mark {
  height: 0.66em;
  width: 1.32em;
  flex: none;
  color: var(--accent);
  transform: translateY(-0.05em);
  overflow: visible;
  filter: drop-shadow(0 0 8px rgba(196, 92, 62, 0.35));
}

.lockup-word {
  display: block;
}

/* First paint, header only: the mark settles in once and then holds. */
.site-header .lockup-mark {
  animation: mark-in 700ms cubic-bezier(0.2, 0, 0, 1) both;
}

@keyframes mark-in {
  from {
    opacity: 0;
    transform: translateY(-0.05em) scale(0.86);
    filter: blur(3px) drop-shadow(0 0 8px rgba(196, 92, 62, 0.35));
  }
  to {
    opacity: 1;
    transform: translateY(-0.05em) scale(1);
    filter: blur(0) drop-shadow(0 0 8px rgba(196, 92, 62, 0.35));
  }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.875rem;
  padding: 0.65rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease,
    transform 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
}

.btn-primary:hover {
  background: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--text);
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--header-h);
  background: linear-gradient(
    to bottom,
    rgba(11, 11, 12, 0.92),
    rgba(11, 11, 12, 0.55) 70%,
    transparent
  );
}

.header-inner {
  position: relative;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 1.4rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  text-decoration: none;
  color: var(--text-mute);
  font-size: 0.92rem;
  transition: color 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.nav-toggle {
  display: none;
  min-height: 2.75rem;
  padding: 0.35rem 1rem;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: min(92vh, 54rem);
  display: grid;
  align-items: end;
  padding-block: 3rem clamp(3rem, 8vw, 6rem);
  overflow: hidden;
}

.hero-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.35) contrast(1.05) brightness(0.72);
  transform: scale(1.08);
  animation: ken 48s ease-in-out infinite alternate;
}

@keyframes ken {
  from {
    transform: scale(1.08) translate3d(-1.2%, 0.6%, 0);
  }
  to {
    transform: scale(1.16) translate3d(1.4%, -0.8%, 0);
  }
}

/* Film grain over the hero. Sits above the fog layers but below the copy,
   and never eats a click. */
.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.08;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(2) infinite;
}

@keyframes grain {
  50% {
    transform: translate(-2%, 1%);
  }
}

.fog {
  position: absolute;
  inset: -10%;
  pointer-events: none;
}

.fog-a {
  background:
    radial-gradient(ellipse at 20% 70%, rgba(200, 200, 205, 0.16), transparent 42%),
    radial-gradient(ellipse at 80% 40%, rgba(180, 180, 190, 0.12), transparent 36%),
    linear-gradient(to top, var(--bg) 6%, transparent 55%);
  animation: drift 28s ease-in-out infinite alternate;
}

.fog-b {
  background: linear-gradient(
    to top,
    var(--bg) 12%,
    rgba(11, 11, 12, 0.35) 40%,
    transparent 70%
  );
  /* counter-drifts against fog-a so the bank never looks like one sheet */
  animation: drift 36s ease-in-out infinite alternate-reverse;
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 35%,
    rgba(11, 11, 12, 0.72) 100%
  );
}

@keyframes drift {
  from {
    transform: translateX(-2%) scale(1.05);
  }
  to {
    transform: translateX(3%) scale(1.12);
  }
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* hero fade-up */
.rise {
  animation: rise 800ms cubic-bezier(0.2, 0, 0, 1) both;
  animation-delay: var(--d, 0ms);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- scroll reveal ---------- */

/* Scoped to .js: the hidden state only exists once the script that undoes
   it is running. Without the guard, a failed or blocked main.js would
   leave the Fragment, Signal and Access copy permanently invisible. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  filter: blur(6px);
  transition: opacity 700ms cubic-bezier(0.2, 0, 0, 1),
    transform 700ms cubic-bezier(0.2, 0, 0, 1),
    filter 700ms cubic-bezier(0.2, 0, 0, 1);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
  filter: none;
}

.js .steps li:nth-child(2).reveal {
  transition-delay: 90ms;
}

.js .steps li:nth-child(3).reveal {
  transition-delay: 180ms;
}

/* Choice buttons arrive one after another; JS sets the per-button delay. */
.choice-in {
  animation: rise 420ms cubic-bezier(0.2, 0, 0, 1) both;
}

/* ---------- shared section rhythm ---------- */
.fragment,
.signal,
.access {
  padding-block: clamp(4rem, 10vw, 8rem);
}

.fragment {
  background: linear-gradient(to bottom, var(--bg), #101012 40%, var(--bg));
}

/* ---------- fragment / staged prototype ---------- */
.stage {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  margin-top: 2.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-m);
}

.stage-art {
  position: relative;
  min-height: 22rem;
}

.stage-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.25) brightness(0.78);
  transition: filter 700ms ease, transform 1.1s ease;
}

/* Compiling lifts the hall out of the murk. */
.stage.is-clear .stage-art img {
  filter: grayscale(0.08) brightness(0.92);
  transform: scale(1.03);
}

.stage-fog {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(16, 16, 18, 0.55), rgba(160, 160, 168, 0.28)),
    radial-gradient(circle at 50% 60%, rgba(200, 200, 210, 0.28), transparent 55%);
  transition: opacity 700ms ease, filter 700ms ease;
}

.stage.is-clear .stage-fog {
  opacity: 0.18;
  filter: blur(8px);
}

.stage-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem 1.4rem 1.6rem;
  background: var(--surface-2);
}

.premise-form label,
.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-mute);
}

textarea,
input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 0.75rem 0.85rem;
  background: var(--well);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  color: var(--text);
  resize: vertical;
}

textarea::placeholder {
  color: #6f6a63;
}

textarea:focus,
input:focus {
  border-color: rgba(196, 92, 62, 0.7);
  outline: none;
}

.premise-form .btn {
  margin-top: 0.85rem;
}

.play-line {
  margin: 0.35rem 0 0.8rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.35;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.choice {
  min-height: 2.75rem;
  padding: 0.45rem 1rem;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease;
}

.choice:hover,
.choice[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent-soft);
}

.play-out {
  margin: 0 0 0.8rem;
  color: var(--text-mute);
}

.whisper {
  margin: 1rem 0 0;
  color: var(--text-mute);
  font-size: 0.9rem;
}

/* ---------- signal ---------- */
.steps {
  list-style: none;
  margin: 3rem 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.steps li {
  padding: 1.4rem 1.2rem 1.5rem;
  border-top: 1px solid var(--line);
}

.num {
  display: block;
  margin-bottom: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

.steps p {
  margin: 0;
  color: var(--text-mute);
}

.creed {
  margin: 0;
  padding: 2rem 0 0;
  max-width: 38rem;
  border-top: 1px solid var(--line);
}

.creed p {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.3;
}

.creed footer {
  color: var(--text-mute);
  font-size: 0.95rem;
}

/* ---------- access ---------- */
.access {
  background:
    radial-gradient(ellipse at 80% 0%, rgba(196, 92, 62, 0.08), transparent 42%),
    var(--bg);
}

.access-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.access-form,
.access-success {
  grid-column: 2;
  grid-row: 1;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: rgba(20, 20, 22, 0.75);
}

.field {
  margin-bottom: 1rem;
}

.opt {
  color: var(--text-mute);
  font-weight: 300;
}

.error {
  margin: 0.35rem 0 0;
  color: #e8a090;
  font-size: 0.85rem;
}

.form-error {
  margin: 1rem 0 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(232, 160, 144, 0.4);
  border-radius: var(--radius-m);
  background: rgba(196, 92, 62, 0.08);
  color: #e8a090;
  font-size: 0.9rem;
}

.form-error a {
  color: var(--accent-soft);
}

.btn[aria-busy="true"] {
  opacity: 0.6;
  pointer-events: none;
}

.access-success h3 {
  margin-top: 0.75rem;
  font-size: 2rem;
}

.access-success p:last-child {
  margin-bottom: 0;
  color: var(--text-mute);
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: auto;
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--text-mute);
}

.footer-inner {
  display: grid;
  gap: 0.4rem;
}

.footer-inner p {
  margin: 0;
}

.fine {
  font-size: 0.8rem;
}

/* ---------- socials ---------- */

/* Underline the word, not the bottom of the 44px hit box. */
.site-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
}

/* Icon-only links, footer only. The 44px box is the hit area; the mark
   inside stays 20px, and colour is the only thing that changes on hover.
   Each <svg> also carries width/height attributes, so the marks stay small
   even if this stylesheet is stale in a cache or fails to load. */
.socials {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  justify-self: start;
  /* pulls the icon edge, not its padding, into line with the copy above */
  margin-left: -0.7rem;
}

.socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.7rem;
  color: var(--text);
  text-decoration: none;
  transition: color 160ms ease;
}

.socials a:hover,
.socials a:focus-visible {
  color: var(--accent);
}

.socials svg {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
}

/* ---------- community: maker space ---------- */

/* A lower, slower version of the homepage hero. Same fog, less shout. */
.hero-quiet {
  min-height: min(66vh, 38rem);
}

.hero-quiet .hero-visual img {
  filter: grayscale(0.55) contrast(1.02) brightness(0.55);
}

.hero-quiet h1 {
  font-size: clamp(2.1rem, 6vw, 4.2rem);
}

.room,
.who,
.arrive {
  padding-block: clamp(3.5rem, 9vw, 7rem);
}

.room {
  background: linear-gradient(to bottom, var(--bg), #101012 40%, var(--bg));
}

.room-grid {
  list-style: none;
  margin: 3rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.room-grid li {
  padding: 1.4rem 1.2rem 1.5rem;
  border-top: 1px solid var(--line);
}

.room-grid .num {
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.room-grid h3 {
  margin-bottom: 0.6rem;
}

.room-grid p {
  margin: 0;
  color: var(--text-mute);
}

.who-list {
  list-style: none;
  margin: 2.25rem 0 0;
  padding: 0;
  max-width: 42rem;
}

.who-list li {
  position: relative;
  padding: 0.85rem 0 0.85rem 1.6rem;
  border-top: 1px solid var(--line);
  color: var(--text-mute);
}

.who-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.45rem;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--accent);
}

.arrive {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(196, 92, 62, 0.08), transparent 44%),
    var(--bg);
}

.arrive-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    right: 0;
    left: 0;
    z-index: 50;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.5rem;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
  }

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

  .site-nav a {
    padding: 0.55rem 0.75rem;
  }

  .stage,
  .steps,
  .room-grid,
  .access-grid {
    grid-template-columns: 1fr;
  }

  .access-form,
  .access-success {
    grid-column: 1;
    grid-row: 2;
  }

  .stage-art {
    min-height: 16rem;
  }

  .steps {
    margin: 2.25rem 0;
  }
}

@media (max-width: 420px) {
  .hero-actions .btn {
    width: 100%;
  }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .btn:hover {
    transform: none;
  }

  /* The rules above stop motion, but these are static styles that would
     otherwise leave content hidden or mid-animation. */
  .js .reveal,
  .js .reveal.is-in {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .rise,
  .choice-in {
    opacity: 1;
    transform: none;
  }

  .hero-visual img {
    transform: scale(1.08);
  }

  .hero-visual::after {
    transform: none;
  }
}
