/* ===== Tokens ===== */
:root {
  --blue-600: #1a7fc4;
  --blue-500: #2196d3;
  --blue-400: #4ab0e4;
  --blue-100: #e3f2fd;
  --blue-50:  #f0f8ff;

  --green-600: #2e7d32;
  --green-100: #e8f5e9;

  --gray-900: #1e293b;
  --gray-700: #475569;
  --gray-500: #94a3b8;
  --gray-300: #cbd5e1;
  --gray-200: #e2e8f0;
  --gray-100: #f1f5f9;
  --gray-50:  #f8fafc;

  --white: #ffffff;

  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);

  --font-sans: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", "Fira Code", monospace;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  color: var(--gray-900);
  background: var(--gray-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Header ===== */
header {
  background: linear-gradient(135deg, var(--blue-600) 0%, var(--blue-400) 100%);
  color: var(--white);
  padding: 2rem 2rem 2.5rem;
  text-align: center;
}

.brand {
  margin-bottom: 1rem;
}

.brand-logo {
  height: 120px;
  filter: brightness(0) invert(1);
}

.top-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.nav-link {
  color: rgba(255,255,255,.8);
  font-weight: 600;
  font-size: .95rem;
  padding: .35rem .75rem;
  border-radius: 6px;
  transition: background .2s, color .2s;
}
.nav-link:hover,
.nav-link.is-current {
  color: var(--white);
  background: rgba(255,255,255,.18);
  text-decoration: none;
}

.eyebrow {
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .85;
  margin-bottom: .35rem;
}

header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: .5rem;
}

.subtitle {
  max-width: 680px;
  margin: 0 auto;
  font-size: 1.05rem;
  opacity: .92;
  line-height: 1.55;
}

/* ===== Main layout ===== */
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* ===== Section headings ===== */
.section-heading {
  margin-bottom: 1.25rem;
}

.section-heading h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: .3rem;
}

.section-heading p {
  font-size: .95rem;
  color: var(--gray-700);
}

.section-heading a {
  color: var(--blue-600);
  font-weight: 600;
}

/* ===== Prompt grid (left side) ===== */
.prompt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.prompt-block {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s;
}

.prompt-block:focus-within {
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px rgba(33,150,211,.15);
}

.prompt-block-wide {
  grid-column: 1 / -1;
}

.block-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--blue-600);
  margin-bottom: .4rem;
}

label {
  display: block;
  font-size: .9rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: .35rem;
}

.mt-sm {
  margin-top: .6rem;
}

input[type="text"],
input[type="url"],
textarea,
select {
  width: 100%;
  font-family: var(--font-sans);
  font-size: .92rem;
  color: var(--gray-900);
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  padding: .6rem .75rem;
  background: var(--gray-50);
  transition: border-color .2s;
  resize: vertical;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2rem;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--blue-500);
  background: var(--white);
}

::placeholder {
  color: var(--gray-500);
  font-size: .85rem;
}

.field-note {
  font-size: .8rem;
  color: var(--gray-500);
  margin-top: .3rem;
}

.field-custom {
  margin-top: .5rem;
}

/* ===== Radio & Checkbox groups ===== */
.radio-group,
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.radio-label,
.checkbox-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .88rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  padding: .3rem .4rem;
  border-radius: 6px;
  transition: background .15s;
  margin-bottom: 0;
}

.radio-label:hover,
.checkbox-label:hover {
  background: var(--blue-50);
}

.radio-label input,
.checkbox-label input {
  width: auto;
  accent-color: var(--blue-600);
  cursor: pointer;
}

/* ===== Results section (right side) ===== */
.results-section {
  position: sticky;
  top: 1.5rem;
}

.prompt-output-card {
  background: var(--gray-900);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1rem;
  min-height: 240px;
}

.prompt-output {
  font-family: var(--font-mono);
  font-size: .85rem;
  line-height: 1.65;
  color: var(--gray-100);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.prompt-output .placeholder-text {
  color: var(--gray-500);
  font-style: italic;
}

/* ===== Action row ===== */
.action-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-primary {
  font-family: var(--font-sans);
  font-size: .95rem;
  font-weight: 700;
  color: var(--white);
  background: var(--blue-600);
  border: none;
  border-radius: 8px;
  padding: .7rem 1.6rem;
  cursor: pointer;
  transition: background .2s, transform .1s;
}

.btn-primary:hover {
  background: var(--blue-500);
}

.btn-primary:active {
  transform: scale(.97);
}

.copy-feedback {
  font-size: .9rem;
  font-weight: 600;
  color: var(--green-600);
}

/* ===== Refinement section ===== */
.refinement-section {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray-200);
}

.refinement-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: .25rem;
}

.refinement-hint {
  font-size: .85rem;
  color: var(--gray-500);
  margin-bottom: .75rem;
}

.refinement-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.refinement-chip {
  font-family: var(--font-sans);
  font-size: .82rem;
  font-weight: 600;
  color: var(--blue-600);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: 20px;
  padding: .4rem .85rem;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .1s;
}

.refinement-chip:hover {
  background: var(--blue-100);
  border-color: var(--blue-400);
}

.refinement-chip:active {
  transform: scale(.96);
}

.refinement-chip.chip-copied {
  background: var(--green-100);
  border-color: var(--green-600);
  color: var(--green-600);
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 2rem 1.5rem 2.5rem;
  border-top: 1px solid var(--gray-200);
  color: var(--gray-700);
  font-size: .9rem;
}

.footer-logo {
  height: 90px;
  margin-bottom: 1rem;
  opacity: .85;
}

footer strong {
  color: var(--blue-600);
}

.footer-note {
  font-size: .82rem;
  color: var(--gray-500);
  margin-top: .4rem;
}

footer a {
  color: var(--blue-600);
  font-weight: 600;
}

/* ===== Guide page layout ===== */
.guide-layout {
  display: block;
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

.guide-section {
  margin-bottom: 2.5rem;
}

/* Step list */
.step-list {
  list-style: none;
  counter-reset: steps;
  padding: 0;
}

.step-list li {
  counter-increment: steps;
  position: relative;
  padding: .9rem 1rem .9rem 3.2rem;
  margin-bottom: .6rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-size: .95rem;
  line-height: 1.55;
}

.step-list li::before {
  content: counter(steps);
  position: absolute;
  left: 1rem;
  top: .85rem;
  width: 1.6rem;
  height: 1.6rem;
  background: var(--blue-600);
  color: var(--white);
  font-size: .8rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-list li strong {
  color: var(--gray-900);
}

/* Tutorial grid & cards */
.tutorial-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.tutorial-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow-sm);
}

.tutorial-card-wide {
  grid-column: 1 / -1;
}

.tutorial-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: .35rem;
}

.tutorial-card p {
  font-size: .9rem;
  color: var(--gray-700);
  margin-bottom: .75rem;
}

/* Code blocks */
.code-block {
  background: var(--gray-900);
  color: var(--gray-100);
  font-family: var(--font-mono);
  font-size: .82rem;
  line-height: 1.7;
  padding: .85rem 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0;
}

/* Resource list */
.resource-list {
  list-style: none;
  padding: 0;
}

.resource-list li {
  padding: .65rem 1rem;
  margin-bottom: .4rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.resource-list a {
  color: var(--blue-600);
  font-weight: 600;
  font-size: .95rem;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  main {
    grid-template-columns: 1fr;
  }

  .results-section {
    position: static;
  }
}

@media (max-width: 600px) {
  header {
    padding: 1.5rem 1rem 2rem;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .subtitle {
    font-size: .95rem;
  }

  main {
    padding: 1.5rem 1rem;
  }

  .prompt-grid {
    grid-template-columns: 1fr;
  }

  .prompt-output-card {
    min-height: 200px;
  }

  .tutorial-grid {
    grid-template-columns: 1fr;
  }

  .guide-layout {
    padding: 1.5rem 1rem;
  }
}
