/* cursive-translator.com — "ink & manuscript" theme
   base = site-factory standard theme, tokens swapped to fountain-pen blue on cream paper;
   visual motif regrown for this site: ruled-paper background, fleuron section marks,
   Caveat handwriting accents. */

:root {
  --paper: #faf7f0;
  --card: #fffdf8;
  --ink: #22242e;
  --ink-soft: #5e6270;
  --accent: #31509e;
  --accent-deep: #24407f;
  --accent-tint: #e9eef9;
  --line: #e3ddd0;
  --line-strong: #cfc7b5;
  --header-ink: #1a2136;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --script: "Caveat", cursive;
  --shadow-card: 0 1px 2px rgba(26, 33, 54, 0.06), 0 8px 28px rgba(26, 33, 54, 0.08);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14161d;
    --card: #1c1f29;
    --ink: #e7e8ec;
    --ink-soft: #9aa0af;
    --accent: #7d97d9;
    --accent-deep: #97acdf;
    --accent-tint: #202a41;
    --line: #2b2f3c;
    --line-strong: #3c4152;
    --header-ink: #0e1220;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.02rem;
  color: var(--ink);
  /* ruled-paper motif: faint horizontal writing lines */
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 31px,
      rgba(49, 80, 158, 0.055) 31px,
      rgba(49, 80, 158, 0.055) 32px
    ),
    var(--paper);
  line-height: 1.65;
}

/* ---------- header / footer ---------- */
header {
  background: var(--header-ink);
  border-bottom: 3px solid var(--accent);
}
header nav, footer nav {
  display: flex;
  gap: 1.4rem;
  align-items: center;
  padding: 0.9rem 1.2rem;
  max-width: 880px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--script);
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: 0.01em;
  color: #f2f4f8;
  text-decoration: none;
  margin-right: auto;
}
.brand::after {
  content: " ❦";
  color: var(--accent);
  font-size: 0.85rem;
  vertical-align: 3px;
}
header a:not(.brand) {
  color: #b9c2d6;
  text-decoration: none;
  font-size: 0.95rem;
}
header a:not(.brand):hover { color: #fff; }

footer {
  background: var(--header-ink);
  margin-top: 4rem;
  color: #8f9ab5;
  font-size: 0.9rem;
}
footer nav { padding-top: 1.6rem; }
footer a { color: #b9c2d6; text-decoration: none; }
footer a:hover { color: #fff; }
footer p {
  max-width: 880px;
  margin: 0 auto;
  padding: 0.2rem 1.2rem 1.8rem;
  font-family: var(--mono);
  font-size: 0.8rem;
}

/* ---------- hero ---------- */
main { max-width: 880px; margin: 0 auto; padding: 0 1.2rem 3rem; }

.eyebrow {
  font-family: var(--script);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-tint);
  display: inline-block;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  margin: 2.2rem 0 0.6rem;
  animation: rise 0.5s ease-out both;
}
h1 {
  font-size: clamp(2.1rem, 5.5vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0.2rem 0 0.6rem;
  animation: rise 0.5s 0.06s ease-out both;
}
.tagline {
  color: var(--ink-soft);
  font-size: 1.12rem;
  max-width: 46rem;
  margin: 0 0 1rem;
  animation: rise 0.5s 0.12s ease-out both;
}
.badges {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0 0 1.4rem;
  animation: rise 0.5s 0.18s ease-out both;
}
.badges li {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  background: var(--card);
}
.badges li::before { content: "✓ "; color: var(--accent); }

/* ---------- tool ---------- */
#tool {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem;
  margin: 0 0 2.4rem;
  box-shadow: var(--shadow-card);
  animation: rise 0.55s 0.24s ease-out both;
}
#dropzone {
  border: 2px dashed var(--line-strong);
  border-radius: 10px;
  padding: 1.4rem 1rem;
  text-align: center;
  margin-bottom: 0.9rem;
  background: var(--paper);
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}
#dropzone p { margin: 0.25rem 0; }
#dropzone.drag, #dropzone:hover { border-color: var(--accent); background: var(--accent-tint); }
.linklike { color: var(--accent); text-decoration: underline; cursor: pointer; font-weight: 600; }
.hint { color: var(--ink-soft); font-size: 0.88rem; }

#preview {
  display: none;
  max-width: 100%;
  max-height: 260px;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin: 0 auto 0.9rem;
}
#preview.show { display: block; }

textarea {
  width: 100%;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem;
  margin: 0.35rem 0;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49, 80, 158, 0.18);
}
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.6rem;
  margin: 0.6rem 0 0.9rem;
  font-size: 0.92rem;
}
.options label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  background: var(--paper);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.options label:hover { border-color: var(--accent); }
.options label:has(input:checked) {
  background: var(--accent-tint);
  border-color: var(--accent);
}
.options input { accent-color: var(--accent); }

button {
  font-family: var(--sans);
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 0.7rem 1.3rem;
  font-size: 1.02rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 2px 10px rgba(49, 80, 158, 0.25);
}
button:hover { background: var(--accent-deep); transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:focus-visible { outline: 3px solid rgba(49, 80, 158, 0.4); outline-offset: 2px; }
button:disabled { opacity: 0.6; cursor: wait; transform: none; }
#convert { display: block; width: 100%; margin-bottom: 0.5rem; letter-spacing: 0.01em; }
.actions { display: flex; gap: 0.6rem; }
.actions button {
  background: var(--card);
  color: var(--accent);
  border: 1.5px solid var(--accent);
  box-shadow: none;
  font-weight: 600;
}
.actions button:hover { background: var(--accent-tint); }
details.embed { margin-top: 0.8rem; border-top: 1px dashed var(--line-strong); padding-top: 0.6rem; }
details.embed summary { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-soft); cursor: pointer; }
details.embed summary:hover { color: var(--accent); }
details.embed textarea { font-size: 0.78rem; }
#status { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-soft); min-height: 1.2em; margin: 0.3rem 0 0; }
#status.error { color: #b3423a; }

/* ---------- content sections ---------- */
h2 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin: 2.8rem 0 0.8rem;
  padding-top: 0.4rem;
}
h2::before {
  content: "❧";
  color: var(--accent);
  margin-right: 0.55rem;
  font-weight: 400;
}
section > p, section li { color: var(--ink); }
section > p { max-width: 48rem; }

/* steps as numbered cards */
.steps ol {
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  padding: 0;
  margin: 1rem 0;
}
.steps li {
  counter-increment: step;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1rem 1.1rem;
  box-shadow: var(--shadow-card);
}
.steps li::before {
  content: "0" counter(step);
  display: block;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  border-bottom: 1px dashed var(--line-strong);
  padding-bottom: 0.4rem;
  margin-bottom: 0.6rem;
}

/* use-case cards */
.usecases ul {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  padding: 0;
  margin: 1rem 0;
}
.usecases li {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

/* plain feature list */
.explain ul { padding-left: 1.2rem; }
.explain li { margin: 0.35rem 0; }

/* comparison table */
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin: 0.8rem 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
th, td { padding: 0.6rem 0.9rem; text-align: left; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th {
  background: var(--accent-tint);
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}
td:first-child { font-weight: 600; }

/* FAQ */
.faq h3 {
  font-size: 1.05rem;
  margin: 1.3rem 0 0.25rem;
  padding-top: 1.1rem;
  border-top: 1px dashed var(--line-strong);
}
.faq h3::before {
  content: "Q";
  font-family: var(--mono);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-size: 0.75rem;
  padding: 0.05rem 0.4rem;
  margin-right: 0.55rem;
  vertical-align: 2px;
}
.faq h3 + p { margin-top: 0.25rem; color: var(--ink-soft); }

code {
  font-family: var(--mono);
  background: var(--accent-tint);
  border: 1px solid var(--line);
  padding: 0.08rem 0.4rem;
  border-radius: 6px;
  font-size: 0.88em;
}
a { color: var(--accent); }
a:hover { color: var(--accent-deep); }

/* handwriting accent for decorative sample words */
.script-accent {
  font-family: var(--script);
  font-size: 1.3em;
  color: var(--accent);
}

/* blog article typography */
article p { max-width: 48rem; }
article h3 { margin: 1.6rem 0 0.4rem; }

/* ---------- motion ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .steps ol, .usecases ul { grid-template-columns: 1fr; }
  header nav, footer nav { gap: 1rem; }
  .options { flex-direction: column; align-items: flex-start; }
}
