:root {
  --bg: #fff8eb;
  --bg-soft: #ffe9c9;
  --ink: #1f2b24;
  --ink-soft: #3d5449;
  --brand: #006d77;
  --brand-strong: #00565d;
  --accent: #f2a365;
  --card: #fffdf8;
  --stroke: #ebdcc4;
  --shadow: 0 16px 48px rgba(31, 43, 36, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  position: relative;
  min-height: 100vh;
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at -10% -10%, #ffe0b7 0%, transparent 55%),
    radial-gradient(900px 500px at 110% -15%, #cbece6 0%, transparent 50%),
    var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  pointer-events: none;
  z-index: -1;
  border-radius: 50%;
  filter: blur(36px);
  opacity: 0.42;
  animation: drift 14s ease-in-out infinite;
}

.ambient-a {
  width: 340px;
  height: 340px;
  background: #f7c07a;
  left: -120px;
  top: 20vh;
}

.ambient-b {
  width: 300px;
  height: 300px;
  background: #8fd3c8;
  right: -120px;
  top: 56vh;
  animation-delay: -5s;
}

.site-header,
main,
.site-footer {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.logo {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.quick-nav {
  display: flex;
  gap: 1rem;
}

.quick-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
}

.quick-nav a:hover {
  color: var(--brand-strong);
}

.hero {
  padding: 1.2rem 0 1.6rem;
  animation: reveal 0.7s ease;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-strong);
  margin: 0;
}

.hero h1 {
  margin: 0.35rem 0 0.5rem;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 800;
  font-size: clamp(2rem, 4.2vw, 3.6rem);
  line-height: 1.05;
  max-width: 16ch;
}

.subtitle {
  max-width: 58ch;
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

.cta {
  display: inline-block;
  background: var(--brand);
  color: #ffffff;
  padding: 0.78rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease;
}

.cta:hover {
  transform: translateY(-1px);
  background: var(--brand-strong);
}

.generator {
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  gap: 1rem;
  margin: 1.25rem 0 1.8rem;
}

.card {
  background: color-mix(in oklab, var(--card) 88%, white 12%);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 1.1rem;
  animation: reveal 0.85s ease;
}

.card h2,
.card h3 {
  margin-top: 0;
}

label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

textarea,
input[type="range"] {
  width: 100%;
}

textarea {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 0.78rem;
  font: inherit;
  resize: vertical;
  min-height: 95px;
  background: #fffdfa;
}

.control-row {
  margin-top: 0.75rem;
}

.swatches {
  display: flex;
  gap: 0.85rem;
  margin-top: 0.95rem;
}

.swatches > div {
  flex: 1;
}

.swatches input[type="color"] {
  width: 100%;
  height: 44px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #fff;
  padding: 0;
}

.font-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.font-chip {
  border: 1px solid var(--stroke);
  background: #fffefb;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.6rem 0.65rem;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.font-chip:hover {
  transform: translateY(-1px);
  border-color: #c5b390;
  color: var(--ink);
}

.font-chip.active {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
  color: var(--brand-strong);
}

.preview-frame {
  min-height: 300px;
  border-radius: 18px;
  border: 1px dashed #ccbc9c;
  background: #fff8eb;
  padding: 1rem;
  display: grid;
  place-items: center;
  text-align: center;
}

#preview-text {
  margin: 0;
  line-height: 1.2;
  text-wrap: pretty;
}

.actions {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

button {
  border: 0;
  background: var(--brand);
  color: #fff;
  border-radius: 10px;
  padding: 0.62rem 0.85rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--brand-strong);
}

button.ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--stroke);
}

button.ghost:hover {
  border-color: #c5b390;
  color: var(--ink);
}

.status {
  min-height: 1.35em;
  margin: 0.6rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.help,
.faq {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.help h2,
.faq h2 {
  margin-top: 0;
  font-family: "Fraunces", Georgia, serif;
}

.help ol {
  margin: 0;
  padding-left: 1.2rem;
}

.faq article + article {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed #d2c2a3;
}

.faq h3 {
  margin: 0 0 0.2rem;
}

.site-footer {
  padding: 1.2rem 0 2rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(18px, -24px);
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .generator {
    grid-template-columns: 1fr;
  }

  .preview-frame {
    min-height: 250px;
  }
}

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
  }

  .quick-nav {
    gap: 0.75rem;
  }

  .font-list {
    grid-template-columns: 1fr;
  }

  .swatches {
    flex-direction: column;
  }
}
