*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #fbfbf9;
  --text: #0b0b0b;
  --muted: #4a4a4a;
  --line: #0b0b0b;
  --muted-line: #dcdcdc;
  --font-display: "Space Grotesk", "Manrope", system-ui, -apple-system, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  position: relative;
}

.background-grid {
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(
      to right,
      rgba(0, 0, 0, 0.04) 0,
      rgba(0, 0, 0, 0.04) 1px,
      transparent 1px,
      transparent 140px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.04) 0,
      rgba(0, 0, 0, 0.04) 1px,
      transparent 1px,
      transparent 140px
    );
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: rgba(251, 251, 249, 0.96);
  border-bottom: 2px solid var(--line);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 20px;
  text-transform: uppercase;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.logo img {
  height: 32px;
  object-fit: contain;
  filter: grayscale(1);
}

.logo-link {
  display: inline-flex;
  text-decoration: none;
  color: inherit;
}

.slogan {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.slogan-rotate {
  font-weight: 800;
  color: var(--text);
  padding: 2px 8px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #fff;
  transition: opacity 0.4s ease, transform 0.4s ease;
  display: inline-block;
  min-width: 88px;
  text-align: center;
}

.slogan-rotate.fade {
  opacity: 1;
  transform: translateY(-6px);
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.nav-link,
.nav-cta,
.dropdown-link {
  color: var(--text);
  text-decoration: none;
  padding: 9px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.nav-link:hover,
.dropdown-link:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #000;
}

.nav-cta {
  background: #0c0c0c;
  color: #f9f9f7;
  box-shadow: 4px 4px 0 #000;
}

.nav-group {
  position: relative;
}

.nav-link-button {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 10px;
  font: inherit;
  cursor: pointer;
  padding: 9px 12px;
  text-transform: uppercase;
}

.nav-dropdown {
  position: absolute;
  top: 115%;
  left: 0;
  padding: 8px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 10px;
  display: none;
  min-width: 180px;
  box-shadow: 6px 6px 0 #000;
}

.nav-group:hover .nav-dropdown {
  display: grid;
  gap: 8px;
}

main {
  position: relative;
  z-index: 1;
  padding: 26px 32px 120px;
  max-width: 1200px;
  margin: 0 auto;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-saved,
.page-my-prompts {
  margin-top: 32px;
}

.page-library h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  text-transform: uppercase;
}

.library-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.library-head .pill-row {
  justify-content: flex-end;
  flex: 1;
}

.library-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 2px solid var(--line);
}

.library-link:hover {
  background: #0b0b0b;
  color: #fbfbf9;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 32px 0 56px;
  min-height: 70vh;
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 6vw, 56px);
  letter-spacing: -0.04em;
  margin: 10px 0 14px;
  line-height: 1.05;
  text-transform: uppercase;
}

.hero-center {
  text-align: center;
}

.hero-center h1 {
  line-height: 1.15;
}

.lede {
  color: var(--muted);
  max-width: 640px;
}

.eyebrow {
  color: var(--text);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.18em;
  font-weight: 800;
  margin: 0;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 800;
  border: 2px solid var(--line);
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: #fff;
  color: var(--text);
  box-shadow: 4px 4px 0 #000;
}

.button.primary {
  background: #0c0c0c;
  color: #f9f9f7;
}

.button.ghost {
  background: #fff;
}

.button:hover {
  transform: translate(-2px, -2px);
}

.mini-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.pill {
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-weight: 700;
  background: #fff;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  row-gap: 6px;
}

.hero-visual .panel {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 8px 8px 0 #000;
}

.panel-title {
  text-transform: uppercase;
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.18em;
  font-weight: 800;
}

.panel-body {
  margin-top: 12px;
}

.panel-text {
  font-family: var(--font-display);
  font-size: 20px;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.pill-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.section {
  margin: 80px 0;
  padding-top: 10px;
  border-top: 2px solid var(--line);
}

.section-head h2 {
  font-size: clamp(26px, 4vw, 38px);
  margin: 8px 0;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

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

.feature-card {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 6px 6px 0 #000;
}

.card-kicker {
  font-weight: 800;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.card-body {
  color: var(--muted);
  margin: 0;
}

.feature-note {
  margin-top: 14px;
  color: var(--muted);
  font-weight: 700;
}

.page-prompts .prompt-box {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 8px 8px 0 #000;
}

.prompt-header {
  margin-bottom: 14px;
}

.prompt-title {
  font-weight: 800;
  font-size: 18px;
  text-transform: uppercase;
}

.prompt-subtitle {
  color: var(--muted);
  margin-top: 4px;
}

.input-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.prompt-form textarea {
  width: 100%;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 12px;
  font-family: var(--font-body);
  font-size: 15px;
  resize: vertical;
}

.prompt-form textarea:focus {
  outline: none;
  box-shadow: 6px 6px 0 #000;
}

.prompt-form input[type="text"] {
  width: 100%;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 12px;
  font-family: var(--font-body);
  font-size: 15px;
}

.prompt-form input[type="text"]:focus {
  outline: none;
  box-shadow: 6px 6px 0 #000;
}

.prompt-form input[type="password"],
.prompt-form input[type="email"] {
  width: 100%;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 12px;
  font-family: var(--font-body);
  font-size: 15px;
}

.prompt-form input[type="password"]:focus,
.prompt-form input[type="email"]:focus {
  outline: none;
  box-shadow: 6px 6px 0 #000;
}

.search-control {
  position: relative;
  display: flex;
  align-items: center;
}

.search-control input[type="text"] {
  padding-right: 46px;
}

.clear-button {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  line-height: 1;
  visibility: hidden;
}

.clear-button:hover {
  color: var(--text);
}

.auth-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-menu {
  position: relative;
}

.avatar-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.auth-controls {
  gap: 6px;
}

.avatar-dropdown {
  position: absolute;
  right: 0;
  top: 110%;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: none;
  flex-direction: column;
  min-width: 200px;
  box-shadow: 6px 6px 0 #000;
  z-index: 5;
}

.avatar-menu.open .avatar-dropdown {
  display: flex;
}

.avatar-email {
  font-weight: 700;
  margin-bottom: 8px;
  word-break: break-all;
}

.dropdown-item {
  background: #f6f6f6;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  font-weight: 700;
}

.dropdown-item + .dropdown-item {
  margin-top: 8px;
}

.dropdown-item:hover {
  background: #0b0b0b;
  color: #fbfbf9;
}

.hint {
  display: inline-block;
  margin-left: 6px;
  font-weight: 800;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  text-align: center;
  line-height: 16px;
  font-size: 12px;
  cursor: help;
  background: #fff;
  position: relative;
}

.hint:hover::after {
  content: attr(title);
  position: absolute;
  top: 24px;
  left: 0;
  background: #0b0b0b;
  color: #fbfbf9;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  width: max-content;
  max-width: 280px;
  z-index: 6;
  white-space: normal;
  box-shadow: 4px 4px 0 #000;
}

.select-ub {
  width: 100%;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 10px;
  font-family: var(--font-body);
  font-size: 15px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #0b0b0b 50%),
    linear-gradient(135deg, #0b0b0b 50%, transparent 50%),
    linear-gradient(to right, #dcdcdc, #dcdcdc);
  background-position: calc(100% - 18px) calc(50% + 2px), calc(100% - 12px) calc(50% + 2px), calc(100% - 28px) 50%;
  background-size: 6px 6px, 6px 6px, 1px 18px;
  background-repeat: no-repeat;
}

.select-ub:focus {
  outline: none;
  box-shadow: 6px 6px 0 #000;
}

.auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.auth-modal[hidden] {
  display: none !important;
}

.auth-panel {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  width: min(440px, 90vw);
  position: relative;
  box-shadow: 10px 10px 0 #000;
}

.auth-form .form-actions {
  margin-top: 14px;
}

.oauth-row {
  margin-top: 10px;
}

.close-button {
  position: absolute;
  right: 12px;
  top: 12px;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

.text-link {
  background: none;
  border: none;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.text-link:hover {
  color: var(--text);
}

.saved-grid,
.my-prompts-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.saved-card,
.my-prompt-card {
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  position: relative;
}

.card-dup {
  position: absolute;
  right: 48px;
  top: 12px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
}

.card-dup:hover {
  background: #0b0b0b;
  color: #fbfbf9;
}

.textarea-with-actions {
  position: relative;
}

.small-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.button.small {
  padding: 6px 10px;
  font-size: 13px;
}

.button.light {
  background: #f6f6f6;
  color: var(--text);
  border: 2px solid var(--muted-line);
}

.button.light:hover {
  box-shadow: 4px 4px 0 #000;
}

.my-prompt-card h3 a {
  color: inherit;
  text-decoration: none;
  border-bottom: 2px solid var(--line);
}

.my-prompt-card h3 a:hover {
  background: #0b0b0b;
  color: #fbfbf9;
}

.editor-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.editor-modal[hidden] {
  display: none !important;
}

.editor-panel {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  width: min(520px, 92vw);
  box-shadow: 10px 10px 0 #000;
  position: relative;
}

.editor-panel .form-actions {
  margin-top: 12px;
}
.card-fav {
  position: absolute;
  right: 12px;
  top: 12px;
  cursor: pointer;
  font-size: 18px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  transition: transform 0.1s ease;
}

.card-fav:hover {
  transform: translateY(-2px);
}

.card-fav.filled {
  background: #0b0b0b;
  color: #fbfbf9;
}

.card-remove {
  position: absolute;
  right: 12px;
  top: 12px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
}

.card-remove:hover {
  background: #0b0b0b;
  color: #fbfbf9;
}

.empty-state {
  margin-top: 14px;
  color: var(--muted);
}

.form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form-col {
  flex: 1;
  min-width: 180px;
}
.prompt-shell {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  white-space: pre-wrap;
  line-height: 1.5;
  margin: 0;
  word-break: break-word;
}

.small {
  font-size: 13px;
}

.placeholder-token {
  background: #fff5d7;
  border: 1px dashed #dba500;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 700;
}

.placeholder-list {
  margin-top: 6px;
}

.placeholder-list code {
  background: #f6f6f6;
  border-radius: 6px;
  padding: 2px 6px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.status {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.prompt-result {
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: #fff;
}

.result-title {
  font-weight: 800;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.result-body {
  white-space: pre-wrap;
  color: var(--text);
  line-height: 1.6;
  margin: 0;
}

.result-body.error {
  border-left: 4px solid var(--line);
  padding-left: 10px;
  background: #f0f0f0;
  font-style: italic;
}

.placeholder {
  color: var(--muted);
}

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

.library-item {
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  box-shadow: 6px 6px 0 #000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.hidden {
  display: none !important;
}

.library-section {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 2px solid var(--line);
}

.library-sentinel {
  height: 8px;
}

.library-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.section-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.list {
  margin: 0;
  padding-left: 16px;
  color: var(--muted);
}

.site-footer {
  max-width: 1200px;
  margin: 0 auto 48px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  color: var(--text);
  gap: 16px;
  border-top: 2px solid var(--line);
  padding-top: 18px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-title {
  font-weight: 800;
  letter-spacing: -0.01em;
}

.footer-meta {
  font-size: 13px;
  color: var(--muted);
  text-transform: none;
  font-weight: 700;
}

.footer-mail {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--muted-line);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-contact {
  font-size: 13px;
  color: var(--muted);
  text-transform: none;
  font-weight: 700;
}

.footer-mail:hover {
  color: #0c0c0c;
  border-color: var(--text);
}

.footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-weight: 800;
  text-transform: uppercase;
}

.footer-links a {
  color: var(--text);
  text-decoration: none;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.footer-links a:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #000;
}

.link-mail {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--muted-line);
  padding-bottom: 2px;
  font-weight: 700;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.link-mail:hover {
  color: #0c0c0c;
  border-color: var(--text);
}

@media (max-width: 768px) {
  .site-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .nav {
    width: 100%;
    flex-wrap: wrap;
  }

  main {
    padding: 22px;
  }

  .site-footer {
    padding: 0 22px;
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }
}
