/* ═══════════════════════════════════════════════
   PoetMind App Theme
   app.poetmind.com
   ═══════════════════════════════════════════════ */

/* ── Tokens ──────────────────────────────────── */
:root {
  --pm-black:      #0f0f0f;
  --pm-ink:        #1a1a1a;
  --pm-charcoal:   #2d2d2d;
  --pm-stone:      #8a7a6a;
  --pm-warm:       #faf8f3;
  --pm-cream:      #f5f2eb;
  --pm-border:     #e5e1d8;
  --pm-border-lt:  #f0ece4;
  --pm-text:       #1a1a1a;
  --pm-muted:      #888;
  --pm-faint:      #bbb;
  --pm-serif:      Georgia, 'Times New Roman', serif;
  --pm-sans:       -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --pm-mono:       'Courier New', Courier, monospace;
  --pm-radius:     10px;
  --pm-radius-sm:  6px;
  --pm-shadow:     0 2px 16px rgba(0,0,0,0.07);
  --pm-shadow-lg:  0 8px 40px rgba(0,0,0,0.12);
  --pm-max:        1100px;
  --pm-content:    680px;

  /* Tier colors */
  --pm-free:       #888;
  --pm-fellow:     #2a5a9a;
  --pm-laureate:   #1a5c2a;
}

/* ── Reset ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--pm-sans);
  background: var(--pm-warm);
  color: var(--pm-text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--pm-stone); text-decoration: none; }
a:hover { color: var(--pm-ink); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ── Layout ──────────────────────────────────── */
.pm-wrap  { max-width: var(--pm-max);     margin: 0 auto; padding: 0 24px; }
.pm-prose { max-width: var(--pm-content); margin: 0 auto; padding: 0 24px; }

/* ── Header ──────────────────────────────────── */
.pm-header {
  background: var(--pm-black);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #222;
}

.pm-header-inner {
  max-width: var(--pm-max);
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.pm-logo {
  font-family: var(--pm-serif);
  font-size: 17px;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.04em;
  font-style: italic;
}

.pm-logo span { color: var(--pm-stone); }

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

.pm-nav a {
  padding: 6px 14px;
  font-size: 14px;
  color: #aaa;
  border-radius: var(--pm-radius-sm);
  transition: all 0.12s;
}

.pm-nav a:hover { color: #fff; background: #222; }
.pm-nav a.active { color: #fff; }

.pm-nav-write {
  background: var(--pm-stone) !important;
  color: #fff !important;
  font-weight: 500;
}

.pm-nav-write:hover { background: #7a6a5a !important; }

.pm-header-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pm-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--pm-charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #aaa;
  flex-shrink: 0;
}

.pm-tier-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}
.pm-tier-dot.free     { background: var(--pm-free); }
.pm-tier-dot.fellow   { background: var(--pm-fellow); }
.pm-tier-dot.laureate { background: var(--pm-laureate); }

/* ── Hero ────────────────────────────────────── */
.pm-hero {
  background: var(--pm-black);
  color: #fff;
  padding: 80px 24px;
  text-align: center;
}

.pm-hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pm-stone);
  margin-bottom: 16px;
}

.pm-hero h1 {
  font-family: var(--pm-serif);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 18px;
  color: #fff;
}

.pm-hero h1 em { color: var(--pm-stone); font-style: italic; }

.pm-hero p {
  font-size: 17px;
  color: #888;
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.pm-hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────── */
.pm-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 22px;
  border-radius: var(--pm-radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: none;
  transition: all 0.12s;
  white-space: nowrap;
}

.pm-btn-primary  { background: #fff; color: var(--pm-ink); }
.pm-btn-primary:hover  { background: #f0f0f0; color: var(--pm-ink); }
.pm-btn-dark     { background: var(--pm-ink); color: #fff; }
.pm-btn-dark:hover { background: var(--pm-charcoal); color: #fff; }
.pm-btn-stone    { background: var(--pm-stone); color: #fff; }
.pm-btn-stone:hover { background: #7a6a5a; color: #fff; }
.pm-btn-outline  { background: transparent; color: #888; border: 1px solid #333; }
.pm-btn-outline:hover { border-color: #888; color: #fff; }
.pm-btn-sm { padding: 7px 14px; font-size: 12px; }
.pm-btn-lg { padding: 14px 28px; font-size: 16px; }

/* ── Cards ───────────────────────────────────── */
.pm-card {
  background: #fff;
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  padding: 24px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pm-card:hover {
  border-color: #c5bfb5;
  box-shadow: var(--pm-shadow);
}

/* ── Feed grid ───────────────────────────────── */
.pm-feed {
  padding: 48px 0;
}

.pm-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.pm-feed-title {
  font-family: var(--pm-serif);
  font-size: 22px;
  font-weight: 400;
}

.pm-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pm-filter {
  padding: 5px 13px;
  border: 1px solid var(--pm-border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--pm-muted);
  background: #fff;
  cursor: pointer;
  transition: all 0.1s;
}

.pm-filter:hover { border-color: var(--pm-stone); color: var(--pm-ink); }
.pm-filter.active { background: var(--pm-ink); color: #fff; border-color: var(--pm-ink); }

.pm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* Poem card in feed */
.pm-poem-card { cursor: pointer; }

.pm-poem-card-title {
  font-family: var(--pm-serif);
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 4px;
  color: var(--pm-ink);
}

.pm-poem-card-author {
  font-size: 12px;
  color: var(--pm-muted);
  margin-bottom: 14px;
}

.pm-poem-card-preview {
  font-family: var(--pm-serif);
  font-size: 15px;
  line-height: 1.9;
  color: #666;
  white-space: pre-wrap;
  border-left: 2px solid var(--pm-border);
  padding-left: 12px;
  overflow: hidden;
  max-height: 110px;
}

.pm-poem-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--pm-border-lt);
}

.pm-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  background: var(--pm-cream);
  color: var(--pm-stone);
  border: 1px solid var(--pm-border);
}

.pm-read-link {
  font-size: 12px;
  color: var(--pm-muted);
}
.pm-read-link:hover { color: var(--pm-ink); }

/* ── Single poem ─────────────────────────────── */
.pm-single {
  padding: 60px 0;
}

.pm-poem-header { margin-bottom: 32px; }

.pm-poem-title {
  font-family: var(--pm-serif);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 8px;
}

.pm-poem-byline {
  font-size: 14px;
  color: var(--pm-muted);
}

.pm-poem-byline a { color: var(--pm-stone); }

.pm-poem-body { margin: 0; }

.pm-poem-text {
  font-family: var(--pm-serif);
  font-size: 20px;
  line-height: 2.2;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}

/* Font variants */
.pm-font-sans-serif .pm-poem-text { font-family: var(--pm-sans); }
.pm-font-monospace  .pm-poem-text { font-family: var(--pm-mono); font-size: 16px; }

/* Spacing variants */
.pm-spacing-compact     .pm-poem-text { line-height: 1.7; }
.pm-spacing-comfortable .pm-poem-text { line-height: 2.1; }
.pm-spacing-airy        .pm-poem-text { line-height: 2.7; }

/* Alignment */
.pm-align-left   .pm-poem-text { text-align: left; }
.pm-align-center .pm-poem-text { text-align: center; }
.pm-align-right  .pm-poem-text { text-align: right; }

.pm-poem-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--pm-border-lt);
}

.pm-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--pm-muted);
  margin-bottom: 32px;
}
.pm-back:hover { color: var(--pm-ink); }

/* ── Poet profile ────────────────────────────── */
.pm-profile {
  padding: 48px 0;
}

.pm-profile-hero {
  background: var(--pm-black);
  color: #fff;
  border-radius: var(--pm-radius);
  padding: 36px 40px;
  margin-bottom: 32px;
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.pm-profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--pm-charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  color: #888;
  flex-shrink: 0;
  border: 2px solid #333;
}

.pm-profile-name {
  font-family: var(--pm-serif);
  font-size: 30px;
  font-weight: 400;
  color: #fff;
  margin-bottom: 6px;
}

.pm-profile-bio {
  font-size: 14px;
  color: #aaa;
  line-height: 1.6;
  max-width: 500px;
  margin-bottom: 10px;
}

.pm-profile-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #666;
  flex-wrap: wrap;
}

/* ── Editor ──────────────────────────────────── */
.pm-editor-page {
  padding: 40px 0;
}

.pm-editor-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

.pm-editor-main { }

.pm-editor-title {
  width: 100%;
  font-family: var(--pm-serif);
  font-size: 32px;
  font-weight: 400;
  border: none;
  outline: none;
  background: transparent;
  padding: 0;
  margin-bottom: 16px;
  color: var(--pm-ink);
  border-bottom: 1px solid var(--pm-border);
  padding-bottom: 12px;
}

.pm-editor-title::placeholder { color: var(--pm-faint); }

.pm-editor-textarea {
  width: 100%;
  min-height: 400px;
  font-family: var(--pm-serif);
  font-size: 19px;
  line-height: 2;
  border: none;
  outline: none;
  background: transparent;
  resize: none;
  color: var(--pm-ink);
  white-space: pre-wrap;
}

.pm-editor-textarea::placeholder { color: var(--pm-faint); font-style: italic; }

.pm-editor-panel {
  background: #fff;
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  padding: 20px;
  position: sticky;
  top: 72px;
}

.pm-editor-panel-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pm-faint);
  margin-bottom: 16px;
}

.pm-field { margin-bottom: 14px; }
.pm-field label { display: block; font-size: 12px; color: var(--pm-muted); margin-bottom: 5px; font-weight: 500; }

.pm-select, .pm-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-sm);
  font-size: 13px;
  background: var(--pm-warm);
  color: var(--pm-ink);
  font-family: var(--pm-sans);
}

.pm-select:focus, .pm-input:focus {
  outline: none;
  border-color: var(--pm-stone);
  background: #fff;
}

.pm-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--pm-border-lt);
}

/* ── Account / Registration ──────────────────── */
.pm-auth-page {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.pm-auth-box {
  background: #fff;
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  padding: 40px 44px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--pm-shadow-lg);
}

.pm-auth-logo {
  text-align: center;
  font-family: var(--pm-serif);
  font-size: 20px;
  color: var(--pm-stone);
  font-style: italic;
  margin-bottom: 28px;
}

.pm-auth-title {
  font-family: var(--pm-serif);
  font-size: 24px;
  font-weight: 400;
  text-align: center;
  margin-bottom: 6px;
}

.pm-auth-sub {
  font-size: 14px;
  color: var(--pm-muted);
  text-align: center;
  margin-bottom: 28px;
}

.pm-form-field { margin-bottom: 16px; }
.pm-form-field label { display: block; font-size: 13px; font-weight: 500; color: var(--pm-ink); margin-bottom: 6px; }
.pm-form-input {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--pm-border);
  border-radius: var(--pm-radius-sm);
  font-size: 14px;
  background: var(--pm-warm);
  color: var(--pm-ink);
  transition: border-color 0.12s;
  font-family: var(--pm-sans);
}
.pm-form-input:focus { outline: none; border-color: var(--pm-stone); background: #fff; }

.pm-form-submit {
  width: 100%;
  padding: 12px;
  background: var(--pm-ink);
  color: #fff;
  border: none;
  border-radius: var(--pm-radius-sm);
  font-size: 15px;
  font-weight: 500;
  margin-top: 8px;
  transition: background 0.12s;
}
.pm-form-submit:hover { background: var(--pm-charcoal); }

.pm-auth-footer {
  text-align: center;
  font-size: 13px;
  color: var(--pm-muted);
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--pm-border-lt);
}

/* ── Account dashboard ───────────────────────── */
.pm-account {
  padding: 48px 0;
}

.pm-account-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
}

.pm-account-nav {
  background: #fff;
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  overflow: hidden;
  position: sticky;
  top: 72px;
}

.pm-account-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  font-size: 13px;
  color: var(--pm-muted);
  border-bottom: 1px solid var(--pm-border-lt);
  transition: all 0.1s;
}
.pm-account-nav a:last-child { border-bottom: none; }
.pm-account-nav a:hover { background: var(--pm-warm); color: var(--pm-ink); }
.pm-account-nav a.active { background: var(--pm-warm); color: var(--pm-ink); font-weight: 500; }

.pm-account-section {
  background: #fff;
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  padding: 28px;
  margin-bottom: 20px;
}

.pm-account-section h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}

.pm-account-section p {
  font-size: 13px;
  color: var(--pm-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.pm-api-key-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--pm-warm);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-sm);
  font-family: var(--pm-mono);
  font-size: 13px;
  color: var(--pm-ink);
  word-break: break-all;
}

/* ── Pricing ─────────────────────────────────── */
.pm-pricing-page { padding: 72px 0; }

.pm-pricing-header {
  text-align: center;
  margin-bottom: 52px;
}

.pm-pricing-header h1 {
  font-family: var(--pm-serif);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 400;
  margin-bottom: 10px;
}

.pm-pricing-header p {
  font-size: 18px;
  color: var(--pm-muted);
}

.pm-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.pm-tier {
  background: #fff;
  border: 1.5px solid var(--pm-border);
  border-radius: var(--pm-radius);
  padding: 32px 28px;
}

.pm-tier.featured {
  border-color: var(--pm-ink);
  box-shadow: var(--pm-shadow-lg);
}

.pm-tier-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pm-stone);
  margin-bottom: 8px;
}

.pm-tier-price {
  font-size: 38px;
  font-weight: 700;
  color: var(--pm-ink);
  margin-bottom: 2px;
  line-height: 1;
}

.pm-tier-price span { font-size: 16px; font-weight: 400; color: var(--pm-muted); }
.pm-tier-annual { font-size: 13px; color: #2e7d32; margin-bottom: 3px; }
.pm-tier-saving { font-size: 12px; color: var(--pm-muted); margin-bottom: 20px; }

.pm-tier-tagline {
  font-size: 14px;
  color: #555;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--pm-border-lt);
  line-height: 1.5;
}

.pm-tier-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.pm-tier-features li {
  font-size: 13px;
  color: #444;
  display: flex;
  gap: 9px;
  line-height: 1.4;
}

.pm-tier-features li .on  { color: #2e7d32; font-weight: 700; flex-shrink: 0; }
.pm-tier-features li .off { color: #ddd; flex-shrink: 0; }

.pm-tier-cta {
  display: block;
  width: 100%;
  padding: 12px;
  text-align: center;
  border-radius: var(--pm-radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  transition: all 0.12s;
}

.pm-tier-cta.free     { background: var(--pm-cream); color: var(--pm-muted); }
.pm-tier-cta.fellow   { background: var(--pm-ink);   color: #fff; }
.pm-tier-cta.laureate { background: #1a3a24;          color: #fff; }
.pm-tier-cta:hover { opacity: 0.9; }

/* ── Footer ──────────────────────────────────── */
.pm-footer {
  background: var(--pm-black);
  color: #666;
  padding: 32px 24px;
  text-align: center;
  font-size: 13px;
  margin-top: 60px;
}

.pm-footer a { color: var(--pm-stone); }
.pm-footer-logo {
  font-family: var(--pm-serif);
  font-style: italic;
  color: #fff;
  font-size: 18px;
  margin-bottom: 10px;
}

/* ── Notices ─────────────────────────────────── */
.pm-notice {
  padding: 12px 16px;
  border-radius: var(--pm-radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
}
.pm-notice-success { background: #e8f5e9; color: #1a5c2a; border: 1px solid #c8e6c9; }
.pm-notice-error   { background: #fdecea; color: #c62828; border: 1px solid #ffcdd2; }
.pm-notice-info    { background: #faf8f3; color: var(--pm-stone); border: 1px solid var(--pm-border); }

/* ── Utilities ───────────────────────────────── */
.pm-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--pm-faint);
  margin-bottom: 10px;
}

.pm-divider { border: none; border-top: 1px solid var(--pm-border-lt); margin: 28px 0; }

.pm-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--pm-muted);
  font-style: italic;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 768px) {
  .pm-editor-layout  { grid-template-columns: 1fr; }
  .pm-account-grid   { grid-template-columns: 1fr; }
  .pm-tiers          { grid-template-columns: 1fr; }
  .pm-profile-hero   { flex-direction: column; gap: 16px; padding: 24px; }
  .pm-auth-box       { padding: 28px 24px; }
  .pm-hero           { padding: 56px 24px; }
}

@media (max-width: 480px) {
  .pm-grid { grid-template-columns: 1fr; }
  .pm-nav a:not(.pm-nav-write):not([style*="color:#fff"]) { display: none; }
}

/* ── Hero feature grid responsive ── */
.pm-hero-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 700px;
  margin: 48px auto 0;
  text-align: left;
}

@media (max-width: 600px) {
  /* Hero feature cards stack on mobile */
  .pm-hero [style*="grid-template-columns:repeat(3"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  /* Quick actions bar wraps nicely */
  .pm-wrap [style*="Quick actions"] {
    flex-direction: column;
    align-items: flex-start;
  }
}
