/*
 * Every color is defined once with light-dark(), which follows color-scheme.
 * By default that is the system setting; the theme toggle sets data-theme on
 * <html>, which pins color-scheme to one side.
 */
:root {
  color-scheme: light dark;

  --bg: light-dark(#f5f2ec, #0c0d10);
  --surface: light-dark(#ffffff, #15171c);
  --field: light-dark(#faf8f4, #0e1014);
  --text: light-dark(#17181c, #f2f0eb);
  --muted: light-dark(#5b5f69, #a2a6b0);
  --line: light-dark(rgb(23 24 28 / 0.12), rgb(255 255 255 / 0.11));
  --line-strong: light-dark(rgb(23 24 28 / 0.34), rgb(255 255 255 / 0.28));
  --accent: light-dark(#c93512, #ff6a45);
  --on-accent: light-dark(#ffffff, #1a0b06);
  --accent-soft: light-dark(rgb(201 53 18 / 0.09), rgb(255 106 69 / 0.13));
  --accent-ring: light-dark(rgb(201 53 18 / 0.28), rgb(255 106 69 / 0.36));
  --glow-a: light-dark(rgb(232 96 44 / 0.2), rgb(255 106 69 / 0.2));
  --glow-b: light-dark(rgb(238 178 72 / 0.24), rgb(110 92 255 / 0.17));
  --dot: light-dark(rgb(23 24 28 / 0.17), rgb(255 255 255 / 0.13));
  --shadow: light-dark(rgb(72 48 24 / 0.24), rgb(0 0 0 / 0.65));
  --danger: light-dark(#b3261e, #ff8a80);
  --ok: light-dark(#1d7a46, #5fd695);
  --ok-soft: light-dark(rgb(29 122 70 / 0.12), rgb(95 214 149 / 0.14));

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Display", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

/* Browsers from before 2024 lack light-dark(); they get the light theme. */
@supports not (color: light-dark(#000, #fff)) {
  :root {
    --bg: #f5f2ec;
    --surface: #ffffff;
    --field: #faf8f4;
    --text: #17181c;
    --muted: #5b5f69;
    --line: rgb(23 24 28 / 0.12);
    --line-strong: rgb(23 24 28 / 0.34);
    --accent: #c93512;
    --on-accent: #ffffff;
    --accent-soft: rgb(201 53 18 / 0.09);
    --accent-ring: rgb(201 53 18 / 0.28);
    --glow-a: rgb(232 96 44 / 0.2);
    --glow-b: rgb(238 178 72 / 0.24);
    --dot: rgb(23 24 28 / 0.17);
    --shadow: rgb(72 48 24 / 0.24);
    --danger: #b3261e;
    --ok: #1d7a46;
    --ok-soft: rgb(29 122 70 / 0.12);
  }

  .theme-toggle {
    display: none;
  }
}

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

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Backdrop: two soft glows and a dot grid that fades out ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(58rem 38rem at 8% -12%, var(--glow-a), transparent 62%),
    radial-gradient(48rem 34rem at 104% 108%, var(--glow-b), transparent 62%);
}

.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.5px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 28% 32%, #000 15%, transparent 75%);
  mask-image: radial-gradient(ellipse 75% 65% at 28% 32%, #000 15%, transparent 75%);
}

/* ---------- Page frame ---------- */

.topbar,
.layout,
.footer {
  /* Narrow gutters on phones leave the 300px the captcha needs inside the card. */
  width: min(72rem, 100% - clamp(1.5rem, 6vw, 4rem));
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  color: inherit;
  font-weight: 650;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand svg {
  flex: none;
  color: var(--accent);
}

.brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-toggle {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  transition:
    border-color 0.15s,
    transform 0.15s;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  transform: rotate(15deg);
}

/* The button shows where a click leads: the sun in the dark, the moon in the light. */
.icon-sun {
  display: none;
}

:root[data-theme="dark"] .icon-sun {
  display: block;
}

:root[data-theme="dark"] .icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun {
    display: block;
  }

  :root:not([data-theme="light"]) .icon-moon {
    display: none;
  }
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding-block: clamp(1rem, 5vh, 4rem);
}

@media (min-width: 60rem) {
  .layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 27rem);
  }
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-block: 1.25rem 1.5rem;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.hero {
  container-type: inline-size;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.25rem;
  padding: 0.35rem 0.85rem 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.pulse {
  position: relative;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

.pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: currentColor;
  animation: ping 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/*
 * The domain is sized to fill the hero column on one line. This rule is the
 * first guess: column width divided by the number of characters (--chars, set
 * by the Worker) times the width of an average bold glyph. app.js then measures
 * the real text and corrects the size. The TLD never breaks; a name too long
 * for the smallest size wraps before the TLD, or inside the name as a last resort.
 */
.domain {
  margin: 0;
  font-size: clamp(1.9rem, calc(100cqi / (var(--chars, 12) * 0.62)), 6.75rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.domain-name {
  overflow-wrap: anywhere;
}

.tld {
  color: var(--accent);
  white-space: nowrap;
}

.lede {
  max-width: 34rem;
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.25rem);
  line-height: 1.5;
}

.price {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.85rem;
  margin: 1.75rem 0 0;
  padding: 0.75rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}

.price-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.price-value {
  font-size: 1.4rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.points {
  display: grid;
  gap: 0.6rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.97rem;
}

.points li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.points svg {
  flex: none;
  margin-top: 0.28em;
  color: var(--accent);
}

/* ---------- Inquiry card ---------- */

.card {
  padding: clamp(1rem, 4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: var(--surface);
  box-shadow: 0 30px 70px -32px var(--shadow);
}

.card h2 {
  margin: 0 0 0.3rem;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.card-sub {
  margin: 0 0 1.3rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.card-sub:last-child {
  margin-bottom: 0;
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.field label {
  font-size: 0.86rem;
  font-weight: 650;
}

.optional {
  color: var(--muted);
  font-weight: 400;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.75rem;
  background: var(--field);
  color: inherit;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

textarea {
  min-height: 6.5rem;
  resize: vertical;
}

::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

input:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.83rem;
}

/* Holds the height of the Turnstile widget so the button does not jump when it loads. */
.captcha {
  min-height: 65px;
  margin: 1.1rem 0 1rem;
}

.submit {
  width: 100%;
  padding: 0.9rem 1.2rem;
  border: 0;
  border-radius: 0.85rem;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    filter 0.15s,
    transform 0.15s;
}

.submit:hover {
  filter: brightness(1.08);
}

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

.submit:disabled {
  opacity: 0.6;
  cursor: progress;
}

.submit:focus-visible,
.theme-toggle:focus-visible,
.brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.form-status {
  margin: 0.75rem 0 0;
  color: var(--danger);
  font-size: 0.9rem;
}

.form-status:empty {
  display: none;
}

.success {
  padding: 1.5rem 0.5rem;
  text-align: center;
  outline: none;
}

.success-icon {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
}

.success-icon svg {
  width: 1.6rem;
  height: 1.6rem;
}

.success p {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

/* ---------- Motion ---------- */

@keyframes ping {
  to {
    transform: scale(2.8);
    opacity: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.hero > *,
.card {
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero > :nth-child(2) {
  animation-delay: 0.06s;
}

.hero > :nth-child(3) {
  animation-delay: 0.12s;
}

.hero > :nth-child(4) {
  animation-delay: 0.18s;
}

.hero > :nth-child(5) {
  animation-delay: 0.24s;
}

.card {
  animation-delay: 0.16s;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
