:root {
  --bg-dark: #050608;
  --bg-light: #f4f4f7;

  --text-dark: #f9fafb;
  --text-light: #111827;

  --card-dark: #111827;
  --card-light: #ffffff;

  --border-dark: #1f2937;
  --border-light: #d1d5db;

  --accent: #6ec1e4;
  --accent-soft: rgba(110, 193, 228, 0.1);
}

/* GLOBAL LAYOUT */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 40px;
  transition: background 0.3s ease, color 0.3s ease;
}

body.dark {
  background: radial-gradient(circle at top, #111827 0, #020617 60%);
  color: var(--text-dark);
}

body.light {
  background: radial-gradient(circle at top, #ffffff 0, #e5e7eb 60%);
  color: var(--text-light);
}

/* PAGE WIDTH */

main,
h1,
p,
.controls,
textarea,
#output,
a,
footer {
  width: min(900px, 100%);
}

/* HEADER TEXT */

h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  letter-spacing: 0.02em;
}

.description {
  margin: 0 0 18px;
  font-size: 0.95rem;
  opacity: 0.9;
}

/* CONTROLS & BUTTONS */

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

button {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.9);
  color: inherit;
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease;
}

body.light button {
  background: #ffffff;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.45);
}

/* TEXTAREA & OUTPUT */

section {
  background: var(--card-dark);
  border-radius: 18px;
  border: 1px solid var(--border-dark);
  padding: 16px 16px 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

body.light section {
  background: var(--card-light);
  border-color: var(--border-light);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
}

textarea {
  width: 100%;
  min-height: 120px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 12px 11px;
  resize: vertical;
  font-size: 0.95rem;
  font-family: inherit;
  margin-bottom: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

body.dark textarea {
  background: #020617;
  color: var(--text-dark);
}

body.light textarea {
  background: #f9fafb;
  color: var(--text-light);
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(110, 193, 228, 0.6);
}

#output {
  width: 100%;
  min-height: 120px;
  border-radius: 12px;
  padding: 14px 12px;
  font-size: 0.97rem;
  line-height: 1.7;
  border: 1px solid rgba(55, 65, 81, 0.7);
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.9),
    rgba(30, 64, 175, 0.55)
  );
  color: #f9fafb;
}

body.light #output {
  background: linear-gradient(135deg, #f9fafb, #e0f2fe);
  color: #0f172a;
}

/* BIONIC BOLD */

#output .bold {
  font-weight: 700;
}

/* LINKS & FOOTER */

a {
  margin-top: 18px;
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--accent);
}

a:hover {
  text-decoration: underline;
}

footer {
  margin-top: 26px;
  font-size: 0.85rem;
  text-align: center;
  opacity: 0.75;
}

/* RESPONSIVE */

@media (max-width: 640px) {
  body {
    padding-top: 24px;
  }

  section {
    padding: 14px 12px 16px;
  }

  h1 {
    font-size: 1.6rem;
  }
}
