/* Kloope — pre-launch site styles. Palette and type follow the Kloope brand kit (light direction). */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/fonts/plus-jakarta-sans-latin-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --white: #ffffff;
  --ink: #131917;
  --ink-soft: #2a3330;
  --muted: #5f7068;
  --surface: #f4f8f6;
  --line: #e4ebe7;
  --line-strong: #cfd9d4;
  --mint: #b6f8a9;
  --emerald: #45e5a3;
  --teal: #04b6bd;
  --deep-teal: #007c83;
  --action: #286247;
  --danger: #b42318;
  --gradient: linear-gradient(115deg, #b6f8a9 0%, #45e5a3 45%, #04b6bd 100%);
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(20px, 4vw, 56px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --focus: 0 0 0 2px var(--white), 0 0 0 4px var(--deep-teal);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
p, h1, h2, h3 { margin: 0; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--deep-teal); outline-offset: 3px; border-radius: 4px; }

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

.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 10;
  padding: 10px 16px; border-radius: 999px;
  background: var(--ink); color: var(--white);
  font-size: 14px; font-weight: 600; text-decoration: none;
}
.skip-link:focus-visible { top: 12px; }
main:focus { outline: none; }
.sheet [data-view] > .cta { margin-top: 24px; }

/* ---------- Layout ---------- */

.page {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.bar {
  width: min(100% - 2 * var(--gutter), 1280px);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: clamp(22px, 3.4vh, 32px);
}

.brand { display: inline-flex; border-radius: 6px; }
.brand img { width: 128px; height: auto; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--muted);
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--emerald);
}

/* ---------- Hero ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(40px, 7vh, 88px) var(--gutter) clamp(56px, 9vh, 104px);
}

.mark {
  position: relative;
  width: clamp(128px, 13vw, 184px);
  aspect-ratio: 386 / 175;
  margin-bottom: clamp(36px, 6vh, 60px);
  isolation: isolate;
}
.mark img { width: 100%; height: 100%; }

/* Slow, seamless colour drift inside the approved artwork. The overlay is clipped
   to the symbol's own alpha channel and blended in "color" mode, so the ribbon's
   shape and fold shading (luminance) stay exactly as drawn. The overlay uses the
   brand gradient in the artwork's own direction (mint left, teal right) and only
   glides gently back and forth, so the symbol never reads differently. */
.mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #b6f8a9 0%, #45e5a3 45%, #04b6bd 100%) 0% 50% / 160% 100% no-repeat;
  -webkit-mask: url("/assets/img/kloope-symbol-384.webp") center / 100% 100% no-repeat;
  mask: url("/assets/img/kloope-symbol-384.webp") center / 100% 100% no-repeat;
  mix-blend-mode: color;
  opacity: 0.55;
  animation: ribbon-drift 10s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes ribbon-drift {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

.headline {
  font-size: clamp(2rem, 0.95rem + 3.75vw, 4.25rem);
  font-weight: 620;
  line-height: 1.06;
  letter-spacing: -0.034em;
  word-spacing: 0.05em;
}
.headline span { display: block; text-wrap: balance; }
.headline .tone { color: var(--muted); }

.lede {
  margin-top: clamp(20px, 3.2vh, 30px);
  font-size: clamp(1.0625rem, 0.96rem + 0.42vw, 1.3125rem);
  font-weight: 450;
  line-height: 1.5;
  letter-spacing: -0.003em;
  word-spacing: 0.03em;
  color: var(--muted);
  text-wrap: balance;
}

.action {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(32px, 5.2vh, 48px);
}

.aside {
  margin-top: 18px;
  font-size: 13.5px;
  letter-spacing: 0.005em;
  color: var(--muted);
}

/* ---------- Buttons ---------- */

.cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgb(19 25 23 / 0.10), 0 10px 24px -14px rgb(19 25 23 / 0.45);
  transition: background-color 0.2s ease, transform 0.2s var(--ease-out), box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.cta svg { width: 16px; height: 16px; flex: none; transition: transform 0.25s var(--ease-out); }
.cta:hover { background: var(--ink-soft); box-shadow: 0 1px 2px rgb(19 25 23 / 0.10), 0 14px 28px -14px rgb(19 25 23 / 0.5); }
.cta:hover svg { transform: translateX(3px); }
.cta:active { transform: scale(0.98); }
.cta:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 999px; }
.cta[aria-busy="true"] { cursor: progress; }
.cta[aria-busy="true"] svg { opacity: 0.5; }
.cta-block { width: 100%; }

/* ---------- Confirmation ---------- */

.confirmation {
  margin-top: clamp(32px, 5.2vh, 48px);
  padding: 22px 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  animation: rise 0.6s var(--ease-out) both;
}
.confirmation:focus-visible { outline-offset: 4px; border-radius: 18px; }
.confirmation h2 { font-size: 19px; font-weight: 650; letter-spacing: -0.02em; }
.confirmation p { margin-top: 4px; font-size: 15px; color: var(--muted); }

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  flex-wrap: wrap;
  padding-block: 22px clamp(22px, 3.2vh, 30px);
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  margin: 0; padding: 0;
  list-style: none;
}
.site-footer a {
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.15s ease;
}
.site-footer a:hover { color: var(--ink); }
.site-footer [hidden] { display: none; }

/* ---------- Entrance motion ---------- */

.reveal { animation: rise 0.9s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms + 60ms); }
.mark.reveal { animation-name: settle; animation-duration: 1.2s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
}
@keyframes settle {
  from { opacity: 0; transform: scale(0.96); }
}

/* ---------- Registration dialog (preview mode and fallback) ---------- */

.sheet {
  width: min(100% - 32px, 440px);
  max-height: calc(100% - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 2px rgb(19 25 23 / 0.06), 0 30px 70px -30px rgb(19 25 23 / 0.35);
  opacity: 1;
  transform: none;
  transition: opacity 0.22s ease, transform 0.3s var(--ease-out), overlay 0.22s allow-discrete, display 0.22s allow-discrete;
}
.sheet:not([open]) { opacity: 0; transform: translateY(8px) scale(0.98); }
@starting-style {
  .sheet[open] { opacity: 0; transform: translateY(8px) scale(0.98); }
}
.sheet::backdrop {
  background: rgb(19 25 23 / 0.28);
  transition: background-color 0.22s ease, overlay 0.22s allow-discrete, display 0.22s allow-discrete;
}
.sheet:not([open])::backdrop { background: rgb(19 25 23 / 0); }
@starting-style {
  .sheet[open]::backdrop { background: rgb(19 25 23 / 0); }
}

.sheet-inner { position: relative; padding: 32px; }

.close {
  position: absolute;
  top: 14px; right: 14px;
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.close:hover { background: var(--surface); color: var(--ink); }
.close:focus-visible { outline-offset: 0; border-radius: 50%; }
.close svg { width: 18px; height: 18px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--action);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet h2 {
  padding-right: 32px;
  font-size: 24px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.sheet-text { margin-top: 10px; font-size: 15px; line-height: 1.55; color: var(--muted); }
.sheet-note { margin-top: 16px; font-size: 13.5px; color: var(--muted); text-align: center; }
.sheet-note a, .consent a { color: var(--ink); text-underline-offset: 2px; }

.field { margin-top: 24px; }
.field label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; }

.input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--white);
  font-size: 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder { color: #8a9891; }
.input:hover { border-color: #b4c2bb; }
.input:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgb(0 124 131 / 0.22); border-radius: 12px; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 3px rgb(180 35 24 / 0.16); }

.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 18px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
  cursor: pointer;
}
.consent input {
  width: 18px; height: 18px;
  margin: 1px 0 0;
  accent-color: var(--ink);
  cursor: pointer;
}

.field-error { margin-top: 8px; font-size: 13.5px; font-weight: 500; color: var(--danger); }
.consent + .field-error { margin-top: 6px; padding-left: 30px; }

.sheet form .cta { margin-top: 24px; }

.form-status:not(:empty) {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
}

/* ---------- Document pages (privacy, 404) ---------- */

.doc {
  width: min(100% - 2 * var(--gutter), 680px);
  margin-inline: auto;
  padding-block: clamp(40px, 8vh, 96px) clamp(56px, 10vh, 120px);
}
.doc h1 { font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.25rem); font-weight: 650; letter-spacing: -0.04em; line-height: 1.08; }
.doc h2 { margin-top: 44px; font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.doc p, .doc li { font-size: 16px; line-height: 1.7; color: #3c4844; }
.doc p { margin-top: 14px; }
.doc ul { margin: 14px 0 0; padding-left: 20px; }
.doc li + li { margin-top: 6px; }
.doc a { color: var(--ink); text-underline-offset: 3px; }
.doc .meta { margin-top: 16px; font-size: 14px; color: var(--muted); }
.doc .notice {
  margin-top: 28px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-size: 14px;
  color: var(--ink);
}
.todo {
  padding: 1px 6px;
  border-radius: 6px;
  background: #fff4d6;
  color: #6b4e00;
  font-weight: 600;
}

.center-page { display: grid; place-items: center; text-align: center; padding: 64px var(--gutter); }
.center-page p { margin-top: 14px; color: var(--muted); font-size: 17px; }
.center-page .cta { margin-top: 32px; }

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .brand img { width: 120px; }
  .status { font-size: 12.5px; }
  .hero { padding-top: 32px; padding-bottom: 56px; }
  .action { width: 100%; }
  .action .cta { width: min(100%, 340px); }
  .site-footer { flex-direction: column-reverse; align-items: center; text-align: center; gap: 14px; }
  .site-footer ul { justify-content: center; gap: 8px 22px; }
  .sheet-inner { padding: 28px 22px 24px; }
}

@media (max-height: 640px) and (min-width: 641px) {
  .hero { padding-block: 28px 40px; }
  .mark { margin-bottom: 28px; width: 120px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .mark::after { display: none; }
}

@media (forced-colors: active) {
  .mark::after { display: none; }
  .cta { border: 1px solid ButtonText; }
}
