:root {
  color-scheme: light;
  --ink: #263d35;
  --muted: #78827a;
  --paper: #f5f2ea;
  --card: #fffdf8;
  --green: #35594b;
  --green-dark: #29473b;
  --gold: #c59c5b;
  --line: #e9e3d6;
  font-family: "DM Sans", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 50% 37%, rgba(255, 255, 255, 0.72), transparent 49%),
    var(--paper);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: 0 7.2%;
}

.topbar {
  display: flex;
  height: 82px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(53, 89, 75, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(53, 89, 75, 0.28);
  border-radius: 50%;
  color: var(--green);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 21px;
  line-height: 1;
}

.topbar-note {
  color: var(--muted);
  font-size: 12px;
}

.generator {
  display: flex;
  width: min(100%, 520px);
  flex: 1;
  flex-direction: column;
  align-items: center;
  align-self: center;
  padding: 50px 0 44px;
  text-align: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #8c7654;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.eyebrow span {
  width: 20px;
  height: 1px;
  background: #c4a878;
}

h1 {
  margin: 18px 0 12px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(42px, 6vw, 58px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.intro {
  max-width: 390px;
  margin: 0 0 28px;
  color: #727b74;
  font-size: 14px;
  line-height: 1.75;
}

.name-card {
  position: relative;
  display: flex;
  width: min(100%, 420px);
  min-height: 253px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 21px 20px 19px;
  border: 1px solid rgba(197, 156, 91, 0.38);
  border-radius: 3px;
  background: var(--card);
  box-shadow: 0 15px 40px rgba(49, 59, 48, 0.07);
}

.name-card::before,
.name-card::after {
  position: absolute;
  width: 13px;
  height: 13px;
  border-color: #c9a76f;
  content: "";
}

.name-card::before {
  top: 10px;
  left: 10px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.name-card::after {
  right: 10px;
  bottom: 10px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.card-illustration {
  width: 62px;
  height: 47px;
  margin-bottom: 9px;
  color: #789080;
}

.card-illustration svg {
  width: 100%;
  height: 100%;
}

.name-label {
  margin: 0 0 8px;
  color: #9a8b70;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.house-name {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.24em;
  margin: 0;
  color: var(--green);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(36px, 7vw, 48px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.card-bottom {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 15px;
  color: #9a9488;
  font-size: 10px;
  letter-spacing: 0.035em;
}

.sparkle {
  color: var(--gold);
  font-size: 10px;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.generate-button,
.copy-button {
  display: inline-flex;
  min-height: 47px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.generate-button {
  gap: 10px;
  padding: 0 20px;
  color: white;
  background: var(--green);
  box-shadow: 0 5px 12px rgba(53, 89, 75, 0.14);
}

.generate-button:hover {
  background: var(--green-dark);
  box-shadow: 0 7px 15px rgba(53, 89, 75, 0.2);
}

.generate-button:active,
.copy-button:active {
  transform: translateY(1px);
}

.button-icon {
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.copy-button {
  gap: 7px;
  padding: 0 14px;
  border: 1px solid #dcd8ce;
  color: #56665c;
  background: rgba(255, 253, 248, 0.72);
}

.copy-button:hover {
  border-color: #aeb8ad;
  background: #fffdf8;
}

.copy-button svg {
  width: 16px;
  height: 16px;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid #c59c5b;
  outline-offset: 3px;
}

.hint {
  margin: 12px 0 0;
  color: #9b9b90;
  font-size: 10px;
}

.footer {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border-top: 1px solid rgba(53, 89, 75, 0.12);
  color: #96978d;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.15em;
}

.footer-star {
  color: #b89a6c;
  font-size: 12px;
}

@media (max-width: 480px) {
  .page {
    padding: 0 6%;
  }

  .topbar {
    height: 68px;
  }

  .topbar-note {
    font-size: 11px;
  }

  .generator {
    justify-content: center;
    padding: 35px 0;
  }

  .intro {
    font-size: 13px;
  }

  .name-card {
    min-height: 235px;
  }

  .footer {
    gap: 10px;
    font-size: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
