/* ── DeepShit — main stylesheet ─────────────────────────────────────────────
   Minimalist light-bg layout: centred portrait card, UI chrome below.
   ────────────────────────────────────────────────────────────────────────── */

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

/* ── Design tokens ──────────────────────────────────────────────────────── */
:root {
  --bg:           #f5f3ef;          /* warm off-white page bg */
  --text:         #1a1a1a;
  --text-muted:   #888;
  --gold:         #c8a96e;
  --gold-dark:    #b8954e;
  --card-size:    420px;            /* square card width on desktop */
  --font-display: 'Cormorant', Georgia, serif;
  --font-ui:      'DM Sans', system-ui, sans-serif;
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Page ───────────────────────────────────────────────────────────────── */
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem 1rem;
  position: relative;
  max-width: 470px;
}
.logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
  text-decoration: none;
}

/* Category strip — hidden until JS confirms 2+ real categories exist */
.cat-strip {
  display: none;   /* JS sets display:flex when there's something to show */
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
  margin-left: auto;
}
.cat-pill {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 100px;
  background: transparent;
  color: rgba(0,0,0,0.4);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.cat-pill:hover,
.cat-pill:focus-visible {
  border-color: var(--gold);
  color: var(--gold-dark);
  outline: none;
}
.cat-pill.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

/* ── Main — centred column ──────────────────────────────────────────────── */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem 2rem;
  width: 100%;
}

/* ── Quote card — the photo with overlaid text ──────────────────────────── */
/*
  Portrait 4:5 ratio (like IG portrait post), max var(--card-size) wide.
  The photo fills the card; text is overlaid at the bottom half.
  On download, the canvas renders 1080×1350 to match this exact ratio.
*/
.quote-card {
  position: relative;
  width: 100%;
  max-width: var(--card-size);
  aspect-ratio: 4 / 5;
  background: #1a1a1a;            /* fallback before image loads */
  overflow: hidden;
  opacity: 0;
  border-radius: 4px;
  transform: translateY(8px);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.quote-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* The Pexels photo — fills the card */
.card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 0.7s var(--ease-out);
}
.card-bg.loaded { opacity: 1; }

/* Gradient scrim — bottom half darkened so text is readable */
.card-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.08) 0%,
    rgba(0,0,0,0.15) 35%,
    rgba(0,0,0,0.72) 70%,
    rgba(0,0,0,0.82) 100%
  );
}

/* Text content over the photo */
.card-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2.6rem 2.5rem 3.0rem 2.5rem ;
}

/* Decorative opening quote mark */
.card-quote-mark {
  font-family: var(--font-display);
  font-size: 8rem;
  line-height: 1;
  color: rgba(255,255,255,0.9);
  margin-bottom: -1.8rem;        /* pull text up close to the mark */
  font-style: normal;
}

blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 4.8vw, 1.8rem);
  font-weight: 600;
  font-style: italic;
  line-height: 1.38;
  color: #fff;
  border: none;
}

.card-author {
  margin-top: 1.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.author-name {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.02em;
}
.author-meta {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
}

/* ── Action row — below the card ────────────────────────────────────────── */
.action-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  margin-top: -1.75rem;
  width: 100%;
  z-index: 99;
  max-width: var(--card-size);
}

.btn-next {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 1.2rem 2rem;
  background: #b8954e;
  color: #fff;
  border: none;
  border-radius: 35px;
  cursor: pointer;
  width: 83%;
  transition: background 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}
.btn-next:hover  { background: #333; }
.btn-next:active { transform: scale(0.98); }
.btn-next:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn-next:disabled { opacity: 0.45; cursor: not-allowed; }

/* Icon buttons row */
.icon-row {
  display: flex;
  gap: 0.6rem;
}
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 40px;
  padding: 0 0.85rem;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 25px;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
  white-space: nowrap;
}
.btn-icon:hover { border-color: var(--text); background: rgba(0,0,0,0.05); }
.btn-icon:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn-icon svg {
  width: 15px; height: 15px;
  stroke: currentColor; fill: none;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}
.btn-label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}


.deep-line{
  margin: 40px auto 120px auto;
  font-size: 0.9rem;
  text-align: center;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem 1.25rem;
  font-size: 0.65rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 0.4rem;
}
footer a { color: var(--text-muted); text-decoration: none; }
footer a:hover { color: var(--gold-dark); }

/* ── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(0.5rem);
  background: rgba(20,20,20,0.92);
  color: #f0ece4;
  font-size: 0.78rem;
  padding: 0.55rem 1.1rem;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Hidden canvas ──────────────────────────────────────────────────────── */
#export-canvas { display: none; }

/* ── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 500px) {
  :root { --card-size: 100vw; }
  header { padding: 1.25rem 1rem 0.75rem; }
  .cat-strip { margin-left: 0; justify-content: center; }
  header { flex-direction: column; gap: 0.5rem; align-items: center; }
  main { padding: 0.75rem 0 1.5rem; }
  .quote-card { border-radius: 0; }
  .action-row { padding: 0 1rem; }
  footer { padding: 0.75rem 1rem 1rem; }
}

/* ── Logo domain suffix ──────────────────────────────────────────────────── */
.logo-domain {
  font-style: normal;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* ── Language dropdown ───────────────────────────────────────────────────── */
.lang-dropdown {
  align-items: center;
  margin-left: auto;
  position: relative;
}

.lang-trigger {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem 0.3rem 0.5rem;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 100px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
  user-select: none;
}
.lang-trigger:hover { border-color: rgba(0,0,0,0.35); background: rgba(0,0,0,0.03); }
.lang-trigger:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.lang-chevron {
  width: 10px;
  height: 10px;
  opacity: 0.5;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.lang-trigger[aria-expanded="true"] .lang-chevron { transform: rotate(180deg); }

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  list-style: none;
  min-width: 140px;
  padding: 0.3rem;
  z-index: 50;
  overflow: hidden;
}
.lang-menu.open { display: block; }

.lang-menu li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 5px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
  transition: background 0.12s ease;
  outline: none;
}
.lang-menu li:hover,
.lang-menu li:focus { background: rgba(0,0,0,0.05); }
.lang-menu li[aria-selected="true"] {
  background: var(--text);
  color: #fff;
}

.flag-img {
  display: inline-block;
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

@media (max-width: 500px) {
  .lang-dropdown { margin-left: 0; }
  .lang-menu { right: auto; left: 0; }
}

/* ── Tagline switcher ────────────────────────────────────────────────────── */
.tagline-wrap {
  width: 100%;
  max-width: 470px;
  text-align: center;
  padding: 0 1.5rem 1.25rem;
  min-height: 1.8rem;
}
.tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  opacity: 0;
  transition: opacity 0.4s ease;
  margin: 0;
}
.tagline.visible { opacity: 1; }

/* ── About section ───────────────────────────────────────────────────────── */
/*
  Visible to search engines (not display:none or visibility:hidden).
  Content collapses via max-height so crawlers still read the text.
  The toggle button reveals it visually.
*/
.about-section {
  width: 100%;
  max-width: 470px;
  margin: 0 auto;
  border-top: 1px solid rgba(0,0,0,0.08);
  scroll-margin-top: 1rem;
}

.about-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.85rem 0;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.about-toggle:hover { color: var(--text); }
.about-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.about-chevron {
  width: 10px;
  height: 10px;
  opacity: 0.5;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.about-toggle[aria-expanded="true"] .about-chevron { transform: rotate(180deg); }

/* Content hidden by default — grid trick avoids reflow scroll jump */
.about-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
  overflow: hidden;
}
.about-body.open {
  grid-template-rows: 1fr;
}
.about-body > .about-content {
  min-height: 0;
  overflow: hidden;
}

.about-content {
  padding: 0.5rem 0 2rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 420px;
}
.about-content h1 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  font-style: italic;
  color: var(--text);
  margin-bottom: 0.85rem;
  line-height: 1.3;
}
.about-content h2 {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  margin: 1.25rem 0 0.5rem;
}
.about-content p { margin-bottom: 0.75rem; }
.about-content a { color: var(--gold-dark); text-decoration: none; }
.about-content a:hover { text-decoration: underline; }
