:root {
  color-scheme: light;
  --ink: #18211d;
  --muted: #68736e;
  --paper: #f5f6f2;
  --surface: #ffffff;
  --surface-soft: #eef1ed;
  --line: #dbe0dc;
  --green: #176b50;
  --green-soft: #e7f1ec;
  --orange: #df673b;
  --purple: #453866;
  --shadow: 0 18px 55px rgba(31, 45, 38, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, textarea, select { font: inherit; }
button { color: inherit; }

.nav {
  min-height: 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 246, 242, .9);
  backdrop-filter: blur(12px);
}
.brand, .back {
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .1em;
  text-decoration: none;
}
.back { justify-self: end; color: var(--muted); font-weight: 700; }
.brand:hover, .back:hover { color: var(--green); }
.product-name { font-size: 15px; font-weight: 780; letter-spacing: -.01em; }
.product-name small {
  margin-left: 6px;
  padding: 3px 5px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 7px;
  letter-spacing: .1em;
  vertical-align: middle;
}

main { max-width: 920px; margin: auto; padding: 0 20px 56px; }
.intro { padding: clamp(58px, 8vw, 92px) 0 clamp(42px, 6vw, 62px); text-align: center; }
.eyebrow { margin: 0 0 14px; color: var(--orange); font-size: 10px; font-weight: 850; letter-spacing: .15em; }
h1, h2, p { margin-top: 0; }
h1 {
  margin: 0;
  font-size: clamp(50px, 8vw, 76px);
  font-weight: 820;
  letter-spacing: -.065em;
  line-height: 1;
  white-space: nowrap;
}
h2 { margin-bottom: 0; font-size: clamp(21px, 2.6vw, 29px); font-weight: 760; letter-spacing: -.025em; }

.translator {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 16px; }
.toolbar > div { display: flex; align-items: baseline; gap: 11px; }
.step { color: var(--orange); font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.toolbar label { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; font-weight: 650; }
select {
  min-height: 36px;
  padding: 0 32px 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
}
.runtime-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.privacy, .model-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid #c7d8cf;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}
.privacy span { font-size: 7px; }
.model-status {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.model-status.ready { border-color: #c7d8cf; color: var(--green); }
.model-status.fallback { border-color: #e3cba2; background: #fff8e9; color: #8b5b0d; }

.tones {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-bottom: 14px;
  padding: 6px;
  border-radius: 14px;
  background: var(--surface-soft);
}
.tone {
  min-height: 70px;
  padding: 13px 15px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.tone strong, .tone span { display: block; }
.tone strong { margin-bottom: 5px; font-size: 13px; }
.tone span { color: var(--muted); font-size: 10px; line-height: 1.4; }
.tone:hover { background: rgba(255,255,255,.75); }
.tone.active { background: var(--green); color: white; box-shadow: 0 5px 16px rgba(23, 107, 80, .16); }
.tone.active span { color: #d9eee5; }
.tone-playful.active { background: var(--purple); box-shadow: 0 5px 16px rgba(69, 56, 102, .2); }

.workbench { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.panel {
  min-width: 0;
  min-height: 410px;
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 2.5vw, 24px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.output-panel { background: #f0f5f1; }
.panel-title { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 10px; margin-bottom: 18px; }
.panel-title h2 { font-size: 17px; }
.text-button {
  padding: 3px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--green);
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}
.text-button:disabled { color: #9ba39f; cursor: default; }
textarea {
  width: 100%;
  min-height: 238px;
  flex: 1;
  resize: vertical;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
}
textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,107,80,.1); }
textarea[aria-invalid="true"] { border-color: #bd492d; box-shadow: 0 0 0 3px rgba(189,73,45,.09); }
.counter { margin-top: 6px; color: var(--muted); font-size: 9px; text-align: right; }
.translate {
  width: 100%;
  min-height: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 13px;
  padding: 0 17px;
  border: 0;
  border-radius: 10px;
  background: var(--orange);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.translate:hover { background: #cf5830; }
.translate:active { transform: translateY(1px); }
.translate:disabled { background: #a6a09a; cursor: wait; }
.result {
  min-height: 280px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px;
  border: 1px solid #cbd8d0;
  border-radius: 10px;
  background: rgba(255,255,255,.7);
}
.result p { margin: 0; white-space: pre-line; font-size: clamp(17px, 2vw, 21px); font-weight: 580; line-height: 1.68; letter-spacing: -.015em; }
.result small { display: block; margin-top: 14px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.result.empty p { color: #7c8781; font-size: 15px; font-weight: 500; }
.signals { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.signals span { padding: 4px 7px; border: 1px solid #bfd0c6; border-radius: 999px; color: var(--green); font-size: 9px; font-weight: 700; }

.examples { padding: 70px 0; }
.examples-head { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 22px; }
.examples-head .eyebrow { margin-bottom: 6px; }
.example-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.example-grid button {
  min-height: 126px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.example-grid button:hover { border-color: var(--orange); box-shadow: 0 9px 25px rgba(31,45,38,.06); transform: translateY(-2px); }
.example-grid span { color: var(--orange); font-size: 9px; font-weight: 850; }
.example-grid p { margin: 26px 0 0; font-size: 15px; font-weight: 620; line-height: 1.45; }
.principle {
  display: grid;
  grid-template-columns: .35fr 1.65fr;
  gap: 28px;
  padding: 34px 0;
  border-block: 1px solid var(--line);
}
.principle p { max-width: 720px; margin: 0; font-size: clamp(22px, 3.5vw, 34px); font-weight: 680; line-height: 1.3; letter-spacing: -.035em; }
.principle strong { color: var(--green); font-weight: 760; }

.prompt-lab { padding: 70px 0 0; }
.prompt-heading { display: grid; grid-template-columns: .42fr 1fr; gap: 18px 30px; align-items: end; margin-bottom: 22px; }
.prompt-heading .eyebrow { margin: 0; }
.prompt-heading > p:last-child { grid-column: 2; max-width: 680px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.prompt-heading code { padding: 2px 5px; border-radius: 4px; background: #e5e9e5; color: var(--green); }
.prompt-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 12px; }
.prompt-meta span { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--muted); font: 700 9px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.prompt-stack { display: grid; gap: 9px; }
.prompt-lab details { overflow: hidden; border: 1px solid #2b3631; border-radius: 11px; background: #18211d; color: #e9efe9; }
.prompt-lab summary { display: flex; justify-content: space-between; gap: 20px; padding: 15px 18px; border-bottom: 1px solid rgba(255,255,255,.14); color: #f5c84c; font-size: 10px; font-weight: 800; letter-spacing: .08em; cursor: pointer; list-style: none; }
.prompt-lab summary span:last-child { color: #9eaea5; font-weight: 600; letter-spacing: .03em; text-align: right; }
.prompt-lab summary::-webkit-details-marker { display: none; }
.prompt-lab pre { margin: 0; overflow: auto; padding: clamp(19px, 3vw, 28px); white-space: pre-wrap; }
.prompt-lab code { color: #dce8e1; font: 500 12px/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.prompt-footnote { max-width: 720px; margin: 15px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }

footer { max-width: 880px; margin: 0 auto; display: flex; justify-content: space-between; padding: 24px 20px 38px; color: var(--muted); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }

@media (max-width: 760px) {
  .nav { grid-template-columns: 1fr auto; }
  .product-name { display: none; }
  .workbench { grid-template-columns: 1fr; }
  .panel { min-height: 350px; }
  textarea { min-height: 190px; }
  .result { min-height: 220px; }
  .prompt-heading { grid-template-columns: 1fr; gap: 8px; }
  .prompt-heading > p:last-child { grid-column: auto; }
  .prompt-lab summary { align-items: flex-start; flex-direction: column; gap: 5px; }
  .prompt-lab summary span:last-child { text-align: left; }
}

@media (max-width: 560px) {
  main { padding-inline: 14px; }
  .intro { padding: 48px 0 38px; }
  h1 { font-size: clamp(41px, 13vw, 58px); }
  .translator { padding: 14px; border-radius: 17px; }
  .toolbar { align-items: flex-start; flex-direction: column; gap: 13px; }
  .toolbar > div { align-items: flex-start; flex-direction: column; gap: 6px; }
  .runtime-line { align-items: stretch; flex-direction: column; }
  .privacy, .model-status { width: fit-content; }
  .tones { grid-template-columns: 1fr; }
  .tone { min-height: 62px; }
  .panel { padding: 16px; }
  .example-grid, .principle { grid-template-columns: 1fr; }
  .examples { padding: 58px 0; }
  .examples-head { align-items: flex-start; flex-direction: column; gap: 7px; }
  .example-grid button { min-height: 105px; }
  .principle { gap: 14px; }
  .prompt-lab { padding-top: 58px; }
  footer { align-items: flex-start; flex-direction: column; gap: 8px; }
}
