/* Arabic skin — v6: "Elegant Luxury" theme (21st.dev, @serafimcloud —
   the tweakcn preset of the same name; full token set read from the
   theme's registry entry and the 21st theme page, 2026-11-08). The v5
   layout is unchanged (headline band over input / output panes, one
   width system); only the theme layer moves: the colourful plum
   identity is replaced by the theme's dark register — warm stone
   charcoal, ivory text, a deep burgundy primary and bronze-gold
   accents, hairline rules, small refined radii, and a serif display
   face. The theme's Latin pairing (Libre Baskerville serif / Poppins
   sans) is mapped onto Arabic honestly: Amiri carries the serif
   display role for Arabic script, IBM Plex Sans Arabic keeps the
   text role, and the theme's own faces remain in the stacks as the
   Latin fallbacks. */

/* --- Tokens ------------------------------------------------------------ */

:root {
  /* Elegant Luxury, dark register (the site is dark-only, so the
     theme's .dark tokens govern). Hexes are the theme's own published
     values; contrasts verified numerically before writing:
     ink on ground 16.0:1, ink on card 13.9:1, muted on ground 11.7:1,
     muted on card 10.2:1, button text on primary 6.1:1, gold on
     ground 10.5:1, gold on card 9.1:1. */
  --p-bg: #1c1917;          /* theme --background */
  --p-ink: #f5f5f4;         /* theme --foreground */
  --p-muted: #d6d3d1;       /* theme --muted-foreground */
  --p-accent: #fbbf24;      /* theme chart-4 — the bright gold: links, rules, numerals */
  --p-accent-ink: #292524;  /* text on the bright gold */
  --p-action: #b91c1c;      /* theme --primary — deep burgundy */
  --p-action-hover: #991b1b;
  --p-action-ink: #faf7f5;  /* theme --primary-foreground */
  --p-bronze: #b45309;      /* theme --accent — fills, the mark's deep gold */
  --p-bronze-ink: #fef3c7;  /* theme --accent-foreground */
  --card-bg: #292524;       /* theme --card */
  --panel-bg: #1f1c1a;      /* theme --muted — textarea / result wells */
  --shadow-warm: rgb(69 10 10 / 0.45);   /* theme shadow colour hsl(0 63% 18%) */
  --shadow-card: 1px 1px 16px -2px rgb(69 10 10 / 0.28), 0 10px 26px -18px rgb(10 4 4 / 0.7);
  --shadow-tool:
    0 24px 60px -24px rgb(10 4 4 / 0.8),
    0 0 90px rgb(180 83 9 / 0.07),
    inset 0 1px 0 rgb(251 191 36 / 0.35);
  --focus: #fbbf24;
  --focus-ring: rgb(251 191 36 / 0.28);

  /* Type: the theme pairs a serif display with a clean sans. Amiri
     takes the serif role for Arabic (an elegant naskh with the same
     classical register as Libre Baskerville); the theme's own faces
     stay in the stacks for Latin glyphs. The theme's tracking is 0,
     which Arabic requires anyway — joined letters never take
     negative tracking. */
  --font-display: "Amiri", "Libre Baskerville", serif;
  --font-text: "IBM Plex Sans Arabic", "Poppins", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --display-weight: 700;
  --display-tracking: 0;
  --display-tracking-xl: 0;
  --ly-scale: 0.9;

  /* One spacing scale (unchanged). Radii follow the theme: its base
     radius is 0.375rem, so the whole scale tightens — small, squared,
     refined — and buttons leave the pill behind. */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;
  --nav: 72px;
  --gut: 80px;
  --bar: 0px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-btn: 6px;
  --line: #44403c;          /* theme --border */
  --line-strong: #57534e;
  --bg-deep: #141110;
  --danger: #f87171;        /* theme chart-1 — the bright red, for error text */
  --danger-bg: rgb(239 68 68 / 0.1);
  --danger-line: rgb(239 68 68 / 0.42);
  --success: #a3b18a;
  --warning: #f59e0b;       /* theme chart-5 — amber */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --m-ease-enter: cubic-bezier(0.22, 1, 0.36, 1);
  --m-in: 150ms;
  --m-out: 120ms;
  --m-press: 90ms;
}

::selection {
  background: var(--p-accent);
  color: var(--p-accent-ink);
}

/* The hidden attribute always wins over component display values
   (the copy button is an inline-flex that starts hidden). */
[hidden] {
  display: none !important;
}

/* --- Base -------------------------------------------------------------- */

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  padding-block-start: var(--nav);
  font-family: var(--font-text);
  /* The ground: the theme's warm charcoal, kept nearly flat — luxury
     is restraint. Two whispers of warm light (bronze at the top,
     burgundy at the foot) over a gentle charcoal fall, nothing more;
     the cards are solid stone, so text contrast never depends on
     what sits behind a paragraph. */
  background-color: var(--p-bg);
  background-image:
    radial-gradient(56rem 34rem at 88% -6%, rgb(180 83 9 / 0.09), rgb(180 83 9 / 0) 62%),
    radial-gradient(48rem 32rem at 50% 108%, rgb(185 28 28 / 0.06), rgb(185 28 28 / 0) 62%),
    linear-gradient(170deg, #221d1a 0%, #1c1917 42%, #16120f 100%);
  background-attachment: fixed, fixed, scroll;
  background-repeat: no-repeat;
  color: var(--p-ink);
  font-size: 16px;
  line-height: 1.8;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

a,
button,
textarea,
.pill {
  transition:
    background-color var(--m-in) var(--ease),
    border-color var(--m-in) var(--ease),
    color var(--m-in) var(--ease),
    transform var(--m-in) var(--ease),
    background-size var(--m-in) var(--ease);
}

h1,
h2 {
  font-family: var(--font-display);
  color: var(--p-ink);
}

h2 {
  font-weight: 700;
  font-size: 34px;
  line-height: 1.7;
  margin-block: 0;
}

h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.9;
  color: var(--p-ink);
  margin-block: 0;
}

section {
  scroll-margin-top: calc(var(--nav) + var(--s-4));
}

/* A control reached by keyboard must land clear of the fixed header. */
main :is(a, button, input, textarea) {
  scroll-margin-top: calc(var(--nav) + var(--s-4));
}

/* --- Header (nav-mega): stone bar over the charcoal ground ------------- */

.site-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 10;
  height: var(--nav);
  background: rgb(28 25 23 / 0.85);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-block-end: 1px solid var(--line);
}

.header-inner,
.nav-panel-inner,
main,
.footer-close,
.footer-inner,
.footer-legal {
  width: min(100% - 2 * var(--gut), 1280px);
  margin-inline: auto;
}

.header-inner {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}

.skip-link {
  position: absolute;
  inset-block-start: -200px;
  inset-inline-start: 0;
  z-index: 20;
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-btn);
  background: var(--p-action);
  color: var(--p-action-ink);
  font-weight: 500;
  text-decoration: none;
}

.skip-link:focus {
  inset-block-start: var(--s-3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--p-ink);
  text-decoration: none;
}

.mark--initial {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--p-accent);
  color: var(--p-accent-ink);
  box-shadow: 0 4px 14px rgb(180 83 9 / 0.35);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.6;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--s-2) var(--s-5);
}

.nav-word {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 2px;
  border: 0;
  background-color: transparent;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 100% calc(100% - 6px);
  color: var(--p-ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.nav-word:hover {
  background-size: 100% 1px;
}

.nav-word[aria-current="page"] {
  background-image: linear-gradient(var(--p-accent), var(--p-accent));
  background-size: 100% 2px;
  background-position: 100% calc(100% - 5px);
}

.nav-panel {
  position: absolute;
  inset-block-start: 100%;
  inset-inline: 0;
  background: rgb(33 29 26 / 0.97);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-block-end: 1px solid var(--line);
  padding-block: var(--s-6);
  animation: panel-in 200ms var(--ease);
}

@keyframes panel-in {
  from {
    transform: translateY(-6px);
  }
  to {
    transform: none;
  }
}

.nav-panel-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-7);
}

.nav-col-title {
  margin-block: 0 var(--s-3);
  font-size: 13px;
  font-weight: 500;
  color: var(--p-muted);
}

.nav-panel-link {
  display: block;
  padding-block: var(--s-3);
  color: var(--p-ink);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}

.nav-link-line {
  display: block;
  margin-block-start: 2px;
  font-size: 14px;
  font-weight: 400;
  color: var(--p-muted);
}

.nav-panel-link:hover .nav-link-line {
  color: var(--p-ink);
}

.nav-card {
  align-self: start;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: var(--s-5);
}

.nav-card-label {
  margin-block: 0 var(--s-2);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--p-muted);
}

.nav-card-text {
  margin-block: 0 var(--s-4);
  font-size: 15px;
  line-height: 1.8;
}

.nav-card-text:last-child {
  margin-block-end: 0;
}

.nav-card-after {
  color: var(--p-accent);
}

/* --- Layout -------------------------------------------------------------- */

main {
  padding-block: var(--s-7) 0;
}

/* --- Hero: the tool (triptych composition on the app-frame) -------------- */

.tool {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-tool);
  padding: var(--s-5);
}

html.m-enter .tool > * {
  animation: enter-rise 700ms var(--m-ease-enter) both;
}

html.m-enter .tool > :nth-child(2) {
  animation-delay: 90ms;
}

html.m-enter .tool > :nth-child(3) {
  animation-delay: 180ms;
}

html.m-enter .tool > :nth-child(4) {
  animation-delay: 260ms;
}

@keyframes enter-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

h1 {
  font-weight: 700;
  font-size: 40px;
  line-height: 1.6;
  margin-block: 0 var(--s-4);
}

.intro {
  font-size: 18px;
  line-height: 1.8;
  margin-block: 0;
  max-width: 34em;
}

.field-label,
.selector legend {
  font-weight: 500;
  font-size: 14px;
  color: var(--p-ink);
}

.field-label {
  display: block;
  margin-block-end: var(--s-2);
}

textarea {
  width: 100%;
  min-height: 168px;
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel-bg);
  color: var(--p-ink);
  font-family: inherit;
  font-size: 17px;
  line-height: 1.9;
  resize: vertical;
}

textarea::placeholder {
  color: var(--p-muted);
  opacity: 1;
}

textarea:focus {
  outline: none;
  border-color: var(--p-accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.counter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-1) var(--s-4);
  margin-block: var(--s-2) var(--s-4);
  font-size: 13px;
  color: var(--p-muted);
}

.word-counter {
  font-family: var(--font-mono);
  font-size: 13px;
}

.word-counter.is-over {
  color: var(--warning);
}

/* Style / ratio tabs: native radios, the burgundy fill marks the choice. */

.selector {
  border: 0;
  margin: 0;
  padding: 0;
}

.selector legend {
  padding: 0;
  margin-block-end: var(--s-2);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.pill-wrap {
  position: relative;
  display: inline-flex;
}

.pill-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-block: var(--s-2);
  padding-inline: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  background: var(--panel-bg);
  color: var(--p-ink);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.pill-input:not(:checked) + .pill:hover {
  border-color: var(--line-strong);
  background: #33302b;
}

.pill-input:checked + .pill {
  background: var(--p-action);
  border-color: transparent;
  color: var(--p-action-ink);
  box-shadow: 0 6px 18px rgb(69 10 10 / 0.4);
}

.pill-input:focus-visible + .pill {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Buttons: one pair. Primary = the theme's solid burgundy,
   secondary outlined. */

.submit-btn,
.copy-btn,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  font-family: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.submit-btn {
  width: 100%;
  height: 56px;
  padding-inline: var(--s-5);
  background: var(--p-action);
  color: var(--p-action-ink);
  box-shadow: 0 10px 28px -10px var(--shadow-warm);
  font-size: 20px;
}

.submit-btn:hover:not(:disabled),
.btn--primary:hover {
  background: var(--p-action-hover);
  transform: translateY(-1px);
}

.submit-btn:active:not(:disabled),
.btn--primary:active,
.copy-btn:active {
  transform: translateY(1px) scale(0.985);
  transition-duration: var(--m-press);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn--primary {
  height: 56px;
  padding-inline: var(--s-6);
  background: var(--p-action);
  color: var(--p-action-ink);
  box-shadow: 0 10px 28px -10px var(--shadow-warm);
  font-size: 20px;
}

.error-banner {
  margin-block-start: var(--s-4);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--danger-line);
  border-radius: var(--r-md);
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 500;
}

/* The three facts ride in one wrapping row under the action — a single
   quiet line, not a stacked column competing with the form. */
.hero-facts {
  list-style: none;
  margin: var(--s-4) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  font-size: 14px;
  color: var(--p-muted);
}

.hero-facts li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-inline-end: var(--s-2);
  background: var(--p-accent);
  vertical-align: middle;
}

/* --- Result ---------------------------------------------------------------- */

.result-panel {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.04);
  padding: var(--s-5);
}

/* ui.js adds .has-result when a result lands: the panel lights up —
   here, a gold edge and a warm halo instead of the old neon glow. */
.result-panel.has-result {
  border-color: rgb(251 191 36 / 0.55);
  box-shadow:
    0 0 0 1px rgb(251 191 36 / 0.15),
    0 0 34px rgb(180 83 9 / 0.12),
    inset 0 1px 0 rgb(255 255 255 / 0.04);
}

.result-title {
  font-size: 20px;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.9;
  margin-block: 0 var(--s-3);
  color: var(--p-ink);
}

.result-empty {
  color: var(--p-muted);
  margin: 0;
}

.result-text {
  margin: 0;
  font-size: 17px;
  line-height: 1.9;
  color: var(--p-ink);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.result-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2) var(--s-4);
  margin-block-start: var(--s-4);
}

.result-words {
  color: var(--p-muted);
  font-size: 13px;
}

.copy-btn {
  height: 44px;
  padding-inline: var(--s-5);
  background: transparent;
  border-color: var(--line-strong);
  color: var(--p-ink);
  font-size: 16px;
}

.copy-btn:hover {
  background: #33302b;
  transform: translateY(-1px);
}

.copy-btn.is-copied {
  color: var(--success);
  border-color: var(--success);
}

/* --- Content sections: stone cards on the charcoal ground ---------------- */

.content-section {
  margin-block-start: var(--s-9);
}

.content-section h2 {
  margin-block-end: var(--s-7);
}

/* A short gold rule under every section heading — the theme's
   hairline gesture, in solid gold. */
.content-section h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 2px;
  margin-block-start: var(--s-4);
  background: var(--p-accent);
}

.content-section p {
  max-width: 46em;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: var(--s-4);
}

.steps li {
  counter-increment: step;
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card-bg);
  box-shadow: var(--shadow-card);
  padding-block: var(--s-4);
  padding-inline: var(--s-5);
  padding-inline-start: calc(var(--s-7) + var(--s-3));
}

/* Step numerals: one gold, in the serif display face — the theme
   allows a single accent system, held consistently. */
.steps li::before {
  content: counter(step, arabic-indic);
  position: absolute;
  inset-inline-start: var(--s-4);
  inset-block-start: var(--s-4);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.4;
  color: var(--p-accent);
}

/* Benefits span the full container like the steps do — the sections
   share one width system; no reading-rail with a dead end column. */
.benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-4);
}

.benefits li {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card-bg);
  box-shadow: var(--shadow-card);
  padding-block: var(--s-4);
  padding-inline: var(--s-5);
}

.benefits strong {
  color: var(--p-ink);
  font-weight: 500;
}

.faq h3 {
  border: 1px solid var(--line);
  border-block-end: 0;
  border-start-start-radius: var(--r-md);
  border-start-end-radius: var(--r-md);
  background: var(--card-bg);
  padding-block: var(--s-4) 0;
  padding-inline: var(--s-5);
  margin-block-start: var(--s-5);
}

.faq h3:first-child {
  margin-block-start: 0;
}

.faq p {
  border: 1px solid var(--line);
  border-block-start: 0;
  border-end-start-radius: var(--r-md);
  border-end-end-radius: var(--r-md);
  background: var(--card-bg);
  padding-block: var(--s-2) var(--s-4);
  padding-inline: var(--s-5);
  margin-block: 0;
}

.cross-link a,
.footer-nav a {
  color: var(--p-accent);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 100% 100%;
}

.cross-link a:hover,
.footer-nav a:hover {
  background-size: 100% 1px;
}

/* --- Footer: footer.closing (close-word, then footer-dark) ------------------ */

.site-footer {
  margin-block-start: var(--s-9);
}

.footer-close {
  padding-block: var(--s-6) var(--s-8);
}

.close-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-5) var(--s-7);
}

.close-text p {
  margin-block: var(--s-3) 0;
  font-size: 17px;
}

.footer-wordmark {
  margin-block: var(--s-8) 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 9vw, 120px);
  line-height: 1.5;
  /* The build's one gradient: the wordmark in the theme's golds,
     bronze rising to pale champagne. */
  background: linear-gradient(100deg, #92400e 0%, #f59e0b 38%, #fbbf24 62%, #fef3c7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.footer-dir {
  background: var(--bg-deep);
  border-block-start: 1px solid var(--line);
  padding-block: var(--s-8) var(--s-6);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-7);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-block: 0 var(--s-4);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
}

.footer-brand .mark--initial {
  width: 30px;
  height: 30px;
  font-size: 17px;
  border-radius: var(--s-2);
}

.footer-note {
  margin-block: 0;
  max-width: 34em;
  font-size: 14px;
  line-height: 1.8;
  color: var(--p-muted);
}

.footer-col-title {
  margin-block: 0 var(--s-3);
  font-size: 13px;
  font-weight: 500;
  color: var(--p-muted);
}

.footer-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  font-weight: 500;
  color: var(--p-ink);
  background-image: linear-gradient(var(--p-accent), var(--p-accent));
}

.footer-legal {
  margin-block: var(--s-7) 0;
  padding-block-start: var(--s-5);
  border-block-start: 1px solid var(--line);
  font-size: 13px;
  color: var(--p-muted);
}

/* --- Wider screens ---------------------------------------------------------- */

@media (min-width: 640px) {
  .tool {
    padding: var(--s-6);
  }

  .benefits {
    grid-template-columns: repeat(2, 1fr);
  }

  .benefits li:last-child {
    grid-column: 1 / -1;
  }

  .footer-inner {
    grid-template-columns: repeat(12, 1fr);
    column-gap: var(--s-5);
  }

  .footer-about {
    grid-column: 1 / 6;
  }

  .footer-nav {
    grid-column: 6 / 10;
  }

  .footer-nav--info {
    grid-column: 10 / 13;
  }
}

@media (min-width: 1280px) {
  h1 {
    font-size: 52px;
  }

  /* One composition at full width: a headline band across the whole
     card, then the form and the result as side-by-side input / output
     panes (the translator convention — the empty pane beside the input
     reads as "output goes here", not as a second input), and the
     action directly under the form in the form's own column, so the
     button, the error banner and the result all belong to one group. */
  .tool {
    grid-template-columns: repeat(12, 1fr);
    column-gap: var(--s-5);
    row-gap: var(--s-6);
    align-items: start;
  }

  .hero-side {
    grid-column: 1 / 13;
    grid-row: 1;
  }

  .tool-form {
    grid-column: 1 / 8;
    grid-row: 2;
  }

  .hero-action {
    grid-column: 1 / 8;
    grid-row: 3;
  }

  .result-panel {
    grid-column: 8 / 13;
    grid-row: 2 / 4;
    align-self: stretch;
  }

  .submit-btn {
    height: 64px;
  }

  .btn--primary {
    height: 64px;
  }
}

/* Wide content grids: from 1024px the sections share the hero's full
   width — steps in three columns, benefits 3-over-2, FAQ as question /
   answer rows whose answer cell keeps a readable measure. */
@media (min-width: 1024px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    column-gap: var(--s-6);
  }

  .benefits {
    grid-template-columns: repeat(6, 1fr);
  }

  .benefits li {
    grid-column: span 2;
  }

  .benefits li:nth-child(4) {
    grid-column: span 3;
  }

  .benefits li:last-child {
    grid-column: span 3;
  }

  .faq {
    display: grid;
    grid-template-columns: minmax(15rem, 5fr) 7fr;
    row-gap: var(--s-5);
  }

  .faq h3 {
    margin-block-start: 0;
    border: 1px solid var(--line);
    border-inline-end: 0;
    border-start-start-radius: var(--r-md);
    border-end-start-radius: var(--r-md);
    border-start-end-radius: 0;
    border-end-end-radius: 0;
    padding-block: var(--s-4);
  }

  .faq p {
    border: 1px solid var(--line);
    border-start-start-radius: 0;
    border-end-start-radius: 0;
    border-start-end-radius: var(--r-md);
    border-end-end-radius: var(--r-md);
    padding-block: var(--s-4);
  }
}

@media (min-width: 640px) and (max-width: 1279px) {
  /* Stacked, like the phone layout, at a wider measure: the pane
     composition needs its full 1280px to work, and a split form /
     action at this band was the worst of both worlds. DOM order is
     task order, so the single column loses nothing. */
  .tool {
    grid-template-columns: 1fr;
  }
}

/* --- Phone -------------------------------------------------------------------- */

@media (max-width: 639px) {
  :root {
    --nav: 56px;
    --gut: 24px;
  }

  h2 {
    font-size: 27px;
  }

  /* The headline steps down on a phone, like h2 already does — at
     40px it pushed the tool itself off the first screen. */
  h1 {
    font-size: 34px;
  }

  /* The four modes as a 2×2 grid: one equal choice, no orphan pill
     alone on a second row. */
  .pills {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .pill-wrap {
    display: block;
  }

  .pill {
    display: flex;
    width: 100%;
    justify-content: center;
  }

  /* The intro already states all three facts; on a phone the facts
     row would sit between the submit button and the result. */
  .hero-facts {
    display: none;
  }

  main {
    padding-block-start: var(--s-4);
  }

  /* Compact app-frame on a phone: the tool's button stays on the
     first screen. */
  .tool {
    padding: var(--s-4);
    gap: var(--s-4);
  }

  textarea {
    min-height: 112px;
  }

  .intro {
    font-size: 16px;
  }

  .site-footer {
    margin-block-start: var(--s-8);
  }

  .brand-name {
    font-size: 17px;
  }

  .site-nav a.nav-word {
    display: none;
  }

  .nav-panel-inner {
    grid-template-columns: 1fr;
    gap: var(--s-5);
  }

  .content-section {
    margin-block-start: var(--s-8);
  }

  .content-section h2 {
    margin-block-end: var(--s-6);
  }

  .footer-close {
    padding-block: var(--s-4) var(--s-7);
  }

  .close-btn {
    width: 100%;
  }
}

/* --- Reduced motion -------------------------------------------------------------- */

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

  .submit-btn:hover:not(:disabled),
  .btn--primary:hover,
  .copy-btn:hover {
    transform: none;
  }
}
