/* ----- Theme tokens ---------------------------------------------------- */
:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --bg-elevated: rgba(16, 22, 31, 0.84);
  --surface: rgba(13, 19, 29, 0.88);
  --surface-2: rgba(18, 27, 39, 0.92);
  --fg: #e7edf4;
  --muted: #9aabbb;
  --heading: #f4f8fc;
  --accent: #7bd4ff;
  --accent-2: #92ffd7;
  --accent-soft: rgba(123, 212, 255, 0.14);
  --border: rgba(127, 161, 196, 0.22);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  --chip-bg: rgba(123, 212, 255, 0.08);
  --button-bg: rgba(255, 255, 255, 0.03);
  --button-bg-strong: linear-gradient(135deg, rgba(123, 212, 255, 0.22), rgba(146, 255, 215, 0.16));
  --button-hover: rgba(255, 255, 255, 0.08);
  --hero-outline: rgba(123, 212, 255, 0.4);
  --selection: rgba(123, 212, 255, 0.28);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #eef2f7;
    --bg-elevated: rgba(255, 255, 255, 0.84);
    --surface: rgba(255, 255, 255, 0.92);
    --surface-2: rgba(248, 250, 253, 0.96);
    --fg: #15212e;
    --muted: #57697b;
    --heading: #0f1722;
    --accent: #005ecb;
    --accent-2: #008a73;
    --accent-soft: rgba(0, 94, 203, 0.1);
    --border: rgba(20, 41, 63, 0.12);
    --shadow: 0 18px 44px rgba(18, 32, 48, 0.08);
    --chip-bg: rgba(0, 94, 203, 0.06);
    --button-bg: rgba(255, 255, 255, 0.6);
    --button-bg-strong: linear-gradient(135deg, rgba(0, 94, 203, 0.14), rgba(0, 138, 115, 0.12));
    --button-hover: rgba(0, 0, 0, 0.04);
    --hero-outline: rgba(0, 94, 203, 0.28);
    --selection: rgba(0, 94, 203, 0.18);
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0f14;
  --bg-elevated: rgba(16, 22, 31, 0.84);
  --surface: rgba(13, 19, 29, 0.88);
  --surface-2: rgba(18, 27, 39, 0.92);
  --fg: #e7edf4;
  --muted: #9aabbb;
  --heading: #f4f8fc;
  --accent: #7bd4ff;
  --accent-2: #92ffd7;
  --accent-soft: rgba(123, 212, 255, 0.14);
  --border: rgba(127, 161, 196, 0.22);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  --chip-bg: rgba(123, 212, 255, 0.08);
  --button-bg: rgba(255, 255, 255, 0.03);
  --button-bg-strong: linear-gradient(135deg, rgba(123, 212, 255, 0.22), rgba(146, 255, 215, 0.16));
  --button-hover: rgba(255, 255, 255, 0.08);
  --hero-outline: rgba(123, 212, 255, 0.4);
  --selection: rgba(123, 212, 255, 0.28);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f7;
  --bg-elevated: rgba(255, 255, 255, 0.84);
  --surface: rgba(255, 255, 255, 0.92);
  --surface-2: rgba(248, 250, 253, 0.96);
  --fg: #15212e;
  --muted: #57697b;
  --heading: #0f1722;
  --accent: #005ecb;
  --accent-2: #008a73;
  --accent-soft: rgba(0, 94, 203, 0.1);
  --border: rgba(20, 41, 63, 0.12);
  --shadow: 0 18px 44px rgba(18, 32, 48, 0.08);
  --chip-bg: rgba(0, 94, 203, 0.06);
  --button-bg: rgba(255, 255, 255, 0.6);
  --button-bg-strong: linear-gradient(135deg, rgba(0, 94, 203, 0.14), rgba(0, 138, 115, 0.12));
  --button-hover: rgba(0, 0, 0, 0.04);
  --hero-outline: rgba(0, 94, 203, 0.28);
  --selection: rgba(0, 94, 203, 0.18);
}

/* ----- Base ----------------------------------------------------------- */
* { box-sizing: border-box; }

html {
  background:
    radial-gradient(circle at top, rgba(123, 212, 255, 0.1), transparent 28%),
    radial-gradient(circle at 80% 10%, rgba(146, 255, 215, 0.08), transparent 24%),
    var(--bg);
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--fg);
  font: 16px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
        Ubuntu, "Helvetica Neue", Arial, "Apple Color Emoji",
        "Segoe UI Emoji", "Segoe UI Symbol";
  background: transparent;
}

::selection { background: var(--selection); }

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

button, input, textarea, select { font: inherit; }

.page-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

/* ----- Hero ----------------------------------------------------------- */
.hero-card {
  position: relative;
  overflow: clip;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 32%),
    linear-gradient(135deg, rgba(123, 212, 255, 0.06), transparent 44%),
    var(--bg-elevated);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 16%, rgba(123, 212, 255, 0.08), transparent 18%),
    radial-gradient(circle at 88% 8%, rgba(146, 255, 215, 0.06), transparent 16%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr);
  align-items: stretch;
}

.hero-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
  padding: 6px 4px 2px;
}

.utility-row {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.appearance-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.control-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.appearance {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
}

.appearance-btn {
  border: 0;
  padding: 8px 12px;
  min-height: 38px;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.appearance-btn:hover,
.appearance-btn:focus-visible {
  color: var(--fg);
  background: var(--button-hover);
  outline: none;
}

.appearance-btn[aria-pressed="true"] {
  color: var(--heading);
  background: var(--button-bg-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

h1 {
  margin: 0;
  font-size: clamp(2.25rem, 4vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--heading);
}

.lead {
  margin: 12px 0 0;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  color: var(--fg);
}

.sublead {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  color: var(--muted);
}

.text-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  padding: 0;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
}

.text-action:hover,
.text-action:focus-visible {
  text-decoration: underline;
  outline: none;
}

.email-slot {
  min-height: 1.5em;
  color: var(--fg);
  font-weight: 600;
}

.is-hidden {
  display: none !important;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--fg);
  font-size: 0.84rem;
  white-space: nowrap;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--button-bg);
  color: var(--fg);
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.button:hover,
.button:focus-visible {
  text-decoration: none;
  background: var(--button-hover);
  transform: translateY(-1px);
  outline: none;
}

.button-primary {
  background: var(--button-bg-strong);
  color: var(--heading);
}

/* ----- Hero art ------------------------------------------------------- */
.hero-art {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.field-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 35%),
    var(--surface);
}

.field-grid {
  --hero-shift-x: 0px;
  --hero-shift-y: 0px;
  --hero-rotate: 0deg;
  --hero-glow-x: 50%;
  --hero-glow-y: 50%;
  position: relative;
  display: grid;
  width: 100%;
  min-height: 360px;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 0;
  border-radius: 18px;
  overflow: clip;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 100%),
    linear-gradient(135deg, rgba(123, 212, 255, 0.1), rgba(146, 255, 215, 0.07));
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.field-grid::before,
.field-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.field-grid::before {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 25% 100%, 100% 33.333%;
  opacity: 0.68;
}

.field-grid::after {
  background:
    radial-gradient(circle at var(--hero-glow-x) var(--hero-glow-y), rgba(123, 212, 255, 0.16), transparent 22%),
    radial-gradient(circle at 50% 50%, rgba(123, 212, 255, 0.1), transparent 46%);
  opacity: 0.88;
  transition: background-position 180ms ease, opacity 220ms ease;
}

.field-cell {
  position: relative;
  z-index: 3;
}

.ambient-cluster {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  transform: translate3d(var(--hero-shift-x), var(--hero-shift-y), 0) rotate(var(--hero-rotate));
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ambient-drift {
  position: absolute;
  inset: 0;
  animation: hero-drift 11s ease-in-out infinite;
}

.ambient {
  position: absolute;
  pointer-events: none;
  transition: opacity 220ms ease, filter 220ms ease;
}

.ambient-ring {
  left: 50%;
  top: 50%;
  width: 188px;
  height: 188px;
  border-radius: 28px;
  border: 1px solid var(--hero-outline);
  transform: translate(-50%, -50%) rotate(26deg);
  opacity: 0.62;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 0 68px rgba(123, 212, 255, 0.1);
}

.ambient-core {
  left: 50%;
  top: 50%;
  width: 92px;
  height: 92px;
  border-radius: 22px;
  transform: translate(-50%, -50%) rotate(16deg);
  background:
    radial-gradient(circle at 35% 35%, rgba(123, 212, 255, 0.34), transparent 68%),
    linear-gradient(135deg, rgba(123, 212, 255, 0.18), rgba(146, 255, 215, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.07);
  opacity: 0.86;
}

.ambient-line {
  left: 50%;
  top: 50%;
  width: 236px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hero-outline), transparent);
  transform: translate(-50%, -50%);
  opacity: 0.56;
}

.ambient-line-b {
  width: 1px;
  height: 236px;
  background: linear-gradient(180deg, transparent, var(--hero-outline), transparent);
}

.field-grid:hover .ambient-ring,
.field-grid:focus-within .ambient-ring {
  opacity: 0.72;
}

.field-grid:hover .ambient-core,
.field-grid:focus-within .ambient-core {
  opacity: 0.94;
}

.field-grid:hover .ambient-line,
.field-grid:focus-within .ambient-line {
  opacity: 0.68;
}

@keyframes hero-drift {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  25% {
    transform: translate3d(8px, -6px, 0) rotate(1.2deg);
  }
  50% {
    transform: translate3d(-4px, 8px, 0) rotate(-1deg);
  }
  75% {
    transform: translate3d(-7px, -5px, 0) rotate(0.8deg);
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
}

/* ----- Sections ------------------------------------------------------- */
.section {
  margin-top: 22px;
}

.section-heading {
  margin-bottom: 10px;
}

h2 {
  margin: 0;
  color: var(--heading);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.card p:first-child,
.card ul:first-child {
  margin-top: 0;
}

.card p:last-child,
.card ul:last-child {
  margin-bottom: 0;
}

ul {
  margin: 12px 0 0 18px;
  padding: 0;
}

li + li {
  margin-top: 8px;
}

.stack-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stack-grid h3 {
  margin: 0 0 8px;
  color: var(--heading);
  font-size: 1rem;
}

.stack-grid p {
  margin: 0;
}

/* ----- Footer --------------------------------------------------------- */
.footer {
  margin-top: 26px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer p {
  margin: 0;
}

.footer-note {
  margin-top: 6px !important;
}

/* ----- States --------------------------------------------------------- */
.text-action.copied {
  color: var(--accent-2);
}

/* ----- Responsive ----------------------------------------------------- */
@media (max-width: 920px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .appearance-wrap {
    margin-left: 0;
  }

  .field-grid {
    min-height: 250px;
  }
}

@media (max-width: 680px) {
  .utility-row {
    margin-bottom: 14px;
  }

  .appearance-wrap {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .control-label {
    font-size: 0.78rem;
  }

  .page-shell {
    padding: 16px 14px 44px;
  }

  .hero-card,
  .card {
    border-radius: 18px;
  }

  .hero-card {
    padding: 14px;
  }

  .appearance {
    width: 100%;
    justify-content: space-between;
  }

  .appearance-btn {
    flex: 1 1 0;
    justify-content: center;
  }

  .chips,
  .cta-row {
    gap: 8px;
  }

  .chip,
  .button {
    width: 100%;
    justify-content: center;
  }

  .stack-grid {
    grid-template-columns: 1fr;
  }

  .field-grid {
    min-height: 210px;
  }
}

/* ----- Reduced motion ------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html, body, * {
    scroll-behavior: auto !important;
  }

  .ambient,
  .button,
  .appearance-btn {
    transition: none !important;
  }

  .field-grid:has(.field-cell:hover) .ambient {
    transform: translate(-50%, -50%) rotate(26deg);
  }
}

/* ----- Print ---------------------------------------------------------- */
@media print {
  :root,
  html[data-theme="dark"],
  html[data-theme="light"] {
    color-scheme: light;
    --bg: #ffffff;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --surface-2: #ffffff;
    --fg: #000000;
    --muted: #444444;
    --heading: #000000;
    --accent: #000000;
    --accent-2: #000000;
    --accent-soft: transparent;
    --border: #cfcfcf;
    --shadow: none;
    --chip-bg: #f2f2f2;
    --button-bg: #ffffff;
    --button-bg-strong: #ffffff;
    --button-hover: #ffffff;
    --hero-outline: #bbbbbb;
  }

  body {
    background: #ffffff !important;
  }

  .hero-card,
  .card,
  .field-card {
    box-shadow: none !important;
    backdrop-filter: none !important;
    background: #ffffff !important;
  }

  .appearance,
  .hero-art,
  #reveal-email,
  #copy-email {
    display: none !important;
  }

  a {
    color: #000000 !important;
    text-decoration: underline;
  }
}
