:root {
  color-scheme: light;
  --ink: #132238;
  --muted: #617087;
  --surface: #fff;
  --soft: #f4f7fb;
  --line: #dce4ef;
  --primary: #3157d5;
  --primary-dark: #2344b6;
  --primary-soft: #e9efff;
  --accent: #118979;
  --danger: #b4233c;
  --warning: #9a5b06;
  --shadow: 0 22px 60px rgba(25, 45, 85, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 3%, rgba(49, 87, 213, 0.12), transparent 30rem),
    radial-gradient(circle at 92% 14%, rgba(17, 137, 121, 0.1), transparent 28rem),
    #f7f9fc;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(rgba(49, 87, 213, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 87, 213, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
  content: "";
  pointer-events: none;
}

a { color: var(--primary); }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, a { outline-offset: 3px; }
:focus-visible { outline: 3px solid rgba(49, 87, 213, 0.28); }

.shell { width: min(1120px, calc(100% - 36px)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(220, 228, 239, 0.86);
  background: rgba(247, 249, 252, 0.9);
  backdrop-filter: blur(18px) saturate(140%);
}

.site-nav { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 850; letter-spacing: -0.02em; text-decoration: none; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(145deg, var(--primary), #6d72e7); box-shadow: 0 8px 18px rgba(49, 87, 213, 0.24); }
.site-links { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.site-links a { display: block; padding: 9px 12px; border-radius: 10px; color: #46556b; font-size: 0.92rem; font-weight: 700; text-decoration: none; }
.site-links a:hover, .site-links a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }
.menu-toggle { display: none; width: 42px; height: 42px; padding: 9px; border: 0; border-radius: 11px; color: var(--ink); background: transparent; cursor: pointer; transition: background .2s ease; }
.menu-toggle:hover { background: var(--primary-soft); }
.menu-toggle span { display: block; width: 22px; height: 2px; border-radius: 999px; background: currentColor; transition: transform .2s ease, opacity .2s ease; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.breadcrumbs { padding-top: 28px; color: var(--muted); font-size: 0.88rem; }
.breadcrumbs a { text-decoration: none; }

.hero { max-width: 780px; padding: 62px 0 34px; }
.eyebrow { display: inline-flex; padding: 6px 11px; border: 1px solid #cfd9fb; border-radius: 999px; color: var(--primary-dark); background: rgba(255,255,255,.72); font-size: .76rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { margin: 18px 0 16px; font-size: clamp(2.35rem, 6vw, 4.7rem); letter-spacing: -.055em; line-height: 1.02; }
.hero p { max-width: 680px; margin: 0; color: var(--muted); font-size: clamp(1rem, 2vw, 1.15rem); }
.trust-list { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 24px 0 0; color: #536278; font-size: .88rem; font-weight: 700; list-style: none; }
.trust-list li::before { margin-right: 7px; color: var(--accent); content: "✓"; }

.tool-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .7fr); gap: 24px; align-items: start; }
.tool-card, .info-card, .content-card { border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); }
.tool-card { padding: clamp(22px, 5vw, 42px); }
.info-card { padding: 24px; box-shadow: 0 12px 32px rgba(25,45,85,.07); }
.info-card h2, .info-card h3 { margin-top: 0; }
.info-card p, .info-card li { color: var(--muted); }

.tool-title { margin: 0 0 4px; font-size: 1.35rem; letter-spacing: -.025em; }
.tool-subtitle { margin: 0 0 28px; color: var(--muted); }
.field { display: grid; gap: 8px; margin-bottom: 20px; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.field label, .field-label { font-weight: 800; }
.field-hint { color: var(--muted); font-size: .86rem; }
.value-badge { min-width: 44px; padding: 4px 9px; border-radius: 9px; color: var(--primary-dark); background: var(--primary-soft); font-weight: 850; text-align: center; }

input[type="text"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  border: 1px solid #cbd6e5;
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
}
input[type="text"], input[type="password"], input[type="number"], select { min-height: 48px; padding: 10px 13px; }
textarea { min-height: 158px; padding: 14px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; line-height: 1.5; }
input[type="range"] { width: 100%; accent-color: var(--primary); }

.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.check { display: flex; align-items: center; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.check label { font-size: .92rem; font-weight: 700; }

.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0; }
.primary-button, .secondary-button, .inline-button { min-height: 48px; padding: 10px 18px; border-radius: 12px; cursor: pointer; font-weight: 850; }
.primary-button { border: 0; color: #fff; background: linear-gradient(135deg, var(--primary), #596fe2); box-shadow: 0 10px 22px rgba(49,87,213,.22); }
.primary-button:hover { background: linear-gradient(135deg, var(--primary-dark), #485bcb); }
.secondary-button, .inline-button { border: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.secondary-button:hover, .inline-button:hover { border-color: #b8c7dd; background: var(--soft); }
.is-copied { color: #fff; border-color: var(--accent); background: var(--accent); }

.output-group { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.output-group textarea { grid-column: 1 / -1; }
.output-group .secondary-button { min-width: 92px; }
.output-group input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1rem; }

.status { min-height: 24px; margin: 12px 0 0; color: var(--muted); font-size: .9rem; }
.status[data-tone="success"] { color: var(--accent); }
.status[data-tone="error"] { color: var(--danger); }

.meter-track { height: 10px; margin-top: 13px; overflow: hidden; border-radius: 999px; background: #e5eaf1; }
.meter-bar { width: 0; height: 100%; border-radius: inherit; background: var(--danger); transition: width .22s ease, background .22s ease; }
.meter-bar[data-level="fair"] { background: #d78d19; }
.meter-bar[data-level="good"] { background: #168f98; }
.meter-bar[data-level="strong"] { background: var(--accent); }
.meter-meta { display: flex; justify-content: space-between; gap: 14px; margin-top: 9px; color: var(--muted); font-size: .86rem; }

.warning { padding: 14px 16px; margin: 0 0 22px; border: 1px solid #f0d2a0; border-radius: 12px; color: #744408; background: #fff8e8; }
.privacy-callout { display: flex; gap: 12px; padding: 15px 16px; margin-top: 22px; border-radius: 13px; color: #255c55; background: #eaf8f5; }
.privacy-callout strong { display: block; }
.privacy-callout-compact { padding: 12px 14px; font-size: .9rem; }

.content-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 56px 0; }
.content-card { padding: 24px; box-shadow: 0 10px 28px rgba(25,45,85,.06); }
.content-card h2, .content-card h3 { margin: 0 0 10px; font-size: 1.14rem; }
.content-card p { margin: 0; color: var(--muted); }

.article { max-width: 820px; margin: 64px auto; }
.article h2 { margin: 42px 0 12px; font-size: clamp(1.55rem, 3vw, 2.15rem); letter-spacing: -.035em; }
.article h3 { margin-top: 28px; }
.article p, .article li { color: #4e5f76; }
.article .lead { color: var(--ink); font-size: 1.08rem; }

.tool-directory { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; margin: 12px 0 64px; }
.tool-link { display: flex; min-height: 180px; flex-direction: column; justify-content: space-between; padding: 24px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: rgba(255,255,255,.9); box-shadow: 0 10px 28px rgba(25,45,85,.06); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.tool-link:hover { transform: translateY(-3px); box-shadow: 0 18px 38px rgba(25,45,85,.11); }
.tool-link strong { font-size: 1.15rem; }
.tool-link span { color: var(--muted); }
.tool-link b { color: var(--primary); font-size: .9rem; }

.length-picker {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 34px;
  align-items: center;
  padding: 30px;
  margin: 0 0 64px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.9);
}

.length-picker h2 { margin: 12px 0 4px; font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.035em; }
.length-picker p { margin: 0; color: var(--muted); }
.length-chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; }
.length-chips a { display: grid; min-height: 48px; place-items: center; border: 1px solid var(--line); border-radius: 11px; color: var(--primary-dark); background: var(--primary-soft); font-weight: 850; text-decoration: none; }
.length-chips a:hover { color: #fff; border-color: var(--primary); background: var(--primary); }

.site-footer { padding: 48px 0; color: rgba(255,255,255,.72); background: #101c2e; text-align: center; }
.site-footer-inner { text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin-bottom: 20px; }
.footer-links a { color: #cad7ff; font-size: .88rem; text-decoration: none; }
.footer-links a:hover { color: #fff; }
.site-footer p { max-width: 700px; margin: 0 auto; font-size: .86rem; }
.site-footer .footer-tagline { margin-top: 1rem; font-size: .9rem; opacity: .8; }

@media (max-width: 820px) {
  .menu-toggle { display: inline-flex; flex-direction: column; align-items: center; justify-content: space-between; }
  .site-links { position: absolute; top: 64px; right: 18px; left: 18px; display: none; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
  .site-links.is-open { display: block; }
  .tool-layout { grid-template-columns: 1fr; }
  .content-grid, .tool-directory { grid-template-columns: 1fr 1fr; }
  .length-picker { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 24px, 1120px); }
  .hero { padding-top: 42px; }
  .tool-card { padding: 20px; border-radius: 17px; }
  .check-grid, .content-grid, .tool-directory { grid-template-columns: 1fr; }
  .length-chips { grid-template-columns: repeat(5, 1fr); }
  .output-group { grid-template-columns: 1fr; }
  .output-group .secondary-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
