/* Duraflame-inspired text cleaner
   Charcoal hearth · ember · teal accent from duraflame.com */

:root {
  --charcoal: #1a1c1c;
  --charcoal-deep: #121414;
  --hearth: #2a2422;
  --ember: #e85d04;
  --flame: #f48c06;
  --glow: #ffba08;
  --teal: #68ccd1;
  --teal-deep: #3aa8af;
  --cream: #f4efe6;
  --cream-muted: rgba(244, 239, 230, 0.62);
  --line: rgba(244, 239, 230, 0.14);
  --panel: rgba(34, 30, 28, 0.72);
  --radius: 0.65rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ff-display: "Montserrat", system-ui, sans-serif;
  --ff-body: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
}

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

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--ff-body);
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--cream);
  background: var(--charcoal-deep);
  overflow-x: hidden;
}

a {
  color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.2s var(--ease);
}

a:hover,
a:focus-visible {
  color: var(--glow);
}

/* Atmosphere */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(232, 93, 4, 0.28), transparent 55%),
    radial-gradient(70% 50% at 85% 90%, rgba(104, 204, 209, 0.12), transparent 50%),
    linear-gradient(165deg, #1f1814 0%, var(--charcoal-deep) 45%, #0e1010 100%);
}

.atmosphere__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.55;
  animation: drift 14s var(--ease) infinite alternate;
}

.atmosphere__glow--ember {
  width: min(55vw, 480px);
  height: min(55vw, 480px);
  left: -8%;
  bottom: -12%;
  background: radial-gradient(circle, rgba(244, 140, 6, 0.55), transparent 70%);
}

.atmosphere__glow--teal {
  width: min(40vw, 360px);
  height: min(40vw, 360px);
  right: -6%;
  top: 18%;
  background: radial-gradient(circle, rgba(104, 204, 209, 0.35), transparent 70%);
  animation-delay: -4s;
}

.atmosphere__grain {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(3%, -4%, 0) scale(1.06); }
}

.site-header,
.shell,
.site-footer {
  position: relative;
  z-index: 1;
}

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1.25rem clamp(1.25rem, 4vw, 3rem) 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand__logo {
  display: block;
  width: clamp(9.5rem, 22vw, 13.5rem);
  height: auto;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.35));
}

.brand__tag {
  margin: 0;
  font-family: var(--ff-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream-muted);
}

/* Shell */
.shell {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 1.5rem 0 3.5rem;
}

.hero {
  display: grid;
  justify-items: start;
  gap: 0.85rem;
  margin-bottom: 2rem;
  animation: rise 0.7s var(--ease) both;
}

.hero__flame {
  width: 3.25rem;
  height: auto;
  filter: drop-shadow(0 0 18px rgba(232, 93, 4, 0.45));
  animation: flicker 3.2s ease-in-out infinite;
}

.hero__title {
  margin: 0;
  font-family: var(--ff-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: var(--cream);
  text-shadow: 0 2px 40px rgba(232, 93, 4, 0.25);
}

.hero__lede {
  margin: 0;
  max-width: 34rem;
  font-size: 1.1rem;
  color: var(--cream-muted);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(-1deg); filter: drop-shadow(0 0 14px rgba(232, 93, 4, 0.4)); }
  50% { transform: scale(1.04) rotate(1.5deg); filter: drop-shadow(0 0 22px rgba(244, 140, 6, 0.65)); }
}

/* Workbench */
.workbench {
  display: grid;
  gap: 1rem;
  animation: rise 0.8s var(--ease) 0.08s both;
}

@media (min-width: 900px) {
  .workbench {
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
    gap: 1.15rem;
  }

  .actions {
    flex-direction: column;
    justify-content: center;
    padding-top: 2.5rem;
  }
}

.pane {
  display: flex;
  flex-direction: column;
  min-height: 280px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.pane__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem 0.35rem;
}

.pane__label {
  margin: 0;
  font-family: var(--ff-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
}

.pane__field {
  flex: 1;
  width: 100%;
  min-height: 240px;
  margin: 0;
  padding: 0.65rem 1rem 1.1rem;
  border: 0;
  resize: vertical;
  background: transparent;
  color: var(--cream);
  font: inherit;
  line-height: 1.55;
  outline: none;
}

.pane__field::placeholder {
  color: rgba(244, 239, 230, 0.35);
}

.pane__field:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(104, 204, 209, 0.45);
}

#output {
  color: #fff8ef;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.85rem 1.1rem;
  padding: 0.25rem 0;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  font-family: var(--ff-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.2s var(--ease),
    color 0.2s var(--ease),
    transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    opacity 0.2s var(--ease);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn--primary {
  padding: 0.95em 1.6em;
  background: linear-gradient(135deg, var(--ember), var(--flame) 55%, var(--glow));
  color: #1a1008;
  box-shadow:
    0 0 0 1px rgba(255, 186, 8, 0.25),
    0 10px 28px rgba(232, 93, 4, 0.35);
}

.btn--primary:hover:not(:disabled),
.btn--primary:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(255, 186, 8, 0.4),
    0 14px 36px rgba(232, 93, 4, 0.45);
}

.btn--primary.is-pulse {
  animation: pulse 0.45s var(--ease);
}

@keyframes pulse {
  0% { transform: scale(1); }
  40% { transform: scale(0.97); }
  100% { transform: scale(1); }
}

.btn--ghost {
  padding: 0.45em 0.85em;
  background: transparent;
  color: var(--cream-muted);
  border: 1px solid var(--line);
}

.btn--ghost:hover:not(:disabled),
.btn--ghost:focus-visible:not(:disabled) {
  color: var(--cream);
  border-color: rgba(104, 204, 209, 0.55);
  background: rgba(104, 204, 209, 0.08);
}

.btn--ghost.is-copied {
  color: var(--charcoal-deep);
  background: var(--teal);
  border-color: var(--teal);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--ff-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream-muted);
  cursor: pointer;
  user-select: none;
}

.toggle input {
  accent-color: var(--teal);
  width: 1rem;
  height: 1rem;
}

/* Log */
.log {
  margin-top: 1.75rem;
  padding: 1.15rem 1.25rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 20, 20, 0.55);
  animation: rise 0.85s var(--ease) 0.14s both;
}

.log__title {
  margin: 0 0 0.75rem;
  font-family: var(--ff-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--flame);
}

.log__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.log__list li {
  font-size: 0.95rem;
  color: var(--cream-muted);
}

.log__list li strong {
  color: var(--cream);
  font-weight: 600;
}

.log__empty {
  font-style: italic;
}

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0 clamp(1.25rem, 4vw, 3rem) 2rem;
  font-size: 0.9rem;
  color: var(--cream-muted);
}

.site-footer p {
  margin: 0;
}

.site-footer__brand {
  font-family: var(--ff-display);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
