/* ============ HumanlyText — design system ============ */
:root {
  --bg: #ffffff;
  --bg-soft: #f5f8fc;
  --bg-grad: radial-gradient(1200px 600px at 70% -10%, #e9f0ff 0%, rgba(233,240,255,0) 60%);
  --fg: #0e1726;
  --muted: #5a6b84;
  --border: #e4e9f1;
  --brand: #2f6bff;
  --brand-dark: #1f4fd6;
  --accent: #10b981;
  --danger: #ef4444;
  --warn: #f59e0b;
  --card: #ffffff;
  --shadow-sm: 0 1px 2px rgba(16,23,38,.05);
  --shadow: 0 2px 6px rgba(16,23,38,.05), 0 12px 32px rgba(16,23,38,.08);
  --radius: 16px;
}
:root[data-theme='dark'],
html[data-theme='dark'] {
  --bg: #0b1120;
  --bg-soft: #0f1829;
  --bg-grad: radial-gradient(1200px 600px at 70% -10%, #15224000 0%, rgba(21,34,64,0) 60%);
  --fg: #eaf0fb;
  --muted: #9fb0cc;
  --border: #1d2840;
  --brand: #5b8cff;
  --brand-dark: #3f6fe6;
  --accent: #34d399;
  --card: #111b2e;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.25);
  --shadow: 0 2px 6px rgba(0,0,0,.25), 0 16px 40px rgba(0,0,0,.4);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0b1120; --bg-soft: #0f1829; --fg: #eaf0fb; --muted: #9fb0cc;
    --border: #1d2840; --brand: #5b8cff; --brand-dark: #3f6fe6; --accent: #34d399;
    --card: #111b2e; --shadow-sm: 0 1px 2px rgba(0,0,0,.25);
    --shadow: 0 2px 6px rgba(0,0,0,.25), 0 16px 40px rgba(0,0,0,.4);
    --bg-grad: radial-gradient(1200px 600px at 70% -10%, rgba(21,34,64,0) 0%, rgba(21,34,64,0) 60%);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  background-image: var(--bg-grad);
  background-repeat: no-repeat;
  color: var(--fg);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.3rem); }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1rem; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
img { max-width: 100%; }

.ht-container { max-width: 72rem; margin-inline: auto; padding-inline: 1rem; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--brand); color:#fff; padding:.5rem 1rem; z-index:100; }
.skip-link:focus { left: 1rem; }

/* Buttons */
.ht-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-weight: 600; font-size: 1rem; border-radius: 12px; padding: .75rem 1.3rem;
  cursor: pointer; border: 1px solid transparent; transition: transform .06s, background .15s, box-shadow .15s;
  text-decoration: none;
}
.ht-btn:hover { text-decoration: none; }
.ht-btn:active { transform: translateY(1px); }
.ht-btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.ht-btn-primary:hover { background: var(--brand-dark); }
.ht-btn-ghost { background: transparent; color: var(--fg); border-color: var(--border); }
.ht-btn-ghost:hover { background: var(--bg-soft); }
.ht-btn-lg { padding: .95rem 1.7rem; font-size: 1.08rem; }
.ht-btn[disabled] { opacity: .55; cursor: not-allowed; }

.icon-btn { background: transparent; border: 1px solid var(--border); color: var(--fg); width: 40px; height: 40px; border-radius: 10px; cursor: pointer; font-size: 1.1rem; }
.icon-btn:hover { background: var(--bg-soft); }
.lang-switch { font-size: .82rem; font-weight: 700; text-decoration: none; letter-spacing: .03em; }
.lang-switch:hover { text-decoration: none; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 1.5rem; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; color: var(--fg); letter-spacing: -.03em; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff; font-weight: 800; }
.brand-text span { color: var(--brand); }
.main-nav { display: flex; gap: 1.25rem; margin-left: auto; }
.main-nav a { color: var(--muted); font-weight: 500; font-size: .95rem; }
.main-nav a:hover, .main-nav a[aria-current='page'] { color: var(--fg); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: .6rem; }

/* Hero */
.hero { padding: clamp(2.5rem, 7vw, 5rem) 0 2rem; text-align: center; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .85rem; font-weight: 600; color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); padding: .35rem .8rem; border-radius: 999px; margin-bottom: 1.2rem; }
.hero p.lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--muted); max-width: 40rem; margin: 0 auto 1.8rem; }
.hero-cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.trust { margin-top: 1.4rem; font-size: .9rem; color: var(--muted); }
.trust strong { color: var(--fg); }

/* Cards / sections */
.section { padding: 3.5rem 0; }
.section-head { text-align: center; max-width: 42rem; margin: 0 auto 2.5rem; }
.ht-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.grid { display: grid; gap: 1.2rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.feature { padding: 1.6rem; }
.feature .ico { font-size: 1.6rem; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: color-mix(in srgb, var(--brand) 12%, transparent); margin-bottom: .9rem; }

/* Tool (humanizer) */
.tool { margin-top: 1rem; }
.tool-card { padding: 1.2rem; }
.tool-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .8rem; }
.tool-toolbar select, .tool-toolbar .seg { font-family: inherit; }
.field-label { font-size: .8rem; font-weight: 600; color: var(--muted); margin-right: .3rem; }
select.input { background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: 10px; padding: .5rem .7rem; font-size: .9rem; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg button { background: var(--bg); border: 0; padding: .5rem .9rem; font-size: .9rem; cursor: pointer; color: var(--muted); }
.seg button.active { background: var(--brand); color: #fff; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.tool-pane { display: flex; flex-direction: column; }
.tool-pane label.cap { font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: .4rem; display:flex; justify-content: space-between; }
textarea.input {
  width: 100%; min-height: 300px; resize: vertical; background: var(--bg); color: var(--fg);
  border: 1px solid var(--border); border-radius: 12px; padding: 1rem; font-size: 1rem; line-height: 1.65; font-family: inherit;
}
textarea.input:focus, select.input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.output-box {
  width: 100%; min-height: 300px; background: var(--bg-soft); color: var(--fg);
  border: 1px solid var(--border); border-radius: 12px; padding: 1rem; font-size: 1rem; line-height: 1.65;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.output-box.placeholder { color: var(--muted); }
.tool-footer { display: flex; justify-content: space-between; align-items: center; margin-top: .9rem; gap: .8rem; flex-wrap: wrap; }
.wordcount { font-size: .85rem; color: var(--muted); }
.wordcount.warn { color: var(--warn); }
.result-actions { display: flex; gap: .5rem; }
.badge { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 600; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--border); }
.badge.human { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: transparent; }
.badge.ai { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: transparent; }
.badge.mid { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: transparent; }
.notice { font-size: .85rem; padding: .6rem .8rem; border-radius: 10px; margin-top: .6rem; }
.notice.err { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.notice.info { background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand); }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color:#fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Cookie consent bar */
.consent-bar { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; max-width: 54rem; margin-inline: auto; z-index: 90; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 14px; padding: .9rem 1.1rem; font-size: .9rem; }
.consent-bar .consent-actions { display: flex; gap: .5rem; }
.consent-bar .ht-btn { padding: .5rem 1rem; font-size: .9rem; }

/* Writing generator topics */
.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .8rem; }
.topic-row { display: flex; align-items: flex-start; gap: .5rem; padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); cursor: pointer; font-size: .92rem; }
.topic-row:hover { background: var(--bg-soft); }
.topic-row input { margin-top: .25rem; }
@media (max-width: 680px) { .topic-grid { grid-template-columns: 1fr; } }

/* FAQ */
.faq details { border: 1px solid var(--border); border-radius: 12px; padding: .2rem 1rem; margin-bottom: .7rem; background: var(--card); }
.faq summary { cursor: pointer; font-weight: 600; padding: .9rem 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: right; color: var(--muted); font-weight: 700; }
.faq details[open] summary::after { content: '–'; }
.faq p { padding-bottom: .9rem; color: var(--muted); }

/* Prose for article/keyword pages */
.prose { max-width: 48rem; margin-inline: auto; }
.prose h2 { margin-top: 2.2rem; }
.prose ul { padding-left: 1.2rem; color: var(--muted); }
.prose li { margin-bottom: .4rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); margin-top: 4rem; padding: 3rem 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.footer-col h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .8rem; }
.footer-col a { display: block; color: var(--fg); font-size: .95rem; margin-bottom: .5rem; }
.footer-col a:hover { color: var(--brand); }
.footer-brand p { max-width: 22rem; font-size: .92rem; margin-top: .8rem; }
.footer-bottom { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--border); font-size: .85rem; }

@media (max-width: 860px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .main-nav { display: none; }
  .header-cta { display: none; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}
