/* Lavirent — one stylesheet for every page. */

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-light.woff2") format("woff2");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  /* Brand colours. To recolour the site, change --accent and --accent-soft here
     and the PALETTE block at the top of galaxy.js. */
  --accent: #8B5CF6;
  --accent-soft: #C4B5FD;
  --accent-ring: rgba(139, 92, 246, 0.4);

  --ink: #EDEDE8;
  --body: #CFCFC9;
  --dim: #A3A39D;
  --notice: #E3D3A1;
  --rule: rgba(237, 237, 232, 0.14);
  --rule-strong: rgba(237, 237, 232, 0.32);

  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --pad: clamp(24px, 5.5vw, 80px);
  --wide: 1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: #000; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: #000;
  color: var(--ink);
  font: 400 16px/1.65 var(--mono);
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; }
::selection { background: var(--accent); color: #000; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.15s;
}
a:hover { color: var(--accent-soft); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
  border-radius: 1px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.wrap { max-width: var(--wide); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }


/* ============ home: galaxy background ============ */
/* soft nebula layer + pixel-sharp star layer, fixed behind the first screen */
#space {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2.5s ease;
}
#space.on { opacity: 1; }
#neb { position: absolute; left: 0; top: 0; will-change: transform; }
#sky { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }


/* ============ home: first screen ============ */
.hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);       /* the column may never grow wider than the screen */
  place-items: center;
  text-align: center;
  overflow: hidden;                            /* the dark halo behind the logo is wider than a phone screen */
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right))
           max(72px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}
.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(26px, 4.2vh, 60px);
  width: 100%;
}
/* a light dark halo so the text stays readable over the galaxy without hiding it */
.hero-inner::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(115%, 1100px);
  height: 150%;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.2) 55%, transparent);
  z-index: -1;
  pointer-events: none;
}
.hero h1 { line-height: 0; }
.logo-wrap {
  position: relative;
  display: block;
  width: min(78vw, max(560px, 34vw), 150vh);
  animation: rise 1.4s cubic-bezier(.2, .7, .2, 1) both;
}
.logo { display: block; width: 100%; height: auto; filter: drop-shadow(0 0 28px rgba(139, 92, 246, 0.18)); }
/* light sweep across the letters, clipped to the logo shape */
.logo-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%);
  background-size: 250% 100%;
  background-position: 150% 0;
  -webkit-mask: url("lavirent-wordmark.webp") center / contain no-repeat;
          mask: url("lavirent-wordmark.webp") center / contain no-repeat;
  mix-blend-mode: soft-light;
  animation: sweep 11s ease-in-out 2.2s infinite;
  pointer-events: none;
}
.soon {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: clamp(12px, 0.9vw, 20px);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--dim);
  padding-left: 0.42em;
  animation: fade 0.8s ease 0.8s both;
}
.soon::before, .soon::after {
  content: "";
  width: clamp(24px, 3vw, 90px);
  height: 1px;
  background: var(--accent);
  opacity: 0.85;
  animation: grow 0.9s cubic-bezier(.2, .7, .2, 1) 1s both;
}
.soon::before { transform-origin: right; }
.soon::after  { transform-origin: left; }
.soon .text { display: inline-block; min-width: 11ch; }

/* the challenge, under the logo */
.hero-ctf {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 100%;
}
.hero-ctf .soon { font-size: clamp(13px, 1vw, 20px); color: var(--ink); }
.hero-ctf-about { color: var(--body); font-size: 15px; line-height: 1.5; animation: fade 0.8s ease 1.1s both; }
.hero-ctf-line {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  animation: fade 0.8s ease 1.2s both;
}
.hero-ctf:not(.is-live) .hero-ctf-line { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--ink); }   /* without JavaScript: a plain sentence */
.hero-ctf-count { animation: fade 0.8s ease 1.2s both; }
.hero-ctf-count:empty { display: none; }
.hero-ctf .count { justify-content: center; margin-top: 0; gap: 10px clamp(18px, 3.2vw, 44px); }
.hero-ctf .count-cell { align-items: center; }
.hero-ctf .count-n { font-size: clamp(34px, 4.6vw, 58px); }
.hero-ctf .count-l { margin-top: 8px; font-size: 11px; }
.hero-ctf-when { font-size: 13px; line-height: 1.5; color: var(--dim); max-width: 48ch; animation: fade 0.8s ease 1.2s both; }
.hero-ctf-go { margin-top: 10px; animation: fade 0.8s ease 1.3s both; }

/* the sign-up form on the first screen: smaller and quieter than the challenge above it */
.hero .signup { margin-top: clamp(0px, 2.4vh, 30px); animation: fade 0.9s ease 1.6s both; }
.hero-more {
  position: absolute;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  font-size: 13px;
  color: var(--dim);
  white-space: nowrap;
  animation: fade 0.9s ease 2.2s both;
}
@media (max-height: 600px) { .hero-more { display: none; } }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes sweep {
  0%   { background-position: 150% 0; }
  45%  { background-position: -50% 0; }
  100% { background-position: -50% 0; }
}


/* ============ buttons (home page and challenge pages) ============ */
.btn {
  display: inline-block;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: #000;
  font: 500 14px/1.2 var(--mono);
  padding: 14px 20px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: #000; }
.btn:disabled { background: var(--dim); border-color: var(--dim); cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn.ghost:hover { background: transparent; border-color: var(--accent-soft); color: var(--accent-soft); }
.btn.ghost:disabled { color: var(--dim); border-color: var(--rule); }

/* ============ countdown digits (home page and challenge pages) ============ */
.count { display: flex; flex-wrap: wrap; gap: 14px clamp(20px, 4.4vw, 52px); margin-top: 16px; font-variant-numeric: tabular-nums; }
.count-cell { display: flex; flex-direction: column; min-width: 2ch; }
.count-n { font-weight: 300; font-size: clamp(42px, 9.5vw, 88px); line-height: 1; letter-spacing: -0.045em; color: var(--ink); }
.count-l { margin-top: 10px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.count-cell:last-child .count-n { color: var(--accent-soft); }          /* the seconds: the part that moves */


/* ============ sign-up form ============ */
.signup { width: min(100%, 470px); text-align: left; }
.signup-row {
  display: flex;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.62);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.signup-row:focus-within { border-color: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-ring); }
.signup-row input {
  flex: 1 1 0;
  width: 0;                                    /* take whatever room the button leaves, never push the row wider */
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 400 16px/1.2 var(--mono);            /* 16px keeps iPhones from zooming in on focus */
  padding: 15px 16px;
  outline: none;
  -webkit-appearance: none;
          appearance: none;
}
.signup-row input::placeholder { color: #7C7C77; opacity: 1; }
.signup-row input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 100px #000 inset;
          box-shadow: 0 0 0 100px #000 inset;
  caret-color: var(--ink);
}
.signup-row button {
  flex: none;
  border: 0;
  border-radius: 0 1px 1px 0;
  background: var(--ink);
  color: #000;
  font: 500 14px/1 var(--mono);
  padding: 0 18px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s;
}
.signup-row button:hover { background: var(--accent-soft); }
.signup-row button:disabled { background: var(--dim); cursor: default; }
.signup-status { font-size: 13px; line-height: 1.5; color: var(--notice); }
.signup-status:not(:empty) { margin-top: 10px; }
.signup-note { margin-top: 12px; font-size: 12.5px; line-height: 1.55; color: var(--dim); }
.signup-small { width: min(100%, 390px); }
.signup-small .signup-row input { padding: 11px 13px; }                 /* the text stays 16px: phones zoom in on anything smaller */
.signup-small .signup-row button {
  background: transparent;
  color: var(--ink);
  border-left: 1px solid var(--rule-strong);
  font-size: 13px;
  padding: 0 15px;
}
.signup-small .signup-row button:hover { background: transparent; color: var(--accent-soft); }
.signup-small .signup-row button:disabled { background: transparent; color: var(--dim); }
.signup-small .signup-note { font-size: 12px; }
.hero .signup-note { text-align: center; }
.hero .signup-status { text-align: center; }


/* ============ home: top bar (appears after the first screen) ============ */
.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) var(--pad) 10px;
  background: rgba(0, 0, 0, 0.9);
  border-bottom: 1px solid var(--rule);
  transform: translateY(-101%);
  visibility: hidden;
  transition: transform 0.28s ease, visibility 0s linear 0.28s;
}
.bar.on { transform: none; visibility: visible; transition: transform 0.28s ease, visibility 0s; }
.bar-mark { display: block; line-height: 0; }
.bar-mark img { display: block; height: 34px; width: auto; }
.bar-links { display: flex; align-items: center; gap: clamp(14px, 3vw, 26px); }
.bar-link { font: 500 13px/1 var(--mono); color: var(--dim); text-decoration: none; white-space: nowrap; }
.bar-link:hover { color: var(--accent-soft); }
.bar-join {
  font: 500 13px/1 var(--mono);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 10px 14px;
}
.bar-join:hover { border-color: var(--accent-soft); }


/* ============ home: sections below the first screen ============ */
/* The rest of the page is see-through, so the galaxy stays faintly visible behind it while scrolling.
   --veil is how dark that layer is: 1 hides the galaxy completely, 0 shows it at full strength. */
.page { --veil: 0.72; position: relative; z-index: 1; background: rgba(0, 0, 0, var(--veil)); overflow-x: clip; }
/* the first screen fades into that layer instead of ending on a hard edge */
.page::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 22vh;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, var(--veil)));
  pointer-events: none;
}
.block { padding-top: clamp(72px, 13vh, 150px); padding-bottom: clamp(72px, 13vh, 150px); }
.block + .block { border-top: 1px solid var(--rule); }
.block h2 {
  font-weight: 300;
  font-size: clamp(26px, 3.3vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.prose { color: var(--body); max-width: 58ch; }
.prose p + p { margin-top: 1.1em; }

/* the label */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(36px, 6vh, 72px) clamp(32px, 6vw, 96px);
}
.about .statement {
  grid-column: 1 / -1;
  /* Monospace: every character is 0.6em wide, so 18 characters always fit one line.
     The size grows with the screen but never so far that 18 characters stop fitting. */
  font-size: min(72px, 5.6vw + 8px, (100vw - 2 * var(--pad)) / 10.9);
  line-height: 1.08;
  letter-spacing: -0.04em;
  max-width: 18ch;
}
.about .prose { grid-column: 2; }

/* Drop 0x1: a swing tag, the kind tied to a garment */
.drop-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 7vw, 110px);
  align-items: center;
}
.drop-text h2 { margin-bottom: 0.7em; }
.tag-holder { position: relative; padding-top: 34px; justify-self: center; width: min(100%, 400px); }
/* the string the tag hangs from */
.tag-holder::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -70px;
  width: 1px;
  height: 128px;
  background: linear-gradient(to bottom, transparent, var(--rule-strong) 45%);
  transform: rotate(7deg);
  transform-origin: 50% 100%;
}
.tag {
  position: relative;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  background: #000;
  padding: 58px 26px 22px;
  transform: rotate(-2deg);
  transform-origin: 50% 24px;
}
.tag-hole {
  position: absolute;
  left: 50%;
  top: 17px;
  width: 15px;
  height: 15px;
  margin-left: -7.5px;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
}
.tag-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 18px; }
.tag-head img { display: block; height: 46px; width: auto; }
.tag-head p { font-weight: 300; font-size: 26px; line-height: 1; letter-spacing: -0.03em; }
.tag dl > div {
  display: grid;
  grid-template-columns: 9ch minmax(0, 1fr);
  column-gap: 2ch;
  padding: 11px 0;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  line-height: 1.5;
}
.tag dt { color: var(--dim); }

/* questions */
.questions h2 { margin-bottom: 1.3em; }
.qa { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px clamp(32px, 6vw, 96px); }
.qa h3 { font-weight: 500; font-size: 16px; line-height: 1.45; margin-bottom: 0.5em; }
.qa p { color: var(--body); max-width: 52ch; }

/* join: a smaller section, the challenge is the main thing now */
.block.join { padding-top: clamp(56px, 9vh, 104px); padding-bottom: clamp(56px, 9vh, 104px); }
.join h2 { font-size: clamp(20px, 2.1vw, 28px); margin-bottom: 0.9em; max-width: 30ch; }

/* footer (every page) */
.foot { border-top: 1px solid var(--rule); padding-top: 34px; padding-bottom: max(34px, env(safe-area-inset-bottom)); }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: 14px; }
.foot small { display: block; margin-top: 22px; font-size: 12.5px; color: var(--dim); }
.foot-mark img { display: block; height: 40px; width: auto; }

@media (max-width: 820px) {
  .about-grid, .drop-grid, .qa { grid-template-columns: minmax(0, 1fr); }
  .about .prose { grid-column: 1; }
  .drop-grid { gap: 84px; }
  .tag-holder { justify-self: start; margin-left: 4px; }
  .qa { gap: 34px; }
}
@media (max-width: 400px) {
  .signup-row input { padding-left: 13px; padding-right: 8px; }
  .signup-row button { padding: 0 13px; }
}


/* ============ text pages: privacy, thanks, confirmed, 404 ============ */
.doc-head { padding-top: max(28px, env(safe-area-inset-top)); padding-bottom: 28px; }
.doc-head a { display: inline-block; line-height: 0; }
.doc-head img { display: block; width: 170px; height: auto; }
.doc { padding-top: clamp(36px, 8vh, 90px); padding-bottom: clamp(72px, 14vh, 150px); min-height: 62vh; }
.doc h1 {
  font-weight: 300;
  font-size: clamp(30px, 4.6vw, 54px);
  line-height: 1.1;
  letter-spacing: -0.035em;
  max-width: 20ch;
  margin-bottom: 0.8em;
}
.doc h2 { font-weight: 500; font-size: 16px; line-height: 1.45; margin-top: 2.6em; margin-bottom: 0.6em; }
.doc p, .doc li { color: var(--body); max-width: 66ch; }
.doc p + p { margin-top: 1em; }
.doc ul { list-style: none; margin-top: 0.8em; }
.doc ul + p, .doc ol + p { margin-top: 1em; }
.doc li { position: relative; padding-left: 2ch; }
.doc li + li { margin-top: 0.5em; }
.doc li::before { content: "\2013"; position: absolute; left: 0; color: var(--dim); }
.doc .lede { color: var(--ink); font-size: 17px; }
.doc .stamp { color: var(--dim); font-size: 13px; margin-top: 3.2em; }
.doc .next { margin-top: 2.2em; display: flex; flex-wrap: wrap; gap: 12px 28px; }
