:root {
  --ink: #1b1917;
  --muted: #746e66;
  --line: #e6ded3;
  --paper: #f7f3ed;
  --card: #fffdfa;
  --accent: #a56c4d;
  --accent-dark: #744833;
  --sage: #5f7466;
  --shadow: 0 20px 55px rgba(71, 52, 35, .09);
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "DM Sans", system-ui, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.shell { min-height: 100vh; }
@keyframes page-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: no-preference) {
  #app > .shell { animation: page-enter .36s cubic-bezier(.22, 1, .36, 1) both; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }
}
.topbar { width: min(1280px, calc(100% - 64px)); min-height: 76px; margin: 0 auto; padding: 23px 0; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { border: 0; background: transparent; padding: 0; display: flex; align-items: baseline; gap: 10px; color: var(--ink); }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -.03em; }
.brand-sub { color: var(--muted); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.top-actions { display: flex; gap: 12px; align-items: center; }
.header-search { display: flex; min-width: 0; align-items: center; gap: 8px; }
.header-search .search-field { width: clamp(260px, 36vw, 520px); }
.header-search .search-field input { min-height: 38px; border-radius: 999px; font-size: 13px; }
.header-search .search-status { min-width: 0; white-space: nowrap; }
.language-switch { min-height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 253, 250, .62); color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.language-active { color: var(--ink); font-weight: 700; }
.language-divider { color: #c3b6a9; }
.language-option, .text-button { border: 0; background: transparent; color: var(--muted); padding: 7px 0; font-size: 13px; }
.top-actions > .text-button { min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.language-option:hover, .text-button:hover { color: var(--ink); }
.top-actions > .text-button:hover { border-color: #cdb6a4; box-shadow: 0 8px 20px rgba(71, 52, 35, .07); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

main { width: min(1280px, calc(100% - 64px)); margin: 0 auto; }
.hero { min-height: calc(100vh - 76px); display: grid; place-items: center; padding: 76px 0 100px; }
.hero-inner { width: min(760px, 100%); text-align: center; }
.eyebrow { margin: 0 0 20px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
h1, h2, h3 { margin: 0; font-family: "Playfair Display", Georgia, serif; font-weight: 600; letter-spacing: -.035em; }
h1 { font-size: clamp(48px, 8vw, 88px); line-height: .98; }
.hero-copy { max-width: 510px; margin: 25px auto 40px; color: var(--muted); font-size: 17px; line-height: 1.7; }
.language-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; max-width: 540px; margin: 0 auto; }
.language-card { position: relative; min-height: 170px; padding: 28px; text-align: left; border: 1px solid var(--line); border-radius: 3px; background: var(--card); box-shadow: var(--shadow); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.language-card:hover { transform: translateY(-4px); border-color: #cdb6a4; box-shadow: 0 25px 70px rgba(71, 52, 35, .14); }
.language-card[dir="rtl"] { text-align: right; }
.language-label { color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.language-title { display: block; margin-top: 35px; font-family: "Playfair Display", Georgia, serif; font-size: 30px; }
.language-arrow { position: absolute; right: 22px; bottom: 20px; color: var(--accent); font-size: 22px; }
.language-card[dir="rtl"] .language-arrow { right: auto; left: 22px; }

.page-head { padding: 72px 0 42px; display: flex; align-items: end; justify-content: space-between; gap: 70px; }
.page-kicker { margin: 0 0 12px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.page-head h1 { font-size: clamp(40px, 5vw, 68px); }
.page-intro { max-width: 430px; margin: 0; color: var(--muted); line-height: 1.7; }
.tutorial-search { display: grid; grid-template-columns: auto minmax(260px, 520px) auto; align-items: center; gap: 16px; margin: 0 0 20px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 253, 250, .62); }
.search-label { color: var(--ink); font-size: 13px; font-weight: 700; }
.search-field { position: relative; width: 100%; }
.search-field input { width: 100%; min-height: 48px; padding: 0 42px 0 16px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: var(--card); color: var(--ink); font-size: 14px; transition: border-color .2s ease, box-shadow .2s ease; }
.search-field input::placeholder { color: #9a9188; }
.search-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(165, 108, 77, .14); }
[dir="rtl"] .search-field input { padding-right: 16px; padding-left: 42px; text-align: right; }
.search-clear { position: absolute; top: 50%; right: 10px; width: 28px; height: 28px; transform: translateY(-50%); border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
[dir="rtl"] .search-clear { right: auto; left: 10px; }
.search-clear:hover { background: #f0e8de; color: var(--ink); }
.search-status { min-width: 62px; margin: 0; color: var(--muted); font-size: 12px; text-align: end; }
.search-empty { grid-column: 1 / -1; margin: 0; padding: 44px 20px; border: 1px dashed var(--line); color: var(--muted); text-align: center; }
.tutorial-card[hidden] { display: none; }
.tutorial-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 10px 0 110px; }
.tutorial-card { min-height: 230px; display: flex; flex-direction: column; padding: 25px; border: 1px solid var(--line); background: var(--card); border-radius: 3px; text-align: left; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.tutorial-card:hover { transform: translateY(-3px); border-color: #cdb6a4; box-shadow: 0 14px 36px rgba(71, 52, 35, .08); }
.tutorial-card[dir="rtl"] { text-align: right; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-index { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .15em; }
.done { color: var(--sage); font-size: 12px; font-weight: 700; }
.tutorial-card h2 { margin: 38px 0 12px; font-size: 24px; line-height: 1.15; }
.tutorial-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.card-meta { margin-top: auto; padding-top: 28px; color: var(--muted); font-size: 12px; }

.tutorial-head { padding: 76px 0 52px; border-bottom: 1px solid var(--line); }
.tutorial-head .crumb { margin: 0 0 20px; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tutorial-head h1 { max-width: 1000px; font-size: clamp(45px, 6vw, 78px); line-height: 1.02; }
.tutorial-head .lead { max-width: 680px; margin: 24px 0 0; color: var(--muted); font-size: 17px; line-height: 1.7; }
.steps { width: 100%; padding: 8px 0 120px; }
.step { display: grid; grid-template-columns: minmax(0, 1fr) minmax(390px, 440px); column-gap: clamp(28px, 4vw, 64px); align-items: start; padding: 56px 0; border-bottom: 0; }
.step + .step { border-top: 1px solid var(--line); }
.step:last-of-type { border-bottom: 0; }
.step-number, .step h2, .step p { grid-column: 1; }
.step-number { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; margin-bottom: 18px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; }
.step h2 { margin-bottom: 12px; font-size: clamp(27px, 3vw, 38px); line-height: 1.12; }
.step p { max-width: 500px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.75; }
.step img { grid-column: 2; grid-row: 1 / span 4; justify-self: end; display: block; width: 100%; max-height: 650px; object-fit: contain; object-position: top center; border: 1px solid var(--line); border-radius: 9px; background: #eee7de; box-shadow: 0 18px 42px rgba(71, 52, 35, .12); cursor: zoom-in; }
.step:not(:has(img)) { grid-template-columns: minmax(0, 760px); }
.note { max-width: 760px; margin-top: 42px; padding: 20px 22px; border-left: 3px solid var(--accent); background: #f0e8de; color: var(--accent-dark); font-size: 14px; line-height: 1.65; }
[dir="rtl"] .note { border-right: 3px solid var(--accent); border-left: 0; }
.tutorial-end { display: flex; justify-content: center; padding: 36px 0 10px; }
.back-to-tutorials { display: inline-flex; min-width: 250px; min-height: 56px; align-items: center; justify-content: center; gap: 11px; padding: 0 24px; border: 1px solid var(--accent-dark); border-radius: 999px; background: var(--accent-dark); color: #fff; font-size: 15px; font-weight: 700; box-shadow: 0 12px 25px rgba(116, 72, 51, .18); transition: transform .2s ease, background .2s ease, box-shadow .2s ease; }
.back-to-tutorials:hover { transform: translateY(-2px); background: var(--ink); border-color: var(--ink); box-shadow: 0 16px 30px rgba(27, 25, 23, .18); }
.back-to-tutorials span:first-child { color: #fff; font-size: 19px; line-height: 1; }
.site-footer { width: min(1280px, calc(100% - 64px)); margin: 0 auto; padding: 22px 0 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; }

.lightbox { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 30px; background: rgba(25, 20, 17, .82); }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(100%, 900px); max-height: calc(100vh - 60px); object-fit: contain; border-radius: 4px; }
.lightbox-close { position: fixed; top: 18px; right: 22px; border: 0; background: transparent; color: #fff; font-size: 38px; line-height: 1; }

@media (max-width: 980px) {
  .tutorial-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step { grid-template-columns: minmax(0, 1fr) minmax(280px, 390px); column-gap: 42px; }
}
@media (max-width: 720px) {
  .topbar, main, .site-footer { width: min(100% - 28px, 1280px); }
  .topbar { min-height: 68px; padding: 20px 0; }
  .top-actions { gap: 10px; flex: 1; justify-content: flex-end; }
  .header-search { flex: 1; }
  .header-search .search-field { width: min(58vw, 260px); }
  .header-search .search-status { display: none; }
  .language-switch { min-height: 34px; padding: 0 9px; }
  .hero { min-height: calc(100vh - 68px); padding: 52px 0 70px; }
  .hero-copy { font-size: 15px; }
  .language-grid { grid-template-columns: 1fr; }
  .language-card { min-height: 145px; }
  .language-title { margin-top: 27px; }
  .page-head { display: block; padding: 42px 0 25px; }
  .page-intro { margin-top: 17px; font-size: 15px; }
  .tutorial-search { display: block; margin-bottom: 12px; padding: 14px; }
  .search-label { display: block; margin-bottom: 9px; }
  .search-status { min-height: 18px; margin-top: 8px; text-align: start; }
  .tutorial-grid { grid-template-columns: 1fr; padding-bottom: 60px; }
  .tutorial-card { min-height: 185px; }
  .tutorial-head { padding: 38px 0 30px; }
  .tutorial-head .lead { font-size: 15px; }
  .steps { padding-top: 0; }
  .step, .step:not(:has(img)) { display: block; padding: 42px 0; }
  .step h2 { font-size: 28px; }
  .step p { font-size: 15px; }
  .step img { width: min(430px, 100%); max-height: none; margin-top: 22px; }
  .note { margin-top: 25px; }
  .tutorial-end { padding: 30px 0 8px; }
  .back-to-tutorials { width: min(100%, 330px); min-height: 60px; font-size: 15px; }
  .site-footer { display: block; line-height: 1.7; }
}
@media (max-width: 420px) {
  .brand-sub { display: none; }
  .header-search .search-field { width: 210px; }
  .text-button { font-size: 12px; }
  .language-switch { font-size: 11px; }
}
