/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:       #0a0a0a;
  --surface:  #111111;
  --border:   #333333;
  --text:     #e0e0e0;
  --text-dim: #aaaaaa;
  --white:    #ffffff;
  --sans: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Georgia', 'Times New Roman', serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ───────────────────────────────────── */
h1 {
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--white);
  text-wrap: balance;
}
h2 {
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--white);
  text-wrap: balance;
}
p, li { 
  font-size: 1.05rem; 
  text-wrap: pretty;
}

/* ── Layout ───────────────────────────────────────── */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}
section:last-of-type { border-bottom: none; }

/* ── Hero & Header ─────────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4rem 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}
.hero .cta-group {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--white);
  background: transparent;
  border: 1px solid var(--white);
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.btn:hover {
  background: var(--white);
  color: var(--bg);
}
.btn-small {
  padding: 0.5rem 1.25rem;
  font-size: 0.8rem;
}

/* ── Intro / Task ─────────────────────────────────── */
#task .task-text {
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}
#task h2 { margin-bottom: 0.75rem; }

/* ── Writing Area ─────────────────────────────────── */
#write h2 { margin-bottom: 0.75rem; }
.editor-wrap {
  position: relative;
}
.editor {
  width: 100%;
  min-height: 320px;
  padding: 1.5rem;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  resize: vertical;
  outline: none;
  overflow: hidden;
  transition: border-color 0.2s;
}
.editor:focus {
  border-color: var(--text-dim);
}
.editor::placeholder {
  color: var(--text-dim);
  opacity: 0.6;
}
.editor-hint {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}
.editor-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.next-step {
  margin-top: 1.5rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ── Send Section ─────────────────────────────────── */
.send-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin: 1.5rem 0 0.5rem;
  flex-wrap: wrap;
}
.send-flow .icon {
  font-size: 2rem;
  line-height: 1;
}
.send-flow .arrow {
  font-size: 1.6rem;
  color: var(--text-dim);
  line-height: 1;
}
.send-label {
  color: var(--text-dim);
  font-size: 0.95rem;
  text-align: center;
  line-height: 1.6;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  text-wrap: balance;
}

/* ── Samples Section ──────────────────────────────── */
#samples h2 { margin-bottom: 1rem; }
#samples {
  content-visibility: auto;
  contain-intrinsic-size: 0 400px;
}

.sample-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sample-list li {
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}
.sample-list li:hover {
  border-color: var(--text-dim);
}
.sample-list button {
  width: 100%;
  padding: 1rem 1.25rem;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sample-list .author {
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ── Reader Overlay ───────────────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.92);
  overflow-y: auto;
  padding: 3rem 1.5rem;
  will-change: opacity;
  contain: content;
}
.overlay.active { display: block; }

.reader {
  max-width: 660px;
  margin: 0 auto;
  position: relative;
}
.reader-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: 1px solid var(--white);
  color: var(--white);
  font-size: 1.4rem;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  z-index: 110;
}
.reader-close:hover {
  background: var(--white);
  color: var(--bg);
}
.reader-title {
  font-size: 1.6rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--white);
  margin-bottom: 0.3rem;
}
.reader-author {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}
.reader-body {
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.9;
  color: var(--text);
  white-space: pre-wrap;
}

/* ── Footer ───────────────────────────────────────── */
footer {
  padding: 3rem 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}

.submit-wrap {
  margin-bottom: 2rem;
}

.btn-submit {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.82rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.5rem;
  font-family: var(--sans);
  letter-spacing: 0.02em;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.btn-submit:hover {
  opacity: 1;
  color: var(--white);
}

.submit-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.4s ease, margin 0.4s ease;
  margin-top: 0;
  text-align: center;
  font-size: 1rem;
  color: var(--text);
  line-height: 1.6;
}

.submit-content.expanded {
  max-height: 400px;
  opacity: 1;
  margin-top: 1.5rem;
}

.submit-link {
  color: var(--white);
  text-decoration: underline;
  transition: opacity 0.2s;
  display: inline-block;
}
.submit-link:hover {
  opacity: 0.7;
}

.email-copy-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-copy-icon {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.btn-copy-icon:hover {
  color: var(--white);
}

.btn-copy-icon span {
  font-size: 1.2rem;
}

/* ── Toast ────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1.5rem;
  font-size: 0.85rem;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 200;
  pointer-events: none;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Show-more toggle ─────────────────────────────── */
.task-more {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease;
  opacity: 0;
}
.task-more.expanded {
  max-height: 600px;
  opacity: 1;
}
.task-more p {
  color: var(--text-dim);
  margin-bottom: 1rem;
}
.task-more-heading {
  font-size: 1rem;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 0.5rem;
  margin-top: 0.75rem;
}
.btn-toggle {
  margin-top: 0.75rem;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 600px) {
  .hero { min-height: 50vh; padding: 2rem 1rem; }
  section { padding: 1.5rem 0; }
  .editor { min-height: 240px; padding: 1rem; }
}
