/* Writing Prompt Generator — Editorial Magazine style */

:root {
  --ink: #121212;
  --ink-soft: #3a3a3a;
  --muted: #6e6e6e;
  --paper: #f3f3f1;
  --paper-bright: #fafaf8;
  --line: rgba(18, 18, 18, 0.14);
  --line-strong: rgba(18, 18, 18, 0.28);
  --accent: #c8102e;
  --accent-deep: #9e0c24;
  --accent-soft: rgba(200, 16, 46, 0.08);
  --success: #1f6b45;
  --radius: 4px;
  --radius-sm: 2px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Archivo", "Segoe UI", sans-serif;
  --max: 940px;
  --header-h: 64px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.bg-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(105deg, #ecece8 0%, #f6f6f4 42%, #efefed 100%);
  pointer-events: none;
}

.bg-atmosphere::before {
  content: "“";
  position: absolute;
  top: -4vw;
  right: 2vw;
  font-family: var(--font-display);
  font-size: clamp(12rem, 34vw, 28rem);
  line-height: 0.8;
  color: rgba(18, 18, 18, 0.045);
  pointer-events: none;
  user-select: none;
  animation: driftSoft 14s ease-in-out infinite alternate;
}

.bg-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 27px,
    rgba(18, 18, 18, 0.025) 28px
  );
  mask-image: linear-gradient(180deg, black 0%, transparent 70%);
  opacity: 0.7;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.55rem 0.9rem;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: 0.75rem;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(243, 243, 241, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.02rem, 2.4vw, 1.2rem);
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 1px;
  background: var(--accent);
  animation: markPulse 3.4s ease-in-out infinite;
}

.nav {
  display: flex;
  gap: 1.15rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.nav a {
  position: relative;
  padding: 0.2rem 0;
  transition: color 0.2s ease;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--accent);
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

.nav a:hover::after,
.nav a:focus-visible::after {
  transform: scaleX(1);
}

/* Hero */

.hero {
  padding: clamp(2.75rem, 8vw, 5rem) 0 clamp(2rem, 5vw, 3.25rem);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  position: relative;
  animation: riseIn 0.7s ease both;
}

.hero-eyebrow {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 8vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 11ch;
  font-weight: 700;
}

.hero-lead {
  margin: 1.25rem 0 0;
  max-width: 36ch;
  font-size: clamp(1.02rem, 2.3vw, 1.18rem);
  color: var(--ink-soft);
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.75rem;
}

/* Sections */

.section {
  padding: clamp(2.25rem, 5vw, 3.5rem) 0;
}

.section-head {
  margin-bottom: 1.6rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.6vw, 2.25rem);
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.section-head p {
  margin: 0.5rem 0 0;
  color: var(--ink-soft);
  max-width: 48ch;
}

/* Form controls */

.prompt-form,
.timer-panel,
.result-panel {
  animation: riseIn 0.55s ease both;
}

.control-group {
  margin: 0 0 1.4rem;
  padding: 0;
  border: 0;
}

.control-group legend {
  margin-bottom: 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper-bright);
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
  font-size: 0.92rem;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.chip:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.chip:has(input:checked) {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 600;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.7rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent);
}

.btn-secondary {
  background: var(--paper-bright);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--ink);
  background: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--ink);
}

.btn-generate {
  min-width: min(100%, 220px);
  margin-top: 0.35rem;
}

.btn-generate.is-pulse {
  animation: generatePulse 0.45s ease;
}

/* Result */

.result-panel {
  margin-top: 1.75rem;
  padding: 1.35rem 1.4rem 1.15rem;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--paper-bright);
}

.result-panel.is-fresh {
  animation: resultPop 0.45s ease;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.result-meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted);
}

.result-text {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.7vw, 1.55rem);
  line-height: 1.4;
  letter-spacing: -0.015em;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.copy-feedback {
  min-height: 1.25rem;
  margin: 0.65rem 0 0;
  font-size: 0.85rem;
  color: var(--success);
}

/* Timer */

.timer-section {
  border-block: 1px solid var(--line);
  background: #ebebe8;
}

.timer-panel {
  display: grid;
  justify-items: start;
  gap: 1.1rem;
  padding: 1.4rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper-bright);
}

.timer-display {
  font-family: var(--font-display);
  font-size: clamp(3.1rem, 11vw, 4.8rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
}

.timer-display.is-running {
  color: var(--accent);
}

.timer-display.is-finished {
  color: var(--accent-deep);
  animation: finishFlash 0.8s ease;
}

.timer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.timer-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Samples */

.samples {
  border-top: 1px solid var(--line);
}

.sample-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.sample-item {
  padding: 1.1rem 1rem 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

.sample-item h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.sample-item h3::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.45rem;
  background: var(--accent);
  vertical-align: 0.1em;
}

.sample-item p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* About */

.about-inner {
  max-width: 62ch;
}

.about h2 {
  margin: 0 0 0.8rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.025em;
}

.about p {
  margin: 0;
  color: var(--ink-soft);
}

.about-list {
  margin: 1.15rem 0 0;
  padding-left: 1.15rem;
  color: var(--ink-soft);
}

.about-list li + li {
  margin-top: 0.4rem;
}

/* FAQ */

.faq {
  border-top: 1px solid var(--line);
  background: #ecece9;
}

.faq-list {
  display: grid;
  gap: 0;
  max-width: 70ch;
  border-top: 1px solid var(--line-strong);
}

.faq-item {
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  padding: 0.95rem 0;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  list-style: none;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--accent);
  font-family: var(--font-body);
  font-weight: 700;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item p {
  margin: 0.7rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* Footer */

.site-footer {
  padding: 2rem 0 2.6rem;
  border-top: 3px solid var(--ink);
  color: var(--muted);
  font-size: 0.9rem;
  background: var(--paper-bright);
}

.footer-inner p {
  margin: 0;
}

.footer-note {
  margin-top: 0.35rem !important;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.15rem;
  margin-top: 0.95rem;
}

.footer-nav a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-nav a:hover {
  color: var(--accent);
}

.nav a[aria-current="page"] {
  color: var(--accent);
}

/* Inner pages (privacy, contact, terms, 404) */

.page-main {
  padding: clamp(2.25rem, 6vw, 3.75rem) 0 clamp(3rem, 7vw, 4.5rem);
}

.prose {
  max-width: 70ch;
}

.prose h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.prose h2 {
  margin: 2rem 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.prose h3 {
  margin: 1.25rem 0 0.45rem;
  font-size: 1.02rem;
}

.prose p,
.prose li {
  color: var(--ink-soft);
}

.prose a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: var(--accent);
}

.prose ul {
  padding-left: 1.2rem;
}

.prose li + li {
  margin-top: 0.35rem;
}

.page-eyebrow {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.page-meta {
  margin: 0 0 1.5rem !important;
  font-size: 0.9rem;
  color: var(--muted) !important;
}

.page-lead {
  font-size: 1.08rem;
  max-width: 42ch;
}

.contact-panel {
  margin: 1.75rem 0;
  padding: 1.25rem 1.3rem;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--accent);
  background: var(--paper-bright);
}

.contact-panel h2 {
  margin-top: 0;
}

.contact-email {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.contact-note {
  margin-bottom: 0 !important;
  font-size: 0.92rem;
}

.error-page .hero-actions {
  margin-top: 1.5rem;
}

/* Animations */

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes markPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

@keyframes generatePulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(0.98);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes resultPop {
  0% {
    opacity: 0.35;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes finishFlash {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

@keyframes driftSoft {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-1.5vw, 1.2vw, 0);
  }
}

/* Responsive */

@media (max-width: 640px) {
  .nav {
    gap: 0.6rem;
    font-size: 0.68rem;
  }

  .hero-title {
    max-width: none;
  }

  .result-panel,
  .timer-panel {
    padding: 1.1rem;
  }

  .btn-generate {
    width: 100%;
  }

  .faq-item summary::after {
    float: none;
    margin-left: 0.5rem;
  }

  .sample-item {
    padding-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
