:root {
  --ink: #172033;
  --muted: #637088;
  --line: #dfe5ef;
  --paper: #ffffff;
  --soft: #f6f8fb;
  --blue: #1769e8;
  --blue-dark: #0e53bd;
  --code: #121b2f;
  --code-soft: #1b2943;
  --green: #77d69b;
  --gold: #f7cb73;
  --rose: #ff9da8;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Instrument Sans", ui-sans-serif, sans-serif;
  line-height: 1.5;
}

button,
textarea {
  font: inherit;
}

.site-header,
.site-footer {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
}

.logo {
  color: var(--ink);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav a,
.nav-disabled {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.nav a:hover {
  color: var(--blue);
}

.nav-disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

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

.hero {
  padding: 72px 0 42px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 820px;
  margin: 0 auto;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(3rem, 7vw, 5.7rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: 0;
}

.subheading {
  margin: 22px 0 34px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.4vw, 1.38rem);
}

.generator {
  display: grid;
  gap: 18px;
}

textarea {
  width: 100%;
  min-height: 230px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--soft);
  color: var(--ink);
  box-shadow: 0 22px 70px rgba(35, 49, 78, 0.08);
  outline: none;
}

textarea:focus {
  border-color: var(--blue);
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(23, 105, 232, 0.12), 0 22px 70px rgba(35, 49, 78, 0.08);
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.chip {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.chip:hover,
.chip:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
}

.actions {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.generate-button {
  display: inline-flex;
  min-width: 168px;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: var(--radius);
  padding: 14px 28px;
  background: var(--blue);
  color: white;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(23, 105, 232, 0.24);
}

.generate-button:hover {
  background: var(--blue-dark);
}

.generate-button:disabled {
  cursor: wait;
  opacity: 0.78;
}

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.36);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.is-loading .spinner {
  display: block;
}

.status {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.output-section {
  padding: 32px 0 76px;
}

.section-heading {
  margin-bottom: 18px;
}

h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  letter-spacing: 0;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 4px;
  background: var(--soft);
}

.tab {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 8px 16px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.tab.is-active {
  background: var(--paper);
  color: var(--blue);
  box-shadow: 0 1px 6px rgba(23, 32, 51, 0.08);
}

.code-panel {
  border: 1px solid var(--line);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  background: var(--code);
  overflow: hidden;
}

.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 12px 16px;
  background: var(--code-soft);
  color: white;
  font-weight: 700;
}

.copy-button {
  min-width: 72px;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  cursor: pointer;
}

.copy-button:hover {
  background: rgba(255, 255, 255, 0.15);
}

pre {
  margin: 0;
  overflow: auto;
}

code {
  display: block;
  min-height: 340px;
  padding: 22px;
  color: #edf4ff;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.94rem;
  line-height: 1.65;
  white-space: pre;
}

.token-keyword {
  color: #8fb8ff;
}

.token-string {
  color: var(--green);
}

.token-comment {
  color: #8491aa;
}

.token-annotation {
  color: var(--gold);
}

.token-type {
  color: var(--rose);
}

.explanation {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--soft);
}

.explanation h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.explanation p {
  margin: 0;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 34px;
  color: var(--muted);
  text-align: center;
}

.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;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 0;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .hero {
    padding-top: 44px;
  }

  .tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .code-panel {
    border-radius: 0 0 var(--radius) var(--radius);
  }
}
