:root {
  --ink: #0b1324;
  --muted: #5d6879;
  --line: #dfe5ee;
  --surface: #ffffff;
  --paper: #f5f7fb;
  --blue: #4d6bff;
  --blue-dark: #334ad2;
  --lime: #d8f878;
  --violet: #c4b5fd;
  --orange: #ffc47a;
  --shadow: 0 18px 50px rgb(11 19 36 / 8%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); min-width: 320px; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.page-container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header { position: sticky; top: 0; z-index: 10; background: rgb(245 247 251 / 90%); border-bottom: 1px solid rgb(223 229 238 / 80%); backdrop-filter: blur(18px); }
.site-header__inner { min-height: 76px; display: flex; align-items: center; gap: 36px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; letter-spacing: -.04em; }
.brand-mark { color: var(--blue); font-size: 14px; transform: rotate(45deg); display: inline-block; }
.main-nav { display: flex; gap: 28px; margin-left: auto; color: var(--muted); font-size: 14px; font-weight: 650; }
.main-nav a:hover, .main-nav a:focus-visible, .footer-links a:hover { color: var(--ink); }
.header-cta { display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 750; }
.header-cta:hover, .header-cta:focus-visible { border-color: var(--ink); }

.home-intro { padding: 90px 0 78px; background: var(--paper); }
.home-intro__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 80px; align-items: center; }
.eyebrow { margin: 0 0 18px; color: var(--blue-dark); font-size: 12px; font-weight: 850; letter-spacing: .13em; line-height: 1.3; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 24px; font-size: clamp(48px, 7vw, 84px); line-height: .98; letter-spacing: -.07em; }
h1 span { color: var(--blue); }
.home-lead { max-width: 520px; margin-bottom: 34px; color: var(--muted); font-size: 19px; line-height: 1.55; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 9px; border: 1px solid transparent; border-radius: 10px; padding: 12px 17px; font-size: 14px; font-weight: 780; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.button:hover, .button:focus-visible { transform: translateY(-2px); }
.button--primary { color: var(--ink); background: var(--lime); border-color: var(--lime); }
.button--primary:hover, .button--primary:focus-visible { background: #c9ec66; }
.button--ghost { color: var(--ink); background: var(--surface); border-color: var(--line); }
.button--ghost:hover, .button--ghost:focus-visible { border-color: var(--ink); }
.button--large { padding: 15px 21px; font-size: 15px; }
.intro-card { position: relative; min-height: 380px; display: flex; flex-direction: column; justify-content: center; align-items: center; overflow: hidden; border-radius: 32px; background: var(--ink); box-shadow: var(--shadow); }
.intro-card::before, .intro-card::after { position: absolute; content: ""; border-radius: 50%; border: 1px solid rgb(216 248 120 / 24%); }
.intro-card::before { width: 430px; height: 430px; }
.intro-card::after { width: 300px; height: 300px; }
.intro-card__orb { position: relative; width: 178px; height: 178px; display: flex; flex-direction: column; justify-content: center; border: 1px solid rgb(216 248 120 / 48%); border-radius: 50%; color: var(--lime); text-align: center; transform: rotate(-8deg); }
.intro-card__orb span { font-size: 30px; font-weight: 850; letter-spacing: -.06em; }
.intro-card__orb strong { margin-top: -4px; color: #fff; font-size: 29px; font-weight: 500; letter-spacing: -.06em; }
.intro-card__notes { position: absolute; right: 26px; bottom: 24px; left: 26px; display: flex; justify-content: space-between; color: rgb(255 255 255 / 65%); font-size: 11px; font-weight: 720; text-transform: uppercase; letter-spacing: .08em; }

.tools-section { padding: 92px 0 112px; background: var(--surface); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.section-heading h2, .how-section h2 { margin-bottom: 0; font-size: clamp(34px, 5vw, 58px); line-height: 1; letter-spacing: -.065em; }
.search-wrap { position: relative; width: min(300px, 100%); }
.search-input { width: 100%; min-height: 48px; padding: 0 40px 0 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--paper); outline: 0; }
.search-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(77 107 255 / 14%); }
.search-wrap > span { position: absolute; top: 12px; right: 16px; color: var(--muted); font-size: 20px; }
.category-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.category-chip { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface); font-size: 13px; font-weight: 720; }
.category-chip:hover, .category-chip:focus-visible { color: var(--ink); border-color: var(--ink); }
.category-chip.is-active { color: var(--ink); border-color: var(--ink); background: var(--lime); }
.tool-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.tool-card { flex: 1 1 250px; max-width: 285px; min-height: 230px; display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.tool-card[hidden] { display: none; }
.tool-card:hover, .tool-card:focus-visible { border-color: rgb(11 19 36 / 25%); box-shadow: 0 15px 32px rgb(11 19 36 / 8%); transform: translateY(-5px); }
.tool-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.tool-icon { width: 42px; height: 42px; display: inline-flex; justify-content: center; align-items: center; border-radius: 12px; color: var(--ink); background: var(--lime); font-size: 14px; font-weight: 850; letter-spacing: -.05em; }
.tool-icon--blue { background: #b9c5ff; }
.tool-icon--violet { background: var(--violet); }
.tool-icon--lime { background: var(--lime); }
.tool-icon--orange { background: var(--orange); }
.tool-card__category { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.tool-card h3 { margin-bottom: 10px; font-size: 20px; letter-spacing: -.04em; }
.tool-card p { margin-bottom: 22px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.tool-card__link { margin-top: auto; font-size: 13px; font-weight: 800; }
.tool-card__link span { color: var(--blue-dark); }
.empty-state { margin: 32px 0 0; color: var(--muted); text-align: center; }

.how-section { padding: 96px 0; background: var(--ink); color: #fff; }
.how-section .eyebrow { color: var(--lime); }
.how-grid { display: grid; grid-template-columns: .7fr 1.3fr; gap: 90px; }
.how-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.how-points article { padding-top: 18px; border-top: 1px solid rgb(255 255 255 / 22%); }
.step-number { display: block; margin-bottom: 44px; color: var(--lime); font-size: 12px; font-weight: 850; letter-spacing: .1em; }
.how-points h3 { margin-bottom: 12px; font-size: 19px; letter-spacing: -.03em; }
.how-points p { margin-bottom: 0; color: rgb(255 255 255 / 65%); font-size: 14px; line-height: 1.55; }

.site-footer { padding: 34px 0; color: var(--muted); background: var(--surface); }
.site-footer__inner { display: flex; align-items: center; gap: 28px; }
.brand--footer { color: var(--ink); font-size: 16px; }
.site-footer p { margin: 0; font-size: 13px; }
.footer-links { display: flex; gap: 18px; margin-left: auto; font-size: 13px; font-weight: 700; }

.tool-page { padding: 48px 0 100px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 58px; color: var(--muted); font-size: 13px; }
.breadcrumbs a:hover, .breadcrumbs a:focus-visible { color: var(--ink); }
.tool-page__heading { display: flex; justify-content: space-between; align-items: end; gap: 50px; margin-bottom: 34px; }
.tool-page__heading .tool-icon { margin-bottom: 20px; }
.tool-page h1 { max-width: 800px; margin-bottom: 16px; font-size: clamp(42px, 6vw, 72px); }
.tool-lead { max-width: 600px; margin-bottom: 0; color: var(--muted); font-size: 18px; line-height: 1.5; }
.privacy-note { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--muted); font-size: 13px; font-weight: 700; }
.privacy-note__dot { width: 8px; height: 8px; border-radius: 50%; background: #73be6b; }
.tool-panel { padding: clamp(20px, 4vw, 42px); border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.tool-workspace { max-width: 900px; margin: 0 auto; }
.tool-textarea, .tool-input { width: 100%; min-height: 150px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fbfcfe; outline: 0; resize: vertical; line-height: 1.55; }
.tool-textarea:focus, .tool-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(77 107 255 / 14%); }
.tool-textarea--large { min-height: 250px; }
.tool-textarea--code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 14px; }
.tool-input { min-height: 52px; resize: none; }
.tool-input--small { width: 130px; min-height: 46px; }
.tool-input--result { color: var(--blue-dark); font-weight: 700; }
.field-label { display: block; margin: 22px 0 8px; font-size: 13px; font-weight: 800; }
.button-row, .tool-actions, .option-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.button-row { margin: 16px 0 28px; }
.tool-actions { margin-top: 16px; }
.option-row { margin: 17px 0; color: var(--muted); font-size: 13px; }
.option-row label { display: inline-flex; align-items: center; gap: 7px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue); }
.metric-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 20px 0 4px; }
.metric { flex: 1 1 130px; max-width: 170px; padding: 17px 14px; border-radius: 12px; background: var(--paper); text-align: center; }
.metric strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 24px; letter-spacing: -.04em; }
.metric span { color: var(--muted); font-size: 12px; font-weight: 700; }
.tool-status { min-height: 21px; margin: 17px 0 0; color: var(--muted); font-size: 13px; }
.tool-status.is-error { color: #b53d3d; }
.tool-status.is-success { color: #267642; }
.segmented { display: flex; width: fit-content; max-width: 100%; margin-bottom: 18px; padding: 4px; border-radius: 12px; background: var(--paper); }
.segment { padding: 10px 14px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 760; }
.segment.is-active { color: var(--ink); background: var(--surface); box-shadow: 0 3px 12px rgb(11 19 36 / 8%); }
.calculator-grid, .converter-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.converter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.calculator-card { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.calculator-card h2 { margin-bottom: 18px; font-size: 17px; letter-spacing: -.03em; }
.inline-fields { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 750; }
.inline-fields label { display: inline-flex; align-items: center; gap: 7px; }
.calculation-result { display: block; min-height: 31px; margin-top: 20px; color: var(--blue-dark); font-size: 22px; font-weight: 850; letter-spacing: -.04em; }
.password-generator { display: grid; grid-template-columns: 1.25fr .75fr; gap: 28px; align-items: end; }
.password-output { position: relative; }
.password-output .tool-input { padding-right: 92px; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.password-strength { position: absolute; right: 14px; bottom: 16px; color: #267642; font-size: 12px; font-weight: 800; }
.password-controls input[type="range"] { width: 100%; accent-color: var(--blue); }
.conversion-results { margin-top: 22px; }
.conversion-results p { display: grid; grid-template-columns: 130px 1fr; gap: 14px; margin: 10px 0; padding-top: 10px; border-top: 1px solid var(--line); }
.conversion-results span { color: var(--muted); font-size: 13px; font-weight: 800; }
.conversion-results output { overflow-wrap: anywhere; color: var(--ink); font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 13px; }
.random-number-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.random-number-form .option-row { grid-column: 1 / -1; margin-bottom: 0; }
.random-result { display: grid; min-height: 150px; margin-top: 22px; place-items: center; border-radius: 16px; color: var(--blue-dark); background: var(--paper); font-size: clamp(42px, 8vw, 76px); font-weight: 900; letter-spacing: -.08em; }
.regex-controls { display: grid; grid-template-columns: 1fr 150px; gap: 14px; }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.result-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.result-block { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.result-block__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: var(--muted); font-size: 12px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.result-block__heading strong { color: var(--blue-dark); font-size: 18px; letter-spacing: 0; }
.result-pre { min-height: 58px; max-height: 300px; margin: 0; overflow: auto; color: var(--ink); font: 13px/1.6 "SFMono-Regular", Consolas, "Liberation Mono", monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.result-block output { display: block; min-height: 26px; color: var(--ink); font: 14px/1.5 "SFMono-Regular", Consolas, "Liberation Mono", monospace; overflow-wrap: anywhere; }
.color-input-row { display: grid; grid-template-columns: 1fr 116px; align-items: end; gap: 18px; }
.color-preview { min-height: 52px; border: 1px solid var(--line); border-radius: 12px; background: transparent; }
.url-results { margin: 0; }
.url-results > div { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.url-results > div:first-child { padding-top: 0; border-top: 0; }
.url-results dt { color: var(--muted); font-size: 13px; font-weight: 800; }
.url-results dd { margin: 0; color: var(--ink); font: 13px/1.5 "SFMono-Regular", Consolas, "Liberation Mono", monospace; overflow-wrap: anywhere; }
.base-converter { display: grid; grid-template-columns: 1fr 36px 1fr; align-items: end; gap: 14px; }
.unit-converter { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.base-converter .tool-input { min-height: 52px; }
.base-arrow { padding-bottom: 16px; color: var(--blue-dark); font-size: 22px; font-weight: 850; text-align: center; }
.result-output { display: block; min-height: 30px; color: var(--blue-dark); font: 700 20px/1.5 "SFMono-Regular", Consolas, "Liberation Mono", monospace; overflow-wrap: anywhere; }
.prime-result { min-height: 125px; margin-top: 22px; font-size: clamp(30px, 7vw, 56px); letter-spacing: -.05em; }
.ratio-equation { display: flex; align-items: end; justify-content: center; flex-wrap: wrap; gap: 10px; }
.ratio-equation label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 800; text-align: center; }
.ratio-equation strong { padding-bottom: 15px; color: var(--blue-dark); font-size: 24px; }
.qr-size-control { max-width: 240px; }
.qr-size-control .field-label { margin-top: 0; }
.qr-color-note { margin: 13px 0 0; color: var(--muted); font-size: 13px; }
.qr-result { display: grid; max-width: 540px; margin: 22px auto 0; padding: 14px; place-items: center; border-radius: 16px; background: var(--paper); }
#qr-canvas { display: block; width: min(100%, 512px); height: auto; image-rendering: pixelated; }
.tool-explainer { display: grid; grid-template-columns: .8fr 1.2fr; gap: 60px; padding: 74px 0 82px; border-bottom: 1px solid var(--line); }
.tool-explainer h2 { margin-bottom: 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.02; letter-spacing: -.06em; }
.tool-explainer > p { max-width: 600px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.65; }
.tool-faq { display: grid; grid-template-columns: .8fr 1.2fr; gap: 60px; padding: 70px 0 76px; border-bottom: 1px solid var(--line); }
.tool-faq h2 { margin-bottom: 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.02; letter-spacing: -.06em; }
.faq-list { display: grid; gap: 10px; }
.faq-list details { padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.faq-list summary { cursor: pointer; color: var(--ink); font-size: 15px; font-weight: 800; }
.faq-list p { margin: 14px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.related-tools { padding-top: 76px; }
.section-heading--tools { align-items: center; }
.section-heading--tools h2 { font-size: clamp(32px, 4vw, 48px); }
.text-link { color: var(--blue-dark); font-size: 14px; font-weight: 800; }
.text-link:hover, .text-link:focus-visible { color: var(--ink); }
.tool-grid--compact .tool-card { min-height: 205px; }

@media (max-width: 820px) {
  .page-container { width: min(100% - 28px, 680px); }
  .site-header__inner { gap: 18px; }
  .main-nav { display: none; }
  .header-cta { margin-left: auto; }
  .home-intro { padding: 64px 0 50px; }
  .home-intro__grid, .how-grid, .tool-explainer, .tool-faq { grid-template-columns: 1fr; gap: 42px; }
  .intro-card { min-height: 300px; }
  .section-heading { align-items: start; flex-direction: column; gap: 20px; }
  .search-wrap { width: 100%; }
  .how-points { grid-template-columns: 1fr; gap: 28px; }
  .step-number { margin-bottom: 18px; }
  .tool-page__heading { align-items: start; flex-direction: column; gap: 22px; }
  .privacy-note { margin-bottom: 0; }
  .calculator-grid, .converter-grid, .password-generator, .random-number-form, .regex-controls, .result-grid, .result-grid--three, .base-converter { grid-template-columns: 1fr; }
  .base-arrow { padding: 0; transform: rotate(90deg); }
  .unit-converter { grid-template-columns: 1fr; }
  .color-input-row { grid-template-columns: 1fr; }
  .random-number-form .option-row { grid-column: auto; }
  .site-footer__inner { align-items: start; flex-wrap: wrap; }
  .footer-links { width: 100%; margin-left: 0; }
}

@media (max-width: 520px) {
  .page-container { width: min(100% - 24px, 480px); }
  .site-header__inner { min-height: 66px; }
  .brand { font-size: 18px; }
  .header-cta { padding: 9px 12px; font-size: 12px; }
  h1 { font-size: clamp(46px, 15vw, 70px); }
  .home-lead { font-size: 17px; }
  .home-intro { padding-top: 50px; }
  .intro-card { min-height: 250px; border-radius: 23px; }
  .intro-card__notes { right: 16px; bottom: 16px; left: 16px; font-size: 9px; }
  .tools-section, .how-section { padding: 70px 0; }
  .tool-card { flex-basis: 100%; max-width: none; }
  .tool-page { padding-top: 28px; }
  .breadcrumbs { margin-bottom: 40px; }
  .tool-page h1 { font-size: 46px; }
  .tool-panel { padding: 16px; border-radius: 16px; }
  .tool-textarea--large { min-height: 210px; }
  .tool-input--small { width: 110px; }
  .metric { flex-basis: calc(50% - 5px); max-width: none; }
  .segmented { width: 100%; }
  .segment { flex: 1 1 50%; padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
