/* hAI Mail — shared site styles */

:root {
  --bg: #212121;
  --panel: #303030;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.16);
  --text: #ffffff;
  --text-dim: #afafaf;
  --text-mute: #afafaf;
  --text-faint: #8f8f8f;
  --max: 1280px;
  --font: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
a { color: var(--text); }
a:hover { color: #d4d4d4; }
code { background: var(--panel); padding: 2px 6px; border-radius: 5px; font-size: 13px; }

@keyframes bubbleIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spinSlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes scanSweep { 0% { transform: translateY(-100%); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { transform: translateY(280%); opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
/* Scroll reveal — progressive enhancement: sections only start hidden when JS runs,
   so the content is always visible if JS is disabled or IntersectionObserver is missing. */
.js .fade-section { opacity: 0; }
.js .fade-section.is-visible { animation: fadeUp 0.6s ease both; }

/* Header / footer, shared across pages */
.site-header, .site-footer {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max); margin: 0 auto; flex-wrap: wrap; gap: 16px;
}
.site-header { padding: 24px 64px; border-bottom: 1px solid var(--border); }
.site-footer { padding: 40px 64px; border-top: 1px solid var(--border); }
.wordmark { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; text-decoration: none; color: var(--text); }
.nav-link { color: var(--text-mute); font-size: 14px; text-decoration: none; }
.nav-link:hover { color: var(--text); }
.footer-links { display: flex; gap: 24px; font-size: 14px; }
.footer-links a { color: var(--text-mute); text-decoration: none; }
.footer-copy { font-size: 13px; color: #6f6f6f; }

.section { max-width: var(--max); margin: 0 auto; padding: 56px 64px 80px; }
.section-divider { border-top: 1px solid var(--border); }
.eyebrow { font-size: 12px; font-weight: 500; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 12px; }

/* Hero */
.hero { padding: 88px 64px 72px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 22px; max-width: var(--max); margin: 0 auto; }
.pill { font-size: 12px; font-weight: 500; color: var(--text-faint); letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid var(--border-strong); padding: 5px 14px; border-radius: 999px; }
.hero h1 { font-size: 52px; line-height: 1.08; font-weight: 600; letter-spacing: -0.02em; margin: 0; max-width: 740px; }
.hero p { font-size: 17px; line-height: 1.6; color: var(--text-dim); max-width: 680px; margin: 0; }
.hero-cta { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 6px; }
.btn-primary { background: #ffffff; color: #0d0d0d; border: none; font-size: 15px; font-weight: 500; padding: 13px 26px; border-radius: 999px; cursor: pointer; transition: background 0.15s ease; }
.btn-primary:hover { background: #ededed; }
.hint-italic { font-size: 11px; color: var(--text-faint); font-style: italic; max-width: 420px; }

/* Chat bubbles */
.chat-thread { margin-top: 32px; width: 100%; max-width: 580px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.bubble { padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; animation: bubbleIn 0.5s ease both; }
.bubble-user { align-self: flex-end; background: #ffffff; color: #0d0d0d; max-width: 78%; }
.bubble-ai { align-self: flex-start; background: var(--panel); border: 1px solid var(--border); color: var(--text); max-width: 88%; animation-delay: 0.4s; }

/* Search-results widget — mirrors the ChatGPT email_list search view:
   header strip, single-account tag, avatar rows with badges + snippet. */
.widget { margin-top: 16px; width: 100%; max-width: 580px; background: var(--panel); border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; text-align: left; position: relative; }
.widget-scan { position: absolute; left: 0; right: 0; top: 48px; height: 72px; background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.05), transparent); animation: scanSweep 5s linear infinite; pointer-events: none; }
.widget-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.widget-head-title { font-size: 15px; font-weight: 600; flex: 1; }
.widget-updated { font-size: 12px; color: var(--text-faint); }
.widget-icon-btn { color: var(--text-faint); font-size: 14px; line-height: 1; }
.widget-refresh { display: inline-block; animation: spinSlow 3s linear infinite; }
.widget-row-account { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-faint); margin-bottom: 3px; }
.widget-at { opacity: 0.85; }
.widget-row { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.widget-row:last-child { border-bottom: none; }
.widget-avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.09); color: #d4d4d4; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.widget-avatar-glyph { color: var(--text-faint); font-size: 15px; font-weight: 400; }
.widget-row-body { flex: 1; min-width: 0; }
.widget-row-top { display: flex; align-items: center; gap: 8px; }
.widget-from { font-size: 13px; color: var(--text-dim); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget-from-strong { color: var(--text); font-weight: 600; }
.widget-time { font-size: 12px; color: var(--text-faint); margin-left: auto; flex-shrink: 0; }
.widget-badge { font-size: 11px; font-weight: 500; padding: 1px 8px; border-radius: 999px; flex-shrink: 0; line-height: 1.6; }
.widget-badge-warn { background: rgba(224,168,92,0.15); color: #e0b070; }
.widget-badge-alert { background: rgba(232,110,110,0.16); color: #e69090; }
.widget-subject { font-size: 14px; font-weight: 500; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget-snippet { font-size: 13px; color: var(--text-faint); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Ask-it grid */
.ask-lede { font-size: 16px; line-height: 1.6; color: var(--text-dim); max-width: 680px; margin: 0 0 32px; }
.ask-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 48px; }
.ask-item { display: flex; gap: 16px; align-items: baseline; }
.ask-num { font-size: 13px; color: var(--text-faint); font-weight: 500; flex-shrink: 0; }
.ask-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.ask-body { font-size: 14px; line-height: 1.55; color: var(--text-mute); }
.ask-footnote { font-size: 14px; color: var(--text-faint); margin: 32px 0 0; }

/* Bigger picture */
.picture-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.picture-copy { display: flex; flex-direction: column; gap: 18px; }
.picture-copy .eyebrow { margin: 0; }
.picture-copy p { font-size: 16px; line-height: 1.65; color: var(--text-dim); margin: 0; }
.roadmap-label { font-size: 12px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 16px; }
.roadmap-item { padding: 16px 0; border-top: 1px solid var(--border); }
.roadmap-item:last-child { border-bottom: 1px solid var(--border); }
.roadmap-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.roadmap-tag { color: var(--text-faint); font-weight: 400; }
.roadmap-body { font-size: 14px; line-height: 1.55; color: var(--text-mute); }

/* How it works */
.hiw-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 40px; }
.hiw-num { font-size: 13px; color: var(--text-faint); font-weight: 500; margin-bottom: 12px; }
.hiw-title { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.hiw-body { font-size: 14px; line-height: 1.6; color: var(--text-mute); }
.hiw-note { font-style: italic; color: var(--text-faint); }

/* Privacy & security teaser (home) */
.pss-lede { font-size: 16px; line-height: 1.6; color: var(--text-dim); margin: 0 0 32px; }
.pss-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 48px; }
.pss-item { display: flex; gap: 14px; }
.pss-dot { width: 6px; height: 6px; border-radius: 50%; background: #ffffff; margin-top: 8px; flex-shrink: 0; }
.pss-text { font-size: 15px; line-height: 1.6; color: var(--text-dim); }
.pss-link { display: inline-block; margin-top: 32px; font-size: 15px; font-weight: 500; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.3); padding-bottom: 2px; }

/* Privacy policy page */
.pp-layout { display: grid; grid-template-columns: 260px 1fr; max-width: var(--max); margin: 0 auto; gap: 48px; }
.pp-nav { padding: 40px 24px 40px 64px; font-size: 13px; align-self: start; position: sticky; top: 0; }
.pp-nav-label { color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; margin-bottom: 14px; }
.pp-nav-list { display: flex; flex-direction: column; gap: 2px; }
.pp-nav-list a { padding: 7px 10px; border-radius: 8px; color: var(--text-mute); text-decoration: none; }
.pp-nav-list a:hover { color: var(--text); }
.pp-body { padding: 40px 64px 96px 0; max-width: 720px; }
.pp-body p, .pp-body li { color: var(--text-dim); font-size: 15px; line-height: 1.7; }
.pp-updated { font-size: 12px; color: var(--text-faint); margin-bottom: 8px; }
.pp-body h1 { font-size: 36px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 22px; }
.pp-body h2 { font-size: 22px; font-weight: 600; margin: 0 0 16px; border-top: 1px solid var(--border); padding-top: 32px; }
.pp-body h3 { font-size: 16px; font-weight: 600; margin: 0 0 10px; }
.pp-body h4 { font-size: 15px; font-weight: 600; color: #dedede; margin: 0 0 8px; }
.pp-body p { margin: 0 0 18px; }
.pp-body ul { margin: 0 0 20px; padding-left: 20px; }
.pp-glance { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 28px 32px; margin-bottom: 48px; }
.pp-glance h3 { margin-bottom: 16px; }
.pp-glance ul { display: flex; flex-direction: column; gap: 12px; margin: 0; font-size: 14px; }
.pp-glance li { font-size: 14px; }

@media (max-width: 900px) {
  .pp-layout { grid-template-columns: 1fr; }
  .pp-nav { position: static; padding: 24px 24px 0; }
  .pp-body { padding: 24px 24px 64px; max-width: none; }
  .ask-grid, .picture-grid, .hiw-grid, .pss-grid { grid-template-columns: 1fr; }
  .site-header, .hero, .section, .site-footer { padding-left: 24px; padding-right: 24px; }
  .hero h1 { font-size: 38px; }
}

/* Respect users who ask the OS to reduce motion: reveal everything statically and
   stop the decorative loops. */
@media (prefers-reduced-motion: reduce) {
  .js .fade-section { opacity: 1; }
  .js .fade-section.is-visible { animation: none; }
  .bubble { animation: none; }
  .widget-refresh { animation: none; }
  .widget-scan { display: none; }
}
