*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --white: #ffffff;
  --ink: #111111;
  --ink-muted: #666666;
  --line: #d9d9d9;
  --error: #b42318;
  --font: "Pliant", system-ui, sans-serif;
  --pad-x: clamp(1.25rem, 4vw, 2.5rem);
  --pad-y: clamp(1.25rem, 3vw, 2rem);
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh;
  padding: var(--pad-y) var(--pad-x);
}

.page__backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--white);
}

.page__header,
.page__main,
.page__footer {
  position: relative;
  z-index: 1;
}

/* Header */

.page__brand {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Hero */

.page__main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 6vh, 3rem) 0;
}

.hero {
  width: 100%;
  max-width: 80rem;
  text-align: center;
}

.hero__headline {
  margin: 0 auto clamp(2rem, 5vw, 2.75rem);
  max-width: 100%;
  font-size: clamp(2.25rem, 7.5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

/* Unified pill form — always one bar, button inside */

.notify {
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
}

.notify__form {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
}

.notify__form.is-hidden {
  display: none;
}

.notify__input,
.notify__button {
  min-height: 2.75rem;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.9375rem;
}

.notify__input {
  flex: 1;
  min-width: 0;
  padding: 0 1rem;
  color: var(--ink);
  background: transparent;
  border: none;
  outline: none;
}

.notify__input::placeholder {
  color: #999;
}

.notify__input.is-error {
  color: var(--error);
}

.notify__button {
  flex-shrink: 0;
  padding: 0 1.25rem;
  font-weight: 600;
  color: var(--white);
  background: var(--ink);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.notify__button:hover:not(:disabled) {
  opacity: 0.85;
}

.notify__button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.notify__button-loading {
  display: none;
}

.notify__button.is-loading .notify__button-label {
  display: none;
}

.notify__button.is-loading .notify__button-loading {
  display: inline;
}

.notify__message {
  min-height: 1.25rem;
  margin: 0.625rem 0 0;
  font-size: 0.8125rem;
  color: var(--error);
  text-align: center;
}

.notify__done[hidden] {
  display: none;
}

.notify__done-text {
  margin: 0;
  padding: 0.875rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* Footer */

.page__footer {
  display: flex;
  justify-content: flex-end;
}

.page__legal {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

/* Background image mode */

body.has-background {
  color: var(--white);
}

body.has-background .page__backdrop {
  background:
    url("mini-pc.png") center / cover no-repeat;
}

body.has-background .page__brand,
body.has-background .hero__headline {
  color: var(--white);
}

body.has-background .page__legal {
  color: rgba(255, 255, 255, 0.7);
}

body.has-background .notify__form {
  background: rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
}

body.has-background .notify__input {
  color: var(--white);
}

body.has-background .notify__input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

body.has-background .notify__button {
  color: var(--ink);
  background: var(--white);
}

body.has-background .notify__done-text {
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--white);
}

body.has-background .notify__message {
  color: #ffb4b4;
}

@media (max-width: 767px) {
  .page {
    padding:
      max(var(--pad-y), env(safe-area-inset-top))
      max(var(--pad-x), env(safe-area-inset-right))
      max(var(--pad-y), env(safe-area-inset-bottom))
      max(var(--pad-x), env(safe-area-inset-left));
  }

  .page__main {
    align-items: flex-start;
    padding-top: clamp(0.5rem, 4vh, 1.5rem);
    padding-bottom: 1.5rem;
  }

  .hero {
    max-width: 100%;
  }

  .hero__headline {
    font-size: clamp(1.625rem, 6.5vw, 2.5rem);
    line-height: 1.15;
    padding-inline: 0.25rem;
  }

  .notify {
    max-width: 100%;
  }

  body.has-background .page__backdrop {
    background-position: 50% 72%;
  }
}

@media (min-width: 768px) {
  .notify {
    max-width: 28rem;
  }

  .hero__headline {
    font-size: 4.25rem;
  }

  .notify__button {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .hero__headline {
    font-size: 5rem;
  }
}

@media (max-width: 380px) {
  .hero__headline {
    font-size: clamp(1.5rem, 7vw, 1.875rem);
  }

  .notify__input {
    font-size: 0.875rem;
    padding: 0 0.75rem;
  }

  .notify__button {
    font-size: 0.8125rem;
    padding: 0 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
