:root {
  --bg: #0b0b0c;
  --bg-elev: #111214;
  --bg-soft: #17181b;
  --bg-hover: #1d1f23;
  --text: #f2f2f3;
  --muted: #b3b7bf;
  --line: #2a2d33;
  --line-strong: #3a3e46;
  --accent: #f2f2f3;
  --maxw: 920px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.22);
  --t-fast: 140ms;
  --t-med: 220ms;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select {
  font: inherit;
}

header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: rgba(11, 11, 12, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  user-select: none;
}

nav {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex: 1;
  flex-wrap: wrap;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  border: 1px solid transparent;
}

nav a:hover,
nav a:focus-visible,
nav a.active {
  background: var(--bg-soft);
  color: var(--text);
  border-color: var(--line);
  outline: none;
}

main {
  width: 100%;
  max-width: var(--maxw);
  margin: 34px auto 60px;
  padding: 0 18px;
}

h1 {
  margin: 0 0 10px;
  text-align: center;
  font-size: clamp(1.8rem, 1vw + 1.45rem, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.intro,
p.intro {
  margin: 0 auto 26px;
  max-width: 760px;
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
}

.section {
  margin-top: 18px;
}

.surface {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.divider {
  width: 100%;
  height: 1px;
  background: var(--line);
  margin: 28px 0 0;
}

footer {
  text-align: center;
  padding: 22px 16px;
  color: var(--muted);
  font-size: 0.92rem;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

/* Rules page */
.rules {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rule {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color var(--t-med), background var(--t-med), box-shadow var(--t-med);
}

.rule.open {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.rule__toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  transition: background var(--t-fast);
}

.rule__toggle:hover,
.rule__toggle:focus-visible {
  background: var(--bg-hover);
  outline: none;
}

.rule__title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 700;
  line-height: 1.35;
}

.rule__hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.5;
}

.rule__chev {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
  color: var(--muted);
  transition: transform var(--t-med), color var(--t-med);
}

.rule.open .rule__chev {
  transform: rotate(180deg);
  color: var(--text);
}

.rule__panel {
  height: 0;
  overflow: hidden;
  transition: height var(--t-med) ease;
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
}

.rule__content {
  padding: 16px 18px 18px;
  max-width: 76ch;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--t-fast), transform var(--t-fast);
}

.rule.open .rule__content {
  opacity: 1;
  transform: translateY(0);
}

.rule.closing .rule__content {
  opacity: 0;
  transform: translateY(-4px);
}

.rule__content p {
  margin: 10px 0;
}

.md-quote {
  margin: 12px 0 14px;
  padding: 10px 14px;
  border-left: 3px solid var(--text);
  background: var(--bg-soft);
  border-radius: 8px;
  white-space: pre-wrap;
}

.md-dash {
  list-style: disc;
  padding-left: 22px;
  margin: 12px 0 14px;
}

.md-dash li {
  margin: 8px 0;
  padding-left: 0;
}

.md-dash li::marker {
  color: var(--muted);
}

.md-label {
  margin: 14px 0 6px;
  font-weight: 700;
  color: var(--text);
}

a.inline {
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Generator */
.generator-layout {
  display: grid;
  gap: 18px;
}

.generator-toolbar,
.generator-panel,
.result-card,
.choice-card,
.status-bar,
.prompt-block {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.generator-toolbar {
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.tab-group,
.action-row,
.mode-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-btn,
.primary-btn,
.secondary-btn,
.choice-btn {
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}

.tab-btn,
.secondary-btn,
.choice-btn {
  background: var(--bg-elev);
  color: var(--text);
}

.primary-btn {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 700;
}

.tab-btn:hover,
.secondary-btn:hover,
.choice-btn:hover,
.primary-btn:hover,
.tab-btn:focus-visible,
.secondary-btn:focus-visible,
.choice-btn:focus-visible,
.primary-btn:focus-visible {
  background: var(--bg-hover);
  color: var(--text);
  outline: none;
}

.primary-btn:hover,
.primary-btn:focus-visible {
  border-color: var(--line-strong);
}

.tab-btn.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.generator-panel,
.result-card,
.prompt-block {
  padding: 18px;
}

.panel-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.panel-copy,
.small-note,
.muted,
.status-text,
.meta-text {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.random-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 16px;
}

.mini-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
}

.mini-card h3 {
  margin: 0 0 6px;
  font-size: 0.94rem;
  color: var(--muted);
  font-weight: 600;
}

.mini-card p {
  margin: 0;
  font-size: 0.98rem;
}

.prompt-block {
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
}

.status-bar {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-track {
  height: 8px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
  flex: 1;
  min-width: 120px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--text);
  transition: width var(--t-med);
}

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

.choice-card {
  overflow: hidden;
}

.choice-media {
  aspect-ratio: 16 / 9;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

.choice-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.choice-body {
  padding: 14px;
}

.choice-title {
  margin: 0 0 4px;
  font-size: 1rem;
}

.choice-subtitle {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.94rem;
}

.choice-btn {
  width: 100%;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.stat-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.stat-label {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.stat-value {
  font-weight: 700;
}

.tag-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.tag {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.92rem;
}

.error-box {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #5c2c33;
  background: #221417;
  color: #ffced5;
}

@media (max-width: 760px) {
  .choices-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }

  .logo {
    text-align: center;
  }

  nav {
    justify-content: center;
  }

  main {
    margin: 22px auto 42px;
    padding: 0 14px;
  }

  .rule__toggle,
  .generator-panel,
  .result-card,
  .prompt-block {
    padding-left: 14px;
    padding-right: 14px;
  }

  .generator-toolbar {
    padding: 10px;
  }
}

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


/* About page */
.about-hero {
  padding: 22px;
}

.about-copy {
  margin: 0;
  color: var(--muted);
  max-width: 78ch;
}

.about-copy + .about-copy {
  margin-top: 12px;
}

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

.profile-card {
  overflow: hidden;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}

.profile-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.profile-media {
  padding: 22px 22px 0;
}

.profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.profile-body {
  padding: 18px 22px 22px;
}

.profile-name {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.profile-role {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.profile-desc {
  margin: 0;
  color: var(--text);
  font-size: 0.96rem;
}
