:root {
  color-scheme: dark;
  --paper: #050814;
  --paper-deep: #0a1023;
  --ink: #edfaff;
  --muted: #91a5c5;
  --line: rgba(76, 221, 255, 0.2);
  --card: rgba(10, 17, 36, 0.82);
  --accent: #35e7ff;
  --accent-soft: rgba(53, 231, 255, 0.13);
  --blue: #765cff;
  --success: #25f5b1;
  --warning: #ffd166;
  --error: #ff5687;
  --magenta: #ef5cff;
  --shadow: 0 0 0 1px rgba(53, 231, 255, 0.05), 0 22px 70px rgba(0, 0, 0, 0.46), 0 0 42px rgba(53, 231, 255, 0.07);
  --radius: 28px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --paper: #edf7ff;
  --paper-deep: #dceaff;
  --ink: #081426;
  --muted: #506581;
  --line: rgba(0, 123, 164, 0.2);
  --card: rgba(247, 252, 255, 0.86);
  --accent: #007f9d;
  --accent-soft: rgba(0, 163, 204, 0.12);
  --blue: #5d42da;
  --success: #087957;
  --warning: #8d5b00;
  --error: #b42f5d;
  --magenta: #a12eb1;
  --shadow: 0 22px 70px rgba(24, 74, 112, 0.14), 0 0 30px rgba(0, 190, 226, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 12% 4%, rgba(53, 231, 255, 0.16), transparent 29rem),
    radial-gradient(circle at 88% 22%, rgba(239, 92, 255, 0.12), transparent 32rem),
    linear-gradient(rgba(53, 231, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 231, 255, 0.035) 1px, transparent 1px),
    linear-gradient(145deg, var(--paper) 0%, var(--paper-deep) 100%);
  background-size: auto, auto, 32px 32px, 32px 32px, auto;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 36%, rgba(53, 231, 255, 0.035) 50%, transparent 64%);
  opacity: .8;
}
a { color: inherit; }
button, input, select { font: inherit; }
button { color: inherit; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 20; background: var(--ink); color: var(--paper); padding: .7rem 1rem; border-radius: 8px; }
.skip-link:focus { top: 1rem; }
.shell { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: blur(18px);
}
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; font-weight: 750; letter-spacing: -.025em; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #15233f, #060a14); color: var(--accent); border: 1px solid rgba(53, 231, 255, .42); box-shadow: 0 0 22px rgba(53, 231, 255, .2), inset 0 0 16px rgba(53, 231, 255, .08); font-family: Georgia, serif; font-size: 1.15rem; position: relative; }
.brand-mark::after { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--magenta); box-shadow: 0 0 12px var(--magenta); top: 6px; right: 6px; }
.site-nav { display: flex; align-items: center; gap: .25rem; }
.site-nav a, .icon-button { border: 0; background: transparent; text-decoration: none; padding: .65rem .85rem; border-radius: 999px; }
.site-nav a:hover, .site-nav a[aria-current="page"], .icon-button:hover { background: var(--card); box-shadow: inset 0 0 0 1px var(--line), 0 0 18px rgba(53, 231, 255, .08); }
.icon-button { cursor: pointer; font-size: 1.05rem; }
.menu-button { display: none; }

.hero { padding: 72px 0 48px; position: relative; }
.tool-hero { padding-top: 46px; padding-bottom: 30px; }
.tool-hero h1 { font-size: clamp(2.8rem, 5.6vw, 5.3rem); margin-bottom: 1rem; }
.eyebrow { margin: 0 0 1rem; color: var(--accent); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .18em; text-shadow: 0 0 16px rgba(53, 231, 255, .6); }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; letter-spacing: -.04em; line-height: 1.02; }
h1 { font-size: clamp(3rem, 7vw, 6.8rem); max-width: 880px; margin-bottom: 1.4rem; font-weight: 500; }
.hero h1 em { color: var(--accent); font-style: italic; text-shadow: 0 0 28px rgba(53, 231, 255, .28); }
.hero-copy { max-width: 690px; font-size: clamp(1.08rem, 2vw, 1.35rem); color: var(--muted); }
.hero-meta { display: flex; gap: 1.2rem; margin-top: 2rem; color: var(--muted); font-size: .88rem; flex-wrap: wrap; }
.hero-meta span::before { content: "•"; color: var(--accent); margin-right: .45rem; }

.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 24px; align-items: start; padding-bottom: 88px; }
.converter-card, .side-card, .feature, .route-card, .note-card {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.converter-card { border-radius: var(--radius); padding: clamp(1.25rem, 4vw, 2.4rem); }
.converter-card { position: relative; overflow: hidden; }
.converter-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 1px; background: linear-gradient(transparent, var(--accent), transparent); box-shadow: 0 0 18px var(--accent); opacity: .6; }
.mode-tabs { display: flex; gap: .35rem; margin-bottom: 2rem; padding: .35rem; border: 1px solid var(--line); border-radius: 999px; width: fit-content; }
.mode-tabs a { text-decoration: none; padding: .55rem 1rem; border-radius: 999px; color: var(--muted); font-size: .9rem; }
.mode-tabs a[aria-current="page"] { background: linear-gradient(120deg, var(--blue), #20b8e7); color: white; box-shadow: 0 0 20px rgba(53, 231, 255, .2); }
.field-label { display: block; font-weight: 750; margin-bottom: .65rem; }
.number-input-wrap { display: flex; align-items: center; gap: .7rem; border-bottom: 2px solid var(--ink); padding-bottom: .5rem; }
.number-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 12px 18px -18px var(--accent); }
.number-prefix { color: var(--accent); font-family: Georgia, serif; font-size: 2rem; }
.number-input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-family: Georgia, serif; font-size: clamp(2.15rem, 7vw, 4.6rem); letter-spacing: -.035em; }
.number-input::placeholder { color: color-mix(in srgb, var(--muted) 38%, transparent); }
.clear-button { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: .6rem; border-radius: 50%; }
.clear-button:hover { background: var(--paper-deep); color: var(--ink); }
.options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 1.5rem 0; }
.option label { display: block; font-size: .74rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .42rem; }
select { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--paper) 92%, transparent); color: var(--ink); padding: .72rem .8rem; }
.result-card { border: 1px solid var(--line); border-radius: 20px; background: color-mix(in srgb, var(--paper) 75%, transparent); padding: 1.35rem; min-height: 180px; display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; }
.result-card[data-state="ready"] { border-color: color-mix(in srgb, var(--success) 55%, var(--line)); box-shadow: inset 0 0 28px rgba(37, 245, 177, .035), 0 0 24px rgba(37, 245, 177, .06); }
.result-card[data-state="warning"] { border-color: color-mix(in srgb, var(--warning) 55%, var(--line)); }
.result-card[data-state="error"] { border-color: color-mix(in srgb, var(--error) 55%, var(--line)); }
.result-label { color: var(--muted); font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .1em; }
.result-text { font-family: Georgia, serif; font-size: clamp(1.55rem, 3.3vw, 2.45rem); line-height: 1.18; margin: .65rem 0; overflow-wrap: anywhere; }
.result-footer { display: flex; justify-content: space-between; gap: 1rem; align-items: end; }
.input-status { min-height: 1.3em; margin: 0; color: var(--muted); font-size: .82rem; }
.result-card[data-state="error"] .input-status { color: var(--error); }
.result-card[data-state="warning"] .input-status { color: var(--warning); }
.primary-button { border: 0; border-radius: 999px; background: linear-gradient(115deg, var(--blue), #009fc4); color: white; font-weight: 750; padding: .8rem 1.15rem; cursor: pointer; white-space: nowrap; box-shadow: 0 0 22px rgba(53, 231, 255, .2); }
.primary-button:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 0 30px rgba(53, 231, 255, .36); }
.primary-button:disabled { opacity: .35; cursor: not-allowed; }
.examples { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; margin-top: 1.2rem; }
.examples > span { color: var(--muted); font-size: .8rem; }
.example-button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: .45rem .75rem; cursor: pointer; }
.example-button:hover { background: var(--accent-soft); border-color: var(--accent); box-shadow: 0 0 16px rgba(53, 231, 255, .12); }
.side-stack { display: grid; gap: 16px; }
.side-card { border-radius: 20px; padding: 1.25rem; box-shadow: none; }
.side-card h2 { font-size: 1.45rem; margin-bottom: .6rem; }
.side-card p { color: var(--muted); font-size: .92rem; margin-bottom: 0; }
.privacy-seal { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); margin-bottom: 1rem; }
.history-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.text-button { border: 0; background: transparent; color: var(--blue); cursor: pointer; font-size: .8rem; }
.history-list { display: grid; gap: 8px; }
.history-item { width: 100%; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; padding: .75rem 0 0; cursor: pointer; display: grid; gap: .15rem; }
.history-item span { color: var(--accent); font-size: .78rem; }
.history-item strong { font-family: Georgia, serif; font-weight: 500; line-height: 1.25; }

.routes { padding: 30px 0 88px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 2rem; }
.section-heading h2 { font-size: clamp(2.1rem, 4vw, 3.8rem); max-width: 650px; margin-bottom: 0; }
.section-heading p { max-width: 430px; color: var(--muted); margin-bottom: .25rem; }
.route-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.route-card { border-radius: 22px; padding: 1.5rem; text-decoration: none; box-shadow: none; min-height: 260px; display: flex; flex-direction: column; transition: transform .25s ease, box-shadow .25s ease; }
.route-card:hover { transform: translateY(-5px); border-color: rgba(53, 231, 255, .48); box-shadow: var(--shadow), 0 0 34px rgba(53, 231, 255, .1); }
.route-number { color: var(--accent); font-family: Georgia, serif; font-size: 1.1rem; }
.route-card h3 { font-family: Georgia, serif; font-size: 1.75rem; margin: auto 0 .6rem; }
.route-card p { color: var(--muted); margin-bottom: 1.2rem; }
.route-link { font-weight: 750; color: var(--blue); }
.trust-section { border-block: 1px solid var(--line); padding: 72px 0; }
.trust-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 5vw; align-items: center; }
.trust-grid h2 { font-size: clamp(2.2rem, 4.5vw, 4.4rem); }
.principles { display: grid; gap: 1rem; }
.principle { display: grid; grid-template-columns: 42px 1fr; gap: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.principle b { color: var(--accent); }
.principle p { color: var(--muted); margin: .2rem 0 0; }
.faq { padding: 84px 0; }
.faq h2 { font-size: clamp(2rem, 4vw, 3.8rem); }
.faq-list { max-width: 820px; }
details { border-top: 1px solid var(--line); padding: 1.15rem 0; }
summary { cursor: pointer; font-weight: 750; }
details p { color: var(--muted); padding-top: .8rem; max-width: 700px; }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 44px; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-inner a { text-decoration: none; }
.footer-inner a:hover { color: var(--ink); }

.mini-tool { max-width: 940px; margin: 2.5rem auto 0; background: linear-gradient(135deg, rgba(15, 29, 58, .96), rgba(5, 8, 20, .98)); color: var(--ink); border: 1px solid rgba(53, 231, 255, .3); border-radius: 30px; padding: clamp(1.4rem, 4vw, 2.5rem); box-shadow: var(--shadow), 0 0 42px rgba(53, 231, 255, .12); transform: rotate(-.6deg); }
.mini-tool-label { color: color-mix(in srgb, var(--paper) 65%, transparent); text-transform: uppercase; font-size: .72rem; letter-spacing: .12em; }
.mini-tool-example { font-family: Georgia, serif; font-size: clamp(1.8rem, 5vw, 4rem); margin: 1rem 0 .4rem; }
.mini-tool-result { color: var(--accent); text-shadow: 0 0 20px rgba(53, 231, 255, .28); font-family: Georgia, serif; font-size: clamp(1.2rem, 2.7vw, 2rem); }

@media (max-width: 880px) {
  .tool-layout, .trust-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: 1fr 1fr; }
  .route-grid { grid-template-columns: 1fr; }
  .route-card { min-height: 210px; }
  .section-heading { align-items: start; flex-direction: column; }
}

@media (max-width: 680px) {
  .hero { padding-top: 48px; }
  .tool-hero { padding-top: 34px; padding-bottom: 24px; }
  .menu-button { display: block; }
  .site-nav { display: none; position: absolute; top: 66px; left: 16px; right: 16px; padding: .7rem; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); flex-direction: column; align-items: stretch; }
  .site-nav[data-open] { display: flex; }
  .site-nav a { border-radius: 10px; }
  .options { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: 1fr; }
  .result-footer { align-items: stretch; flex-direction: column; }
  .primary-button { width: 100%; }
  .hero-meta { gap: .4rem 1rem; }
  h1 { font-size: clamp(2.9rem, 15vw, 4.6rem); }
  .mode-tabs { width: 100%; overflow-x: auto; }
  .mode-tabs a { flex: 1; text-align: center; white-space: nowrap; }
}

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