/*
 * AskDimitri — shared styles for the public site pages.
 * Colours and fonts come from /css/tokens.css; page-specific rules stay in each
 * page's own <style> block.
 */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
/* A whisper of light at the top of the paper */
body.glow { background: radial-gradient(1100px 480px at 50% -8%, var(--glow) 0%, var(--paper) 62%); }

.page { max-width: 620px; margin: 0 auto; padding: 28px 20px 80px; position: relative; z-index: 1; }
@media (max-width: 380px) { .page { padding-left: 16px; padding-right: 16px; } }

a { color: var(--ink); }

/* Skip link */
.skip { position: absolute; left: 12px; top: -48px; z-index: 10; background: var(--card); color: var(--ink); padding: 8px 14px; border-radius: 6px; border: 1px solid var(--field-border); }
.skip:focus { top: 12px; }

/* Visually hidden, still read by screen readers */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Keyboard focus is always visible */
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 3px; }

/* Navigation */
nav.site { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 56px; }
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.wordmark .delta { font-family: var(--serif); font-size: 32px; color: var(--gold); line-height: 1; }
.wordmark .name { font-size: 15px; font-weight: 500; letter-spacing: 0.01em; }
nav.site .links { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
nav.site .links a { font-size: 14px; color: var(--muted); text-decoration: none; }
nav.site .links a:hover, nav.site .links a[aria-current="page"] { color: var(--ink); }
nav.site .links a.login { color: var(--ink); }

.eyebrow { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 0 0 24px; }

/* Forms */
.reply-card { border-top: 1px solid var(--hairline); margin-top: 44px; padding-top: 30px; }
.reply-card h2 { font-size: 15px; font-weight: 500; margin: 0 0 14px; }
.field { margin-bottom: 12px; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; min-width: 0; }
@media (max-width: 420px) { .field-row { flex-direction: column; gap: 0; } }
.field label, label.field-label { display: block; font-size: 13.5px; font-weight: 500; color: var(--text); margin: 0 0 4px; line-height: 1.4; }
.field label .opt { font-weight: 400; color: var(--muted); }

input[type="text"], input[type="email"], select {
  display: block; width: 100%; height: 48px; padding: 0 14px;
  font-family: var(--sans); font-size: 16px; color: var(--text); /* 16px stops iOS zooming on focus */
  background-color: var(--card); border: 1px solid var(--field-border); border-radius: 8px;
  transition: border-color 0.2s ease;
}
input::placeholder { color: var(--muted); opacity: 1; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2322271f' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center; background-size: 12px 8px;
}
input:hover, select:hover { border-color: var(--ink); }
input:focus-visible, select:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
.field-error { margin: 5px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--danger); }
.field-error:empty { display: none; }

.btn {
  display: block; width: 100%; height: 48px; margin-top: 6px;
  font-family: var(--sans); font-size: 16px; font-weight: 500;
  color: var(--paper); background: var(--ink);
  border: none; border-radius: 8px; cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}
.btn:hover:not(:disabled) { background: var(--delta); transform: translateY(-1px); }
.btn:disabled { opacity: 0.65; cursor: wait; }
.btn.secondary { color: var(--ink); background: var(--card); border: 1px solid var(--field-border); }
.btn.secondary:hover:not(:disabled) { background: var(--tint); }
.btn.secondary:disabled { cursor: not-allowed; }

/* A button that reads as a link */
.link-button {
  display: inline; width: auto; height: auto; margin: 0; padding: 0;
  font: inherit; color: var(--ink); background: none; border: none;
  text-decoration: underline; cursor: pointer;
}
.link-button:disabled { color: var(--muted); text-decoration: none; cursor: default; }

.form-error {
  margin: 12px 0 0; padding: 10px 14px; font-size: 14px; line-height: 1.55;
  color: var(--text); background: var(--danger-bg);
  border: 1px solid var(--danger-line); border-left: 3px solid var(--danger); border-radius: 6px;
}
.form-error[hidden] { display: none; }

.fineprint { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 12px 0 0; }
.fineprint a { color: var(--muted); text-decoration: underline; }

/* Honeypot: off screen for humans, still filled in by bots. Never type=hidden. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Result cards (sent, confirmed, errors) */
.confirm { border: 1px solid var(--hairline); border-radius: 10px; padding: 20px 22px; background: var(--card); }
.confirm[hidden] { display: none; }
.confirm:focus { outline: none; }
.confirm:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.confirm p { margin: 0 0 10px; font-size: 15px; }
.confirm p:last-child { margin-bottom: 0; }
.confirm .big { font-family: var(--serif); font-size: 20px; color: var(--ink); line-height: 1.35; }
.confirm .actions { font-size: 14px; color: var(--muted); }

/* Signature block */
.signature { display: flex; align-items: center; gap: 16px; margin-top: 28px; }
.signature img { width: 96px; height: 96px; border-radius: 50%; display: block; border: 1px solid var(--hairline); flex: 0 0 auto; }
.signature .sig-name { font-family: var(--serif); font-size: 19px; margin: 0 0 4px; }
.signature .sig-creds { font-family: var(--sans); font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }

/* Footer */
footer.site { margin-top: 72px; font-size: 13px; color: var(--muted); line-height: 1.8; }
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--ink); }

/* The drifting Δ watermark behind the paper */
.watermark {
  position: fixed; z-index: 0; pointer-events: none;
  font-family: var(--serif); color: var(--gold); opacity: 0.05;
  font-size: min(72vh, 560px); line-height: 1;
  right: -0.18em; top: 8vh;
  animation: drift 26s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translateY(0) rotate(-2deg); }
  to   { transform: translateY(4vh) rotate(2deg); }
}

/* Entrance: elements settle onto the page like a letter being laid down */
@keyframes settle {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.fade { animation: settle 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.d1 { animation-delay: 0.05s; } .d2 { animation-delay: 0.18s; }
.d3 { animation-delay: 0.32s; } .d4 { animation-delay: 0.5s; }
.d5 { animation-delay: 0.68s; } .d6 { animation-delay: 0.85s; }

/* Pen stroke under a headline */
h1.stroke::after {
  content: ""; display: block; width: 76px; height: 3px;
  background: var(--delta); border-radius: 2px; margin-top: 20px;
  transform-origin: left; animation: stroke 0.9s 0.75s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
@keyframes stroke { from { transform: scaleX(0); } }

/* Scroll reveals, the pulse line and page transitions live in /css/motion.css. */

@media (prefers-reduced-motion: reduce) {
  .watermark, .fade, h1.stroke::after { animation: none !important; }
  .fade { opacity: 1; transform: none; }
  .btn, input, select { transition: none; }
  .btn:hover:not(:disabled) { transform: none; }
}
