/* /page/* template stylesheet — design by Tanya (UIX Designer) */
/* See: _reports/from-tanya-donska-expert-uix-designer-23.md     */

:root {
  --bg-page:        #F5F4F1;
  --bg-card:        #FFFFFF;
  --text-primary:   #1A1918;
  --text-secondary: #6B6760;
  --text-heading:   #111110;
  --color-accent:   #2D4EAA;
  --border-subtle:  #E8E6E1;
  --color-error:    #D32F2F;
  --border-error:   #E53935;
  --bg-error-banner:#FFEBEE;
  --border-frozen:  #C8C5BE;
  --color-success:    #1B6B3A;
  --bg-success-banner:#E8F5E9;

  --shadow-card:
    0 1px 3px rgba(0, 0, 0, 0.06),
    0 6px 24px rgba(0, 0, 0, 0.03);
  --shadow-topbar:  0 1px 0 rgba(0, 0, 0, 0.08);

  --radius-card:  20px;
  --radius-code:  4px;
  --radius-pre:   10px;
  --radius-pill:  6px;

  --font-stack:       -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --content-width:    680px;
  --card-padding-h:   56px;
  --card-padding-v:   48px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ───────────────────────────────────────────────────── */
body {
  background: var(--bg-page);
  font-family: var(--font-stack);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-primary);
  min-height: 100vh;
}

/* ── Top bar ────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  height: 56px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 10;
  transition: box-shadow 0.15s ease;
}

.topbar.scrolled { box-shadow: var(--shadow-topbar); }

.brand {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}

/* ── Page wrap ──────────────────────────────────────────────── */
.page-wrap {
  padding: 40px 24px 0;
}

/* ── Content card ───────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--card-padding-v) var(--card-padding-h);
  max-width: var(--content-width);
  margin: 0 auto;
}

/* ── Headings ───────────────────────────────────────────────── */
.card h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text-heading);
  margin-bottom: 8px;
}

.card h2 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--text-heading);
  margin-top: 32px;
  margin-bottom: 8px;
}

.card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-heading);
  margin-top: 24px;
  margin-bottom: 6px;
}

/* ── Body text ──────────────────────────────────────────────── */
.card p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* Effective date line rendered as first <p> after h1 */
.card h1 + p {
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* Divider between header block and body */
.card h1 + p + p,
.card h1 + p + h2 {
  margin-top: 24px;
}

.card hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 24px 0;
}

/* ── Lists ──────────────────────────────────────────────────── */
.card ul {
  padding-left: 24px;
  margin-bottom: 16px;
}

.card li {
  line-height: 1.75;
  color: var(--text-primary);
  margin-bottom: 6px;
}

/* ── Inline code & blocks ───────────────────────────────────── */
.card code {
  font-size: 14px;
  background: var(--bg-page);
  border-radius: var(--radius-code);
  padding: 1px 5px;
}

.card pre {
  background: var(--bg-page);
  border-radius: var(--radius-pre);
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 16px;
}

.card pre code { background: none; padding: 0; border-radius: 0; }

/* ── Links (Ink produces <a> from [text](url)) ──────────────── */
.card a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.card a:hover {
  border-bottom-color: var(--color-accent);
}

/* ── Images ──────────────────────────────────────────────────── */
.card img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-pre);
  margin-bottom: 16px;
}

/* ── Blockquotes ─────────────────────────────────────────────── */
.card blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: 16px;
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-style: italic;
}

.card blockquote p:last-child { margin-bottom: 0; }

/* ── Tables ──────────────────────────────────────────────────── */
.card table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 14px;
}

.card th {
  text-align: left;
  font-weight: 600;
  padding: 10px 12px;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-subtle);
}

.card td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

/* ── Footer ─────────────────────────────────────────────────── */
.page-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 40px 24px 48px;
  font-size: 13px;
  font-weight: 500;
}

.page-footer a {
  color: var(--color-accent);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  transition: background 0.1s ease;
}

.page-footer a:hover { background: var(--border-subtle); }

.page-footer .sep { color: var(--text-secondary); padding: 0 2px; }

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .card {
    border-radius: var(--radius-card);
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .topbar { padding: 0 16px; }

  .page-wrap { padding: 24px 0 0; }

  .card {
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    padding: 32px 20px;
  }
}

/* ── Contact form (/reach-out) ──────────────────────────────── */

.contact-form label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-heading);
  margin-top: 20px;
  margin-bottom: 6px;
  text-align: left;
}

.contact-form label:first-child { margin-top: 0; }

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-stack);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  outline: none;
  transition: border-color 0.15s ease;
  resize: vertical;
}

.contact-form textarea { min-height: 120px; }

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--color-accent);
}

.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.contact-form button {
  display: block;
  margin-left: auto;
  margin-top: 24px;
  padding: 12px 32px;
  font-family: var(--font-stack);
  font-size: 16px;
  font-weight: 600;
  color: #FFFFFF;
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 8px rgba(45, 78, 170, 0.22);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.contact-form button:hover { opacity: 0.85; }

.contact-error {
  background: var(--bg-error-banner);
  border-left: 3px solid var(--border-error);
  color: var(--color-error);
  font-size: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}

/* ── EmailGuard typo prompt ─────────────────────────────────── */
.typo-prompt, .eg-typo-prompt {
  background: #FFF8E1;
  border-left: 3px solid #F59E0B;
  color: #92400E;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
}
.typo-prompt p, .eg-typo-prompt p { margin: 0 0 10px; }
.typo-prompt button, .eg-typo-prompt button {
  display: inline-block;
  margin: 4px 8px 0 0;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #FFFFFF;
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.typo-prompt button.typo-no, .eg-typo-prompt button.eg-typo-no {
  background: transparent;
  color: #92400E;
  border: 1px solid #F59E0B;
}

.success-check {
  color: var(--color-success);
  font-style: normal;
}

/* ── POW Verification UI (/reach-out) ───────────────────────── */
/* UX spec: Tanya Donska (_reports/from-tanya-donska-expert-uix-designer-79.md) */

@keyframes pow-spin {
  to { transform: rotate(360deg); }
}

.pow-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: pow-spin 0.75s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
  flex-shrink: 0;
}

.contact-form button.is-loading {
  cursor: not-allowed;
  opacity: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.contact-form button:disabled {
  cursor: not-allowed;
}

.pow-status-line {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
  text-align: left;
}

.pow-status-line.is-visible {
  opacity: 1;
}

.noscript-warning {
  background: #FFF8E1;
  border-left: 3px solid #F59E0B;
  color: #92400E;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Readonly = POW in-flight; full opacity so user data stays visible */
.contact-form input[readonly],
.contact-form textarea[readonly] {
  border-color: var(--border-frozen);
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  .pow-spinner {
    animation: none;
    border-top-color: #ffffff;
    opacity: 0.7;
  }
}
