/* PayLorya AI design system shared by every page: tokens (light + dark), type, nav, buttons,
   pills, cards, motion. Page styles (app.css, about.css) use only these tokens for color. */

/* Manrope, self-hosted (variable, weights 200-800; SIL Open Font License, /fonts/OFL.txt). Latin and
   Latin Extended only: other scripts fall back to the system font. A new font file gets a new name
   (-v23), because /fonts/* is cached for a year (public/_headers). */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/manrope-latin-ext-v23.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/manrope-latin-v23.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  /* Surfaces */
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f6f2ea;       /* inset blocks inside a surface */
  --field: #f3efe7;           /* inputs, chips */
  --field-hover: #ece6db;
  --line: #ebe5da;
  /* Text */
  --ink: #1f2328;
  --ink-2: #5f6368;
  --ink-3: #9a9ca1;
  /* Brand */
  --brand: #1f2328;           /* graphite: brand marks, emphasis */
  --brand-soft: #f0ece5;
  --brand-line: #e2dccf;
  --accent: #c2410c;          /* coral (text-safe): success, links, completed */
  --accent-soft: #fdede7;
  --accent-line: #f6cdbd;
  --primary: #1f2328;         /* primary button */
  --on-primary: #ffffff;
  --primary-glow: rgba(31, 35, 40, .22);
  /* Status */
  --danger: #a3133a;
  --danger-soft: #fbe9ee;
  --warn: #8a5a00;
  --warn-soft: #fbf1df;
  /* Elevation */
  --shadow: 0 1px 2px rgba(31, 35, 40, .04), 0 12px 32px rgba(31, 35, 40, .06);
  --shadow-lift: 0 2px 4px rgba(31, 35, 40, .05), 0 18px 40px rgba(31, 35, 40, .09);
  --shadow-chip: 0 1px 2px rgba(31, 35, 40, .05);
  --skeleton-a: #efe9df;
  --skeleton-b: #f7f3ec;
  /* Shape and motion */
  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mark-bg: linear-gradient(180deg, #34383d, #202329); /* logo tile: graphite in both themes, as in the app icon */
  --coral: #fd7b5d;           /* the logo's coral; decorative only */
  --mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121315;
    --surface: #1b1c1f;
    --surface-2: #222327;
    --field: #25262a;
    --field-hover: #2d2e33;
    --line: #2f3034;
    --ink: #f3f1ec;
    --ink-2: #a8a6a1;
    --ink-3: #75736f;
    --brand: #f3f1ec;
    --brand-soft: rgba(243, 241, 236, .1);
    --brand-line: rgba(243, 241, 236, .2);
    --accent: #ff8a6b;
    --accent-soft: rgba(255, 138, 107, .14);
    --accent-line: rgba(255, 138, 107, .3);
    --primary: #c2410c;
    --on-primary: #ffffff;
    --primary-glow: rgba(194, 65, 12, .35);
    --danger: #f43f5e;
    --danger-soft: rgba(244, 63, 94, .14);
    --warn: #e9b356;
    --warn-soft: rgba(233, 179, 86, .14);
    --shadow: 0 0 0 1px rgba(255, 255, 255, .05), 0 12px 32px rgba(0, 0, 0, .4);
    --shadow-lift: 0 0 0 1px rgba(255, 255, 255, .07), 0 18px 40px rgba(0, 0, 0, .5);
    --shadow-chip: 0 0 0 1px rgba(255, 255, 255, .06);
    --skeleton-a: #26272b;
    --skeleton-b: #303136;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121315;
  --surface: #1b1c1f;
  --surface-2: #222327;
  --field: #25262a;
  --field-hover: #2d2e33;
  --line: #2f3034;
  --ink: #f3f1ec;
  --ink-2: #a8a6a1;
  --ink-3: #75736f;
  --brand: #f3f1ec;
  --brand-soft: rgba(243, 241, 236, .1);
  --brand-line: rgba(243, 241, 236, .2);
  --accent: #ff8a6b;
  --accent-soft: rgba(255, 138, 107, .14);
  --accent-line: rgba(255, 138, 107, .3);
  --primary: #c2410c;
  --on-primary: #ffffff;
  --primary-glow: rgba(194, 65, 12, .35);
  --danger: #f43f5e;
  --danger-soft: rgba(244, 63, 94, .14);
  --warn: #e9b356;
  --warn-soft: rgba(233, 179, 86, .14);
  --shadow: 0 0 0 1px rgba(255, 255, 255, .05), 0 12px 32px rgba(0, 0, 0, .4);
  --shadow-lift: 0 0 0 1px rgba(255, 255, 255, .07), 0 18px 40px rgba(0, 0, 0, .5);
  --shadow-chip: 0 0 0 1px rgba(255, 255, 255, .06);
  --skeleton-a: #26272b;
  --skeleton-b: #303136;
}

/* Base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -.005em;
}
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0; }
.muted { color: var(--ink-2); }
.fine { color: var(--ink-3); font-size: 12.5px; margin: 10px 0 0; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
  transition: background-color .4s var(--ease), color .4s var(--ease), border-color .4s var(--ease), box-shadow .4s var(--ease) !important;
}

/* Motion */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
/* Load-time entrance; stagger with style="--d:120ms". */
.reveal { animation: rise .7s var(--ease) both; animation-delay: var(--d, 0ms); }
/* Scroll entrance; web/src/shared/nav.ts adds .in. */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0ms); }
[data-reveal].in { opacity: 1; transform: none; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 10; background: var(--bg); transition: box-shadow .3s; }
.nav.scrolled { box-shadow: 0 1px 0 var(--line); }
.nav-in { display: flex; align-items: center; gap: 12px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.mark { width: 30px; height: 30px; border-radius: 24%; background: var(--mark-bg); color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 700; }
:root[data-theme="dark"] .mark { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mark { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); } }
.logo .tag { font-weight: 500; color: var(--ink-2); }
.nav-links { display: flex; gap: 4px; margin-left: 20px; }
.nav-links a { color: var(--ink-2); font-size: 14px; font-weight: 500; padding: 7px 12px; border-radius: 999px; white-space: nowrap; transition: color .2s, background .2s; }
.nav-links a:hover { color: var(--ink); background: var(--field); }
.nav-links a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-chip); }
.nav-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.status, .chip-sm {
  display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-chip); white-space: nowrap;
}
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: breathe 2.4s ease-in-out infinite; }
.status.off i { background: var(--warn); animation: none; }
.chip-sm { color: var(--ink-2); }
.theme-toggle {
  width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-chip); display: grid; place-items: center; cursor: pointer;
  transition: transform .3s var(--spring), background .2s;
}
.theme-toggle:hover { background: var(--field); }
.theme-toggle:active { transform: scale(.92); }
.theme-toggle svg { transition: transform .5s var(--spring), opacity .3s; }
.theme-toggle .moon { display: none; }
.theme-toggle[aria-pressed="true"] .sun { display: none; }
.theme-toggle[aria-pressed="true"] .moon { display: block; }
.theme-toggle[aria-pressed="true"] svg { transform: rotate(-20deg); }

/* Buttons */
.btn {
  border: 0; border-radius: 999px; padding: 14px 22px; font-weight: 600; font-size: 15px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 18px var(--primary-glow); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px var(--primary-glow); }
/* Small primary pill in the marketing nav ("Open app"); after .btn.primary so its shadow wins. */
.btn.nav-cta { padding: 9px 16px; font-size: 14px; box-shadow: 0 4px 12px var(--primary-glow); }
.btn.ghost { background: var(--field); color: var(--ink); }
.btn.ghost:hover { background: var(--field-hover); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.btn svg { transition: transform .25s var(--ease); }
.btn.primary:hover .arrow { transform: translateX(3px); }
.btn.loading svg { display: none; }
.btn.loading::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.pill .live { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: breathe 1.6s ease-in-out infinite; }
.t-run { background: var(--brand-soft); color: var(--brand); }
.t-ok { background: var(--accent-soft); color: var(--accent); }
.t-done { background: var(--primary); color: var(--on-primary); }
.t-warn { background: var(--warn-soft); color: var(--warn); }
.t-bad { background: var(--danger-soft); color: var(--danger); }

/* Cards */
.card { background: var(--surface); border-radius: var(--r-xl); padding: 28px; box-shadow: var(--shadow); }
.card h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; font-weight: 700; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); border-radius: 999px; padding: 12px 20px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lift); transition: opacity .3s var(--ease), transform .4s var(--spring); max-width: calc(100% - 32px); z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

footer { padding: 8px 0 40px; color: var(--ink-3); font-size: 12.5px; }
footer p { max-width: 820px; margin: 0; }

@media (max-width: 720px) {
  .nav-links { margin-left: 4px; }
  .nav-links a { padding: 7px 9px; }
  .chip-sm { display: none; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .logo .tag { display: none; }
  .nav-in { gap: 6px; }
  .nav-links { gap: 0; margin-left: 0; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-right { flex-shrink: 0; }
  .nav-right .btn { white-space: nowrap; }
  /* The logo already links home; three links and a button overflow narrow screens (/hackathon). */
  .nav-links a[href="/"] { display: none; }
  .status > span { display: none; }
  .status { padding: 14px; }
  .card { padding: 20px; border-radius: 24px; }
}
@media (max-width: 420px) {
  /* Mark only: the wordmark would push the nav links onto two lines. */
  .logo { font-size: 0; gap: 0; }
  .logo .mark { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* The PayLorya AI mark scales with its tile (nav, auth, about, chat avatars). */
/* The P fills the tile as in the app icon (public/brand/paylorya-app-icon.png); the round chat avatar keeps a margin. */
.mark > svg, .bot-av > svg, .side-mark > svg { width: 100%; height: 100%; display: block; }
.bot > svg { width: 86%; height: 86%; }
