/* ===========================================================================
   OneDollarAI
   Motif: paid tickets and till receipts. The product is sold in small
   denominations, so the interface borrows from the things that record small
   payments: perforated tickets, tear lines, monospaced stamps.
   =========================================================================== */

:root {
  --ink:    #1A1B25;
  --wash:   #EEF1F8;
  --paper:  #FFFFFF;
  --cobalt: #2B4EFF;
  --stamp:  #FFC93C;
  --line:   #D8DCE8;
  --good:   #12805C;
  --bad:    #C2334D;
  --muted:  #5C6178;

  --display: 'Space Grotesk', system-ui, sans-serif;
  --body:    'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, monospace;

  --r:  10px;
  --rl: 16px;
  --shadow:    0 1px 2px rgba(26,27,37,.06), 0 8px 24px rgba(26,27,37,.06);
  --shadow-lg: 0 2px 4px rgba(26,27,37,.08), 0 18px 48px rgba(26,27,37,.12);
  --wrap: 1140px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 16.5px;
  line-height: 1.62;
  color: var(--ink);
  background: var(--wash);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -.018em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 5.2vw, 3.1rem); }
h2 { font-size: clamp(1.45rem, 3.4vw, 2.05rem); }
h3 { font-size: 1.12rem; }
h4 { font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; }

p { margin: 0 0 1rem; }

a { color: var(--cobalt); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono  { font-family: var(--mono); }
.small { font-size: .84rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hl { color: var(--cobalt); }
.lead { font-size: 1.12rem; color: #33374a; max-width: 62ch; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.narrow-form { max-width: 460px; margin: 0 auto; }
.pad-m  { padding: 28px 0; }
.pad-l  { padding: 52px 0; }
.pad-xl { padding: 84px 0; }

/* accessibility ---------------------------------------------------------- */
.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: #fff; padding: 12px 18px; z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 2px;
  border-radius: 3px;
}

/* header ----------------------------------------------------------------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.head-inner { display: flex; align-items: center; gap: 18px; height: 66px; }

.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  font-family: var(--mono); font-weight: 500; font-size: .95rem;
  background: var(--stamp); color: var(--ink);
  padding: 3px 8px; border-radius: 5px;
  border: 1.5px solid var(--ink);
}
.brand-text { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; }

.nav { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.nav > a { color: #2c3044; font-size: .94rem; font-weight: 500; }
.nav > a.on { color: var(--cobalt); }

.chip {
  font-family: var(--mono); font-size: .8rem;
  background: var(--wash); border: 1px solid var(--line);
  padding: 4px 10px; border-radius: 999px;
}
.chip-n { font-weight: 500; color: var(--cobalt); }

.burger {
  display: none; margin-left: auto;
  background: none; border: 0; padding: 10px; cursor: pointer;
}
.burger span {
  display: block; width: 22px; height: 2px; margin: 4px 0;
  background: var(--ink); transition: transform .18s ease, opacity .18s ease;
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--body); font-size: .94rem; font-weight: 600;
  padding: 11px 20px; border-radius: var(--r);
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  text-align: center;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-lg { padding: 14px 26px; font-size: 1rem; }
.btn.full { width: 100%; }

.btn-solid { background: var(--cobalt); color: #fff; box-shadow: var(--shadow); }
.btn-solid:hover { background: #1F3EE8; }
.btn-ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn.disabled, .btn:disabled { opacity: .55; pointer-events: none; }
.btn.small { padding: 7px 12px; font-size: .82rem; }

.stack-btns { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.link { color: var(--cobalt); font-weight: 500; }
.linkbtn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--cobalt); font-weight: 500; font-family: var(--mono);
}
.linkbtn:hover { text-decoration: underline; }

/* flash ------------------------------------------------------------------ */
.flashes { padding-top: 16px; }
.flash {
  padding: 12px 16px; border-radius: var(--r); margin-bottom: 10px;
  border-left: 4px solid; font-size: .94rem; background: var(--paper);
}
.flash-good { border-color: var(--good); }
.flash-bad  { border-color: var(--bad); }

/* hero ------------------------------------------------------------------- */
.hero { padding: 64px 0 40px; background:
  radial-gradient(1000px 400px at 15% -10%, rgba(43,78,255,.09), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-block; font-size: .78rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 14px;
}

/* receipt ---------------------------------------------------------------- */
.receipt {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
/* torn bottom edge */
.receipt::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -8px; height: 12px;
  background:
    radial-gradient(circle at 6px -2px, transparent 6px, var(--paper) 6px) 0 0/12px 12px repeat-x;
}
.receipt-head {
  display: flex; justify-content: space-between;
  font-size: .8rem; color: var(--muted);
  padding-bottom: 12px; border-bottom: 1px dashed var(--line); margin-bottom: 14px;
}
.receipt-line {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 5px 0; font-size: .93rem;
}
.receipt-line.total { font-weight: 700; font-size: 1.06rem; }
.receipt-rule { border-top: 1px dashed var(--line); margin: 12px 0; }
.receipt-foot { font-size: .78rem; color: var(--muted); text-align: center; margin: 10px 0 0; }
.receipt-out { margin-top: 26px; }

/* ticket ----------------------------------------------------------------- */
.ticket-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
}
.ticket {
  display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--rl);
  box-shadow: var(--shadow);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.ticket:hover {
  text-decoration: none; transform: translateY(-3px);
  box-shadow: var(--shadow-lg); border-color: #B9C0D6;
}
.ticket-top { padding: 20px 20px 14px; flex: 1; }
.ticket-cat {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted);
}
.ticket-top h3 { margin: 7px 0 6px; }
.ticket-top p { font-size: .9rem; color: var(--muted); margin: 0; }

/* the perforation: notches either side, dashes between */
.ticket-tear { position: relative; height: 1px; background: transparent; margin: 0 0 2px; }
.ticket-tear::before,
.ticket-tear::after {
  content: ''; position: absolute; top: -7px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--wash); border: 1px solid var(--line);
}
.ticket-tear::before { left: -8px;  clip-path: inset(0 0 0 50%); }
.ticket-tear::after  { right: -8px; clip-path: inset(0 50% 0 0); }
.ticket-stub {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 20px 17px;
  border-top: 1px dashed var(--line);
}
.stamp {
  font-size: .78rem; background: var(--stamp);
  padding: 3px 9px; border-radius: 4px; border: 1px solid rgba(26,27,37,.22);
}
.go { font-size: .82rem; color: var(--cobalt); }

/* sections --------------------------------------------------------------- */
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 18px; margin-bottom: 22px; flex-wrap: wrap;
}
.sec-head h1, .sec-head h2 { margin: 0; }

.band { background: var(--paper); border-block: 1px solid var(--line); padding: 56px 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 28px; }
.step-n { color: var(--cobalt); font-size: .84rem; }
.step h3 { margin: 6px 0 6px; }
.step p { color: var(--muted); font-size: .94rem; margin: 0; }

.cat-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }
.cat-card {
  background: var(--paper); color: var(--ink); padding: 20px;
  border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .14s ease, transform .14s ease;
}
.cat-card:hover { text-decoration: none; border-color: var(--cobalt); transform: translateY(-2px); }
.cat-card h3 { margin: 0 0 6px; }
.cat-card p { font-size: .88rem; color: var(--muted); margin: 0 0 8px; }

.cta-panel {
  background: var(--ink); color: #fff;
  border-radius: var(--rl); padding: 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 30px;
  flex-wrap: wrap;
}
.cta-panel h2 { margin: 0 0 8px; }
.cta-panel .lead { color: #C9CDDE; margin: 0; }

/* forms ------------------------------------------------------------------ */
.tool-form { margin: 22px 0; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: .93rem; margin-bottom: 6px; }
.req { color: var(--bad); }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=search], textarea, select {
  width: 100%; font-family: var(--body); font-size: 1rem;
  padding: 11px 13px; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line); border-radius: var(--r);
  transition: border-color .14s ease, box-shadow .14s ease;
}
textarea.mono, input.mono { font-family: var(--mono); font-size: .9rem; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--cobalt);
  box-shadow: 0 0 0 3px rgba(43,78,255,.14);
}
textarea { resize: vertical; min-height: 100px; }
.help { margin: 6px 0 0; }
input.mini { width: 74px; padding: 6px 8px; font-family: var(--mono); }

.checks { display: flex; gap: 22px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; }

.hp { position: absolute; left: -9999px; }   /* honeypot */

.searchbar { display: flex; gap: 10px; margin: 20px 0; }
.searchbar input { flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 26px; }
.pill {
  font-size: .84rem; padding: 6px 13px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--line); color: #2c3044;
}
.pill:hover { text-decoration: none; border-color: var(--ink); }
.pill.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* tool page -------------------------------------------------------------- */
.crumbs { color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }

.tool-grid { display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: start; }
.run-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 8px 0 10px; }

.output {
  font-family: var(--mono); font-size: .9rem; line-height: 1.66;
  white-space: pre-wrap; word-wrap: break-word;
  margin: 0; padding: 4px 0; max-height: 620px; overflow-y: auto;
}
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* "printing" sweep while the model is generating */
.sweep { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; margin-bottom: 12px; }
.sweep::after {
  content: ''; display: block; height: 100%; width: 38%;
  background: var(--cobalt); border-radius: 2px;
  animation: print 1.05s ease-in-out infinite;
}
@keyframes print {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}
.is-busy { opacity: .6; pointer-events: none; }

.err-box {
  margin-top: 22px; padding: 14px 16px; border-radius: var(--r);
  background: #FDF1F3; border-left: 4px solid var(--bad); font-size: .94rem;
}

.tool-side { display: grid; gap: 16px; position: sticky; top: 86px; }
.side-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r); padding: 20px; margin-bottom: 16px;
}
.side-card h2 { font-size: 1.05rem; }
.side-card h3 { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: .74rem; }
.price-stamp { font-size: 1.5rem; font-weight: 500; margin: 4px 0 12px; }

.ticks { list-style: none; padding: 0; margin: 0 0 16px; }
.ticks li { position: relative; padding-left: 24px; margin-bottom: 8px; font-size: .92rem; }
.ticks li::before {
  content: '✓'; position: absolute; left: 0; top: -1px;
  color: var(--good); font-weight: 700;
}
.side-links { list-style: none; padding: 0; margin: 0; }
.side-links li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.side-links li:last-child { border: 0; }

.faq { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: .96rem; }
.faq[open] summary { color: var(--cobalt); }
.faq p { margin: 10px 0 2px; color: #33374a; font-size: .94rem; }

.prose h2 { margin-top: 1.5em; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 7px; }
.prose code {
  font-family: var(--mono); font-size: .86em;
  background: var(--wash); padding: 2px 5px; border-radius: 4px;
}

/* pricing ---------------------------------------------------------------- */
.plan-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); margin: 30px 0; }
.plan {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--rl); padding: 26px; position: relative;
  display: flex; flex-direction: column;
}
.plan h2 { font-size: 1.2rem; }
.plan-featured { border: 2px solid var(--cobalt); box-shadow: var(--shadow-lg); }
.plan-flag {
  position: absolute; top: -11px; left: 22px;
  background: var(--stamp); color: var(--ink);
  font-size: .72rem; padding: 3px 10px; border-radius: 4px;
  border: 1px solid rgba(26,27,37,.25);
}
.plan-price { font-size: 2.1rem; font-weight: 500; margin: 4px 0 2px; }
.plan-price .per { font-size: .95rem; color: var(--muted); }
.plan .ticks { flex: 1; margin-top: 14px; }

/* tables and stats ------------------------------------------------------- */
.stat-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 24px 0; }
.stat {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  padding: 15px 20px; min-width: 128px; flex: 1;
}
.stat-n { display: block; font-size: 1.5rem; font-weight: 500; }
.stat-l { font-size: .8rem; color: var(--muted); }

.table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: .92rem; }
.table th {
  text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }

.tag {
  font-family: var(--mono); font-size: .74rem;
  padding: 2px 8px; border-radius: 999px; border: 1px solid;
}
.tag-done    { color: var(--good); border-color: rgba(18,128,92,.35);  background: rgba(18,128,92,.07); }
.tag-failed  { color: var(--bad);  border-color: rgba(194,51,77,.35);  background: rgba(194,51,77,.07); }
.tag-pending { color: var(--muted); border-color: var(--line);         background: var(--wash); }

.deflist dt { font-weight: 600; color: var(--muted); margin-top: 12px; }
.deflist dd { margin: 4px 0 0; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }

.pager { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0; }
.pager a, .pager span {
  padding: 5px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper);
}
.pager .on { background: var(--ink); color: #fff; border-color: var(--ink); }

.empty {
  background: var(--paper); border: 1px dashed var(--line); border-radius: var(--r);
  padding: 34px; text-align: center; color: var(--muted);
}

.admin-nav { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.admin-nav a { color: var(--muted); }
.admin-nav a.on { color: var(--cobalt); font-weight: 500; }

.spark { display: flex; align-items: flex-end; gap: 4px; height: 90px; margin: 10px 0; }
.spark-bar { flex: 1; background: var(--cobalt); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .82; }

/* footer ----------------------------------------------------------------- */
.site-foot { background: var(--paper); border-top: 1px solid var(--line); margin-top: 60px; padding: 44px 0 0; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px; padding-bottom: 30px; }
.foot-grid h4 { color: var(--muted); margin-bottom: 12px; }
.foot-grid a { display: block; color: #2c3044; font-size: .92rem; padding: 3px 0; }
.foot-base {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding: 16px 20px; color: var(--muted);
}

/* ------------------------------------------------------------------ mobile */
@media (max-width: 980px) {
  .tool-grid { grid-template-columns: 1fr; }
  .tool-side { position: static; }
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .hero-receipt { max-width: 400px; }
  .two-col { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 20px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .burger { display: block; }
  .nav {
    display: none; position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 10px 20px 18px; box-shadow: var(--shadow-lg);
  }
  .nav.open { display: flex; }
  .nav > a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: 12px; }
  .chip { align-self: flex-start; margin: 10px 0; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .pad-l { padding: 34px 0; }
  .pad-xl { padding: 48px 0; }
  .cta-panel { padding: 26px; }
  .foot-grid { grid-template-columns: 1fr; gap: 20px; }
  .stat { min-width: 100%; }
  .ticket-grid { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .stack-btns .btn { width: auto; flex: 1; min-width: 140px; }
  .searchbar { flex-direction: column; }
  /* tables scroll rather than squash */
  .table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* respect the OS setting: no sweep, no lift, no slide */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
      transition-duration: .001ms !important; }
  .btn:hover, .ticket:hover, .cat-card:hover { transform: none; }
}

@media print {
  .site-head, .site-foot, .tool-side, .result-actions, .tool-form { display: none; }
  body { background: #fff; }
  .receipt { box-shadow: none; border: 0; }
}
