html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0b0b0b;
  color: #ffffff;
  font-family: system-ui, -apple-system, sans-serif;
  text-rendering: geometricPrecision;
}

/* System */
:root{
  --text-strong: rgba(255,255,255,0.92);
  --text:        rgba(255,255,255,0.74);
  --text-dim:    rgba(255,255,255,0.46);

  --fz-brand: 44px;
  --fz-sub:   16px;
  --fz-body:  18px;
  --fz-fine:  12px;

  --corner-bottom: calc(18px + env(safe-area-inset-bottom));
  --corner-left: calc(18px + env(safe-area-inset-left));
  --magenta: #ff00c8;
}

/* Layout */
.cosmoz {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 48px 20px;
}

/* Hero */
.cosmoz__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.cosmoz__title {
  margin: 0;
  font-size: var(--fz-brand);
  letter-spacing: 0.28em;
  font-weight: 600;
  color: var(--text-strong);
}

.cosmoz__subtitle {
  margin: 0;
  font-size: var(--fz-sub);
  color: var(--text);
}

/* Panel */
.cosmoz__panel {
  width: min(720px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 6px;
  text-align: center;
}

/* Copy */
.cosmoz__copy--center {
  width: min(640px, 92vw);
  margin: 0 auto;
  text-align: center;
}

.cosmoz__note {
  margin: 0;
  font-size: var(--fz-body);
  line-height: 1.7;
}

.cosmoz__note--primary { color: var(--text-strong); }

.cosmoz__note--secondary {
  color: var(--text);
  max-width: 52ch;
  margin: 14px auto 0;
}

/* Release */
.cosmoz__release {
  margin: 14px 0 6px;
  text-align: center;
  font-size: var(--fz-body);
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--text-strong);
}

/* Form (act) */
.cosmoz__form {
  width: min(560px, 92vw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cosmoz__textarea {
  width: 100%;
  min-height: 180px;
  box-sizing: border-box;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--text-strong);
  border-radius: 14px;
  padding: 14px 14px;
  outline: none;
  resize: vertical;
  line-height: 1.5;
}

.cosmoz__textarea::placeholder{
  color: rgba(255,255,255,0.32);
}

.cosmoz__textarea:focus {
  border-color: rgba(255,255,255,0.30);
}

/* Button */
.cosmoz__button {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.06);
  color: var(--text-strong);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.22em;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.10s ease;
}

.cosmoz__button:hover {
  border-color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.10);
}

.cosmoz__button:active { transform: translateY(1px); }

.cosmoz__button--full {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
}

/* Fineprint */
.cosmoz__fineprint {
  margin: 0;
  font-size: var(--fz-fine);
  line-height: 1.55;
  color: var(--text-dim);
  text-align: center;
}

.cosmoz__fineprint--primary { color: var(--text-strong); }

/* Seal coordinate base */
.cosmoz__seal {
  margin: 6px 0 0;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  letter-spacing: 0.06em;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.4;
  user-select: text;
}

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

/* Corner concept link */
.cosmoz__cornerlink{
  position: fixed;
  left: var(--corner-left);
  bottom: var(--corner-bottom);
  z-index: 10;
  font-size: var(--fz-fine);
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s ease;
}

.cosmoz__cornerlink:hover,
.cosmoz__cornerlink:focus-visible{
  color: var(--magenta);
  outline: none;
}

/* =========================
   HOME (scoped)
   ========================= */
.page-home .cosmoz{ gap: 24px; }


.page-home .cosmoz__symbol{
  display: inline-flex;
  margin-top: 28px;
}

.page-home .cosmoz__symbol img{
  width: 160px;
  height: 160px;
  display: block;
  cursor: pointer;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,0.55));
  opacity: 0.95;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.page-home .cosmoz__symbol:hover img{
  transform: translateY(-1px);
  opacity: 1;
}

/* =========================
   SEAL (scoped)
   ========================= */
.page-seal .cosmoz__subtitle{ color: var(--text-dim); }

.page-seal .cosmoz__panel{ gap: 10px; }

.page-seal .cosmoz__note{ margin-bottom: 2px; }

.page-seal .cosmoz__seal--copy{
  appearance: none;
  -webkit-appearance: none;
  width: min(260px, 72vw);
  margin: 2px auto 0;
  color: var(--text-strong);
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  border-radius: 10px;
}

.page-seal .cosmoz__seal--copy:hover{
  border-color: rgba(255,255,255,0.26);
  background: rgba(255,255,255,0.055);
}

.page-seal .cosmoz__seal--copy:active{
  transform: translateY(1px);
}

.page-seal .cosmoz__seal--copied{
  border-color: rgba(255,255,255,0.32);
  background: rgba(255,255,255,0.07);
}

.page-seal .cosmoz__textlink{
  display: inline-block;
  margin-top: 10px;
  font-size: var(--fz-fine);
  letter-spacing: 0.08em;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.page-seal .cosmoz__textlink:hover,
.page-seal .cosmoz__textlink:focus-visible{
  color: var(--magenta);
  outline: none;
}

/* =========================
   Atmospheric overlay (robust: DOM element)
   ========================= */

.page-act,
.page-seal{
  position: relative;
  overflow: hidden;
}

.page-act .cosmoz__form {
  padding-bottom: calc(48px + env(safe-area-inset-bottom));
}

.cosmoz__atmos{
  position: fixed;
  inset: -22%;
  pointer-events: none;
  z-index: 0;

  background:
    radial-gradient(900px 540px at 18% 28%, rgba(255,255,255,0.038), rgba(0,0,0,0) 62%),
    radial-gradient(760px 480px at 82% 62%, rgba(255, 180, 120, 0.020), rgba(0,0,0,0) 64%),
    radial-gradient(560px 420px at 54% 86%, rgba(255, 80, 200, 0.010), rgba(0,0,0,0) 66%);

  filter: blur(10px);
  opacity: 0.92;

  transform: translate3d(-2.2%, -1.2%, 0) scale(1.02);
  will-change: transform;
  animation: atmos-drift 34s linear infinite;
}

.cosmoz__atmos::after{
  content:"";
  position: absolute;
  inset: -12%;
  pointer-events: none;

  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.014) 0px, rgba(255,255,255,0.014) 1px, rgba(0,0,0,0) 2px, rgba(0,0,0,0) 5px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.010) 0px, rgba(255,255,255,0.010) 1px, rgba(0,0,0,0) 2px, rgba(0,0,0,0) 7px);

  opacity: 0.18;
  mix-blend-mode: overlay;

  transform: translate3d(0,0,0);
  will-change: transform;
  animation: atmos-grain 18s linear infinite;
}

.page-act .cosmoz,
.page-seal .cosmoz{
  position: relative;
  z-index: 1;
}

.page-seal .cosmoz__atmos{
  opacity: 0.96;
  filter: blur(9px);
}

@keyframes atmos-drift{
  0%   { transform: translate3d(-2.2%, -1.2%, 0) scale(1.02); }
  50%  { transform: translate3d( 2.2%,  1.4%, 0) scale(1.03); }
  100% { transform: translate3d(-2.2%, -1.2%, 0) scale(1.02); }
}

@keyframes atmos-grain{
  0%   { transform: translate3d(0,0,0); }
  50%  { transform: translate3d(-1.0%, 0.8%, 0); }
  100% { transform: translate3d(0,0,0); }
}

@media (prefers-reduced-motion: reduce){
  .cosmoz__atmos,
  .cosmoz__atmos::after{
    animation: none;
  }
}

.page-home .cosmoz__pixel{
  position: fixed;
  left: var(--corner-left);
  bottom: var(--corner-bottom);
  top: auto;
  right: auto;
  z-index: 999;

  width: 2px;
  height: 2px;
  display: block;

  background: rgba(255, 255, 255, 0.55);
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35);

  text-decoration: none;
}

/* Gör klick-/hover-yta större utan att pixeln ser större ut */
.page-home .cosmoz__pixel::before{
  content:"";
  position: absolute;
  left: -10px;
  top: -10px;
  width: 22px;
  height: 22px;
}

/* Hover/focus triggas nu i den större ytan */
.page-home .cosmoz__pixel:hover,
.page-home .cosmoz__pixel:focus-visible{
  background: var(--magenta);
  outline: none;
}

/* Touch-enheter: ingen hover – pixeln är magenta från start */
@media (hover: none) {
  .page-home .cosmoz__pixel {
    background: var(--magenta);
  }
}
/* =========================
   CONCEPT (scoped)
   ========================= */


.page-concept .cosmoz{
  justify-content: flex-start;
  padding-top: 64px;
  padding-bottom: 64px;
}

/* Textblock */
.page-concept .cosmoz__panel--concept{
  width: min(560px, 92vw);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 18px;

  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.012);
  border-radius: 0;
  padding: 24px 22px;
}

/* Meta */
.page-concept .cosmoz__meta{
  margin: 0 0 16px;
  font-size: var(--fz-fine);
  letter-spacing: 0.10em;
  color: var(--text-dim);
  text-transform: lowercase;
}

/* Body text */
.page-concept .cosmoz__note{
  margin: 0;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
}

.page-concept .cosmoz__panel--concept .cosmoz__note:first-of-type{
  color: var(--text-strong);
}

/* Links */
.page-concept .cosmoz__link{
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.18);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.page-concept .cosmoz__link:hover,
.page-concept .cosmoz__link:focus-visible{
  color: var(--magenta);
  border-color: rgba(255,0,200,0.55);
  outline: none;
}
/* =========================
   OFFER (scoped)
   ========================= */
.page-offer .cosmoz__panel { gap: 18px; }

.cosmoz__amount-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 0;
}

.cosmoz__currency {
  font-size: 28px;
  color: var(--text-dim);
  font-weight: 300;
  line-height: 1;
}

.cosmoz__amount {
  flex: 1;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--text-strong);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 28px;
  font-weight: 300;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}

.cosmoz__amount::-webkit-outer-spin-button,
.cosmoz__amount::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.cosmoz__amount:focus {
  border-color: rgba(255,255,255,0.30);
}

.cosmoz__amount::placeholder {
  color: rgba(255,255,255,0.20);
}

.cosmoz__form--offer {
  width: min(320px, 92vw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cosmoz__textlink--skip {
  display: block;
  margin: 4px auto 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--fz-fine);
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s ease;
  padding: 8px;
}

.cosmoz__textlink--skip:hover,
.cosmoz__textlink--skip:focus-visible {
  color: var(--text);
  outline: none;
}

/* =========================
   PARTIKLAR
   ========================= */
#particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
}

/* =========================
   SIDÖVERGÅNG
   ========================= */
#transition-overlay {
  position: fixed;
  inset: 0;
  background: #0b0b0b;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.42s ease;
}

#transition-overlay.transition-overlay--active {
  opacity: 1;
  pointer-events: all;
}

/* Fade in vid sidladdning */
.page-home body,
body.page-home {
  opacity: 0;
  transition: opacity 0s;
}

body.page-home.page-loaded {
  opacity: 1;
  transition: opacity 0.55s ease;
}

/* =========================
   SYMBOL — kontinuerlig puls
   ========================= */
.page-home .cosmoz__symbol img {
  animation: symbol-pulse 2.8s ease-in-out infinite;
  transform-origin: center center;
}

@keyframes symbol-pulse {
  0%   { transform: scale(1);     opacity: 0.88; }
  50%  { transform: scale(1.030); opacity: 1;    }
  100% { transform: scale(1);     opacity: 0.88; }
}

.page-home .cosmoz__symbol:hover img {
  animation-play-state: paused;
  opacity: 1;
}

/* =========================
   INSTALL-KNAPP
   ========================= */
.cosmoz__install-btn {
  position: fixed;
  right: calc(18px + env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--fz-fine);
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s ease;
  padding: 8px;
}

.cosmoz__install-btn:hover {
  color: var(--magenta);
}

/* =========================
   REDUCED MOTION
   ========================= */
@media (prefers-reduced-motion: reduce) {
  .page-home .cosmoz__symbol img {
    animation: none;
  }
  #transition-overlay {
    transition: none;
  }
}

/* =========================
   SEAL — OFFERING
   ========================= */
.cosmoz__offering {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: min(300px, 92vw);
  margin-left: auto;
  margin-right: auto;
}

.cosmoz__offering-trigger {
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--fz-fine);
  letter-spacing: 0.10em;
  color: var(--text-dim);
  padding: 6px;
  transition: color 0.2s ease;
}
.cosmoz__offering-trigger:hover { color: var(--text); }

.cosmoz__offering-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.45s ease, opacity 0.35s ease 0.08s;
}
.cosmoz__offering-form.is-open {
  max-height: 120px;
  opacity: 1;
}


.cosmoz__amount-input-small {
  box-sizing: border-box;
  width: auto;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--text-strong);
  border-radius: 10px;
  padding: 7px 22px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
  transition: border-color 0.15s;
}
.cosmoz__amount-input-small::-webkit-outer-spin-button,
.cosmoz__amount-input-small::-webkit-inner-spin-button { -webkit-appearance: none; }
.cosmoz__amount-input-small:focus { border-color: rgba(255,255,255,0.26); }
.cosmoz__amount-input-small::placeholder { color: rgba(255,255,255,0.18); }

.cosmoz__offer-submit {
  appearance: none;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--text-strong);
  border-radius: 10px;
  padding: 7px 22px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.cosmoz__offer-submit:hover {
  border-color: rgba(255,255,255,0.30);
  background: rgba(255,255,255,0.09);
}

/* Payment Element wrapper */
#payment-wrapper {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: min(340px, 92vw);
  margin: 0 auto;
}
#payment-wrapper.is-open { display: flex; }
#payment-element { width: 100%; }
#payment-message {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-align: center;
  min-height: 18px;
}
#payment-message.is-error { color: #ff6b6b; }
