: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); }

.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 { max-width: 820px; padding: 76px 0 42px; }
.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); }
.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);
}

.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; }

.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; }

.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 { padding-top: 56px; }
  .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; }
  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 { padding: 48px 2px 34px; }
  .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; }
  .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; }
}
