/* Kaddu guide site — shared styles (homepage + tools)
   One typeface (Manrope), flat dark surfaces, spacing and type from fixed scales. */
:root {
  --bg: #000000;
  --surface: #181818;
  --surface-2: #1F1F1F;
  --surface-3: #272727;
  --line: #313131;
  --text: #F5F5F5;
  --muted: #A3A3A3;
  --faint: #737373;
  --accent: #FF8A2A;
  --accent-ink: #1A0E00;
  --ok: #34D399;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Manrope', system-ui, sans-serif; font-size: 16px; line-height: 24px; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 24px; } }

/* text styles */
.heading-1 { font-size: 48px; line-height: 48px; font-weight: 600; letter-spacing: -0.02em; }
@media (min-width: 768px) { .heading-1 { font-size: 60px; line-height: 60px; } }
.heading-2 { font-size: 36px; line-height: 40px; font-weight: 600; letter-spacing: -0.01em; }
@media (min-width: 768px) { .heading-2 { font-size: 48px; line-height: 48px; } }
.heading-4 { font-size: 30px; line-height: 36px; font-weight: 600; }
.heading-5 { font-size: 24px; line-height: 32px; font-weight: 600; }
.heading-6 { font-size: 20px; line-height: 28px; font-weight: 600; }
.title-2 { font-size: 18px; line-height: 28px; font-weight: 500; }
.title-3 { font-size: 16px; line-height: 24px; font-weight: 500; }
.title-4 { font-size: 14px; line-height: 20px; font-weight: 500; }
.body-3 { font-size: 16px; line-height: 24px; font-weight: 400; }
.body-6 { font-size: 14px; line-height: 20px; font-weight: 400; }
.caption-3 { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.caption-5 { font-size: 12px; line-height: 16px; font-weight: 400; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }

/* skip link */
.skip { position: absolute; left: 16px; top: -48px; z-index: 100; background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: 8px; font-weight: 600; transition: transform .3s var(--ease); }
.skip:focus { transform: translateY(64px); }

/* floating navigation */
.nav { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 50; width: calc(100% - 32px); max-width: 1120px; }
.nav-bar { display: flex; align-items: center; gap: 16px; padding: 8px 8px 8px 16px; border-radius: 16px; background: rgba(24, 24, 24, .72); border: 1px solid rgba(255, 255, 255, .08); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 18px; line-height: 28px; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav-links { display: none; gap: 4px; margin-left: auto; }
.nav-links a { text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted); transition: background-color .3s var(--ease), color .3s var(--ease); }
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.nav-links a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, .08); }
.nav-action { display: none; }
.menu-btn { margin-left: auto; width: 40px; height: 40px; border-radius: 8px; border: 0; background: rgba(255, 255, 255, .06); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.menu-btn span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .5s var(--ease), opacity .3s var(--ease); }
.menu-btn span + span { margin-top: 4px; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.menu-panel { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding: 96px 24px 24px; display: flex; flex-direction: column; gap: 8px; opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
.menu-panel.open { opacity: 1; pointer-events: auto; }
.menu-panel a { text-decoration: none; font-size: 30px; line-height: 36px; font-weight: 600; padding: 8px 0; opacity: 0; transform: translateY(24px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.menu-panel.open a { opacity: 1; transform: none; }
@media (min-width: 900px) {
  .nav-links { display: flex; }
  .nav-action { display: inline-flex; }
  .menu-btn, .menu-panel { display: none; }
}

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; min-height: 40px; border-radius: 8px; border: 1px solid transparent; font: 600 16px/24px 'Manrope', system-ui, sans-serif; text-decoration: none; cursor: pointer; transition: background-color .3s var(--ease), transform .5s var(--ease), border-color .3s var(--ease); }
.btn:active { transform: scale(.98); }
.btn:focus-visible, .nav-links a:focus-visible, .menu-btn:focus-visible, .card:focus-visible, .faq summary:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #FF9C4A; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: rgba(255, 255, 255, .06); }
.btn-sm { font-size: 14px; line-height: 20px; min-height: 36px; }
.link { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line); transition: text-decoration-color .3s var(--ease); }
.link:hover { text-decoration-color: var(--accent); }

/* sections */
main { display: block; }
.section { padding: 80px 0; }
.section-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; max-width: 680px; }
.eyebrow { color: var(--accent); }

/* hero */
.hero { padding: 128px 0 64px; }
@media (min-width: 900px) { .hero { padding: 160px 0 80px; } }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.15fr .85fr; } }
.hero h1 { max-width: 680px; background: linear-gradient(90deg, #FFFFFF, #9B9B9B); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .sub { max-width: 680px; margin-top: 24px; color: var(--muted); font-size: 18px; line-height: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 32px; }
.proof { display: flex; align-items: center; gap: 12px; margin-top: 32px; color: var(--muted); }
.proof img { width: 40px; height: 40px; border-radius: 9999px; border: 1px solid var(--line); }
.hero-art { position: relative; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); padding: 24px; display: grid; place-items: center; min-height: 280px; overflow: hidden; }
.hero-art img { max-height: 340px; width: auto; }

/* cards */
.grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 640px) and (max-width: 899px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; text-decoration: none; transition: transform .5s var(--ease), border-color .3s var(--ease), background-color .3s var(--ease); }
a.card:hover { transform: translateY(-4px); border-color: #4A4A4A; background: var(--surface-2); }
a.card:active { transform: translateY(-2px) scale(.99); }
.card-img { aspect-ratio: 16 / 9; background: var(--surface-3); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 16px; flex: 1; }
.card-meta { display: flex; align-items: center; gap: 8px; color: var(--faint); }
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 9999px; background: var(--surface-3); color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 500; }
.card-more { margin-top: auto; padding-top: 8px; color: var(--accent); font-weight: 600; font-size: 14px; line-height: 20px; }
.icon-tile { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--accent); }
.feature { padding: 24px; gap: 12px; }

/* skeleton (loading) */
.skeleton { background: var(--surface-2); border-radius: 8px; animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* tagline reveal */
.reveal-tagline { padding: 96px 0; }
.reveal-tagline p { max-width: 900px; font-size: 36px; line-height: 40px; font-weight: 600; letter-spacing: -0.01em; }
@media (min-width: 768px) { .reveal-tagline p { font-size: 48px; line-height: 48px; } }
.reveal-tagline .w { color: rgba(245, 245, 245, .3); transition: color .6s var(--ease); }
.reveal-tagline .w.on { color: var(--text); }
.reveal-tagline .w.hl.on { color: var(--accent); }

/* steps */
.step-num { width: 32px; height: 32px; border-radius: 9999px; display: grid; place-items: center; background: var(--surface-3); color: var(--accent); font-weight: 600; font-size: 14px; }

/* youtube */
.yt { display: grid; gap: 24px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 24px; }
@media (min-width: 900px) { .yt { grid-template-columns: 1fr 1fr; padding: 40px; } }
.yt-list { display: grid; gap: 12px; }
.yt-item { display: flex; gap: 12px; align-items: center; text-decoration: none; padding: 8px; border-radius: 12px; transition: background-color .3s var(--ease); }
.yt-item:hover { background: var(--surface-2); }
.yt-item img { width: 120px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: var(--surface-3); flex: none; }

/* faq */
.faq { display: grid; gap: 12px; max-width: 800px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 0 24px; transition: background-color .3s var(--ease); }
.faq details[open] { background: var(--surface-2); }
.faq summary { list-style: none; cursor: pointer; padding: 16px 0; display: flex; justify-content: space-between; gap: 16px; font-weight: 500; font-size: 18px; line-height: 28px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { flex: none; margin-top: 4px; transition: transform .5s var(--ease); color: var(--muted); }
.faq details[open] summary svg { transform: rotate(45deg); }
.faq details p { padding: 0 0 24px; color: var(--muted); }

/* final cta */
.final { text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 64px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.final p { max-width: 560px; color: var(--muted); }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 64px 0 40px; margin-top: 80px; }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer h4 { font-size: 14px; line-height: 20px; font-weight: 600; margin-bottom: 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer a { color: var(--muted); text-decoration: none; font-size: 14px; line-height: 20px; transition: color .3s var(--ease); }
.footer a:hover { color: var(--text); }
.footer-bottom { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--faint); }

/* scroll reveal */
.rise { opacity: 0; transform: translateY(32px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.rise.in { opacity: 1; transform: none; }

/* calculator */
.calc { display: grid; gap: 24px; }
@media (min-width: 900px) { .calc { grid-template-columns: 1fr 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 14px; line-height: 20px; font-weight: 500; }
.field input { width: 100%; padding: 8px 12px; min-height: 48px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 500 16px/24px 'Manrope', system-ui, sans-serif; transition: border-color .3s var(--ease); }
.field input:hover { border-color: #4A4A4A; }
.field input[aria-invalid="true"] { border-color: #F87171; }
.field .hint { color: var(--faint); font-size: 12px; line-height: 16px; }
.field .err { color: #F87171; font-size: 12px; line-height: 16px; min-height: 16px; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.tabs button { padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: 600 14px/20px 'Manrope', system-ui, sans-serif; cursor: pointer; transition: background-color .3s var(--ease), color .3s var(--ease); }
.tabs button[aria-selected="true"] { background: var(--surface-3); color: var(--text); }
.result-big { font-size: 48px; line-height: 48px; font-weight: 600; letter-spacing: -0.02em; }
.result-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.result-row b { font-weight: 600; }
.note { padding: 12px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 20px; }
.breadcrumb { display: flex; gap: 8px; color: var(--faint); font-size: 14px; line-height: 20px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }

/* article pages */
.article-head { padding: 128px 0 40px; }
@media (min-width: 900px) { .article-head { padding: 160px 0 48px; } }
.article-head h1 { max-width: 800px; margin-top: 16px; font-size: 36px; line-height: 40px; font-weight: 600; letter-spacing: -0.01em; }
@media (min-width: 768px) { .article-head h1 { font-size: 48px; line-height: 48px; } }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 24px; color: var(--faint); font-size: 14px; line-height: 20px; }
.article-meta b { color: var(--muted); font-weight: 500; }
.article-lead { max-width: 720px; margin-top: 24px; color: var(--muted); font-size: 18px; line-height: 28px; }
.article-cover { margin-top: 40px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.article-cover img { width: 100%; height: auto; }
.article-layout { display: grid; gap: 40px; padding-bottom: 40px; }
.article-layout > * { min-width: 0; } /* wide tables scroll inside their box, never the page */
@media (min-width: 1024px) { .article-layout { grid-template-columns: 220px minmax(0, 720px); justify-content: space-between; } }
.toc { align-self: start; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
@media (min-width: 1024px) { .toc { position: sticky; top: 96px; } }
.toc h2 { font-size: 14px; line-height: 20px; font-weight: 600; margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 16px; display: grid; gap: 8px; color: var(--muted); font-size: 14px; line-height: 20px; }
.toc a { text-decoration: none; color: var(--muted); transition: color .3s var(--ease); }
.toc a:hover { color: var(--text); }
.prose { max-width: 720px; font-size: 16px; line-height: 24px; color: #D4D4D4; }
.prose > * + * { margin-top: 16px; }
.prose h2 { font-size: 24px; line-height: 32px; font-weight: 600; color: var(--text); margin-top: 48px; scroll-margin-top: 96px; }
.prose h3 { font-size: 18px; line-height: 28px; font-weight: 600; color: var(--text); margin-top: 32px; }
.prose ul, .prose ol { padding-left: 24px; display: grid; gap: 8px; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--text); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--accent); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; min-width: 520px; }
.prose th, .prose td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.prose th { background: var(--surface-2); color: var(--text); font-weight: 600; }
.prose tr:last-child td { border-bottom: 0; }
.callout { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.callout b { color: var(--accent); }
.author { display: flex; gap: 16px; align-items: flex-start; margin-top: 48px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.author img { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.related { padding: 40px 0 0; }

/* blog list */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filters button { padding: 8px 12px; border-radius: 9999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 600 14px/20px 'Manrope', system-ui, sans-serif; cursor: pointer; transition: background-color .3s var(--ease), color .3s var(--ease); }
.filters button:hover { color: var(--text); }
.filters button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.filters button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.empty { padding: 40px 24px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: 16px; }

/* widgets added by app.js: cookie banner, support button, notifications, maintenance banner */
.cookie-consent-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 9000; max-width: 560px; margin: 0 auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: 0 16px 48px rgba(0, 0, 0, .5); transition: opacity .3s var(--ease), transform .5s var(--ease); }
.cookie-consent-content { display: flex; flex-direction: column; gap: 12px; }
.cookie-consent-title { display: block; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--text); }
.cookie-consent-text p { margin-top: 4px; font-size: 12px; line-height: 16px; color: var(--muted); }
.cookie-consent-text a { color: var(--text); }
.cookie-full-text { display: none; }
.cookie-mobile-text { display: block; }
@media (min-width: 640px) {
  .cookie-full-text { display: block; }
  .cookie-mobile-text { display: none; }
  .cookie-consent-content { flex-direction: row; align-items: center; }
}
.cookie-consent-actions { display: flex; gap: 8px; flex: none; }
.btn-cookie-accept, .btn-cookie-decline { padding: 8px 12px; min-height: 36px; border-radius: 8px; font: 600 14px/20px 'Manrope', system-ui, sans-serif; cursor: pointer; border: 1px solid var(--line); transition: background-color .3s var(--ease); }
.btn-cookie-accept { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-cookie-accept:hover { background: #FF9C4A; }
.btn-cookie-decline { background: transparent; color: var(--text); }
.btn-cookie-decline:hover { background: rgba(255, 255, 255, .06); }
.btn-cookie-accept:focus-visible, .btn-cookie-decline:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.floating-telegram-btn { position: fixed; right: 16px; bottom: 16px; z-index: 8000; width: 56px; height: 56px; border-radius: 9999px; display: grid; place-items: center; background: #229ED9; color: #fff; cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); touch-action: none; user-select: none; transition: transform .5s var(--ease); }
.floating-telegram-btn:hover { transform: scale(1.05); }
.floating-telegram-btn:active, .floating-telegram-btn.is-dragging { transform: scale(.96); }
.floating-telegram-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.telegram-online-dot { position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; border-radius: 9999px; background: var(--ok); border: 2px solid var(--bg); }
.telegram-widget-tooltip { position: absolute; right: 64px; white-space: nowrap; padding: 4px 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; line-height: 16px; color: var(--text); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
.floating-telegram-btn:hover .telegram-widget-tooltip { opacity: 1; }

.kaddu-toast { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); z-index: 9500; display: none; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line); color: var(--text); font-size: 14px; line-height: 20px; box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }

.kaddu-maintenance-top-banner { position: relative; z-index: 45; margin: 88px 16px 0; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.kaddu-maintenance-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; font-size: 14px; line-height: 20px; }
.kaddu-maintenance-left { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.kaddu-maintenance-icon { color: var(--accent); display: inline-flex; }
.kaddu-maintenance-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; background: var(--surface-3); color: var(--text); text-decoration: none; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { transform: none; transition: opacity .3s linear; }
  .reveal-tagline .w { color: var(--text); transition: none; }
  .menu-panel a, a.card, .btn, .faq summary svg, .menu-btn span { transition: opacity .3s linear; transform: none !important; }
  .skeleton { animation: none; }
}
