/* PromptMe, creative writing theme */
:root {
  --ink: #1c2438;
  --ink-soft: #3a4560;
  --ink-muted: #6b7289;
  --parchment: #f4efe6;
  --paper: #fffdf9;
  --paper-deep: #ebe4d7;
  --line: #e0d8c8;
  --line-strong: #cfc5b2;
  --spark: #e4572e;
  --spark-deep: #c9441f;
  --spark-soft: #fff0eb;
  --moss: #2f6f5e;
  --moss-soft: #e8f3ef;
  --sky: #3d6fd8;
  --shadow-sm: 0 1px 2px rgba(28, 36, 56, 0.05);
  --shadow-md: 0 8px 24px rgba(28, 36, 56, 0.08);
  --shadow-lg: 0 18px 50px rgba(28, 36, 56, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --nav-h: 72px;
}

html {
  font-size: 16px;
  position: relative;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(228, 87, 46, 0.10), transparent 55%),
    radial-gradient(900px 420px at 95% 0%, rgba(61, 111, 216, 0.10), transparent 50%),
    radial-gradient(700px 380px at 50% 100%, rgba(47, 111, 94, 0.08), transparent 55%),
    linear-gradient(180deg, #f8f4ec 0%, var(--parchment) 40%, #efe8db 100%);
  background-attachment: fixed;
  line-height: 1.6;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

a {
  color: var(--sky);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--spark);
}

h1, h2, h3, h4, h5, h6,
.display-heading {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
}

/* Layout shell */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(255, 253, 249, 0.82);
  border-bottom: 1px solid rgba(224, 216, 200, 0.85);
  box-shadow: var(--shadow-sm);
}

.site-nav {
  min-height: var(--nav-h);
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none !important;
  color: var(--ink) !important;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--spark) 0%, #f08a4b 55%, #f6c177 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(228, 87, 46, 0.28);
  flex-shrink: 0;
}

.brand-mark svg {
  width: 20px;
  height: 20px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.brand-tag {
  font-size: 0.72rem;
  color: var(--ink-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-nav .navbar-nav .nav-link {
  color: var(--ink-soft) !important;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.55rem 0.9rem !important;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav .navbar-nav .nav-link:hover,
.site-nav .navbar-nav .nav-link:focus {
  color: var(--ink) !important;
  background: rgba(228, 87, 46, 0.08);
}

.site-nav .navbar-toggler {
  border-color: var(--line-strong);
  border-radius: 10px;
}

.site-nav .navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(228, 87, 46, 0.2);
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.auth-actions .nav-link {
  white-space: nowrap;
}

.btn-auth {
  border-radius: 999px !important;
  padding: 0.45rem 1rem !important;
  font-weight: 650 !important;
}

.btn-auth-primary {
  background: var(--ink) !important;
  color: #fff !important;
}

.btn-auth-primary:hover {
  background: var(--ink-soft) !important;
  color: #fff !important;
}

.site-main {
  flex: 1 0 auto;
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 1.5rem 1rem 3rem;
}

.site-main.container,
.site-main > .container,
.site-main > .container-fluid {
  max-width: 1100px;
}

.site-nav > .container,
.site-footer > .container {
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (max-width: 576px) {
  .site-main {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .site-nav > .container,
  .site-footer > .container {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }
}

.site-footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.7);
  backdrop-filter: blur(8px);
  color: var(--ink-muted);
  font-size: 0.9rem;
  padding: 1.25rem 0;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.site-footer a {
  color: var(--ink-soft);
  font-weight: 600;
}

/* Buttons / forms shared */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.15rem rgba(228, 87, 46, 0.25);
}

.form-control, .form-select {
  border-color: var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.form-control:focus, .form-select:focus {
  border-color: rgba(228, 87, 46, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(228, 87, 46, 0.15);
}

.btn-primary {
  --bs-btn-bg: var(--spark);
  --bs-btn-border-color: var(--spark);
  --bs-btn-hover-bg: var(--spark-deep);
  --bs-btn-hover-border-color: var(--spark-deep);
  --bs-btn-active-bg: var(--spark-deep);
  --bs-btn-active-border-color: var(--spark-deep);
}

/* ===== Home landing ===== */
.hero {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  padding: 1rem 0 2rem;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.15fr 0.85fr;
    padding: 2rem 0 3rem;
  }
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--spark);
  background: var(--spark-soft);
  border: 1px solid rgba(228, 87, 46, 0.18);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  margin-bottom: 1.1rem;
}

.hero-kicker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--spark);
  box-shadow: 0 0 0 4px rgba(228, 87, 46, 0.18);
}

.hero h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  margin: 0 0 1rem;
  max-width: 14ch;
}

.hero h1 em {
  font-style: italic;
  color: var(--spark);
  font-weight: 550;
}

.hero-lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 38ch;
  margin: 0 0 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.4rem;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-hero:hover {
  transform: translateY(-1px);
}

.btn-hero-primary {
  background: linear-gradient(135deg, var(--spark) 0%, #f08a4b 100%);
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(228, 87, 46, 0.28);
}

.btn-hero-primary:hover {
  color: #fff !important;
  box-shadow: 0 14px 28px rgba(228, 87, 46, 0.35);
}

.btn-hero-ghost {
  background: rgba(255, 253, 249, 0.8);
  color: var(--ink) !important;
  border: 1px solid var(--line-strong);
}

.btn-hero-ghost:hover {
  background: var(--paper);
  color: var(--ink) !important;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  color: var(--ink-muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hero-panel {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  overflow: hidden;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, var(--spark), #f08a4b 50%, var(--moss));
}

.hero-panel-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}

.hero-panel-quote {
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.45;
  color: var(--ink);
  margin: 0 0 1.25rem;
}

.hero-panel-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line-strong);
  color: var(--ink-muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.feature-grid {
  display: grid;
  gap: 1rem;
  margin: 0.5rem 0 2rem;
}

@media (min-width: 768px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

.feature-card {
  background: rgba(255, 253, 249, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem;
  box-shadow: var(--shadow-sm);
  height: 100%;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 0.9rem;
  font-size: 1.15rem;
}

.feature-icon.spark { background: var(--spark-soft); color: var(--spark); }
.feature-icon.moss { background: var(--moss-soft); color: var(--moss); }
.feature-icon.sky { background: #eaf0ff; color: var(--sky); }

.feature-card h3 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}

.feature-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.section-heading {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto 1.75rem;
}

.section-heading h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0 0 0.6rem;
}

.section-heading p {
  margin: 0;
  color: var(--ink-soft);
}

.cta-band {
  margin-top: 1rem;
  background: linear-gradient(135deg, #243049 0%, #1c2438 55%, #2a3d55 100%);
  color: #f4efe6;
  border-radius: calc(var(--radius) + 4px);
  padding: 2rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-lg);
}

.cta-band h2 {
  color: #fff;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  margin: 0 0 0.4rem;
}

.cta-band p {
  margin: 0;
  color: rgba(244, 239, 230, 0.8);
  max-width: 36ch;
}

/* ===== Prompt tool ===== */
.pm-container {
  max-width: 920px;
  margin: 0 auto;
}

.pm-page-header {
  margin-bottom: 1.5rem;
}

.pm-page-header h1 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin: 0 0 0.45rem;
}

.pm-page-header p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 52ch;
}

.pm-row {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  flex-wrap: wrap;
}

label.pm-label {
  min-width: 4.5rem;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.9rem;
}

input.pm-input,
textarea.pm-textarea {
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
  font-family: inherit;
  background: var(--paper);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input.pm-input:focus,
textarea.pm-textarea:focus {
  outline: none;
  border-color: rgba(228, 87, 46, 0.55);
  box-shadow: 0 0 0 3px rgba(228, 87, 46, 0.14);
}

button.pm-btn {
  background: linear-gradient(135deg, var(--spark) 0%, #ef7a42 100%);
  color: #fff;
  border: 0;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
  font-size: 0.95rem;
  box-shadow: 0 6px 16px rgba(228, 87, 46, 0.22);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}

button.pm-btn:hover:not([disabled]) {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(228, 87, 46, 0.28);
}

button.pm-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

button.pm-btn.pm-secondary {
  background: var(--ink);
  box-shadow: 0 6px 14px rgba(28, 36, 56, 0.16);
}

button.pm-btn.pm-secondary:hover:not([disabled]) {
  background: var(--ink-soft);
  box-shadow: 0 10px 18px rgba(28, 36, 56, 0.2);
}

button.pm-btn.pm-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}

button.pm-btn.pm-ghost:hover:not([disabled]) {
  background: rgba(28, 36, 56, 0.04);
  color: var(--ink);
  box-shadow: none;
  transform: none;
}

.pm-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  background: rgba(255, 253, 249, 0.92);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  backdrop-filter: blur(6px);
}

.pm-card > h3,
.pm-card-header h3 {
  margin: 0;
  font-size: 1.15rem;
}

.pm-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
}

.pm-card-header h3 {
  flex: 1 1 auto;
  min-width: 0;
}

pre.pm-output {
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
  font-family: inherit;
  min-height: 96px;
  padding: 1rem 1.1rem;
  background: linear-gradient(180deg, #faf7f1 0%, #f3ede3 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  line-height: 1.65;
}

.prompt-container {
  position: relative;
}

.prompt-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex: 0 1 auto;
}

.prompt-actions .pm-btn {
  font-size: 0.8rem !important;
  padding: 0.35rem 0.75rem !important;
  box-shadow: none;
}

.muted {
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.pm-story-actions {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}

/* Modals */
.pm-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(28, 36, 56, 0.48);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(3px);
}

.pm-modal-backdrop.open {
  display: flex;
}

.pm-modal {
  background: var(--paper);
  border-radius: calc(var(--radius) + 2px);
  width: min(520px, 100%);
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}

.pm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
}

.pm-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  padding-right: 0;
}

.pm-modal-close {
  background: transparent;
  border: 0;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-muted);
  padding: 0 4px;
  border-radius: 8px;
}

.pm-modal-close:hover {
  color: var(--ink);
  background: rgba(28, 36, 56, 0.06);
}

.pm-modal-body {
  padding: 0.5rem;
  overflow-y: auto;
  flex: 1;
}

.pm-prompt-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pm-prompt-list li button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(224, 216, 200, 0.8);
  padding: 0.85rem 0.75rem;
  cursor: pointer;
  border-radius: 10px;
  font-family: inherit;
}

.pm-prompt-list li button:hover {
  background: var(--spark-soft);
}

.pm-prompt-list .pm-item-title {
  font-weight: 700;
  color: var(--ink);
  display: block;
  margin-bottom: 2px;
}

.pm-prompt-list .pm-item-meta {
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.pm-modal-empty,
.pm-modal-loading,
.pm-modal-error {
  padding: 1.75rem 0.85rem;
  text-align: center;
  color: var(--ink-muted);
}

.pm-modal-error {
  color: #b42318;
}

.pm-modal-form {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pm-modal-form label {
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.pm-modal-form .pm-input {
  width: 100%;
  box-sizing: border-box;
}

.pm-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 0.9rem 1.15rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 700px) {
  .pm-row {
    flex-direction: column;
    align-items: stretch;
  }

  label.pm-label {
    min-width: 0;
  }

  .pm-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .prompt-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .brand-tag {
    display: none;
  }

  .cta-band {
    text-align: center;
    justify-content: center;
  }
}

/* Privacy policy */
.privacy-page {
  max-width: 820px;
}

.privacy-updated {
  margin-top: 0.5rem !important;
}

.privacy-content h2 {
  font-size: 1.25rem;
  margin: 1.75rem 0 0.65rem;
}

.privacy-content h3 {
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 700;
  margin: 1.15rem 0 0.45rem;
  letter-spacing: 0;
}

.privacy-content p,
.privacy-content li {
  color: var(--ink-soft);
}

.privacy-content ul {
  padding-left: 1.25rem;
  margin: 0.4rem 0 0.9rem;
}

.privacy-content li {
  margin-bottom: 0.35rem;
}

.privacy-content strong {
  color: var(--ink);
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}
