:root {
  color-scheme: light;
  --navy: #071827;
  --navy-soft: #102a3e;
  --blue: #0072bc;
  --blue-bright: #1597e5;
  --aqua: #53d5c5;
  --ink: #10202d;
  --muted: #647381;
  --line: #dce5eb;
  --surface: #ffffff;
  --canvas: #f3f7f9;
  --shadow: 0 24px 70px rgba(7, 24, 39, .14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, select, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.page-glow {
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 720px;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 12%, rgba(83, 213, 197, .20), transparent 26%),
    radial-gradient(circle at 16% 8%, rgba(21, 151, 229, .18), transparent 23%),
    linear-gradient(180deg, #e8f4f8 0%, rgba(243, 247, 249, 0) 88%);
}

.site-header {
  width: min(1240px, calc(100% - 48px));
  height: 104px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(7, 24, 39, .1);
}

.brand, .footer-brand {
  display: flex;
  align-items: center;
  gap: 17px;
  color: var(--navy);
  text-decoration: none;
}

.brand img { width: 132px; height: auto; display: block; }
.brand-divider { width: 1px; height: 30px; background: #bbc9d2; }
.product-name { font-size: 17px; font-weight: 750; letter-spacing: -.02em; white-space: nowrap; }

.header-actions { display: flex; align-items: center; gap: 28px; }
.header-actions > a {
  color: #344654;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}
.header-actions > a:hover { color: var(--blue); }
.text-link { color: var(--blue); font-weight: 800; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #cae0dd;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: #2c605a;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #28a892;
  box-shadow: 0 0 0 4px rgba(40, 168, 146, .13);
}
.status-pill[data-state="checking"] .status-dot { background: #dca83b; box-shadow: 0 0 0 4px rgba(220, 168, 59, .13); }
.status-pill[data-state="offline"] { color: #9b4141; border-color: #efd0d0; }
.status-pill[data-state="offline"] .status-dot { background: #d35757; box-shadow: 0 0 0 4px rgba(211, 87, 87, .13); }

main { width: min(1240px, calc(100% - 48px)); margin: 0 auto; }

.hero-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, .78fr);
  gap: 46px;
  align-items: center;
  padding: 72px 0 44px;
}
.hero { max-width: 760px; padding: 0; }
.eyebrow { display: flex; align-items: center; gap: 12px; color: #476171; font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.eyebrow i { display: block; width: 3px; height: 3px; border-radius: 50%; background: var(--blue); }
.eyebrow-red { color: #d71920; }
.eyebrow-red i { background: #d71920; }
.hero h1 { margin: 20px 0 19px; color: var(--navy); font-size: clamp(54px, 7vw, 91px); font-weight: 760; line-height: .94; letter-spacing: -.065em; }
.hero h1 em { color: var(--blue); font-style: normal; }
.hero p { max-width: 630px; margin: 0; color: #516776; font-size: clamp(17px, 2vw, 21px); line-height: 1.55; letter-spacing: -.015em; }

.translator {
  overflow: hidden;
  border: 1px solid rgba(7, 24, 39, .10);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.beta-note {
  margin: 0;
  padding: 10px 20px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted, #4a5766);
  background: rgba(7, 24, 39, .04);
  border-bottom: 1px solid rgba(7, 24, 39, .06);
  text-align: center;
}

.language-bar {
  min-height: 80px;
  display: grid;
  grid-template-columns: 1fr 80px 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.language-select { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 16px; padding: 0 28px; }
.language-select > span { color: #75848f; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.language-select select {
  width: 100%;
  border: 0;
  outline: 0;
  appearance: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23445b6b' stroke-width='1.8'%3E%3Cpath d='m3 5 4 4 4-4'/%3E%3C/svg%3E") no-repeat right center;
  color: var(--navy);
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
}
.language-select-right { border-left: 1px solid var(--line); }

.swap-button {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  justify-self: center;
  border: 1px solid #cddae2;
  border-radius: 50%;
  background: #f7fafb;
  cursor: pointer;
  transition: .2s ease;
}
.swap-button:hover { border-color: var(--blue); background: #edf8ff; color: var(--blue); transform: rotate(180deg); }
.swap-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.translation-grid { display: grid; grid-template-columns: 1fr 1fr; }
.text-panel { position: relative; min-width: 0; }
.input-panel { border-right: 1px solid var(--line); }
.output-panel { background: #f8fbfc; }
.panel-heading, .panel-footer { display: flex; align-items: center; justify-content: space-between; padding: 0 28px; }
.panel-heading { height: 58px; color: #425665; font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.panel-heading button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: #657887;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}
.panel-heading button:hover:not(:disabled) { color: var(--blue); }
.panel-heading button:disabled { opacity: .38; cursor: default; }
.panel-heading svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

textarea {
  display: block;
  width: 100%;
  height: 300px;
  resize: none;
  border: 0;
  outline: 0;
  padding: 10px 28px 24px;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.7;
  letter-spacing: -.01em;
}
textarea::placeholder { color: #9aabb5; }
#translated-text { color: #163247; }

.panel-footer { min-height: 76px; border-top: 1px solid var(--line); color: #82909a; font-size: 12px; }
.primary-button {
  min-width: 148px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 17px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: white;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 114, 188, .25);
  transition: .2s ease;
}
.primary-button:hover:not(:disabled) { background: #0064a6; transform: translateY(-1px); }
.primary-button:disabled { background: #b9c9d3; box-shadow: none; cursor: default; }
.primary-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.output-footer { color: #5d7585; }
.privacy-inline { display: inline-flex; align-items: center; gap: 6px; color: #3b746d; }
.privacy-inline svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.output-state {
  position: absolute;
  inset: 58px 0 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(248, 251, 252, .94);
  color: #536a79;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(4px);
}
.output-state[hidden] { display: none; }
.spinner { width: 27px; height: 27px; border: 2px solid #d5e3ea; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.error-message { margin: 0 28px 24px; padding: 14px 17px; border: 1px solid #f0cbcb; border-radius: 10px; background: #fff4f4; color: #9b4040; font-size: 13px; line-height: 1.5; }

.spell-checker {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: stretch;
  margin: 0;
  padding: 30px;
  border: 1px solid rgba(7, 24, 39, .10);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(7, 24, 39, .08);
}
.spell-copy .section-kicker {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.spell-copy h2 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1;
  letter-spacing: -.045em;
}
.spell-copy p {
  max-width: 430px;
  margin: 0;
  color: #5d7180;
  font-size: 16px;
  line-height: 1.6;
}
.spell-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fbfc;
}
.spell-card label {
  color: #425665;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.word-input-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}
#word-input {
  width: 100%;
  height: 52px;
  border: 1px solid #cfdae1;
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  padding: 0 16px;
  font-size: 17px;
  outline: 0;
}
#word-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 114, 188, .12);
}
#copy-word {
  height: 52px;
  border: 0;
  border-radius: 13px;
  background: var(--navy);
  color: #fff;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
#copy-word:disabled {
  background: #b9c9d3;
  cursor: default;
}
.word-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  right: 92px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid #cfdae1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(7, 24, 39, .16);
}
.word-suggestions button {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #edf2f5;
  background: transparent;
  color: var(--ink);
  padding: 12px 15px;
  text-align: left;
  font-size: 15px;
  cursor: pointer;
}
.word-suggestions button:last-child { border-bottom: 0; }
.word-suggestions button:hover,
.word-suggestions button:focus {
  background: #edf8ff;
  color: var(--blue);
  outline: 0;
}
.word-helper {
  min-height: 20px;
  margin: 0;
  color: #718391;
  font-size: 13px;
}

.language-strip { display: flex; align-items: center; justify-content: space-between; padding: 28px 4px 72px; color: #6d7e8a; }
.language-strip > span { font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.language-strip > div { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; justify-content: flex-end; }
.language-strip b { color: #536774; font-size: 12px; font-weight: 700; }
.language-strip i { width: 3px; height: 3px; border-radius: 50%; background: #a9bac4; }

.usage-stats {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 38px;
  align-items: stretch;
  margin: -30px 0 54px;
  padding: 34px;
  border: 1px solid rgba(7, 24, 39, .10);
  border-radius: 22px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 18px 48px rgba(7, 24, 39, .08);
  backdrop-filter: blur(12px);
}
.usage-stats h2 {
  margin: 12px 0 10px;
  color: var(--navy);
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.08;
  letter-spacing: -.04em;
}
.usage-stats p {
  margin: 0;
  color: #667987;
  font-size: 14px;
  line-height: 1.65;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stats-grid article {
  min-height: 124px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 19px 17px;
  border: 1px solid #dce8ee;
  border-radius: 17px;
  background: #f8fbfc;
}
.stats-grid span {
  color: var(--blue);
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 820;
  letter-spacing: -.05em;
}
.stats-grid p {
  color: #526777;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1.35;
  text-transform: uppercase;
}

.stats-hero { padding-bottom: 28px; }
.stats-page-panel { margin-top: 0; }
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 0 0 24px;
}
.admin-card {
  padding: 30px;
  border: 1px solid rgba(7, 24, 39, .10);
  border-radius: 22px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 18px 48px rgba(7, 24, 39, .08);
}
.admin-card-heading h2 {
  margin: 10px 0 8px;
  color: var(--navy);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
  letter-spacing: -.04em;
}
.admin-card-heading p {
  margin: 0;
  max-width: 760px;
  color: #667987;
  font-size: 14px;
  line-height: 1.65;
}
.data-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}
.data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 16px;
  border: 1px solid #dce8ee;
  border-radius: 14px;
  background: #f8fbfc;
  color: #435866;
  font-size: 14px;
}
.data-row b {
  color: var(--blue);
  font-size: 18px;
}
.review-card { margin-bottom: 54px; }
.admin-login {
  display: flex;
  align-items: end;
  gap: 14px;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid #dce8ee;
  border-radius: 16px;
  background: #f8fbfc;
}
.admin-login label {
  flex: 1;
  display: grid;
  gap: 7px;
  color: #536774;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.admin-login input {
  width: 100%;
  height: 46px;
  border: 1px solid #cadbe4;
  border-radius: 12px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  outline: 0;
}
.admin-login input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 114, 188, .10);
}
.review-list {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}
.review-item {
  padding: 18px;
  border: 1px solid #dce8ee;
  border-radius: 16px;
  background: #f8fbfc;
}
.review-meta {
  margin-bottom: 14px;
  color: #6a7d8a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.review-text-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.review-text-grid > div {
  min-width: 0;
  padding: 15px;
  border-radius: 13px;
  background: #fff;
}
.review-text-grid h3 {
  margin: 0 0 8px;
  color: #435866;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.review-text-grid p,
.empty-state {
  margin: 0;
  color: #263b4a;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.empty-state { color: #75848f; }

.about {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 90px;
  padding: 82px 74px;
  border-radius: 22px;
  background: var(--navy);
  color: #fff;
}
.section-kicker { color: var(--aqua); font-size: 10px; font-weight: 850; letter-spacing: .17em; }
.about h2 { margin: 18px 0 23px; font-size: clamp(31px, 4vw, 48px); line-height: 1.08; letter-spacing: -.045em; }
.about-copy p { margin: 0; color: #adbfca; font-size: 15px; line-height: 1.75; }
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.principles article { padding-top: 19px; border-top: 1px solid #2a4153; }
.principles article > span { color: var(--aqua); font-size: 10px; font-weight: 800; }
.principles h3 { margin: 24px 0 10px; font-size: 17px; }
.principles p { margin: 0; color: #9fb1bd; font-size: 12px; line-height: 1.65; }

footer {
  width: min(1240px, calc(100% - 48px));
  min-height: 160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.3fr auto;
  gap: 40px;
  align-items: center;
  color: #73838e;
  font-size: 11px;
  line-height: 1.6;
}
.footer-brand img { width: 94px; }
.footer-brand span { padding-left: 15px; border-left: 1px solid #c7d1d7; color: #405461; font-size: 13px; font-weight: 750; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

@media (max-width: 900px) {
  .hero-tools { grid-template-columns: 1fr; gap: 26px; padding: 56px 0 36px; }
  .hero { padding-top: 0; }
  .translation-grid { grid-template-columns: 1fr; }
  .input-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  textarea { height: 235px; }
  .about { grid-template-columns: 1fr; gap: 50px; padding: 62px 46px; }
  .spell-checker { grid-template-columns: 1fr; }
  .usage-stats { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: 1fr; }
  .review-text-grid { grid-template-columns: 1fr; }
  footer { grid-template-columns: 1fr 1fr; padding: 32px 0; }
  footer > p:last-child { display: none; }
}

@media (max-width: 640px) {
  .site-header, main, footer { width: min(100% - 28px, 1240px); }
  .site-header { height: 80px; }
  .brand { gap: 10px; }
  .brand img { width: 94px; }
  .brand-divider { height: 24px; }
  .product-name { font-size: 13px; }
  .header-actions > a { display: none; }
  .status-pill { width: 31px; min-height: 31px; justify-content: center; padding: 0; }
  .status-pill #model-status-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }
  .hero-tools { padding: 48px 0 28px; gap: 22px; }
  .hero { padding: 0 2px; }
  .hero h1 { font-size: clamp(48px, 16vw, 68px); }
  .hero p { font-size: 16px; }
  .translator { border-radius: 16px; }
  .language-bar { grid-template-columns: 1fr 48px 1fr; min-height: 73px; }
  .language-select { display: block; padding: 0 14px; }
  .language-select > span { display: block; margin-bottom: 7px; font-size: 9px; }
  .language-select select { font-size: 12px; padding-right: 14px; text-overflow: ellipsis; }
  .swap-button { width: 34px; height: 34px; }
  .swap-button svg { width: 17px; }
  .panel-heading, .panel-footer { padding: 0 18px; }
  textarea { height: 220px; padding: 8px 18px 18px; font-size: 16px; }
  .panel-footer { min-height: 68px; }
  .primary-button { min-width: 125px; height: 42px; }
  .output-state { inset: 58px 0 68px; }
  .language-strip { display: block; padding: 24px 2px 52px; }
  .language-strip > div { justify-content: flex-start; margin-top: 17px; gap: 10px; }
  .spell-checker { margin: 0; padding: 22px; border-radius: 16px; }
  .word-input-wrap { grid-template-columns: 1fr; }
  #copy-word { width: 100%; }
  .word-suggestions { right: 0; }
  .usage-stats { margin: -26px 0 42px; padding: 24px; border-radius: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .stats-grid article { min-height: 104px; }
  .admin-login { display: grid; align-items: stretch; }
  .about { padding: 48px 27px; border-radius: 16px; }
  .principles { grid-template-columns: 1fr; }
  footer { grid-template-columns: 1fr; gap: 14px; }
}

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