/* Holdout — tool.html styles
 * Brand: dawn-sky teal #2C4F5E, golden-hour amber #D4A04D, paper cream #FAF6F0
 * Voice: contemplative, journal-like, quiet
 */

:root {
  --primary: #2C4F5E;
  --primary-dark: #1f3a45;
  --accent: #D4A04D;
  --accent-dark: #b88336;
  --bg: #FAF6F0;
  --bg-card: #FFFFFF;
  --bg-soft: #F2EBDF;
  --text: #1A1F26;
  --text-muted: #5C6470;
  --sage: #B5C5B8;
  --border: #E5DDD0;
  --error: #B33A3A;

  --serif: 'Lora', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, system-ui, sans-serif;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(28, 36, 50, 0.04), 0 0 0 1px rgba(28,36,50,0.04);
  --shadow-md: 0 4px 18px rgba(28, 36, 50, 0.08), 0 0 0 1px rgba(28,36,50,0.04);
  --shadow-lg: 0 12px 40px rgba(28, 36, 50, 0.12), 0 0 0 1px rgba(28,36,50,0.04);
}

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400&family=Inter:wght@400;500;600&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* topnav */
.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}
.topnav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.topnav nav { display: flex; gap: 22px; align-items: center; }
.topnav nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.topnav nav a:hover { color: var(--primary); }
.topnav nav a.cta {
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  border-radius: var(--r-md);
  transition: background 0.15s;
}
.topnav nav a.cta:hover { background: var(--primary-dark); color: white; }

/* layout */
.tool {
  max-width: 760px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

/* hero */
.hero { text-align: center; margin-bottom: 48px; }
.kicker {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-dark);
  font-weight: 600;
  margin-bottom: 18px;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 22px;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent-dark);
}
.lede {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}
.lede-sm {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 6px;
}

/* form */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 36px;
  box-shadow: var(--shadow-md);
}
.field { display: flex; flex-direction: column; margin-bottom: 22px; }
.field .label {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}
.field input,
.field textarea {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(44, 79, 94, 0.12);
}
.field .hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  font-style: italic;
}

button.primary, button.secondary, button.ghost {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
button.primary {
  background: var(--primary);
  color: white;
  width: 100%;
}
button.primary:hover { background: var(--primary-dark); }
button.primary:disabled { opacity: 0.6; cursor: not-allowed; }
button.secondary {
  background: var(--bg-soft);
  color: var(--primary);
  border-color: var(--border);
}
button.secondary:hover { background: var(--sage); }
button.ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
button.ghost:hover { color: var(--primary); border-color: var(--primary); }

/* loading */
.loading { text-align: center; padding: 32px 0; color: var(--text-muted); }
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

.error {
  background: #FBEAEA;
  color: var(--error);
  padding: 14px 18px;
  border-radius: var(--r-md);
  font-size: 14px;
  margin-top: 16px;
  border: 1px solid #E8C8C8;
}

/* result */
.result { margin-top: 32px; }
.essay-card {
  background: linear-gradient(135deg, #FFFFFF 0%, #FAF6F0 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 38px 36px 28px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.essay-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.essay-card header {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
}
.card-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-dark);
  font-weight: 600;
  margin-bottom: 8px;
}
.essay-card h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.card-region {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 4px;
}
.essay-body {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
}
.essay-body p { margin-bottom: 14px; }
.essay-body p:last-child { margin-bottom: 0; }

.next-attempts {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.next-attempts h3 {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-dark);
  margin-bottom: 14px;
}
.next-attempts ol {
  list-style: none;
  counter-reset: attempts;
}
.next-attempts li {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  padding-left: 36px;
  margin-bottom: 12px;
  position: relative;
  counter-increment: attempts;
}
.next-attempts li::before {
  content: counter(attempts);
  position: absolute;
  left: 0;
  top: -2px;
  width: 26px;
  height: 26px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
}

.essay-card footer {
  margin-top: 24px;
  text-align: right;
}
.watermark {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.actions button { flex: 1; min-width: 140px; }

/* waitlist */
.waitlist {
  margin-top: 36px;
  padding: 28px;
  background: var(--bg-soft);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
}
.waitlist h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 8px;
}
.waitlist p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.55;
}
#signup-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
#signup-form input {
  flex: 1;
  min-width: 200px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: white;
  font-size: 14px;
  outline: none;
}
#signup-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(44,79,94,0.12); }
#signup-form button { width: auto; padding: 11px 20px; }
#signup-status { margin-top: 10px; font-size: 13px; }

/* recent */
.recent {
  margin-top: 60px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}
.recent h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  color: var(--primary);
  letter-spacing: -0.01em;
}
.recent-list {
  list-style: none;
  margin-top: 18px;
}
.recent-list li {
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.recent-list li .species {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--primary);
  font-weight: 500;
}
.recent-list li .when {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}
.recent-list li.loading-sm {
  justify-content: center;
  font-style: italic;
}

/* meta / FAQ */
.meta { margin-top: 56px; }
.meta details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin-bottom: 8px;
}
.meta details summary {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  user-select: none;
}
.meta details summary:hover { color: var(--accent-dark); }
.meta details p {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  margin-top: 10px;
}
.meta details p em { color: var(--accent-dark); }

/* footer */
.site-footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}
.site-footer a { color: var(--primary); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* mobile */
@media (max-width: 600px) {
  .topnav { padding: 14px 18px; }
  .topnav nav { gap: 14px; }
  .topnav nav a:not(.cta) { display: none; }
  .tool { padding: 36px 18px 60px; }
  .form-card { padding: 24px 20px; }
  .essay-card { padding: 28px 22px; }
  .essay-card h2 { font-size: 24px; }
  .essay-body { font-size: 16px; }
  .actions { flex-direction: column; }
}
