:root {
  --bg: #FDFBF7;
  --bg-soft: #F4EFE6;
  --ink: #1C2421;
  --ink-soft: #4A5D54;
  --brand: #0D7A73;
  --brand-strong: #095C56;
  --accent: #E86A33;
  --card: #FFFFFF;
  --stroke: #EAE3D5;
  --shadow: 0 12px 36px rgba(13, 122, 115, 0.08);
  --shadow-hover: 0 24px 48px rgba(13, 122, 115, 0.12);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  position: relative;
  min-height: 100vh;
  font-family: "Sora", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at -10% -10%, rgba(232, 106, 51, 0.05) 0%, transparent 55%),
    radial-gradient(900px 500px at 110% -15%, rgba(13, 122, 115, 0.08) 0%, transparent 50%),
    var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: drift 14s ease-in-out infinite alternate;
}

body::before {
  width: 400px;
  height: 400px;
  background: rgba(232, 106, 51, 0.12);
  left: -150px;
  top: 15vh;
}

body::after {
  width: 350px;
  height: 350px;
  background: rgba(13, 122, 115, 0.12);
  right: -100px;
  top: 60vh;
  animation-delay: -5s;
}

.ambient {
  display: none;
}

.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: 1.5rem 0;
}

.logo {
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  transition: color var(--transition);
}
.logo:hover { color: var(--brand); }

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

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

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

.hero {
  padding: 3rem 0 2rem;
  animation: reveal 0.7s ease-out;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand);
  margin: 0 0 1rem;
  background: rgba(13, 122, 115, 0.1);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  display: inline-block;
}

.hero h1 {
  margin: 0 0 1rem;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 800;
  font-size: clamp(2.2rem, 4.5vw, 4rem);
  line-height: 1.1;
  max-width: 18ch;
  color: var(--ink);
}

.subtitle {
  max-width: 58ch;
  margin: 0 auto 2rem;
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.cta {
  display: inline-block;
  background: var(--brand);
  color: #ffffff;
  padding: 0.9rem 2rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(13, 122, 115, 0.2);
}

.cta:hover {
  transform: translateY(-2px);
  background: var(--brand-strong);
  box-shadow: 0 6px 16px rgba(13, 122, 115, 0.3);
}

.generator {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0 4rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 2.25rem;
  animation: reveal 0.85s ease-out;
  transition: var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-hover);
}

.card h2,
.card h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--ink);
}

label {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

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

textarea {
  border: 2px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: 1rem;
  font: inherit;
  font-size: 1rem;
  resize: vertical;
  min-height: 110px;
  background: var(--bg);
  transition: var(--transition);
  color: var(--ink);
}
textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(13, 122, 115, 0.1);
}

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

input[type="range"] {
  accent-color: var(--brand);
  height: 6px;
  background: var(--stroke);
  border-radius: 3px;
  outline: none;
}

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

.swatches > div {
  flex: 1;
}

.swatches input[type="color"] {
  width: 100%;
  height: 48px;
  border: 2px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 2px;
  cursor: pointer;
  transition: var(--transition);
}
.swatches input[type="color"]:hover {
  border-color: var(--brand);
}

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

.font-chip {
  border: 2px solid var(--stroke);
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.font-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(13, 122, 115, 0.4);
}

.font-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(13, 122, 115, 0.2);
}

.preview-frame {
  min-height: 320px;
  border-radius: var(--radius-md);
  border: 2px dashed rgba(13, 122, 115, 0.2);
  background: var(--bg);
  padding: 2rem;
  display: grid;
  place-items: center;
  text-align: center;
  transition: var(--transition);
}

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

.actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

button {
  border: 0;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.8rem 1.5rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

button:hover {
  background: var(--brand-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(13, 122, 115, 0.2);
}

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

button.ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(13, 122, 115, 0.05);
  box-shadow: none;
}

.status {
  min-height: 1.5em;
  margin: 1rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.help,
.faq {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.help:hover, .faq:hover {
  box-shadow: var(--shadow-hover);
}

.help h2,
.faq h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.8rem;
}

.help p, .faq p {
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.help ol {
  margin: 0;
  padding-left: 1.5rem;
  color: var(--ink-soft);
}
.help li { margin-bottom: 0.5rem; }

.help a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}
.help a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.faq article + article {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--stroke);
}

.faq h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.site-footer {
  padding: 2rem 0 3rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  text-align: center;
  border-top: 1px solid var(--stroke);
  margin-top: 2rem;
}

@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -40px) scale(1.1); }
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

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

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

  .swatches {
    flex-direction: column;
  }
  
  .actions {
    flex-direction: column;
  }
  button { width: 100%; }
}
