/* ============================================================
   Перекладач дипломатичної мови
   Brand: Youth Council under the MFA of Ukraine (Brandbook 2024)
   Palette: #0057B7 blue · #FFDD00 yellow · #F3F2F2 dove grey · #272727 slate
   Type:    Bandera Pro (headers) · Osnova Pro (body)
   ============================================================ */

/* --- Brand fonts. Drop BANDERAPRO.TTF / OSNOVAPRO.TTF into /fonts and
       these activate automatically, overriding the web fallbacks. --- */
@font-face {
  font-family: "Bandera Pro";
  src: url("fonts/BANDERAPRO.TTF") format("truetype");
  font-weight: normal; /* single-weight file: lets the browser synthesize bold for 700 */
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Osnova Pro";
  src: url("fonts/OSNOVAPRO.TTF") format("truetype");
  font-weight: normal; /* single-weight file: lets the browser synthesize bold for 700 */
  font-style: normal;
  font-display: swap;
}

:root {
  --blue: #0057b7;
  --blue-700: #00408a;
  --blue-900: #002a5c;
  --blue-tint: #e7effa;
  --yellow: #ffdd00;
  --paper: #f3f2f2;
  --paper-2: #eceae6;
  --white: #ffffff;
  --ink: #272727;
  --ink-soft: #4d4d4d;
  --ink-faint: #7a7a78;
  --line: rgba(39, 39, 39, 0.12);
  --line-strong: rgba(39, 39, 39, 0.22);

  --ff-head: "Bandera Pro", serif;
  --ff-body: "Osnova Pro", sans-serif;

  --shadow-card: 0 1px 2px rgba(39, 39, 39, 0.04), 0 18px 40px -24px rgba(0, 42, 92, 0.28);
  --maxw: 760px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* paper grain to echo the brandbook's recycled-paper texture */
.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
}

/* thin Ukrainian-flag rule at the very top — quiet, official letterhead feel */
.flagbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 4px;
  z-index: 50;
  background: linear-gradient(to bottom, var(--blue) 0 50%, var(--yellow) 50% 100%);
}

main, .site-head, .site-foot { position: relative; z-index: 1; }

/* ---------------- Header ---------------- */
.site-head {
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 24px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  color: var(--blue);
  max-width: 440px;
}
.brand__mark { width: 46px; height: 46px; flex: none; }
.brand__text {
  font-family: var(--ff-head);
  font-size: 15px;
  line-height: 1.22;
  color: var(--blue);
}
.brand__text strong { font-weight: 700; }
.head-tag-wrap { position: relative; display: inline-block; flex: none; }
.head-tag {
  font-family: var(--ff-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
  white-space: nowrap;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.15s;
}
.head-tag:hover { color: var(--blue-900); }
.head-tag:focus-visible { outline: none; border-radius: 4px; box-shadow: 0 0 0 3px rgba(0, 87, 183, 0.4); }
.head-tip {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  background: var(--ink);
  color: #fff;
  font-family: var(--ff-body);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.45);
  z-index: 60;
  animation: tipIn 0.16s ease both;
}
.head-tip[hidden] { display: none; }
.head-tip::before {
  content: "";
  position: absolute;
  bottom: 100%;
  right: 18px;
  border: 6px solid transparent;
  border-bottom-color: var(--ink);
}
@keyframes tipIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------------- Hero ---------------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 24px 80px; }

.hero { padding: 40px 0 30px; position: relative; }
.kicker {
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 16px;
}
.hero__title {
  font-family: var(--ff-head);
  font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 4.3rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0;
}
.hero__lead {
  font-size: clamp(1.02rem, 2.4vw, 1.18rem);
  color: var(--ink-soft);
  max-width: 60ch;
  margin: 26px 0 0;
}

/* ---------------- Console card ---------------- */
.console {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  padding: clamp(22px, 4vw, 38px);
  margin-top: 14px;
}
.field { margin-bottom: 30px; }
.field__label {
  display: block;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin-bottom: 11px;
}

.textwrap { position: relative; }
textarea {
  width: 100%;
  resize: vertical;
  min-height: 92px;
  font-family: var(--ff-body);
  font-size: 1.12rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  padding: 15px 16px 26px;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
textarea::placeholder { color: var(--ink-faint); }
textarea:focus {
  outline: none;
  background: var(--white);
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 87, 183, 0.14);
}
.counter {
  position: absolute;
  right: 12px;
  bottom: 8px;
  font-size: 12px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
}
.examples__lbl { font-size: 13px; color: var(--ink-faint); margin-right: 2px; }
.chip {
  font-family: var(--ff-body);
  font-size: 13px;
  color: var(--blue-700);
  background: var(--blue-tint);
  border: 1px solid transparent;
  border-radius: 100px;
  padding: 6px 13px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.chip:hover { background: #d7e6fb; }
.chip:active { transform: translateY(1px); }

/* format cards */
.formats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 11px;
}
.fmt {
  position: relative;
  display: block;
  cursor: pointer;
  border: 1.5px solid var(--line-strong);
  border-radius: 13px;
  padding: 14px 15px 13px;
  background: var(--paper);
  transition: border-color 0.16s, background 0.16s, box-shadow 0.16s, transform 0.12s;
}
.fmt:hover { transform: translateY(-2px); border-color: var(--blue); }
.fmt input { position: absolute; opacity: 0; pointer-events: none; }
.fmt__name {
  display: block;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink);
  margin-bottom: 3px;
  padding-right: 22px;
}
.fmt__tone { display: block; font-size: 12.5px; line-height: 1.4; color: var(--ink-faint); }
.fmt__tick {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  transition: border-color 0.15s, background 0.15s;
}
.fmt input:checked ~ .fmt__tick { background: var(--blue); border-color: var(--blue); }
.fmt input:checked ~ .fmt__tick::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--yellow);
}
.fmt:has(input:checked) {
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(0, 87, 183, 0.12);
}
.fmt input:focus-visible ~ .fmt__tick { box-shadow: 0 0 0 4px rgba(255, 221, 0, 0.55); }

.fmt-group {
  grid-column: 1 / -1;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-faint);
  margin: 6px 0 -2px;
}

/* length segmented control */
.lengths {
  display: flex;
  gap: 6px;
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  padding: 5px;
}
.len {
  flex: 1 1 0;
  cursor: pointer;
  border-radius: 8px;
  padding: 9px 10px;
  text-align: center;
  color: var(--ink-soft);
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}
.len input { position: absolute; opacity: 0; pointer-events: none; }
.len__t { display: block; font-size: 14px; font-weight: 700; }
.len__s { display: block; font-size: 11.5px; font-weight: 400; color: var(--ink-faint); margin-top: 1px; }
.len:hover { color: var(--ink); }
.len:has(input:checked) {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 14px -8px rgba(0, 64, 138, 0.8);
}
.len:has(input:checked) .len__s { color: rgba(255, 255, 255, 0.82); }
.len:has(input:focus-visible) { box-shadow: 0 0 0 4px rgba(255, 221, 0, 0.55); }

/* submit */
.submit {
  position: relative;
  width: 100%;
  font-family: var(--ff-body);
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: 0.01em;
  color: var(--white);
  background: var(--blue);
  border: none;
  border-radius: 13px;
  padding: 17px 20px;
  cursor: pointer;
  transition: background 0.16s, transform 0.1s, box-shadow 0.16s;
  box-shadow: 0 10px 22px -12px rgba(0, 64, 138, 0.7);
}
.submit:hover:not(:disabled) { background: var(--blue-700); }
.submit:active:not(:disabled) { transform: translateY(1px); }
.submit:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(255, 221, 0, 0.6); }
.submit:disabled { cursor: progress; opacity: 0.92; }
.submit__spinner {
  display: none;
  width: 18px;
  height: 18px;
  margin-left: 10px;
  vertical-align: -3px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.submit.is-loading .submit__spinner { display: inline-block; }

/* ---------------- Result ---------------- */
.result {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfcfe, var(--white));
  padding: 22px 24px;
  animation: rise 0.45s ease both;
}
.result__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.result__label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--blue);
}
.result__fmt { font-size: 12.5px; color: var(--ink-faint); text-align: right; }
.result__text {
  font-family: var(--ff-head);
  font-size: clamp(1.18rem, 3vw, 1.4rem);
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
}
.result__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.ghost {
  font-family: var(--ff-body);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--blue-700);
  background: transparent;
  border: 1.5px solid var(--line-strong);
  border-radius: 100px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ghost:hover { background: var(--blue-tint); border-color: var(--blue); }
.ghost:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(255, 221, 0, 0.5); }
.ghost.is-ok { color: var(--blue-900); border-color: var(--blue); background: var(--blue-tint); }

.explain {
  margin-top: 16px;
  padding: 16px 18px;
  background: var(--paper);
  border-radius: 10px;
  animation: rise 0.35s ease both;
}
.explain p { margin: 0; font-size: 15px; line-height: 1.62; color: var(--ink-soft); }

.errorbox {
  margin-top: 20px;
  padding: 14px 16px;
  border: 1.5px solid #d8b400;
  background: #fff8d6;
  border-radius: 10px;
  font-size: 14.5px;
  color: #5c4a00;
}

.console__note {
  margin: 24px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-faint);
}

/* ---------------- Footer ---------------- */
.site-foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px 24px 56px;
  border-top: 1px solid var(--line);
}
.foot__row { margin-bottom: 14px; }
.foot__logo { height: 60px; width: auto; opacity: 0.92; }
.foot__meta { margin: 0; font-size: 13px; color: var(--ink-faint); }

/* ---------------- Animations ---------------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.reveal { opacity: 0; transform: translateY(14px); animation: rise 0.6s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: var(--d, 0s); }

@media (prefers-reduced-motion: reduce) {
  .reveal, .result, .explain { animation: none; opacity: 1; transform: none; }
  .submit__spinner { animation-duration: 1.4s; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 620px) {
  body { font-size: 16px; }
  .site-head { flex-wrap: wrap; padding-top: 18px; }
  .head-tag { order: 3; }
  .formats { grid-template-columns: 1fr; }
  .hero { padding-top: 26px; }
  .result__head { flex-direction: column; gap: 2px; }
  .result__fmt { text-align: left; }
}

/* ============================================================
   Additions: nav, watermark, comparison, how-it-works,
   did-you-know, license, About modal, design polish
   ============================================================ */

/* header nav */
.head-right { display: flex; align-items: center; gap: 16px; }
.navlink {
  flex: none;
  font-family: var(--ff-body);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--blue-900);
  background: var(--yellow);
  border: none;
  cursor: pointer;
  padding: 7px 13px;
  border-radius: 100px;
  white-space: nowrap;
  transition: filter 0.15s;
}
.navlink:hover { filter: brightness(0.96); }
.navlink:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0, 87, 183, 0.55); }

/* faint emblem watermark behind the hero */
.hero { position: relative; overflow: hidden; }
.hero > :not(.hero__wm) { position: relative; z-index: 1; }
.hero__wm {
  position: absolute;
  top: -26px;
  right: -40px;
  width: 280px;
  height: auto;
  opacity: 0.05;
  z-index: 0;
  pointer-events: none;
  filter: grayscale(0.2);
}

/* link-style button */
.linkbtn {
  font-family: var(--ff-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--blue-700);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
}
.linkbtn:hover { color: var(--blue); text-decoration: underline; }
.linkbtn:focus-visible { outline: none; border-radius: 4px; box-shadow: 0 0 0 4px rgba(255, 221, 0, 0.5); }

.result__compare { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }

/* comparison panel */
.compare { margin-top: 24px; animation: rise 0.4s ease both; }
.compare__title {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 14px;
}
.compare__list { display: grid; gap: 11px; }
.compare__item {
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 11px;
  background: var(--white);
  padding: 14px 16px;
}
.compare__fmt {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 5px;
}
.compare__text { font-family: var(--ff-head); font-size: 1.06rem; line-height: 1.46; color: var(--ink); }
.compare__item.is-pending .compare__text { color: var(--ink-faint); font-style: italic; }
.compare__item.is-error { border-left-color: #d8b400; }

/* section title */
.section-title {
  font-family: var(--ff-head);
  font-weight: 700;
  font-size: clamp(1.4rem, 4vw, 1.7rem);
  color: var(--ink);
  margin: 0 0 20px;
}

/* how it works */
.how { margin-top: 58px; }
.how__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.how__step {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 20px;
}
.how__num {
  flex: none;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-family: var(--ff-head);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.how__txt { font-size: 14.5px; line-height: 1.5; color: var(--ink-soft); }
.how__txt strong { color: var(--ink); }

/* did you know */
.fact { margin-top: 44px; }
.fact__card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--yellow);
  border-radius: 16px;
  padding: 24px 26px;
  box-shadow: var(--shadow-card);
}
.fact__label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--blue);
}
.fact__text {
  font-family: var(--ff-head);
  font-size: clamp(1.08rem, 2.6vw, 1.22rem);
  line-height: 1.5;
  color: var(--ink);
  margin: 10px 0 14px;
}

/* footer license */
.foot__license {
  margin: 16px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-faint);
}
.foot__license a { color: var(--blue-700); }
.foot__license img {
  width: 1em; height: 1em;
  max-width: 1em; max-height: 1em;
  margin-left: 0.2em;
  vertical-align: text-bottom;
  opacity: 0.7;
}

/* About modal */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(15, 28, 46, 0.55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.modal__panel {
  position: relative;
  background: var(--white);
  border-radius: 18px;
  max-width: 580px;
  width: 100%;
  max-height: 86vh;
  overflow: auto;
  padding: 36px 36px 30px;
  box-shadow: 0 30px 80px -20px rgba(0, 42, 92, 0.55);
  animation: rise 0.3s ease both;
}
.modal__close {
  position: absolute;
  top: 14px; right: 16px;
  width: 34px; height: 34px;
  border: none;
  background: var(--paper);
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.15s;
}
.modal__close:hover { background: #e6e5e1; }
.modal__title { font-family: var(--ff-head); font-size: clamp(1.5rem, 5vw, 1.8rem); color: var(--ink); margin: 0 0 16px; }
.modal p { font-size: 15px; line-height: 1.62; color: var(--ink-soft); margin: 0 0 12px; }
.modal a { color: var(--blue-700); }
.modal .modal__sub {
  color: var(--blue);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 12.5px;
  margin: 20px 0 8px;
}
.modal__list { margin: 0 0 12px; padding-left: 20px; color: var(--ink-soft); font-size: 15px; line-height: 1.6; }
.modal__list li { margin-bottom: 5px; }
.modal .modal__credit { font-size: 12.5px; color: var(--ink-faint); margin-top: 20px; }

@media (max-width: 620px) {
  .how__steps { grid-template-columns: 1fr; }
  .head-right { gap: 10px; }
  .hero__wm { width: 190px; opacity: 0.045; }
  .modal__panel { padding: 28px 22px 24px; }
}

/* ---------------- Footer QR + souvenir modal ---------------- */
.foot__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.foot__qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: var(--blue);
  font-family: var(--ff-body);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}
.foot__qr img {
  width: 110px;
  height: 110px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 6px;
}
.foot__qr:hover img { border-color: var(--blue); }
.foot__qr-title { display: block; max-width: 160px; }
.foot__qr-cta {
  display: inline-block;
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--blue-900);
  background: var(--yellow);
  padding: 3px 10px;
  border-radius: 100px;
}
.foot__qr:hover .foot__qr-cta { filter: brightness(0.96); }

.modal__panel--souvenir { max-width: 460px; text-align: center; }
.souvenir__img {
  width: auto;
  max-width: 300px;
  max-height: 64vh;
  display: block;
  margin: 8px auto 0;
  border-radius: 12px;
  box-shadow: 0 14px 34px -14px rgba(0, 42, 92, 0.45);
}
.souvenir__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}
.souvenir__btn {
  font-family: var(--ff-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  padding: 11px 20px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.souvenir__btn:hover { border-color: var(--blue); }
.souvenir__btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0, 87, 183, 0.45); }
.souvenir__btn--cta { background: var(--blue); color: #fff; border-color: var(--blue); }
.souvenir__btn--cta:hover { background: var(--blue-900); }
.souvenir__hint { font-size: 12.5px; color: var(--ink-faint); margin: 12px 0 0; }

@media (max-width: 620px) {
  .foot__top { justify-content: center; text-align: center; }
}

/* ============================================================
   Mobile optimization (phones) — overrides earlier breakpoints
   ============================================================ */
@media (max-width: 620px) {
  body { overflow-x: hidden; }

  /* tighter gutters */
  main { padding: 0 18px 60px; }
  .site-head { padding: 16px 18px 6px; }
  .site-foot { padding: 26px 18px 46px; }

  /* header: brand on top, actions on their own row below */
  .site-head { flex-direction: column; align-items: flex-start; gap: 12px; flex-wrap: nowrap; }
  .brand { max-width: 100%; gap: 11px; }
  .brand__mark { width: 40px; height: 40px; }
  .brand__text { font-size: 13.5px; }
  .head-right { width: 100%; gap: 12px; flex-wrap: wrap; align-items: center; }

  /* hero */
  .hero { padding: 20px 0 22px; }
  .kicker { font-size: 12px; letter-spacing: 0.12em; margin-bottom: 12px; }
  .hero__title { font-size: clamp(2.15rem, 9.5vw, 3rem); }
  .hero__lead { font-size: 1rem; margin-top: 18px; }
  .hero__wm { width: 168px; opacity: 0.045; top: -8px; right: -22px; }

  /* console */
  .console { padding: 20px 16px; border-radius: 16px; margin-top: 12px; }
  .formats { grid-template-columns: 1fr; }
  .chip { padding: 8px 13px; }

  /* length control a touch tighter so 3 segments fit cleanly */
  .len { padding: 9px 6px; }
  .len__t { font-size: 13px; }
  .len__s { font-size: 10.5px; }

  /* result actions stack full-width for easy tapping */
  .result__head { flex-direction: column; gap: 2px; }
  .result__fmt { text-align: left; }
  .result__actions { flex-direction: column; align-items: stretch; gap: 9px; }
  .result__actions .ghost { width: 100%; text-align: center; }

  /* sections */
  .how { margin-top: 42px; }
  .section-title { margin-bottom: 16px; }
  .how__steps { grid-template-columns: 1fr; gap: 12px; }
  .fact { margin-top: 32px; }
  .fact__card { padding: 20px; }

  /* footer: logo and QR share one row on opposite sides */
  .foot__top { flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: nowrap; text-align: left; }
  .foot__logo { height: auto; max-width: 50%; }
  .foot__qr { flex: none; }
  .foot__qr img { width: 88px; height: 88px; }
  .foot__qr span { font-size: 11px; }

  /* modals become bottom sheets — a natural mobile pattern */
  .modal { padding: 0; align-items: flex-end; }
  .modal__panel {
    width: 100%;
    max-width: none;
    max-height: 92vh;
    max-height: 88dvh;
    padding: 16px 20px 26px;
    border-radius: 18px 18px 0 0;
    animation: sheet 0.28s ease both;
  }
  .modal__panel--souvenir { max-width: none; }
  /* keep the close button pinned & reachable while the sheet scrolls */
  .modal__close {
    position: sticky;
    top: 6px;
    right: auto;
    display: block;
    margin: 0 -4px 2px auto;
  }
  .modal__title { margin-top: 0; }
  .modal p { margin-bottom: 10px; }
  .modal .modal__sub { margin: 16px 0 6px; }
}

@keyframes sheet { from { transform: translateY(26px); opacity: 0; } to { transform: none; opacity: 1; } }
