/* ==========================================================================
   Quillo — design system + components
   Hand-written, dependency-free CSS. Shared by the landing page and the app.
   ========================================================================== */

:root {
  /* Brand */
  --brand-1: #6366f1;   /* indigo  */
  --brand-2: #8b5cf6;   /* violet  */
  --brand-3: #d946ef;   /* fuchsia */
  --brand:   #6d5efc;
  --brand-ink: #4f46e5;
  --grad: linear-gradient(135deg, var(--brand-1), var(--brand-2) 55%, var(--brand-3));
  --grad-soft: linear-gradient(135deg, rgba(99,102,241,.12), rgba(217,70,239,.10));

  /* Ink + surfaces */
  --ink:      #0f1222;
  --ink-soft: #474d63;
  --muted:    #8b90a6;
  --bg:       #ffffff;
  --bg-soft:  #f6f7fb;
  --bg-tint:  #f2f1fe;
  --card:     #ffffff;
  --line:     #e8e8f1;
  --line-2:   #eef0f6;

  /* State */
  --ok:   #16a34a;
  --warn: #d97706;

  /* Shape */
  --radius:    18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --shadow-sm: 0 1px 2px rgba(16,18,34,.06), 0 1px 1px rgba(16,18,34,.04);
  --shadow:    0 10px 30px -12px rgba(16,18,34,.18);
  --shadow-lg: 0 30px 60px -20px rgba(79,70,229,.28);

  --maxw: 1120px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 .5em; font-weight: 750; }
h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1rem; color: var(--ink-soft); }
a  { color: var(--brand-ink); text-decoration: none; }
img, svg { display: block; max-width: 100%; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ----------------------------------------------------------- Buttons --- */
.btn {
  --b: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 650; font-size: .96rem;
  padding: .72rem 1.15rem; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  white-space: nowrap; text-decoration: none; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px -8px rgba(99,102,241,.7); }
.btn-primary:hover { box-shadow: 0 14px 28px -8px rgba(99,102,241,.8); transform: translateY(-1px); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #d6d6e6; background: var(--bg-soft); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #1d2140; transform: translateY(-1px); }
.btn-lg { padding: .95rem 1.6rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* ----------------------------------------------------------- Badges ---- */
.pill {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .8rem; font-weight: 600; color: var(--brand-ink);
  background: var(--bg-tint); border: 1px solid #e4e2fb;
  padding: .35rem .75rem; border-radius: 999px;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(109,94,252,.18); }

/* ----------------------------------------------------------- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(12px);
  background: rgba(255,255,255,.78);
  border-bottom: 1px solid var(--line-2);
}
.nav { display: flex; align-items: center; gap: 1.5rem; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; color: var(--ink); letter-spacing: -.02em; }
.brand .logo { width: 30px; height: 30px; }
.nav .links { display: flex; gap: 1.4rem; margin-left: 1rem; }
.nav .links a { color: var(--ink-soft); font-weight: 550; font-size: .95rem; }
.nav .links a:hover { color: var(--ink); }
.nav .spacer { flex: 1; }
.nav .nav-cta { display: flex; gap: .6rem; align-items: center; }
.nav-toggle { display: none; }

/* ----------------------------------------------------------- Hero ------ */
.hero { position: relative; overflow: hidden; padding: 76px 0 40px; }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto -10%; height: 620px; z-index: -1;
  background:
    radial-gradient(45% 55% at 18% 12%, rgba(99,102,241,.20), transparent 70%),
    radial-gradient(40% 50% at 82% 8%, rgba(217,70,239,.18), transparent 70%),
    radial-gradient(60% 60% at 50% 0%, rgba(139,92,246,.12), transparent 70%);
  filter: blur(8px);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero h1 { margin-top: .6rem; }
.hero .lede { font-size: 1.15rem; max-width: 33ch; }
.hero .cta-row { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.5rem 0 1rem; }
.hero .trust { display: flex; align-items: center; gap: 1rem; color: var(--muted); font-size: .86rem; flex-wrap: wrap; }
.hero .trust .stars { color: #f59e0b; letter-spacing: 2px; }

/* App preview card (hero right) */
.preview {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.preview .top { display: flex; align-items: center; gap: .5rem; padding: .7rem .9rem; border-bottom: 1px solid var(--line-2); background: var(--bg-soft); }
.preview .top .d { width: 11px; height: 11px; border-radius: 50%; background: #e0e0ec; }
.preview .top .d:nth-child(1){ background:#ff5f57;} .preview .top .d:nth-child(2){ background:#febc2e;} .preview .top .d:nth-child(3){ background:#28c840;}
.preview .top .url { margin-left: auto; font-size: .74rem; color: var(--muted); }
.preview .body { padding: 16px; display: grid; gap: 12px; }
.preview .src { background: var(--bg-soft); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px; font-size: .82rem; color: var(--ink-soft); }
.preview .src b { color: var(--ink); }
.preview .arrow { text-align: center; color: var(--brand); font-size: 1.1rem; }
.preview .outs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini {
  border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 11px; background: #fff;
  font-size: .78rem; box-shadow: var(--shadow-sm); animation: rise .6s ease both;
}
.mini h5 { margin: 0 0 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-ink); display: flex; align-items: center; gap: 5px; }
.mini p { margin: 0; color: var(--ink-soft); font-size: .76rem; line-height: 1.45; }
.mini:nth-child(2){ animation-delay:.08s } .mini:nth-child(3){ animation-delay:.16s } .mini:nth-child(4){ animation-delay:.24s }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ----------------------------------------------------------- Logos ----- */
.logos { padding: 26px 0 8px; }
.logos p { text-align: center; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.logos .row { display: flex; flex-wrap: wrap; gap: 30px 44px; justify-content: center; align-items: center; opacity: .72; }
.logos .row span { font-weight: 750; color: #9aa0b4; font-size: 1.05rem; letter-spacing: -.01em; }

/* ----------------------------------------------------------- Sections -- */
section { padding: 64px 0; }
.section-head { max-width: 640px; margin: 0 auto 42px; text-align: center; }
.section-head .pill { margin-bottom: 14px; }
.section-head p { font-size: 1.06rem; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); position: relative; }
.step .n { width: 36px; height: 36px; border-radius: 10px; background: var(--grad-soft); color: var(--brand-ink); font-weight: 800; display: grid; place-items: center; margin-bottom: 14px; }
.step h3 { margin-bottom: .35rem; }
.step p { margin: 0; font-size: .95rem; }

/* Feature cards */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .2s ease; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-soft); margin-bottom: 14px; color: var(--brand-ink); }
.feature h3 { font-size: 1.08rem; margin-bottom: .3rem; }
.feature p { margin: 0; font-size: .94rem; }

/* Platforms strip */
.platforms { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.platforms .chip { display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-weight: 600; font-size: .92rem; box-shadow: var(--shadow-sm); }

/* Pricing */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.plan.feat { border-color: transparent; box-shadow: var(--shadow-lg); position: relative; background:
   linear-gradient(#fff,#fff) padding-box, var(--grad) border-box; border: 2px solid transparent; }
.plan .tag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--grad); color: #fff; font-size: .72rem; font-weight: 700; padding: .3rem .8rem; border-radius: 999px; letter-spacing: .02em; }
.plan h3 { font-size: 1.1rem; }
.plan .price { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; margin: .2rem 0 0; }
.plan .price small { font-size: .9rem; font-weight: 600; color: var(--muted); }
.plan .desc { font-size: .9rem; color: var(--muted); margin-bottom: 1rem; min-height: 2.4em; }
.plan ul { list-style: none; margin: 0 0 1.4rem; padding: 0; display: grid; gap: .6rem; }
.plan li { display: flex; gap: .55rem; font-size: .92rem; color: var(--ink-soft); }
.plan li svg { flex: none; margin-top: 3px; color: var(--ok); }
.plan .btn { margin-top: auto; }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; display: grid; gap: 12px; }
details.qa { border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; padding: 4px 18px; box-shadow: var(--shadow-sm); }
details.qa summary { cursor: pointer; font-weight: 650; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary::after { content: "+"; font-size: 1.3rem; color: var(--brand); font-weight: 400; }
details.qa[open] summary::after { content: "–"; }
details.qa p { padding: 0 0 14px; margin: 0; font-size: .95rem; }

/* CTA band */
.cta-band { background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: 52px; text-align: center; position: relative; overflow: hidden; }
.cta-band::before { content:""; position:absolute; inset:auto -10% -60% -10%; height: 300px; background: radial-gradient(50% 80% at 50% 100%, rgba(139,92,246,.45), transparent 70%); }
.cta-band h2 { color: #fff; position: relative; }
.cta-band p { color: #c7c9da; max-width: 46ch; margin: 0 auto 1.6rem; position: relative; }

/* Footer */
.site-footer { border-top: 1px solid var(--line-2); padding: 44px 0 30px; margin-top: 20px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.foot-grid h5 { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .8rem; }
.foot-grid a { display: block; color: var(--ink-soft); font-size: .92rem; padding: .25rem 0; }
.foot-grid a:hover { color: var(--ink); }
.foot-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: .85rem; }

/* ======================================================================
   APP (app.html)
   ====================================================================== */
.app-main { padding: 26px 0 70px; }
.app-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 20px; flex-wrap: wrap; }
.app-head h1 { font-size: 1.7rem; margin: 0; }
.app-head p { margin: .25rem 0 0; font-size: .95rem; }
.usage { display: inline-flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--ink-soft); background: var(--bg-soft); border: 1px solid var(--line); padding: .5rem .85rem; border-radius: 999px; }
.usage b { color: var(--ink); }

.app-grid { display: grid; grid-template-columns: 420px 1fr; gap: 22px; align-items: start; }

.composer { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); position: sticky; top: 84px; }
.composer label { font-weight: 650; font-size: .9rem; display: block; margin: 0 0 .5rem; }
.composer textarea {
  width: 100%; min-height: 168px; resize: vertical; font: inherit; font-size: .94rem; line-height: 1.55;
  padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-soft); color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.composer textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(109,94,252,.14); background: #fff; }
.composer .row-between { display: flex; align-items: center; justify-content: space-between; margin: .5rem 0 1.1rem; }
.composer .link-btn { background: none; border: none; color: var(--brand-ink); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; padding: 0; }
.composer .count { font-size: .78rem; color: var(--muted); }

.field { margin-bottom: 1.1rem; }
.seg { display: flex; gap: 6px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.seg button { flex: 1; border: none; background: none; font: inherit; font-size: .85rem; font-weight: 600; color: var(--ink-soft); padding: .5rem; border-radius: 9px; cursor: pointer; transition: all .15s ease; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--brand-ink); box-shadow: var(--shadow-sm); }

.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check { display: flex; align-items: center; gap: .55rem; border: 1px solid var(--line); border-radius: 11px; padding: .55rem .7rem; cursor: pointer; font-size: .88rem; font-weight: 550; transition: all .15s ease; user-select: none; background:#fff; }
.check:hover { border-color: #d6d6e6; }
.check input { accent-color: var(--brand); width: 16px; height: 16px; }
.check.on { background: var(--grad-soft); border-color: #d9d6fb; color: var(--brand-ink); }

/* Output column */
.results { display: grid; gap: 16px; }
.empty {
  border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 60px 30px; text-align: center; color: var(--muted);
  background: repeating-linear-gradient(135deg, var(--bg-soft), var(--bg-soft) 12px, #fff 12px, #fff 24px);
}
.empty .ic { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; background: var(--grad-soft); display: grid; place-items: center; color: var(--brand-ink); }
.empty h3 { color: var(--ink); margin-bottom: .25rem; }

.out-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; animation: rise .45s ease both; }
.out-card .head { display: flex; align-items: center; gap: .6rem; padding: 13px 16px; border-bottom: 1px solid var(--line-2); }
.out-card .head .pic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; }
.out-card .head h3 { margin: 0; font-size: .98rem; }
.out-card .head .meta { margin-left: auto; display: flex; align-items: center; gap: .5rem; font-size: .76rem; color: var(--muted); }
.out-card .body { padding: 16px; }
.out-card .text { white-space: pre-wrap; font-size: .92rem; line-height: 1.6; color: var(--ink); margin: 0; font-family: var(--font); }
.out-card .acts { display: flex; gap: .5rem; padding: 0 16px 14px; }
.icon-btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); font: inherit; font-size: .82rem; font-weight: 600; padding: .45rem .8rem; border-radius: 9px; cursor: pointer; transition: all .15s ease; }
.icon-btn:hover { border-color: #d6d6e6; background: var(--bg-soft); color: var(--ink); }
.icon-btn.copied { color: var(--ok); border-color: #bbf7d0; background: #f0fdf4; }

/* Color tokens per platform */
.c-x       { background: #0f1419; }
.c-linkedin{ background: #0a66c2; }
.c-instagram{ background: linear-gradient(135deg,#f9ce34,#ee2a7b 45%,#6228d7); }
.c-newsletter{ background: #ea580c; }
.c-video   { background: #111; }
.tone-x { color:#0f1419 }

/* Loading shimmer */
.skeleton { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.sk-line { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--bg-soft) 25%, #ececf4 37%, var(--bg-soft) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; margin: 9px 0; }
@keyframes shimmer { 0% { background-position: 100% 0 } 100% { background-position: 0 0 } }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,18,34,.5); backdrop-filter: blur(3px); display: none; place-items: center; z-index: 100; padding: 20px; }
.modal-backdrop.open { display: grid; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal { background: #fff; border-radius: var(--radius-lg); max-width: 440px; width: 100%; padding: 32px; box-shadow: var(--shadow-lg); text-align: center; animation: pop .25s ease; }
@keyframes pop { from { transform: scale(.95); opacity: .6 } to { transform: none; opacity: 1 } }
.modal .crown { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 16px; background: var(--grad); display: grid; place-items: center; color: #fff; box-shadow: var(--shadow-lg); }
.modal h3 { font-size: 1.4rem; }
.modal ul { list-style: none; padding: 0; margin: 1rem 0 1.4rem; display: grid; gap: .5rem; text-align: left; }
.modal li { display: flex; gap: .5rem; font-size: .92rem; color: var(--ink-soft); }
.modal li svg { color: var(--ok); flex: none; }
.modal .close { background: none; border: none; color: var(--muted); font-size: .86rem; cursor: pointer; margin-top: .6rem; font-weight: 600; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 999px; font-size: .9rem; font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 200; display: flex; align-items: center; gap: .5rem; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { color: #4ade80; }

/* ----------------------------------------------------------- Responsive */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero .lede { max-width: none; }
  .steps, .features, .pricing { grid-template-columns: 1fr; }
  .app-grid { grid-template-columns: 1fr; }
  .composer { position: static; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .nav .links { display: none; }
  .nav-toggle { display: inline-grid; }
}
@media (max-width: 560px) {
  .hero .preview .outs { grid-template-columns: 1fr; }
  .cta-band { padding: 36px 22px; }
  .foot-grid { grid-template-columns: 1fr; }
  .checks { grid-template-columns: 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
