:root {
  --content-max: 76rem;
  --radius: 1rem;
  --surface-quiet: color-mix(in srgb, var(--surface) 88%, transparent);
}

html[data-public-page] body {
  background:
    radial-gradient(circle at 50% -12rem, rgb(32 126 95 / 0.17), transparent 38rem),
    var(--canvas);
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 50% -12rem, rgb(34 104 80 / 0.1), transparent 38rem),
    var(--canvas);
}

[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 20;
  inset-block-start: 0.7rem;
  inset-inline-start: 0.7rem;
  padding: 0.55rem 0.8rem;
  border-radius: 0.5rem;
  background: var(--gold-bright);
  color: #10271f;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-180%);
}

.skip-link:focus { transform: translateY(0); }

.public-shell { overflow: clip; }

.public-topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  max-inline-size: 88rem;
  margin-inline: auto;
  padding: max(0.8rem, env(safe-area-inset-top)) clamp(1rem, 3vw, 2rem) 0.55rem;
}

.brand-link { position: relative; z-index: 2; }

.primary-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-inline-size: 0;
}

.primary-nav a {
  display: inline-flex;
  align-items: center;
  min-block-size: 3rem;
  padding-inline: 0.62rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
  white-space: nowrap;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  background: rgb(199 164 90 / 0.12);
  color: var(--text);
}

.primary-nav a:hover { transform: translateY(-1px); }

.public-topbar .controls { flex-wrap: nowrap; }
.public-topbar .control-button { min-inline-size: 3rem; }

.public-hero {
  min-block-size: auto;
  padding-block: clamp(1.45rem, 4vw, 3.2rem) clamp(2.8rem, 7vw, 5.5rem);
}

.public-hero .hero-cover img {
  opacity: 0.18;
  filter: saturate(0.86);
}

html[data-theme="light"] .public-hero .hero-cover img { opacity: 0.075; }

.public-hero .hero-content { inline-size: min(100%, 52rem); }

.public-hero h1 {
  max-inline-size: 24ch;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.public-hero .logo-stage {
  inline-size: min(88vw, 42rem);
  filter: drop-shadow(0 1rem 2rem rgb(0 0 0 / 0.17));
}

.hero-intro {
  max-inline-size: 37rem;
  margin: 0.75rem auto 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
}

.section-wrap {
  max-inline-size: var(--content-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 2rem);
}

.name-check { padding-block: clamp(2.4rem, 6vw, 4.4rem); }

.section-heading {
  max-inline-size: 45rem;
  margin-inline: auto;
  text-align: center;
}

.section-heading h2,
.action-card h2,
.content-page h1,
.content-sections h2,
.closed-note h2 {
  margin: 0.35rem 0 0;
  color: var(--text);
  font-size: clamp(1.4rem, 3.2vw, 2.25rem);
  font-weight: 800;
  line-height: 1.35;
}

.section-heading > p:last-child { color: var(--muted); }

.name-check-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 0.82fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: stretch;
  margin-block-start: 1.5rem;
}

.name-form,
.site-preview,
.action-card,
.content-page,
.closed-note,
.qr-gift,
.contact-section {
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--surface-quiet);
  box-shadow: var(--shadow);
}

.name-form { padding: clamp(1rem, 3vw, 1.5rem); }

.name-form label {
  display: block;
  margin-block-end: 0.55rem;
  color: var(--text);
  font-weight: 800;
}

.name-input-row {
  display: flex;
  gap: 0.65rem;
  align-items: stretch;
}

.name-input-row input {
  min-inline-size: 0;
  flex: 1 1 auto;
  min-block-size: 3rem;
  padding-inline: 0.85rem;
  border: 1px solid var(--stroke);
  border-radius: 0.65rem;
  background: rgb(1 12 10 / 0.35);
  color: var(--text);
  font: inherit;
  line-height: 1.2;
}

html[data-theme="light"] .name-input-row input { background: rgb(255 255 255 / 0.55); }

.name-input-row input:focus {
  border-color: var(--gold-bright);
  outline: 3px solid rgb(225 197 127 / 0.27);
  outline-offset: 2px;
}

.field-hint,
.field-feedback {
  margin-block-start: 0.65rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.65;
}

.field-feedback[data-state="available"] { color: var(--emerald-soft); }
.field-feedback[data-state="invalid"],
.field-feedback[data-state="taken"],
.field-feedback[data-state="reserved"],
.field-feedback[data-state="limited"] { color: var(--gold-bright); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-block-size: 3rem;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.7rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0); }

.button-primary {
  background: var(--gold-bright);
  color: #10271f;
}

.button-primary:hover { background: #f0d890; }

html[data-theme="light"] .button-primary { background: #72551b; color: #fffaf0; }
html[data-theme="light"] .button-primary:hover { background: #604613; color: #fffaf0; }

.button-secondary {
  border-color: var(--stroke);
  background: rgb(17 49 42 / 0.62);
  color: var(--text);
}

html[data-theme="light"] .button-secondary { background: rgb(255 252 245 / 0.7); }
.button-secondary:hover { border-color: var(--gold); }

.site-preview {
  position: relative;
  display: grid;
  min-block-size: 14rem;
  overflow: hidden;
  isolation: isolate;
}

.site-preview picture { position: absolute; z-index: -1; inset: 0; }
.site-preview picture::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgb(2 16 13 / 0.52), rgb(2 16 13 / 0.84));
  content: "";
}

.site-preview img { inline-size: 100%; block-size: 100%; object-fit: cover; opacity: 0.55; }

.site-preview-copy {
  align-self: end;
  padding: 1.1rem;
  color: #f7f3ea;
}

.site-preview-copy strong {
  display: block;
  margin-block: 0.18rem 0.28rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(1rem, 2.5vw, 1.35rem);
}

.site-preview-copy p:last-child { color: rgb(247 243 234 / 0.85); font-size: 0.82rem; line-height: 1.6; }

.home-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding-block-end: clamp(2rem, 5vw, 4rem);
}

.action-card { padding: clamp(1.15rem, 3vw, 1.8rem); }
.action-card p { margin-block-start: 0.7rem; color: var(--muted); }

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-block-start: 1rem;
}

.home-story {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: center;
  padding-block-end: clamp(3rem, 6vw, 5rem);
}

.soon-link,
.quiet-link {
  display: inline-flex;
  align-items: center;
  min-block-size: 3rem;
  padding-inline: 0.85rem;
  border: 1px dashed var(--stroke);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.quiet-link { border-style: solid; color: var(--text); }
.quiet-link:hover { border-color: var(--gold); }

.welcome-panel,
.install-prompt {
  position: fixed;
  z-index: 12;
  inset-inline: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-inline-size: 44rem;
  margin-inline: auto;
  padding: 0.85rem 1rem;
  border: 1px solid var(--stroke);
  border-radius: 0.8rem;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.welcome-panel { inset-block-end: max(1rem, env(safe-area-inset-bottom)); }
.install-prompt { inset-block-end: max(1rem, env(safe-area-inset-bottom)); }

.welcome-panel strong,
.install-prompt strong { color: var(--text); }
.welcome-panel p,
.install-prompt p { color: var(--muted); font-size: 0.8rem; line-height: 1.55; }

.icon-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  min-inline-size: 3rem;
  min-block-size: 3rem;
  padding: 0;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
}

.icon-button:hover { border-color: var(--gold); }

.content-page {
  margin-block: clamp(2rem, 6vw, 5rem);
  padding: clamp(1.2rem, 4vw, 3rem);
}

.content-header {
  max-inline-size: 52rem;
  padding-block-end: 1.3rem;
  border-block-end: 1px solid var(--stroke);
}

.content-header > p:last-child { margin-block-start: 0.7rem; color: var(--muted); }

.page-status {
  color: var(--gold-bright);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.content-sections {
  display: grid;
  gap: clamp(1.35rem, 4vw, 2.5rem);
  max-inline-size: 55rem;
  margin-block-start: clamp(1.4rem, 4vw, 2.5rem);
}

.content-sections h2 { font-size: clamp(1.18rem, 2.5vw, 1.55rem); }
.content-sections p { margin-block-start: 0.65rem; color: var(--muted); }

.article-link {
  max-inline-size: var(--content-max);
  margin: -3rem auto 3rem;
  padding-inline: clamp(1rem, 3vw, 2rem);
}

.article-link a,
.quiet-link { text-underline-offset: 0.22em; }

.closed-page { max-inline-size: 48rem; }
.closed-note { margin-block-start: 1.5rem; padding: 1rem; }
.closed-note h2 { font-size: 1.1rem; }
.closed-note p { margin-block-start: 0.45rem; color: var(--muted); }

.qr-gift {
  display: grid;
  place-items: center;
  min-block-size: 12rem;
  margin-block-start: 1.5rem;
  padding: 1.25rem;
  color: var(--muted);
  text-align: center;
}

.qr-markup { inline-size: 100%; min-inline-size: 0; text-align: start; }
.qr-markup svg { display: block; inline-size: 100%; block-size: auto; }

.contact-section {
  max-inline-size: var(--content-max);
  margin: -2rem auto 3rem;
  padding: clamp(1rem, 3vw, 1.5rem);
}

.contact-owner > p { margin-block-end: 0.7rem; color: var(--text); font-weight: 800; }

.public-footer {
  max-inline-size: 76rem;
  padding-block-start: 2.5rem;
  border-block-start: 1px solid var(--stroke);
}

.public-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1rem;
  margin-block-end: 0.85rem;
}

.public-footer nav a { display: inline-flex; align-items: center; min-block-size: 3rem; padding-inline: .5rem; color: var(--text); text-underline-offset: 0.2em; }
.public-footer p { max-inline-size: 72rem; margin-inline: auto; }
.public-footer .footer-note { margin-block: 0.45rem; color: var(--muted); }

html[data-hero-active="false"] .public-hero::before,
html[data-hero-active="false"] .public-hero .hero-orbits,
html[data-hero-active="false"] .public-hero .logo-stage::after,
html[data-page-hidden="true"] .public-hero::before,
html[data-page-hidden="true"] .public-hero .hero-orbits,
html[data-page-hidden="true"] .public-hero .logo-stage::after {
  animation-play-state: paused;
}

html[data-motion="reduce"] .public-hero::before,
html[data-motion="reduce"] .public-hero .hero-orbits,
html[data-motion="reduce"] .public-hero .logo-stage::after {
  animation: none !important;
}

@media (max-width: 65rem) {
  .public-topbar { grid-template-columns: auto 1fr; }
  .primary-nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; overflow-x: auto; scrollbar-width: thin; }
  .public-topbar .controls { justify-self: end; }
}

@media (max-width: 44rem) {
  .public-topbar { gap: 0.55rem; padding-inline: 1rem; }
  .public-topbar .controls { gap: 0.3rem; }
  .public-topbar .control-button { padding-inline: 0.58rem; font-size: 0.71rem; }
  .primary-nav a { padding-inline: 0.56rem; font-size: 0.76rem; }
  .name-check-grid,
  .home-actions { grid-template-columns: 1fr; }
  .name-input-row { flex-direction: column; }
  .name-input-row .button { inline-size: 100%; }
  .button-row .button { flex: 1 1 12rem; }
  .welcome-panel,
  .install-prompt { align-items: flex-start; }
  .install-prompt { flex-wrap: wrap; }
  .install-prompt .button { flex: 1 1 12rem; }
}

@media (max-width: 23rem) {
  .public-topbar { grid-template-columns: 1fr; }
  .public-topbar .controls { justify-self: start; }
  .primary-nav { grid-column: 1; grid-row: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .primary-nav a,
  .button { transition: none; }
}
