:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #172033;
  --muted: #5d6b82;
  --primary: #635bff;
  --primary-dark: #4b44d9;
  --border: #dce3ee;
  --shadow: 0 18px 45px rgba(23, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(99, 91, 255, 0.18), transparent 34rem),
    linear-gradient(135deg, #f8fbff 0%, var(--bg) 100%);
  color: var(--text);
}

.app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.hero {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(2.3rem, 5vw, 4.5rem);
  line-height: 1.02;
}

.hero p:last-child {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.7;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.panel,
.cheatsheet {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.panel {
  min-height: 560px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

button,
.badge {
  border: 0;
  border-radius: 999px;
  font-weight: 800;
}

button {
  padding: 10px 14px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.badge {
  padding: 8px 11px;
  background: #eef0ff;
  color: var(--primary-dark);
  font-size: 0.8rem;
}

textarea,
.preview {
  width: 100%;
  min-height: 500px;
  padding: 22px;
}

textarea {
  display: block;
  resize: vertical;
  border: 0;
  outline: none;
  background: #101827;
  color: #eef5ff;
  font: 1rem/1.65 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.preview {
  overflow-wrap: anywhere;
  line-height: 1.7;
}

.preview h1,
.preview h2,
.preview h3 {
  margin: 0.7em 0 0.35em;
  line-height: 1.2;
}

.preview blockquote {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  border-left: 5px solid var(--primary);
  background: #f3f5ff;
  color: #38445a;
}

.preview code {
  border-radius: 6px;
  padding: 0.14rem 0.35rem;
  background: #edf2f7;
  color: #b4235f;
}

.preview pre {
  overflow-x: auto;
  border-radius: 16px;
  padding: 1rem;
  background: #101827;
  color: #eef5ff;
}

.preview pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.preview a {
  color: var(--primary-dark);
  font-weight: 700;
}

.preview img {
  display: block;
  width: min(100%, 720px);
  max-height: 420px;
  margin: 1rem 0;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.16);
}

.youtube-embed {
  position: relative;
  width: 100%;
  margin: 1rem 0;
  overflow: hidden;
  border-radius: 18px;
  background: #101827;
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.16);
  aspect-ratio: 16 / 9;
}

.youtube-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.task-list {
  list-style: none;
  padding-left: 0;
}

.task-list input {
  margin-right: 0.55rem;
}

.cheatsheet {
  margin-top: 22px;
  padding: 24px;
}

.cheatsheet h2 {
  margin-bottom: 12px;
}

.cheatsheet ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 24px;
  margin: 0;
  padding-left: 1.25rem;
  color: var(--muted);
}

.cheatsheet code {
  border-radius: 6px;
  padding: 0.12rem 0.35rem;
  background: #edf2f7;
  color: var(--text);
}

.usage-note {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f3f5ff;
  color: #38445a;
  line-height: 1.7;
}

@media (max-width: 820px) {
  .app {
    width: min(100% - 20px, 680px);
    padding: 28px 0;
  }

  .editor-grid,
  .cheatsheet ul {
    grid-template-columns: 1fr;
  }

  .panel {
    min-height: auto;
  }
}
