/* ── Lipsum ──
   Colours, fonts, tool bar and theme come from ../shared/rm-tools.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: var(--rm-primary);
  --primary-dark: var(--rm-primary-hover);
  --primary-light: var(--rm-primary-soft);
  --surface: var(--rm-surface);
  --bg: var(--rm-surface-2);
  --text: var(--rm-text);
  --text-muted: var(--rm-muted);
  --border: var(--rm-border);
  --radius: var(--rm-radius-lg);
  --shadow: var(--rm-shadow-md);
  --shadow-lg: var(--rm-shadow-lg);
}

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── CONTAINER ── */
.container { max-width: 900px; margin: 0 auto; padding: 0 24px; }

/* ── HERO (blueprint band from rm-tools.css; holds the generator) ── */
.hero {
  padding: 56px 0;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 12px;
}

.subtitle {
  font-size: 1.05rem;
  margin-bottom: 36px;
}

/* ── CONTROLS CARD ── */
.controls-card {
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-end;
}

.control-group { display: flex; flex-direction: column; gap: 6px; }

.control-group label {
  font: 600 .7rem var(--rm-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .15em;
}

select, input[type="number"] {
  border: 1px solid var(--border);
  border-radius: var(--rm-radius);
  padding: 10px 14px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  height: 44px;
}

select:focus, input[type="number"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

select { min-width: 160px; cursor: pointer; }
input[type="number"] { width: 70px; text-align: center; font-family: var(--rm-mono); -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button { display: none; }

/* number stepper */
.number-input { display: flex; align-items: center; }
.num-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}
#decBtn { border-radius: var(--rm-radius) 0 0 var(--rm-radius); border-right: none; }
#incBtn { border-radius: 0 var(--rm-radius) var(--rm-radius) 0; border-left: none; }
.num-btn:hover { background: var(--primary-light); color: var(--primary); }
.number-input input { border-radius: 0; }

/* checkbox */
.checkbox-group { justify-content: flex-end; padding-bottom: 4px; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--text);
  user-select: none;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  font-family: var(--rm-body) !important;
}
.checkbox-label input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: var(--rm-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
  background: var(--surface);
}
.checkbox-label input:focus-visible + .checkbox-custom { outline: 2px solid var(--primary); outline-offset: 2px; }
.checkbox-label input:checked + .checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
}
.checkbox-label input:checked + .checkbox-custom::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid var(--rm-primary-ink);
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
  display: block;
}

/* generate button (shared .rm-btn-primary look, full control height) */
.btn-generate { height: 44px; padding: 0 26px; font-size: .95rem; }

/* ── OUTPUT AREA ── */
.output-area {
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.output-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.word-count {
  font: 600 .74rem var(--rm-mono);
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .1em;
}

.toolbar-actions { display: flex; gap: 8px; }

.btn-action {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--rm-radius);
  font: 600 .85rem var(--rm-body);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-action:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}
.btn-action svg { flex-shrink: 0; }

.output-text {
  padding: 28px;
  min-height: 200px;
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text);
}
.output-text p + p { margin-top: 18px; }
/* the output sits inside the hero band, so restore normal text colours */
.output-text p { color: var(--text); }
.output-text .placeholder-hint { color: var(--text-muted); font-style: italic; }

/* ── ABOUT ── */
.about-section {
  padding: 72px 0;
  flex: 1;
}
.about-section h2 {
  font-size: 2.1rem;
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--text);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.about-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: var(--primary); }
.about-icon { margin-bottom: 14px; }
.about-card h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.about-card p { color: var(--text-muted); font-size: 0.93rem; line-height: 1.7; }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--rm-text);
  color: var(--rm-bg);
  padding: 12px 24px;
  border-radius: var(--rm-radius);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--rm-shadow-lg);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
  opacity: 0;
  pointer-events: none;
  z-index: 999;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .hero { padding: 40px 0; }
  .controls-row { flex-direction: column; align-items: stretch; }
  .btn-generate { width: 100%; }
  .checkbox-group { justify-content: flex-start; }
  .output-toolbar { flex-wrap: wrap; }
}
