/*
 * Moratti Scooter Trikes — User Manual
 * Tokens, type and components follow the morattibali theme (assets/site.css)
 * so the manual reads as part of morattibali.com.
 */
:root {
    --ink: #143e36;
    --paper: #f8f5ed;
    --orange: #ee592f;
    --orange-dark: #c8431f;
    --line: #d8ddd3;
    --muted: #59665f;
    --sage: #e9eee6;
    --sand: #e8ddc8;
    --sand-line: #d8c9ae;
    --navy: #123e5c;
    --font: 'DM Sans', Arial, sans-serif;
    --display: 'Manrope', Arial, sans-serif;
    --gutter: 6.2%;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 150px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--font); -webkit-text-size-adjust: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
a, button { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--display); }
h1, h2 { font-weight: 500; letter-spacing: -.055em; line-height: 1.05; overflow-wrap: break-word; hyphens: auto; }
h1 { font-size: clamp(2.8rem, 6vw, 5.6rem); margin-bottom: 26px; }
h2 { font-size: clamp(2rem, 3.6vw, 3.4rem); margin-bottom: 0; }
h3 { font-size: 1.2rem; line-height: 1.3; letter-spacing: -.03em; font-weight: 600; }
em { font-family: Georgia, serif; font-weight: 400; letter-spacing: -.04em; }
p { color: var(--muted); }
.eyebrow { font-size: .75rem; letter-spacing: .12em; font-weight: 700; color: var(--ink); margin-bottom: 24px; }
.text-link { font-weight: 600; }
.text-link:hover, .footer a:hover { text-decoration: underline; text-underline-offset: 6px; }

/*
 * DM Sans has no Cyrillic or CJK. Arial comes before the CJK fonts so Latin
 * and Cyrillic never fall into Japanese/Chinese glyphs, and each CJK language
 * gets its own fonts (a Japanese font would draw Chinese with Japanese forms).
 */
.lang-zh, :lang(zh) { --font: 'DM Sans', Arial, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif; }
.lang-ja, :lang(ja) { --font: 'DM Sans', Arial, 'Hiragino Sans', 'Yu Gothic', 'Meiryo', 'Noto Sans JP', sans-serif; }
.lang-ko, :lang(ko) { --font: 'DM Sans', Arial, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif; }
.language-option, .lang-card { font-family: var(--font); }
.language-option:lang(ru), .lang-card:lang(ru) { font-family: 'DM Sans', Arial, sans-serif; }
.lang-zh h1, .lang-zh h2, .lang-ja h1, .lang-ja h2, .lang-ko h1, .lang-ko h2 { letter-spacing: -.01em; line-height: 1.2; font-family: var(--font); font-weight: 700; }
.lang-ru h1, .lang-ru h2 { letter-spacing: -.035em; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 5px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* Buttons — same as the theme */
.button { display: inline-flex; align-items: center; justify-content: space-between; gap: 26px; border: 1px solid transparent; padding: 15px 22px; font-size: 1rem; line-height: 1.3; font-weight: 600; border-radius: 5px; transition: transform .2s, background .2s; min-height: 50px; }
.button:hover { transform: translateY(-2px); }
.button > span[aria-hidden] { font-size: 1.25rem; }
.button.orange { background: var(--orange); color: #fff; }
.button.orange:hover { background: var(--orange-dark); }
.button.dark { background: var(--ink); color: #fff; }
.button.outline { border-color: var(--ink); }
.button.outline-light { border-color: #ffffff80; color: #fff; }
.button.small { padding: 11px 18px; font-size: .875rem; min-height: 44px; gap: 14px; }
.button-flag { display: inline-flex; align-items: center; gap: 12px; }

/* Header */
.header { position: sticky; top: 0; z-index: 30; height: 86px; padding: 0 4.3%; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(8px); }
.logo { display: flex; align-items: center; gap: 16px; }
.logo img { width: 142px; height: auto; mix-blend-mode: multiply; }
.logo span { font-size: .75rem; letter-spacing: .2em; padding-left: 16px; border-left: 1px solid var(--line); }
.header-actions { display: flex; align-items: center; gap: 14px; }

/* Flags */
.flag { width: 22px; height: 16px; border-radius: 2px; flex: none; box-shadow: 0 0 0 1px #143e361f; }
.flag-lg { width: 44px; height: 31px; border-radius: 3px; }

/* Language picker — mirrors .language-picker on morattibali.com */
.language-picker { position: relative; }
.language-trigger { min-width: 164px; height: 46px; border: 1px solid #cbbd9f; border-radius: 6px; background: var(--paper); color: var(--ink); display: flex; align-items: center; gap: 10px; padding: 0 14px; font-weight: 600; box-shadow: 0 2px 8px #143e3612; }
.language-chevron { margin-left: auto; font-size: 1.15rem; line-height: 1; transition: transform .2s; transform: translateY(-3px); }
.language-trigger[aria-expanded="true"] .language-chevron { transform: rotate(180deg) translateY(-3px); }
.language-options { position: absolute; top: 52px; right: 0; width: min(700px, calc(100vw - 24px)); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; padding: 10px; background: var(--paper); border: 1px solid var(--sand-line); border-radius: 8px; box-shadow: 0 16px 35px #143e3630; z-index: 40; }
.language-options[hidden] { display: none; }
.language-option { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 12px; border: 1px solid var(--sand-line); background: var(--sand); border-radius: 6px; color: #283a4c; font-weight: 600; white-space: nowrap; overflow: hidden; }
.language-option span { overflow: hidden; text-overflow: ellipsis; }
.language-option:hover { background: #ddd0b6; }
.language-option.selected { background: var(--navy); border-color: var(--navy); color: #f8eac9; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.16fr 1fr; min-height: 620px; }
.hero-copy { padding: 66px 8% 30px 7.4%; display: flex; flex-direction: column; }
.hero-copy .eyebrow { margin-bottom: 42px; }
.lead { max-width: 460px; font-size: 1.12rem; line-height: 1.65; margin-bottom: 30px; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 18px 28px; margin-bottom: 56px; }
.hero-footer { border-top: 1px solid var(--line); padding-top: 22px; margin-top: auto; display: flex; align-items: end; justify-content: space-between; gap: 20px; font-size: .875rem; color: var(--muted); }
.hero-footer strong { color: var(--ink); font-size: 1.05rem; }
.hero-visual { position: relative; overflow: hidden; background: #1e3d35; min-height: 420px; }
.hero-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.hero-visual:after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #0004, transparent 30%, transparent 62%, #0009); pointer-events: none; }
.hero-caption { position: absolute; left: 32px; bottom: 30px; z-index: 1; margin: 0; color: #fff; font-family: Georgia, serif; font-style: italic; font-size: 2.1rem; line-height: 1.1; letter-spacing: -.04em; }
.hero-caption em { font-style: italic; }

/* Landing: language cards */
.section { padding: 96px var(--gutter); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 35px; margin-bottom: 42px; }
.section-heading > p { margin-bottom: 6px; min-width: 200px; text-align: right; }
.languages { background: var(--sage); }
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.lang-card { display: flex; align-items: center; gap: 16px; padding: 18px; background: var(--paper); border: 1px solid #d1d8ce; border-radius: 6px; transition: transform .2s, border-color .2s, background .2s; min-height: 86px; }
.lang-card:hover { transform: translateY(-2px); border-color: var(--ink); }
.lang-card-text { display: flex; flex-direction: column; min-width: 0; }
.lang-card-name { font-weight: 700; font-size: 1.05rem; }
.lang-card-title { font-size: .85rem; color: var(--muted); }
.lang-card-arrow { margin-left: auto; font-size: 1.2rem; }
.lang-card.selected { background: var(--navy); border-color: var(--navy); color: #f8eac9; }
.lang-card.selected .lang-card-title { color: #cbd8e2; }

.facts { background: var(--ink); color: #fff; display: grid; grid-template-columns: repeat(4, 1fr); padding: 27px 5%; gap: 20px; font-size: .95rem; }
.facts span { display: flex; flex-direction: column; gap: 2px; }
.facts b { font-size: .75rem; color: #b8cec4; font-weight: 400; letter-spacing: .04em; }

/* Table of contents */
.toc { position: sticky; top: 86px; z-index: 20; background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.toc-track { display: flex; gap: 6px; overflow-x: auto; padding: 10px 4.3%; scrollbar-width: none; }
.toc-track::-webkit-scrollbar { display: none; }
.toc a { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; font-weight: 500; white-space: nowrap; transition: background .2s, color .2s; }
.toc a span { font-family: Georgia, serif; color: var(--orange); }
.toc a:hover { border-color: var(--ink); }
.toc a.is-current { background: var(--ink); border-color: var(--ink); color: #fff; }
.toc a.is-current span { color: #f7b49f; }

/* Chapters */
.chapter { padding: 90px var(--gutter); border-bottom: 1px solid var(--line); }
.chapter-alt { background: var(--sage); }
.chapter-dark { background: var(--ink); color: #fff; border-bottom-color: var(--ink); }
.chapter-dark p { color: #c7d9ce; }
.chapter-head { display: grid; grid-template-columns: 90px 1fr; align-items: baseline; column-gap: 10px; margin-bottom: 46px; max-width: 980px; }
.chapter-head > p { grid-column: 2; margin: 18px 0 0; max-width: 620px; font-size: 1.05rem; }
.chapter-no { font-family: Georgia, serif; font-size: 2.6rem; line-height: 1; color: var(--orange); }
.chapter-body { display: grid; gap: 40px; }
.chapter-body.split, .chapter-dark .chapter-body { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; gap: 56px; }
.chapter-photo { width: 100%; height: auto; max-height: 620px; object-fit: cover; border-radius: 6px; }
.dark-photo { background: #0d0d0d; object-fit: contain; }
.sub-title { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; font-family: var(--font); font-weight: 700; margin: 0 0 6px; }
.sub-title + .control-list { margin-bottom: 34px; }

.rule-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; }
.rule-list li { display: grid; grid-template-columns: 44px 1fr; gap: 10px; padding: 20px 0; border-top: 1px solid var(--line); }
.rule-list p { margin: 0; color: var(--ink); }
.rule-no { font-family: Georgia, serif; font-size: 1.5rem; line-height: 1.1; color: var(--orange); }

.warning-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.warning-list li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; padding: 20px; border: 1px solid #ffffff2b; border-radius: 6px; background: #ffffff0d; }
.warning-list p { margin: 0; color: #fff; }
.warning-mark, .usb-warning > span { width: 30px; height: 30px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-weight: 800; }

.card-grid { display: grid; gap: 18px; }
.card-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.item-card { margin: 0; background: #fff; border: 1px solid #d1d8ce; border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; }
.item-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; padding: 24px; }
.photo-card img { object-fit: cover; padding: 0; aspect-ratio: 3 / 4; background: #0d0d0d; }
.item-card figcaption { display: flex; gap: 12px; align-items: baseline; padding: 18px 20px; border-top: 1px solid var(--line); font-weight: 600; margin-top: auto; }
.item-card figcaption span { font-family: Georgia, serif; color: var(--orange); font-weight: 400; }

.control-list, .knob-list, .check-list { list-style: none; margin: 0; padding: 0; }
.control-list li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; padding: 16px 0; border-top: 1px solid #c7d0c4; }
.control-list strong { display: block; font-size: 1.02rem; }
.control-list p { margin: 4px 0 0; font-size: .94rem; }
.control-no { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: .85rem; font-weight: 700; }

.note-box { margin-top: 28px; padding: 26px 28px; border-left: 4px solid var(--orange); background: #fff; border-radius: 0 6px 6px 0; max-width: 860px; }
.note-box h3 { margin-bottom: 10px; }
.note-box ol { margin: 0; padding-left: 20px; color: var(--muted); }
.note-box li + li { margin-top: 6px; }

.dashboard-photo { width: 100%; max-width: 760px; margin: 0 auto 40px; border-radius: 10px; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.icon-item { display: grid; grid-template-columns: 48px 1fr; gap: 14px; padding: 18px; background: var(--paper); border: 1px solid #d1d8ce; border-radius: 6px; }
.icon-item strong { display: block; line-height: 1.3; }
.icon-item p { margin: 4px 0 0; font-size: .9rem; }
.icon-glyph { width: 48px; height: 48px; border-radius: 8px; background: #101614; display: grid; place-items: center; }
.icon-green { color: #36d27a; }
.icon-amber { color: #ffb020; }
.icon-blue { color: #4aa8ff; }
.icon-red { color: #ff5a4f; }
.icon-plain { color: #e8f1ec; }
.icon-text { font-weight: 800; font-size: .95rem; letter-spacing: .02em; }
.icon-display { font-family: 'Courier New', monospace; font-weight: 700; font-size: .6rem; }

.knob-list li { padding: 16px 0; border-top: 1px solid var(--line); }
.knob-list p { margin: 8px 0 0; }
.knob-chip { display: inline-flex; align-items: center; gap: 10px; padding: 5px 12px 5px 6px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; font-size: .85rem; letter-spacing: .04em; }
.knob-chip span { min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; background: #ffffff1f; display: grid; place-items: center; font-size: .7rem; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.steps li { border-top: 1px solid #c7d0c4; padding-top: 20px; }
.steps img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; background: #0d0d0d; margin-bottom: 22px; }
.step-no { display: block; font-family: Georgia, serif; font-size: 1.6rem; color: var(--orange); margin-bottom: 10px; }
.steps p { margin: 0; color: var(--ink); }

.check-list li { position: relative; padding: 14px 0 14px 32px; border-top: 1px solid var(--line); color: var(--ink); }
.check-list li:before { content: '✓'; position: absolute; left: 4px; top: 14px; color: var(--orange); font-weight: 700; }

.usb-copy { align-self: center; }
.usb-lead { font-family: var(--display); font-size: clamp(1.4rem, 2.4vw, 2rem); line-height: 1.3; letter-spacing: -.03em; color: #fff !important; }
.usb-warning { display: grid; grid-template-columns: 30px 1fr; gap: 14px; align-items: start; padding: 20px; border: 1px solid #ffffff2b; border-radius: 6px; }

.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.info-card { padding: 28px; background: #fff; border: 1px solid #d1d8ce; border-radius: 6px; }
.info-card.wide { grid-column: 1 / -1; }
.info-card h3 { margin-bottom: 14px; }
.info-value { font-family: var(--display); font-size: 1.6rem; font-weight: 600; letter-spacing: -.03em; color: var(--ink); margin: 0; }
.info-card dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 10px 20px; }
.info-card dt { color: var(--muted); }
.info-card dd { margin: 0; font-weight: 700; text-align: right; }

.final-call { text-align: center; background: var(--ink); color: #fff; padding: 90px 20px; }
.final-call .eyebrow { color: #c7d9ce; }
.final-call h2 { font-size: clamp(2.2rem, 5vw, 4.6rem); margin-bottom: 34px; letter-spacing: -.04em; }
.final-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }
.final-note { color: #c7d9ce; font-size: .875rem; margin: 23px 0 0; }

/* Footer — same grid as the theme */
.footer { padding: 65px var(--gutter) 20px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; font-size: .9rem; }
.footer .eyebrow { font-size: .75rem; }
.footer p { margin: 18px 0; }
.footer a { overflow-wrap: anywhere; }
.footer-logo { display: inline-flex; }
.footer-bottom { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 22px; display: flex; gap: 25px; justify-content: space-between; font-size: .8rem; }

@media (min-width: 1600px) { body { max-width: 1800px; margin: auto; } }

@media (max-width: 1050px) {
    .hero { grid-template-columns: 1fr 1fr; }
    .rule-list { grid-template-columns: 1fr; }
    .card-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
    .steps { gap: 18px; }
}

@media (max-width: 760px) {
    html { scroll-padding-top: 136px; }
    .header { height: 70px; padding: 0 16px; gap: 10px; }
    .logo { gap: 10px; }
    .logo img { width: 104px; }
    .logo span { padding-left: 10px; font-size: .65rem; }
    .header-cta { display: none; }
    .language-trigger { min-width: 0; height: 44px; padding: 0 10px; gap: 8px; }
    .language-trigger-label { max-width: 86px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .language-options { position: fixed; top: 76px; left: 12px; right: 12px; width: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: min(72vh, 560px); overflow: auto; }
    .toc { top: 70px; }
    .toc-track { padding: 10px 16px; }

    .hero { grid-template-columns: 1fr; min-height: 0; }
    .hero-copy { padding: 40px 16px 28px; min-width: 0; }
    h1 { font-size: clamp(2.1rem, 10vw, 2.8rem); }
    h2 { font-size: clamp(1.7rem, 7.5vw, 2.2rem); }
    .hero-copy .eyebrow { margin-bottom: 24px; }
    .hero-actions { margin-bottom: 32px; }
    .hero-actions .button { width: 100%; }
    .hero-visual { min-height: 0; aspect-ratio: 4 / 3; order: -1; }
    .manual-hero .hero-visual { aspect-ratio: 16 / 10; }
    .hero-caption { left: 16px; bottom: 16px; font-size: 1.5rem; }

    .section { padding: 60px 16px; }
    .section-heading { flex-direction: column; align-items: start; gap: 8px; margin-bottom: 26px; }
    .section-heading > p { text-align: left; }
    .lang-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .lang-card { flex-direction: column; align-items: start; gap: 10px; padding: 14px; min-height: 0; }
    .lang-card-arrow { display: none; }
    .facts { grid-template-columns: 1fr 1fr; padding: 24px 16px; }

    .chapter { padding: 56px 16px; }
    .chapter-head { grid-template-columns: 1fr; margin-bottom: 28px; }
    .chapter-head > p { grid-column: 1; }
    .chapter-no { font-size: 2rem; margin-bottom: 10px; }
    .chapter-body.split, .chapter-dark .chapter-body { grid-template-columns: 1fr; gap: 28px; }
    .chapter-photo { max-height: 420px; }
    .card-grid.three, .card-grid.two { grid-template-columns: 1fr 1fr; }
    .card-grid.three > :last-child:nth-child(odd) { grid-column: 1 / -1; }
    .item-card img { padding: 14px; }
    .item-card figcaption { padding: 14px; font-size: .92rem; }
    .steps { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; }
    .note-box { padding: 20px; }
    .icon-grid { grid-template-columns: 1fr; }

    .footer { padding: 45px 16px 28px; grid-template-columns: 1fr 1fr; gap: 35px 20px; }
    .footer > div:first-child { grid-column: 1 / -1; }
    .footer-bottom { flex-wrap: wrap; gap: 15px; font-size: .75rem; }
    .footer-bottom > span { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .button, .lang-card { transition: none; }
}

@media print {
    .header, .toc, .final-call, .footer, .hero-visual, .hero-actions { display: none !important; }
    .hero { display: block; min-height: 0; }
    .chapter, .chapter-dark, .chapter-alt { background: #fff; color: #000; padding: 24px 0; break-inside: avoid-page; }
    .chapter-dark p, .warning-list p { color: #000; }
}
