/* Decade — joindecade.com */

@font-face {
  font-family: "Hanken Grotesk";
  src: url("/fonts/HankenGrotesk.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/IBMPlexMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --black: #0d0e0f;
  --accent: #1f3b4d;          /* Dark Gray Blue */
  --bone: #ece8e1;
  --bone-dim: #8f8b85;        /* 5.6:1 on --black */
  --line: rgba(236, 232, 225, 0.16);
  --error: #e8a598;

  --sans: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(20px, 4vw, 48px);
}

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--black);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

p, h1, fieldset { margin: 0; padding: 0; }
a { color: inherit; }
svg { display: block; }

:focus-visible { outline: 1px solid var(--bone); outline-offset: 4px; }

.sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- One screen ---------- */

.page {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  padding:
    max(24px, env(safe-area-inset-top)) var(--gutter)
    max(24px, env(safe-area-inset-bottom));
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(90% 55% at 50% 118%, rgba(31, 59, 77, .55), transparent 70%),
    radial-gradient(70% 50% at 50% -10%, #191b1e, transparent 70%),
    var(--black);
}

/* Fine film grain */
.page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .07;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.ghost {
  position: absolute;
  z-index: -1;
  width: max(150vw, 1500px);
  height: auto;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  color: var(--bone);
  opacity: .025;
  pointer-events: none;
}
@media (min-width: 900px) {
  .ghost { width: 120vw; }
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.top__mark { width: 30px; height: auto; color: var(--bone); }

.top__link, .bottom, .towel-note, .pick legend {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--bone-dim);
}
.top__link { text-decoration: none; padding: 8px 0; transition: color .3s ease; }
.top__link:hover { color: var(--bone); }

.center {
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
  padding: 40px 0;
}

.wordmark svg {
  width: min(70vw, 460px);
  height: auto;
  color: var(--bone);
}
.tagline {
  margin-top: clamp(18px, 3vw, 28px);
  font-size: clamp(16px, 1.6vw, 19px);
  letter-spacing: .01em;
}
.towel-note { margin-top: 10px; }

/* ---------- Form ---------- */

.join, .success {
  width: 100%;
  max-width: 400px;
  margin-top: clamp(44px, 8vh, 72px);
}

.inline {
  display: flex;
  border-bottom: 1px solid var(--line);
  transition: border-color .3s ease;
}
.inline:focus-within { border-color: var(--bone); }

input[type="email"], input[type="text"] {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 52px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--bone);
  font: 400 17px/1 var(--sans);   /* 16px+ stops iOS zooming in */
  letter-spacing: .01em;
  -webkit-appearance: none;
  appearance: none;
}
input:focus-visible { outline: none; }
input::placeholder { color: var(--bone-dim); }
input:-webkit-autofill {
  -webkit-text-fill-color: var(--bone);
  -webkit-box-shadow: 0 0 0 100px var(--black) inset;
  caret-color: var(--bone);
}

#step-2 input[type="text"] {
  border-bottom: 1px solid var(--line);
  text-align: center;
  transition: border-color .3s ease;
}
#step-2 input[type="text"]:focus { border-color: var(--bone); }

.btn {
  flex: none;
  height: 52px;
  padding: 0 4px 0 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--bone);
  font: 500 12px/1 var(--mono);
  letter-spacing: .2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity .3s ease;
}
.btn:hover { opacity: .6; }
.btn[disabled] { opacity: .4; cursor: progress; }
.btn--full {
  width: 100%;
  margin-top: 28px;
  padding: 0;
  background: var(--bone);
  color: var(--black);
}
.btn--full:hover { opacity: .85; }

.pick {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  border: 0;
  min-width: 0;
}
.pick legend { width: 100%; margin-bottom: 14px; padding: 0; }
.chip { position: relative; cursor: pointer; }
.chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.chip span {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  font-size: 15px;
  color: var(--bone-dim);
  transition: border-color .25s ease, color .25s ease, background-color .25s ease;
}
.chip:hover span { border-color: rgba(236, 232, 225, .4); color: var(--bone); }
.chip input:checked + span {
  border-color: var(--bone);
  background: var(--bone);
  color: var(--black);
}
.chip input:focus-visible + span { outline: 1px solid var(--bone); outline-offset: 4px; }
.pick[aria-invalid="true"] .chip span { border-color: var(--error); }

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.error {
  margin-top: 16px;
  font-size: 14px;
  color: var(--error);
}
.error:empty { display: none; }

.success {
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.4;
  outline: none;
}

/* ---------- Bottom line ---------- */

.bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 10px;
}
.bottom a { text-decoration: none; transition: color .3s ease; }
.bottom a:hover { color: var(--bone); }
.dot { margin: 0 10px; }

@media (max-width: 600px) {
  .bottom { justify-content: center; text-align: center; }
  .bottom p:last-child { display: grid; gap: 6px; }
  .dot { display: none; }
}

/* ---------- Arrival ---------- */

@media (prefers-reduced-motion: no-preference) {
  .wordmark, .tagline, .towel-note, .join {
    animation: arrive 1.6s cubic-bezier(.2, .7, .2, 1) both;
  }
  .tagline, .towel-note { animation-delay: .35s; }
  .join { animation-delay: .7s; }
  .top, .bottom { animation: fade 1.6s ease 1.1s both; }
  .step:not([hidden]), .success:not([hidden]) { animation: fade .8s ease both; }

  @keyframes arrive {
    from { opacity: 0; transform: translateY(10px); filter: blur(4px); }
    to { opacity: 1; transform: none; filter: none; }
  }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
}
