/* css/tokens.css */
/* Design tokens — see DESIGN.md. Nothing here is app-specific. */

:root {
  /* Colors */
  --color-fresh-grass: #8ed462;
  --color-cream-paper: #f5f1e4;
  --color-ink-black: #2c2e2a;
  --color-pure-white: #ffffff;
  --color-sandstone: #e0dbce;
  --color-stone-gray: #80827f;
  --color-hairline-mist: #d5d5d4;
  --color-sky-pop: #2ba0ff;
  --color-coral-pop: #ff705d;
  --color-sunshine-pop: #f5e211;

  /* Typography */
  --font-inter: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --text-micro: 14px;
  --text-body-sm: 15px;
  --text-body: 17px;
  --text-body-lg: 18px;
  --text-subheading: 20px;

  /* Radius */
  --radius-small: 10px;
  --radius-mid: 20px;
  --radius-card: 32px;
  --radius-full: 50px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 0.2s;
  --dur-mid: 0.28s;

  /* Layers */
  --z-sheet: 40;
  --z-toast: 60;
}

/* css/base.css */
/* Reset, page canvas and shared primitives used by more than one component. */

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  font-family: var(--font-inter);
  background: var(--color-cream-paper);
  color: var(--color-ink-black);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* The app shell is exactly one viewport tall; the page scrolls only to reach
   the content below it, and stops being scrollable once cards are queued. */
body.is-compact { overflow: hidden; }

button, input { font-family: inherit; }
button { cursor: pointer; }

/* Components toggle visibility with the `hidden` attribute; flex/grid display
   would otherwise win over the UA rule. */
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--color-ink-black);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Shared primitives ---------- */

.scroll-y {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--color-sandstone) transparent;
}
.scroll-y::-webkit-scrollbar { width: 8px; }
.scroll-y::-webkit-scrollbar-thumb {
  background: var(--color-sandstone);
  border-radius: var(--radius-full);
}

.scroll-x {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.scroll-x::-webkit-scrollbar { display: none; }

.ghost-btn {
  padding: 6px 16px;
  border: 1px solid var(--color-hairline-mist);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-stone-gray);
  font-size: var(--text-body-sm);
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.ghost-btn:hover { border-color: var(--color-ink-black); color: var(--color-ink-black); }

.spin {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* css/components/nav.css */
/* Floating pill navigation. */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--color-pure-white);
  border-radius: var(--radius-full);
  /* Logical, not left/right: the whole bar mirrors under dir="rtl". */
  padding: 8px;
  padding-inline-start: 20px;
}

.nav-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nav-mark {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--color-fresh-grass);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-mark svg {
  width: 24px; height: 24px;
  fill: none;
  stroke: var(--color-ink-black);
  stroke-width: 11;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-name {
  font-size: var(--text-body);
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nav-right { display: flex; align-items: center; gap: 8px; flex: none; }

.nav-link {
  font-size: var(--text-body-sm);
  color: var(--color-ink-black);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.nav-link:hover { background: var(--color-cream-paper); }

/* The other nav action is the language switcher — see components/lang.css.
   The "1000+ supported sites" button that used to sit here moved out entirely;
   the rail's own chip already opens that sheet. */

@media (max-width: 620px) {
  .nav { padding: 6px; padding-inline-start: 16px; }
  .nav-name { font-size: var(--text-body-sm); }
  .nav-link { padding: 6px 8px; }
}

/* css/components/lang.css */
/* Language switcher in the nav. The pill borrows the shape the sites button
   used to have; the menu is the one floating surface outside the sheet. */

.lang { position: relative; flex: none; }

.lang-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 14px 10px 16px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-cream-paper);
  color: var(--color-ink-black);
  font-size: var(--text-body-sm); font-weight: 500;
  white-space: nowrap;
  transition: background var(--dur-fast);
}
.lang-btn:hover { background: var(--color-sandstone); }
.lang-btn > svg { width: 16px; height: 16px; flex: none; }

.lang-code { letter-spacing: 0.02em; }

.lang-caret { display: flex; width: 12px; height: 12px; color: var(--color-stone-gray); }
.lang-caret svg { width: 100%; height: 100%; transition: transform var(--dur-fast); }
.lang.is-open .lang-caret svg { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  /* Hangs off the nav's inline end, so it flips sides on its own in Arabic. */
  inset-inline-end: 0;
  z-index: var(--z-sheet);
  min-width: 210px;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  list-style: none;
  background: var(--color-pure-white);
  border: 1px solid var(--color-hairline-mist);
  border-radius: var(--radius-mid);
  box-shadow: 0 12px 32px rgb(44 46 42 / 0.12);
}

.lang-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-small);
  color: var(--color-ink-black);
  font-size: var(--text-body-sm);
  text-decoration: none;
  transition: background var(--dur-fast);
}
.lang-menu a:hover { background: var(--color-cream-paper); }

.lang-name { flex: 1; min-width: 0; }
.lang-tick { color: var(--color-fresh-grass); font-weight: 500; opacity: 0; }
.lang-menu a.is-active { font-weight: 500; }
.lang-menu a.is-active .lang-tick { opacity: 1; }

@media (max-width: 620px) {
  .lang-btn { padding: 9px 12px 9px 13px; }
  .lang-menu { min-width: 190px; }
}

/* css/components/contact.css */
/* Contact Us page: a normal scrolling page, not the one-viewport app shell
   layout.css defines for the composer UI — hence its own wrapper here rather
   than reusing .shell. */

.page-shell {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-card {
  background: var(--color-pure-white);
  border-radius: var(--radius-card);
  padding: 32px 28px;
}

.contact-title {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.contact-body {
  font-size: var(--text-body);
  line-height: 1.5;
  color: var(--color-stone-gray);
  margin-bottom: 24px;
}
/* Second paragraph (scope/response-time expectations) reads as a footnote
   to the friendly first line, not a second headline-weight statement —
   smaller, tighter to the line above it, one margin-bottom for the pair. */
.contact-subbody {
  margin-top: -14px;
  font-size: var(--text-body-sm);
}

.contact-form { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--text-body-sm); color: var(--color-stone-gray); }

.field input,
.field textarea {
  border: 1px solid var(--color-hairline-mist);
  border-radius: var(--radius-mid);
  background: var(--color-cream-paper);
  color: var(--color-ink-black);
  font-family: inherit;
  font-size: var(--text-body);
  padding: 12px 16px;
  outline: none;
  transition: border-color var(--dur-fast);
}
.field input:focus, .field textarea:focus { border-color: var(--color-ink-black); }
.field textarea { resize: vertical; min-height: 120px; }

/* Honeypot: real people never see or fill this. Off-screen via position
   rather than display:none/visibility:hidden — some bots skip fields hidden
   that way but still auto-fill this one. routes/contact.py drops the
   submission silently when it arrives non-empty. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.contact-submit {
  align-self: flex-start;
  margin-top: 4px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-coral-pop);
  color: var(--color-pure-white);
  font-size: var(--text-body);
  font-weight: 500;
  transition: opacity var(--dur-fast), transform 0.1s;
}
.contact-submit:hover:not(:disabled) { opacity: 0.88; }
.contact-submit:active:not(:disabled) { transform: scale(0.97); }
.contact-submit:disabled { background: var(--color-sandstone); color: var(--color-stone-gray); cursor: not-allowed; }

/* Same legal-links row as .seo-foot on the tool pages (templates/partials/
   seo.html) — contact.html doesn't include that partial, so it needs its
   own copy of just the bit it's missing rather than pulling in all of
   seo.css for one line of links. */
.page-foot {
  text-align: center;
  padding-top: 8px;
  font-size: var(--text-body-sm);
  color: var(--color-stone-gray);
}
.page-foot a { color: var(--color-ink-black); text-decoration: underline; }

@media (max-width: 620px) {
  .contact-card { padding: 24px 20px; border-radius: 26px; }
}

/* css/components/toast.css */
/* Transient message, one at a time. */

.toast {
  position: fixed;
  left: 50%; bottom: 24px;
  transform: translate(-50%, 20px);
  z-index: var(--z-toast);
  max-width: calc(100vw - 40px);
  padding: 14px 22px;
  border-radius: var(--radius-full);
  background: var(--color-ink-black);
  color: var(--color-pure-white);
  font-size: var(--text-body-sm); line-height: 1.4;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* Clear the batch action bar, which only exists once cards are queued. */
body.is-compact .toast { bottom: 92px; }
