/* ============================================================
   LoremIpsum.dev — accessible stylesheet
   Contrast targets:
     - body text      #E8EAED on #121417  => ~14.5:1  (AAA)
     - Muted text     #8B949E on #121417  => ~7.4:1   (AAA)
     - Accent/links   #79C0FF on #121417  => ~7.6:1   (AAA)
     - Buttons        #0A0C10 on #79C0FF  => ~9.5:1   (AAA)
     - Focus outline  #FFD166  (AA/AAA on both light/dark)
   ============================================================ */

:root {
  --bg: #121417;
  --surface: #1C2025;
  --surface-2: #23282E;
  --text: #E8EAED;
  --muted: #AFB6BF;
  --accent: #79C0FF;
  --accent-ink: #0A0C10;
  --focus: #FFD166;

  --gap: 1rem;
  --radius: 0.75rem;
}

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

.hero {
  background: linear-gradient(180deg, #1A1F26 0%, var(--bg) 100%);
  padding: 3.5rem 0;
  border-bottom: 1px solid #2A3038;
}

.wrap {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 6vw, 3rem);
  letter-spacing: -0.03em;
}

.accent { color: var(--accent); }

.tagline {
  max-width: 42rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.1rem;
}

main { padding: 2rem 0 4rem; }

/* ---------- Controls ---------- */
.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: var(--gap);
  background: var(--surface);
  border: 1px solid #2A3038;
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.field { display: grid; gap: 0.4rem; }

label {
  font-weight: 600;
  color: var(--text);
  font-size: 0.875rem;
}

select, input, button {
  font: inherit;
  color: var(--text);
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface-2);
  border: 2px solid #3A4250;
}

select:focus, input:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.controls-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

button {
  cursor: pointer;
  font-weight: 700;
}

#generate {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
}

#generate:hover { background: #8FCEFF; }

#copy {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

#copy:hover {
  background: #1B2A3D;
  color: #B5D9FF;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- Output ---------- */
.output-box {
  background: var(--surface);
  border: 1px solid #2A3038;
  border-radius: var(--radius);
  padding: 1.5rem;
  min-height: 12rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}

.output-box:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.output-box .sent { margin-bottom: 1em; }

.output-box:empty::before {
  content: "Your generated placeholder will appear here.";
  color: var(--muted);
}

/* Plain text mode: remove paragraph spacing so output pastes as raw text. */
.output-box.plain {
  white-space: pre-wrap;
  line-height: 1.4;
}

.editorial-note {
  margin-top: 0.875rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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