/* ==========================================================================
   onlineaitool.com — design system
   Light, premium. No framework. Compiled, not CDN.
   ========================================================================== */

:root {
  /* colour */
  --bg:        #fbfbfa;
  --surface:   #ffffff;
  --surface-2: #f6f6f5;
  --ink:       #18181b;
  --ink-2:     #3f3f46;
  --muted:     #71717a;
  --line:      #e6e6e4;
  --line-2:    #d4d4d8;

  --brand:     #4f46e5;
  --brand-600: #4338ca;
  --brand-50:  #eef2ff;
  --brand-100: #e0e7ff;

  --ok:        #15803d;
  --ok-bg:     #f0fdf4;
  --warn:      #b45309;
  --warn-bg:   #fffbeb;
  --err:       #b91c1c;
  --err-bg:    #fef2f2;

  /* type */
  --font-head: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, monospace;

  /* space — 8pt grid */
  --s1: .5rem;  --s2: 1rem;   --s3: 1.5rem;
  --s4: 2rem;   --s5: 3rem;   --s6: 4rem;   --s7: 6rem;

  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;

  --shadow-sm: 0 1px 2px rgba(24,24,27,.05);
  --shadow:    0 1px 3px rgba(24,24,27,.06), 0 8px 24px -12px rgba(24,24,27,.12);
  --shadow-lg: 0 2px 6px rgba(24,24,27,.05), 0 24px 48px -20px rgba(24,24,27,.18);

  --wrap: 1140px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0 0 var(--s2);
  font-weight: 700;
}
h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.1vw, 1.9rem); margin-top: var(--s5); }
h3 { font-size: 1.15rem; margin-top: var(--s4); }
p  { margin: 0 0 var(--s2); }
a  { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { margin: 0 0 var(--s2); padding-left: 1.25rem; }
li { margin-bottom: .4rem; }
code { font-family: var(--font-mono); font-size: .875em; background: var(--surface-2);
       padding: .15em .4em; border-radius: 5px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s3); }
.narrow { max-width: 780px; }

/* ---------- skip link / a11y ---------- */
.skip {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
  padding: .75rem 1.25rem; z-index: 200; border-radius: 0 0 var(--r-sm) 0;
}
.skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251,251,250,.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.head-in { display: flex; align-items: center; gap: var(--s3);
           height: 62px; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s3); }
.brand {
  font-family: var(--font-head); font-weight: 800; font-size: 1.05rem;
  color: var(--ink); letter-spacing: -.03em; text-decoration: none; white-space: nowrap;
}
.brand span { color: var(--brand); }
.nav { display: flex; gap: var(--s3); margin-left: auto; }
.nav a {
  font-size: .875rem; font-weight: 500; color: var(--ink-2); text-decoration: none;
  padding: .35rem 0; border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); text-decoration: none; }
.nav-toggle {
  display: none; margin-left: auto; background: none; border: 1px solid var(--line-2);
  border-radius: var(--r-sm); padding: .45rem .6rem; cursor: pointer; color: var(--ink);
}
@media (max-width: 820px) {
  .nav { display: none; position: absolute; top: 62px; left: 0; right: 0;
         flex-direction: column; gap: 0; background: var(--surface);
         border-bottom: 1px solid var(--line); padding: var(--s1) var(--s3) var(--s2); }
  .nav.open { display: flex; }
  .nav a { padding: .7rem 0; border-bottom: 1px solid var(--line); }
  .nav-toggle { display: block; }
}

/* ---------- breadcrumb ---------- */
.crumb { font-size: .8125rem; color: var(--muted); padding: var(--s3) 0 0; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--brand); }
.crumb span { margin: 0 .4rem; opacity: .5; }

/* ---------- hero ---------- */
.hero { padding: var(--s3) 0 var(--s4); }
.hero p.lede { font-size: 1.0625rem; color: var(--muted); max-width: 62ch; margin-bottom: 0; }
.eyebrow {
  display: inline-block; font-size: .6875rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brand); background: var(--brand-50);
  padding: .3rem .7rem; border-radius: 999px; margin-bottom: var(--s2);
}

/* ---------- cards / panels ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-top: var(--s3); }

/* ---------- the tool ---------- */
.tool { margin: var(--s2) 0 var(--s5); }
.tool-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow); overflow: hidden;
}
.tool-head {
  padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
}
.tool-target { font-family: var(--font-head); font-weight: 700; color: var(--ink); font-size: 1rem; }
.tool-target b { color: var(--brand); }
.tool-body { padding: var(--s4); }

.drop {
  border: 2px dashed var(--line-2); border-radius: var(--r-lg);
  padding: var(--s6) var(--s3); text-align: center; cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
  background: var(--surface-2);
}
.drop:hover { border-color: var(--brand); background: var(--brand-50); }
.drop.over { border-color: var(--brand); background: var(--brand-50); border-style: solid; }
.drop svg { margin: 0 auto var(--s2); color: var(--brand); opacity: .85; }
.drop b { display: block; font-family: var(--font-head); font-size: 1.0625rem; color: var(--ink); margin-bottom: .35rem; }
.drop small { color: var(--muted); font-size: .8125rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-head); font-weight: 600; font-size: .9375rem;
  padding: .7rem 1.4rem; border-radius: var(--r-sm); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); text-decoration: none; }
.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* result */
.result { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: var(--s4); align-items: start; }
@media (max-width: 720px) { .result { grid-template-columns: 1fr; } }
.preview { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
           background: var(--surface-2); min-height: 160px; display: grid; place-items: center; }
.preview img { width: 100%; object-fit: contain; max-height: 340px; }

.stat-row { display: flex; align-items: baseline; justify-content: space-between;
            padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: .9375rem; }
.stat-row:last-child { border-bottom: 0; }
.stat-row dt { color: var(--muted); }
.stat-row dd { margin: 0; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-row dd.good { color: var(--ok); }
.stat-row dd.bad  { color: var(--err); }

.bar { height: 8px; border-radius: 999px; background: var(--surface-2);
       overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; background: var(--brand); width: 0;
           transition: width .35s ease; }

.badge { display: inline-flex; align-items: center; gap: .4rem; font-size: .8125rem;
         font-weight: 600; padding: .35rem .7rem; border-radius: 999px; }
.badge-ok   { background: var(--ok-bg);   color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-err  { background: var(--err-bg);  color: var(--err); }

.controls { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-top: var(--s3); }
label.field { display: flex; flex-direction: column; gap: .3rem; font-size: .8125rem;
              color: var(--muted); font-weight: 500; }
/* 16px minimum on every form control.
   Below 16px, iOS Safari zooms the whole page the moment a field is focused,
   which on a tool site means the layout jumps every time someone taps an input.
   This is the single most common mobile bug on form-heavy pages. */
label.field input, label.field select, label.field textarea,
input[type="text"], input[type="number"], input[type="date"], select, textarea {
  font-family: var(--font-body); font-size: 16px; padding: .55rem .7rem;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface);
  color: var(--ink); min-width: 0; max-width: 100%;
}
label.field input, label.field select { min-width: 120px; }
label.field input[type="checkbox"] { min-width: 0; width: 20px; height: 20px; padding: 0; }
textarea { line-height: 1.5; }
.hidden { display: none !important; }

/* ---------- spec table ---------- */
.table-scroll { overflow-x: auto; margin: 0 0 var(--s2); }
table { border-collapse: collapse; width: 100%; font-size: .9375rem; }
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
th { font-family: var(--font-head); font-weight: 600; color: var(--ink);
     background: var(--surface-2); font-size: .875rem; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }

.verified {
  display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center;
  font-size: .8125rem; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: .6rem .9rem; margin-bottom: var(--s3);
}
.verified b { color: var(--ink-2); font-weight: 600; }

/* ---------- FAQ ---------- */
.faq details {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  padding: 0; margin-bottom: .6rem;
}
.faq summary {
  cursor: pointer; list-style: none; padding: .95rem 1.1rem;
  font-family: var(--font-head); font-weight: 600; color: var(--ink); font-size: .9375rem;
  display: flex; justify-content: space-between; align-items: center; gap: var(--s2);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 1.25rem; line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq .answer { padding: .95rem 1.1rem; color: var(--ink-2); font-size: .9375rem; }
.faq .answer p:last-child { margin-bottom: 0; }

/* ---------- tool grid ---------- */
.grid { display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tile {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: var(--s3); text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tile:hover { border-color: var(--brand); box-shadow: var(--shadow); text-decoration: none;
              transform: translateY(-1px); }
.tile b { display: block; font-family: var(--font-head); color: var(--ink);
          font-size: .9375rem; margin-bottom: .2rem; }
.tile small { color: var(--muted); font-size: .8125rem; line-height: 1.5; display: block; }

.cat-head { display: flex; align-items: center; gap: .7rem; margin: var(--s5) 0 var(--s2); }
.cat-head h2 { margin: 0; }
.cat-head .count { font-size: .8125rem; color: var(--muted); background: var(--surface-2);
                   border: 1px solid var(--line); padding: .15rem .55rem; border-radius: 999px; }

/* ---------- ad slots (reserved now, filled after AdSense approval) ---------- */
.ad-slot { margin: var(--s4) auto; text-align: center; overflow: hidden; }
.ad-slot[data-size="leaderboard"] { min-height: 90px; }
.ad-slot[data-size="rectangle"]   { min-height: 250px; }
.ad-slot::before {
  content: "Advertisement"; display: block; font-size: .625rem; letter-spacing: .1em;
  text-transform: uppercase; color: #b8b8b5; margin-bottom: .35rem;
}
.ad-slot:empty::before { content: ""; }

/* ---------- notes ---------- */
.note {
  border-left: 3px solid var(--brand); background: var(--brand-50);
  padding: var(--s2) var(--s3); border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: .9375rem; margin: var(--s3) 0;
}
.note.privacy { border-left-color: var(--ok); background: var(--ok-bg); }
.note p:last-child { margin-bottom: 0; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); background: var(--surface);
             margin-top: var(--s7); padding: var(--s5) 0 var(--s4); }
.foot-grid { display: grid; gap: var(--s4); grid-template-columns: 1.4fr repeat(4, 1fr); }
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-grid h4 { font-size: .8125rem; text-transform: uppercase; letter-spacing: .08em;
                color: var(--ink); margin-bottom: var(--s2); }
.foot-grid a { display: block; font-size: .875rem; color: var(--muted); padding: .2rem 0; }
.foot-grid a:hover { color: var(--brand); }
.foot-grid p { font-size: .875rem; color: var(--muted); }
.foot-base { border-top: 1px solid var(--line); margin-top: var(--s4); padding-top: var(--s3);
             font-size: .8125rem; color: var(--muted); display: flex; flex-wrap: wrap;
             gap: var(--s2) var(--s3); justify-content: space-between; }

/* ---------- prose (blog) ---------- */
.prose { max-width: 72ch; }
.prose h2 { margin-top: var(--s5); }
.prose img { border-radius: var(--r); border: 1px solid var(--line); margin: var(--s3) 0; }
.prose blockquote { margin: var(--s3) 0; padding-left: var(--s3);
                    border-left: 3px solid var(--line-2); color: var(--muted); font-style: italic; }
.meta { font-size: .8125rem; color: var(--muted); margin-bottom: var(--s3); }

/* ==========================================================================
   Touch and small screens
   ========================================================================== */

/* Comfortable tap targets. WCAG 2.2 asks for 24px minimum; 44px is the
   platform guidance. Desktop keeps the tighter spacing. */
@media (max-width: 900px) {
  .foot-grid a { padding: .55rem 0; }
  .foot-grid { gap: var(--s3); }
  .crumb { font-size: .875rem; }
  .crumb a { display: inline-block; padding: .25rem 0; }
}

/* Phones */
@media (max-width: 560px) {
  body { font-size: 16px; }

  .wrap { padding: 0 1rem; }

  /* The tool is the point of the page — give it the width. */
  .tool-card { border-radius: var(--r-lg); }
  .tool-head { padding: var(--s2) var(--s2); gap: .35rem var(--s2); }
  .tool-target { font-size: .875rem; }
  .tool-body { padding: var(--s2); }

  /* A 4rem drop zone eats the whole screen on a phone. */
  .drop { padding: var(--s4) var(--s2); }
  .drop svg { width: 32px; height: 32px; }
  .drop b { font-size: 1rem; }

  .panel { padding: var(--s3) var(--s2); }

  /* Full-width buttons are easier to hit and read. */
  .controls { gap: .75rem; }
  .controls .btn { width: 100%; }
  .btn { padding: .8rem 1.2rem; min-height: 46px; }

  /* Stack every stat row label above its value so long values never squeeze. */
  .stat-row { flex-wrap: wrap; gap: .15rem; }
  .stat-row dd { text-align: left !important; max-width: 100% !important; }

  .grid { grid-template-columns: 1fr; }
  .cat-head { flex-wrap: wrap; }

  .faq summary { padding: .85rem .9rem; font-size: .9375rem; }
  .faq .answer { padding: .85rem .9rem; }

  th, td { padding: .6rem .7rem; font-size: .875rem; }

  /* Reserved ad space should not push the tool off the first screen. */
  .ad-slot[data-size="leaderboard"] { min-height: 60px; }
  .ad-slot[data-size="rectangle"] { min-height: 200px; }

  .site-foot { margin-top: var(--s5); padding-top: var(--s4); }
  .foot-base { gap: .5rem; }
}

/* Tablets: two columns is right for the tool panel, but the results grid
   should not collapse to a single column as early as the phone rules do. */
@media (min-width: 561px) and (max-width: 1024px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .wrap { padding: 0 1.25rem; }
}

/* Landscape phones: the sticky header eats too much of a short viewport. */
@media (max-height: 480px) and (orientation: landscape) {
  .site-head { position: static; }
}

/* Respect the system setting. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print { .site-head, .site-foot, .ad-slot, .tool { display: none; } }

/* Standalone "See all …" calls to action — inline in prose but functionally
   buttons, so give them a real tap area on touch screens. */
.more-link {
  display: inline-block;
  padding: .4rem 0;
  font-weight: 500;
}
@media (max-width: 900px) {
  .more-link { padding: .6rem 0; }
}
