/*
 * eingest.com stylesheet.
 *
 * Source file — copied to `site/styles.css` by `npm run site:build`.
 * Brand colors match the extension (src/popup/styles.css). No web fonts or
 * external requests (the Privacy Policy promises no third-party trackers),
 * so the site uses the system font stack. Light/dark follows the visitor's
 * OS setting.
 */

:root {
  --primary: #4361ee;
  --primary-hover: #3a56d4;
  --primary-soft: rgba(67, 97, 238, 0.1);
  --text: #1a1a2e;
  --text-2: #4a4a68;
  --text-3: #6a6a88;
  --bg: #ffffff;
  --bg-alt: #f6f7fb;
  --surface: #ffffff;
  --border: #e4e6ef;
  --shadow-sm: 0 1px 3px rgba(26, 26, 46, 0.08);
  --shadow-md: 0 8px 24px rgba(26, 26, 46, 0.1);
  --radius: 14px;
  --max: 1080px;
  color-scheme: light;
}

/*
 * Dark theme. Applies when the visitor picked dark with the header toggle
 * (`data-theme="dark"` on <html>, set by /theme.js), OR when they haven't
 * picked anything and their OS is in dark mode. Picking light overrides a
 * dark OS. Keep the two blocks identical.
 */
:root[data-theme='dark'] {
  --primary: #6b84ff;
  --primary-hover: #8a9dff;
  --primary-soft: rgba(107, 132, 255, 0.14);
  --text: #ececf4;
  --text-2: #b6b6cc;
  --text-3: #8b8ba3;
  --bg: #12121e;
  --bg-alt: #181828;
  --surface: #1d1d30;
  --border: #2c2c44;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --primary: #6b84ff;
    --primary-hover: #8a9dff;
    --primary-soft: rgba(107, 132, 255, 0.14);
    --text: #ececf4;
    --text-2: #b6b6cc;
    --text-3: #8b8ba3;
    --bg: #12121e;
    --bg-alt: #181828;
    --surface: #1d1d30;
    --border: #2c2c44;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px; /* keep anchored headings clear of the sticky header */
}

/* Pages fill at least the full screen height, so the footer always sits at
   the bottom even on short pages (e.g. the 404). */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--primary);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--primary-hover);
}
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

main {
  flex: 1 0 auto;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  top: 12px;
  color: #fff;
}

/* ── Header ─────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.06em;
  text-decoration: none;
}
.brand:hover {
  color: var(--text);
}
.brand img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.site-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.site-nav a:hover {
  color: var(--text);
  background: var(--primary-soft);
}
.site-nav a[aria-current='page'] {
  color: var(--primary);
  background: var(--primary-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Theme toggle (sun ⇄ moon morph) ────────────────────────────────── */

/*
 * One SVG: a circle (the sun's body / the moon) plus 8 rays. In dark mode a
 * masking circle slides in to carve the crescent, the body grows slightly,
 * and the rays spin and shrink away. Hidden until /theme.js runs (the
 * `hidden` attribute), so visitors without JS never see a dead button.
 */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.theme-toggle[hidden] {
  display: none;
}
.theme-toggle:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: rotate(-12deg);
}
.theme-toggle svg {
  width: 20px;
  height: 20px;
  overflow: visible;
}
.theme-toggle .sun-body {
  transform-origin: center;
  transition: transform 0.5s cubic-bezier(0.5, 1.5, 0.5, 1);
}
.theme-toggle .moon-mask {
  transition: transform 0.5s cubic-bezier(0.3, 1.3, 0.4, 1);
}
.theme-toggle .sun-rays {
  transform-origin: center;
  transition: transform 0.5s cubic-bezier(0.5, 1.5, 0.5, 1), opacity 0.3s ease;
}
:root[data-theme='dark'] .theme-toggle .sun-body {
  transform: scale(1.75);
}
:root[data-theme='dark'] .theme-toggle .moon-mask {
  transform: translate(-7px, 3px);
}
:root[data-theme='dark'] .theme-toggle .sun-rays {
  transform: rotate(-90deg) scale(0.4);
  opacity: 0;
}

/* Circular "reveal" when switching themes (View Transitions API, where
   supported). /theme.js animates the clip-path from the button's position. */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* ── Buttons ────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 18px rgba(67, 97, 238, 0.35);
}
.btn-primary:hover {
  background: var(--primary-hover);
  color: #fff;
  transform: translateY(-1px);
}
.btn-soon {
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
  cursor: default;
}

/* ── Hero ───────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 88px 0 72px;
}
.hero::before {
  content: '';
  position: absolute;
  inset: -40% -20% auto;
  height: 560px;
  background:
    radial-gradient(closest-side, rgba(67, 97, 238, 0.22), transparent 70%) 30% 40% / 60% 100% no-repeat,
    radial-gradient(closest-side, rgba(123, 140, 255, 0.18), transparent 70%) 72% 30% / 50% 90% no-repeat;
  pointer-events: none;
  z-index: -1;
}
/* The logo is a circle with transparent corners. `drop-shadow` follows the
   actual circle; a `box-shadow` would trace the square image box and show
   a faint square border in light mode. */
.hero-logo {
  width: 88px;
  height: 88px;
  margin: 0 auto 24px;
  border-radius: 50%;
  filter: drop-shadow(0 8px 18px rgba(26, 26, 46, 0.18));
}
.eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}
.hero h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 60px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.hero h1 span {
  background: linear-gradient(90deg, var(--primary), #8a6cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lead {
  max-width: 600px;
  margin: 20px auto 32px;
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--text-2);
}
.hero-note {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--text-3);
}

/* ── Sections ───────────────────────────────────────────────────────── */

.section {
  padding: 72px 0;
}
.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-title {
  margin: 0 0 8px;
  text-align: center;
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: -0.01em;
}
.section-lead {
  max-width: 560px;
  margin: 0 auto 40px;
  text-align: center;
  color: var(--text-2);
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.card h3 {
  margin: 14px 0 6px;
  font-size: 18px;
}
.card p {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
}
.card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}
.card-icon svg {
  width: 22px;
  height: 22px;
}
.pill {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

.steps {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
}
.steps li {
  position: relative;
  padding: 24px 24px 24px 76px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-2);
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 24px;
  top: 22px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.cta {
  text-align: center;
}

/* ── Legal pages ────────────────────────────────────────────────────── */

.legal {
  display: grid;
  gap: 40px;
  /* Top/bottom only — the side padding comes from `.container` (a full
     `padding` shorthand here wiped it out and text touched phone edges). */
  padding-top: 48px;
  padding-bottom: 80px;
}
@media (min-width: 960px) {
  .legal {
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: start;
  }
  .toc {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 112px);
    overflow: auto;
  }
}
.toc {
  padding: 18px 20px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}
.toc summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}
.toc ol {
  margin: 12px 0 0;
  padding-left: 20px;
  line-height: 1.5;
}
.toc li {
  margin: 6px 0;
  color: var(--text-3);
}
.toc a {
  color: var(--text-2);
  text-decoration: none;
}
.toc a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.legal-article {
  max-width: 740px;
}
.legal-article h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 32px;
}
.legal-meta span {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-3);
  font-size: 13px;
}
.legal-article h2 {
  margin: 40px 0 10px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 22px;
  letter-spacing: -0.01em;
}
.legal-article h3 {
  margin: 0 0 10px;
  font-size: 18px;
}
.legal-article p,
.legal-article li {
  color: var(--text-2);
}
.legal-article p {
  margin: 0 0 14px;
}
.legal-article ul {
  margin: 0 0 16px;
  padding-left: 22px;
}
.legal-article li {
  margin: 6px 0;
}
.legal-article strong {
  color: var(--text);
}
/* The Privacy Policy's "short version" summary box. */
.legal-article .summary {
  padding: 20px 24px 8px;
  margin-bottom: 8px;
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-radius: var(--radius);
}
.legal-article .summary li {
  color: var(--text);
}
.table-wrap {
  margin: 0 0 18px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.legal-article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.legal-article th,
.legal-article td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.legal-article tr:last-child td {
  border-bottom: none;
}
.legal-article th {
  background: var(--bg-alt);
  color: var(--text);
  font-weight: 600;
}
.legal-article td {
  color: var(--text-2);
}
.back-to-top {
  display: inline-block;
  margin-top: 32px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

/* ── 404 ────────────────────────────────────────────────────────────── */

.not-found {
  padding: 120px 0;
  text-align: center;
}
.not-found h1 {
  margin: 0 0 12px;
  font-size: 48px;
}
.not-found p {
  margin: 0 0 28px;
  color: var(--text-2);
}

/* ── Footer ─────────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  font-size: 14px;
  color: var(--text-3);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 28px;
  padding-bottom: 28px;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.footer-brand img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}
/* Copyright + trademark notice, stacked. Inherits the footer's muted
   --text-3, which is themed for light and dark. */
.footer-legal {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.footer-legal span + span {
  font-size: 12px;
}

/* Small superscript ™ after the wordmark (header brand, hero lead). Uses
   currentColor, so it follows light/dark mode automatically. */
.tm {
  /* Common ™ style: lighter than the name (normal weight, secondary color)
     with a tiny gap, so it reads as a mark rather than part of the word.
     Never smaller than 10px. --text-2 is themed for light and dark. */
  font-size: max(10px, 0.55em);
  font-weight: 400;
  color: var(--text-2);
  vertical-align: super;
  line-height: 0;
  margin-left: 0.15em;
  letter-spacing: 0;
}

/* ™ on the big standalone hero logo: sits at the logo's top-right corner.
   Uses --text-2, themed for light and dark. */
.logo-mark {
  position: relative;
  display: block;
  width: fit-content;
  margin: 0 auto 24px;
}
.logo-mark .hero-logo {
  display: block;
  margin: 0;
}
.logo-mark .tm {
  position: absolute;
  /* The logo is a circle, so the box's corner is empty space — pull the ™
     in toward the circle's edge. */
  top: 10px;
  right: -1px;
  font-size: 13px;
  line-height: 1;
  vertical-align: baseline;
  margin: 0;
  color: var(--text-2);
}
.footer-meta {
  display: flex;
  align-items: center;
  gap: 20px;
}
.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a,
.footer-email {
  color: var(--text-2);
  text-decoration: none;
  white-space: nowrap;
}
.footer-links a:hover,
.footer-email:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Below ~760px the footer stacks, centered:
     © line
     Terms of Service · Privacy Policy
     support@eingest.com */
@media (max-width: 760px) {
  .site-footer .container {
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    text-align: center;
  }
  .footer-brand {
    flex-direction: column;
    gap: 8px;
  }
  .footer-meta {
    flex-direction: column;
    gap: 8px;
  }
  .footer-links {
    justify-content: center;
    gap: 16px;
  }
}

/* ── Small screens ──────────────────────────────────────────────────── */

@media (max-width: 640px) {
  /* The 2-row header below is ~95px tall; leave room so headings reached
     from the table of contents aren't hidden under it. */
  html {
    scroll-padding-top: 120px;
  }
  .container {
    padding-left: 20px;
    padding-right: 20px;
  }
  /* Header becomes a deliberate 2-row layout:
       [logo EINGEST ............ ☀/☾]
       [Home   Terms   Privacy Policy   Contact] */
  .site-header .container {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      'brand toggle'
      'nav nav';
    align-items: center;
    row-gap: 8px;
    height: auto;
    padding-top: 10px;
    padding-bottom: 8px;
  }
  .header-actions {
    display: contents;
  }
  .brand {
    grid-area: brand;
  }
  .theme-toggle {
    grid-area: toggle;
  }
  .site-nav {
    grid-area: nav;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 0;
    margin: 0 -8px;
  }
  .site-nav a {
    padding: 6px 8px;
    white-space: nowrap;
  }
  .hero {
    padding: 56px 0 48px;
  }
  .section {
    padding: 56px 0;
  }
  .legal {
    padding-top: 28px;
    gap: 24px;
  }
  .steps li {
    padding: 20px 20px 20px 68px;
  }
  .steps li::before {
    left: 20px;
    top: 18px;
  }
  .card {
    padding: 20px;
  }
  .btn {
    width: 100%;
    max-width: 360px;
  }
  .legal-article table {
    font-size: 14px;
  }
  .legal-article th,
  .legal-article td {
    padding: 10px 12px;
  }
}

/* Very narrow phones (e.g. iPhone SE, 320–375px): tighten the nav row so
   all four links stay on one line. */
@media (max-width: 380px) {
  .site-nav a {
    padding: 6px 5px;
    font-size: 13px;
  }
  .brand {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .theme-toggle:hover {
    transform: none;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

@media print {
  .theme-toggle,
  .site-header,
  .site-footer,
  .toc,
  .back-to-top,
  .skip-link {
    display: none !important;
  }
  .legal {
    display: block;
    padding: 0;
  }
  body {
    background: #fff;
    color: #000;
  }
}
