/*
 * Johar: stencil violet on stencil-paper yellow (design brief: sites/03-booking/DESIGN.md).
 * Sides are written as start/end (logical properties), so the Persian page mirrors by itself.
 */

@font-face { font-family: "Reem Kufi"; src: url(../fonts/reem-kufi-latin-wght-normal.woff2) format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0000-00FF, U+2013-2014, U+2018-201D; }
@font-face { font-family: "Reem Kufi"; src: url(../fonts/reem-kufi-arabic-wght-normal.woff2) format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0600-06FF, U+200C-200F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Albert Sans"; src: url(../fonts/albert-sans-latin-wght-normal.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Noto Sans Arabic"; src: url(../fonts/noto-sans-arabic-arabic-wght-normal.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0600-06FF, U+200C-200F, U+FB50-FDFF, U+FE70-FEFF; }

:root {
  --tissue: #F4ECBE;      /* page: the canary tissue of stencil paper */
  --sheet: #FFFFFF;       /* stencil sheets: cards, forms, calendar */
  --violet: #4A2C82;      /* the one accent: the transferred stencil line */
  --violet-dark: #3A2068;
  --violet-tint: #EFE9F8;
  --carbon: #21172F;      /* text: the carbon layer */
  --soap: #2F7D5B;        /* only "Confirmed" */
  --edge: #E2D58A;        /* torn tissue edges, quiet lines, blocked time */
  --muted: #5E5270;       /* secondary text */
  --closed: #E9E4CE;

  --f-head: "Reem Kufi", "Albert Sans", system-ui, sans-serif;
  --f-text: "Albert Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 3px;
}
:root:lang(fa) { --f-text: "Noto Sans Arabic", "Albert Sans", Tahoma, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
body { margin: 0; background: var(--tissue); color: var(--carbon); font: 17px/1.6 var(--f-text); }
:lang(fa) body, body:lang(fa) { font-size: 16.5px; line-height: 1.85; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--violet); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--violet-dark); text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--f-head); font-weight: 500; line-height: 1.12; margin: 0 0 .4em; color: var(--carbon); }
:lang(fa) h1, :lang(fa) h2, :lang(fa) h3 { line-height: 1.35; }
:lang(en) :is(h1, h2, h3, .size__name, .appt__when, .daystrip__day, .slip__when) { word-spacing: .12em; }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
bdi { unicode-bidi: isolate; }

.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 820px; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--violet); color: #fff; padding: 8px 14px; z-index: 10; }
.skip:focus { top: 8px; }
.trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.icon { width: 1.15em; height: 1.15em; flex: none; }

/* ---------- Buttons and links ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 48px; padding: 0 26px;
  background: var(--violet); color: #fff; border: 0; border-radius: var(--radius); font: 600 17px/1 var(--f-text);
  text-decoration: none; cursor: pointer; transition: background .15s; }
.btn:hover { background: var(--violet-dark); color: #fff; }
.btn:active { background: #2c1852; }
.btn[disabled], .btn[aria-busy="true"] { background: #8a7aa8; cursor: progress; }
.btn--small { min-height: 40px; padding: 0 16px; font-size: 15px; }
.link { background: none; border: 0; padding: 0; color: var(--violet); text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
.link:hover { color: var(--violet-dark); text-decoration-thickness: 2px; }
.link--quiet { color: var(--muted); font-size: 15px; }
.link--quiet:hover { color: var(--carbon); }

/* ---------- Header ---------- */
.top { padding-block: 18px; }
.top__in { display: flex; align-items: center; gap: 28px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--violet); text-decoration: none; }
.logo:hover { color: var(--violet); }
.logo__mark { width: 40px; height: 44px; }
.logo__line { fill: none; stroke: currentColor; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .9s cubic-bezier(.5, 0, .3, 1) .15s forwards; }
.logo__drop { fill: currentColor; opacity: 0; animation: drop .25s ease-out 1s forwards; }
.seen .logo__line { animation: none; stroke-dashoffset: 0; }
.seen .logo__drop { animation: none; opacity: 1; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.logo__name { font: 600 27px/1 var(--f-head); letter-spacing: .01em; }
:lang(fa) .logo__name { letter-spacing: 0; font-size: 28px; }
.nav { display: flex; gap: 26px; }
.nav a, .top__tools > a:not(.btn) { color: var(--carbon); text-decoration: none; font-size: 16px; }
.nav a:hover, .top__tools > a:not(.btn):hover { color: var(--violet); text-decoration: underline; }
.nav a[aria-current], .top__tools a[aria-current] { color: var(--violet); text-decoration: underline; }
.top__tools { margin-inline-start: auto; display: flex; align-items: center; gap: 20px; }
.lang, .acct { display: inline-flex; align-items: center; gap: 6px; }
.lang span:lang(fa) { font-family: "Noto Sans Arabic", sans-serif; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: 0; min-height: min(78vh, 760px); }
.hero__text { max-width: none; margin: 0; padding-inline: max(var(--gutter), calc((100vw - 1240px) / 2 + var(--gutter))) 48px; padding-block: 32px 48px; }
.hero h1 { font-size: clamp(44px, 6.2vw, 92px); font-weight: 500; letter-spacing: -.01em; margin-bottom: .35em; }
:lang(fa) .hero h1 { letter-spacing: 0; font-size: clamp(40px, 5.4vw, 78px); }
.hero__lead { font-size: 19px; max-width: 30em; color: var(--carbon); }
.hero__go { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; margin-top: 30px; }
.hero__photo { margin: 0; align-self: stretch; position: relative; }
.hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 76% 40%; }

/* ---------- The stencil sheet: white paper with the yellow tissue torn along its top ---------- */
.sheet { position: relative; background: var(--sheet); padding: clamp(22px, 4vw, 52px); margin-top: 18px; }
.sheet::before { content: ""; position: absolute; inset-inline: 0; top: -13px; height: 14px; background: var(--edge);
  -webkit-mask: radial-gradient(circle at 8px 15px, #000 8px, transparent 8.5px) 0 0 / 16px 15px repeat-x;
          mask: radial-gradient(circle at 8px 15px, #000 8px, transparent 8.5px) 0 0 / 16px 15px repeat-x; }

/* ---------- Booking ---------- */
.book { padding-block: 72px 40px; }
.book__head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 12px 40px; margin-bottom: 18px; }
.book__head h2 { font-size: clamp(36px, 4.4vw, 58px); margin: 0; }
.book__head p { margin: 0 0 .5em; color: var(--muted); max-width: 34em; }
.step { padding-block: 30px; border-top: 1px solid var(--edge); }
.step__title { display: flex; align-items: center; gap: 12px; font-size: 26px; margin-bottom: 4px; }
.step__n { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1.5px solid var(--violet); border-radius: 50%;
  color: var(--violet); font: 500 17px/1 var(--f-text); flex: none; }
.step__hint, .step__empty { color: var(--muted); margin: 0 0 18px; }
.step__empty { margin: 0; padding: 18px; border: 1.5px dashed var(--edge); text-align: center; }

.sizes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.size { display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 16px; background: #fff; border: 1.5px solid var(--edge);
  border-radius: var(--radius); text-align: start; cursor: pointer; position: relative; transition: border-color .15s; }
.size:hover { border-color: var(--violet); }
.size[aria-pressed="true"] { border-color: var(--violet); outline: 2px solid var(--violet); outline-offset: 4px; }
.size[aria-pressed="true"]::after { content: ""; position: absolute; top: 18px; inset-inline-end: 18px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--violet) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8'/%3E%3C/svg%3E") center / 20px no-repeat; }
.size__photo { display: block; aspect-ratio: 4 / 4.4; overflow: hidden; background: var(--closed); margin-bottom: 8px; }
.size__photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease-out; }
.size:hover .size__photo img { transform: scale(1.03); }
.size__name { font: 500 24px/1.1 var(--f-head); padding-inline: 4px; }
.size__time { display: flex; align-items: center; gap: 6px; color: var(--violet); font-weight: 600; font-size: 15px; padding-inline: 4px; }
.size__text { color: var(--muted); font-size: 15px; line-height: 1.5; padding-inline: 4px; }

/* Calendar: weeks in rows, Saturday first in Persian, Monday first in English. */
.cal { max-width: 640px; }
.cal__wait { color: var(--muted); }
.cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal__wd { font-size: 13px; color: var(--muted); text-align: center; padding-bottom: 2px; }
.day { position: relative; min-height: 58px; padding: 6px 2px 4px; border: 1.5px solid var(--edge); background: #fff; border-radius: var(--radius);
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; font-variant-numeric: tabular-nums; }
.day b { font-size: 19px; font-weight: 600; }
.day small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.day:hover { border-color: var(--violet); }
.day[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); color: #fff; }
.day[aria-pressed="true"] small { color: #E4DCF3; }
.day:disabled { cursor: default; color: #5A5270; }
.day:disabled:hover { border-color: var(--edge); }
.day--closed { background: var(--closed); border-color: var(--closed); }
.day--closed:hover { border-color: var(--closed) !important; }
.day--full { background: repeating-linear-gradient(135deg, #fff 0 6px, #F7F1D4 6px 12px); }
.day--full b { text-decoration: line-through; text-decoration-thickness: 1px; }
.cal__month { grid-column: 1 / -1; font: 500 19px/1 var(--f-head); margin: 16px 0 4px; }
.cal__month:first-child { margin-top: 0; }
.cal__key { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: 14px; color: var(--muted); }
.cal__key i { display: inline-block; width: 16px; height: 16px; border-radius: 2px; vertical-align: -3px; margin-inline-end: 6px; border: 1.5px solid var(--edge); background: #fff; }
.cal__key .k-closed { background: var(--closed); border-color: var(--closed); }
.cal__key .k-full { background: repeating-linear-gradient(135deg, #fff 0 3px, #F2E9BE 3px 6px); }

/* The day strip: the chosen day from opening to closing; the tattoo is a violet block exactly as long as the job. */
.daystrip__day { font: 500 21px/1.3 var(--f-head); margin-bottom: 30px; }
.strip { position: relative; height: 78px; background: #fff; border: 1.5px solid var(--carbon); border-radius: 2px; margin-bottom: 38px; cursor: pointer; touch-action: pan-y; }
.strip__tick { position: absolute; top: -24px; transform: translateX(-50%); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.strip__tick:dir(rtl), [dir="rtl"] .strip__tick { transform: translateX(50%); }
.strip__tick::after { content: ""; position: absolute; top: 22px; left: 50%; width: 1px; height: 6px; background: var(--muted); }
.strip__busy { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, var(--edge) 0 6px, #fff 6px 12px); }
.strip__busy span { position: absolute; bottom: -24px; inset-inline-start: 0; font-size: 13px; color: var(--muted); white-space: nowrap; }
.strip__job { position: absolute; top: 9px; bottom: 9px; background: var(--violet); color: #fff; border-radius: 2px; display: flex; align-items: center;
  justify-content: center; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden;
  transition: inset-inline-start .28s cubic-bezier(.3, .7, .3, 1), width .28s cubic-bezier(.3, .7, .3, 1); }
.strip__job[hidden] { display: none; }
.starts { display: flex; flex-wrap: wrap; gap: 8px; }
.start { min-width: 68px; min-height: 42px; padding: 0 12px; border: 1.5px solid var(--violet); background: #fff; color: var(--violet); border-radius: var(--radius);
  font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; }
.start:hover { background: var(--violet-tint); }
.start[aria-pressed="true"] { background: var(--violet); color: #fff; }
.starts__none { color: var(--muted); margin: 0; }

/* Step 4: the ticket (a perforated slip with the chosen size, day and time) and the form. */
.ticket { border: 1.5px dashed var(--violet); padding: 16px 20px; margin: 10px 0 22px; background: var(--violet-tint); }
.ticket__line { margin: 0; font-size: 18px; }
.ticket__line strong { color: var(--violet); }
.ticket--empty { background: transparent; border-color: var(--edge); }
.ticket--empty .ticket__line { color: var(--muted); font-size: 16px; }
.as { color: var(--muted); }
.as strong { color: var(--carbon); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; margin-bottom: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; font-size: 15px; }
.field small { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.field input, .field textarea { width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid #CFC39A; border-radius: var(--radius);
  background: #fff; font: inherit; color: var(--carbon); }
.field textarea { min-height: 0; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--violet); outline: 2px solid var(--violet); outline-offset: 0; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #A3243B; outline: 2px solid #A3243B; outline-offset: 0; }
.field input::placeholder, .field textarea::placeholder { color: #8b8296; }
:lang(fa) .field input[dir="ltr"] { text-align: right; }
.field--wide { margin-bottom: 20px; }
.form__msg { padding: 12px 16px; border: 1.5px solid #A3243B; background: #FBEDEF; color: #6E1426; border-radius: var(--radius); }
.form__msg--ok { border-color: var(--soap); background: #E7F3EC; color: #1E5A40; }
.form__go { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin: 0; }
.form__after { color: var(--muted); font-size: 15px; }
.note { padding: 14px 18px; background: #fff; border: 1.5px solid var(--edge); }
.note--warn { border-color: var(--violet); background: var(--violet-tint); }

/* ---------- Work ---------- */
.work { padding-block: 80px 40px; }
.work__head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px 48px; align-items: end; margin-bottom: 34px; }
.work__head h2 { font-size: clamp(36px, 4.4vw, 58px); margin: 0; }
.work__head p { margin: 0 0 .4em; color: var(--muted); max-width: 32em; }
/* Four columns; two photos twice as big, so ten photos fill four even rows. */
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense; gap: 20px; }
.gallery__item { margin: 0; display: flex; flex-direction: column; }
.gallery__item img { width: 100%; aspect-ratio: 4 / 4.6; object-fit: cover; flex: 1; min-height: 0; }
.gallery__item--paisley, .gallery__item--rose { grid-column: span 2; grid-row: span 2; }
.gallery__item--paisley img, .gallery__item--rose img { aspect-ratio: auto; }
.gallery__item--swallow img { object-position: 50% 30%; }
.gallery__item figcaption { font-size: 14px; color: var(--muted); padding-top: 8px; }

/* ---------- How it goes ---------- */
.how { padding-block: 60px 90px; }
.how h2 { font-size: clamp(36px, 4.4vw, 58px); margin-bottom: 34px; }
.how__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; counter-reset: how; }
.how__steps li { counter-increment: how; }
.how__steps img { width: 100%; aspect-ratio: 4 / 4.6; object-fit: cover; margin-bottom: 18px; }
.how__steps h3 { font-size: 23px; display: flex; gap: 10px; align-items: baseline; }
.how__steps h3::before { content: counter(how); font: 500 15px/1 var(--f-text); color: var(--violet); border: 1.5px solid var(--violet); border-radius: 50%;
  width: 28px; height: 28px; display: inline-grid; place-items: center; flex: none; transform: translateY(-3px); }
:lang(fa) .how__steps h3::before { content: counter(how, persian); }
.how__steps p { color: var(--muted); font-size: 16px; }

/* ---------- Pages ---------- */
.pg { padding-block: 40px 90px; min-height: 60vh; }
.pg__head { margin-bottom: 30px; }
.pg__head h1 { font-size: clamp(36px, 5vw, 60px); }
.pg__head p { color: var(--muted); }
.pg__foot { margin-top: 36px; color: var(--muted); }
.sent { text-align: center; margin-bottom: 40px; outline: none; animation: peel .5s cubic-bezier(.3, .7, .3, 1); }
@keyframes peel { from { opacity: 0; transform: translateY(14px); } }
.sent__mark { margin: 0 auto 10px; width: 58px; height: 58px; border-radius: 50%; background: var(--violet); color: #fff; display: grid; place-items: center; }
.sent__mark .icon { width: 30px; height: 30px; }
.sent h2 { font-size: 34px; }
.sent__when { font-size: 19px; color: var(--violet); font-weight: 600; }
.sent p:last-child { max-width: 34em; margin: 0 auto; color: var(--muted); }
.list__title { font-size: 26px; margin-top: 10px; }
.appts { list-style: none; margin: 0 0 34px; padding: 0; display: grid; gap: 12px; }
.appt { display: flex; gap: 20px; justify-content: space-between; align-items: center; background: #fff; border: 1.5px solid var(--edge); padding: 18px 22px; border-radius: var(--radius); }
.appt--pending { border-color: var(--violet); }
.appt__when { font: 500 20px/1.3 var(--f-head); margin: 0 0 2px; }
.appt__size { margin: 0; color: var(--muted); }
.appt__note { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.appt__side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex: none; }
.appts--past .appt { background: transparent; }
.appts--past .appt__when { color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: var(--radius); font-size: 14px; font-weight: 600; white-space: nowrap; }
.tag .icon { width: 16px; height: 16px; }
.tag--pending { border: 1.5px solid var(--violet); color: var(--violet); }
.tag--confirmed { background: var(--soap); color: #fff; }
.tag--cancelled { background: var(--closed); color: #4d4660; }
.empty { text-align: center; padding: 34px; background: #fff; border: 1.5px dashed var(--edge); margin-bottom: 34px; }
.sheet.empty { border: 0; }
.login { max-width: 520px; margin-inline: auto; }
.login h1 { font-size: 40px; }
.login .field { margin-bottom: 16px; }
.login__new { margin: 26px 0 0; padding-top: 18px; border-top: 1px solid var(--edge); color: var(--muted); }

.care { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; align-items: start; }
.care h1 { font-size: clamp(40px, 5vw, 64px); }
.care__lead { font-size: 20px; }
.care h2 { font-size: 26px; margin-top: 34px; }
.care ul { padding-inline-start: 1.2em; margin: 0; }
.care li { margin-bottom: .5em; }
.care li::marker { color: var(--violet); }
.care .note { margin-top: 34px; }
.care__photos { display: grid; gap: 20px; position: sticky; top: 20px; }
.prose { max-width: 70ch; }

/* ---------- Question box (cancel) ---------- */
.ask { border: 0; padding: 0; max-width: min(440px, calc(100vw - 32px)); background: transparent; }
.ask::backdrop { background: rgba(33, 23, 47, .45); }
.ask__in { background: #fff; padding: 26px 28px; }
.ask h2 { font-size: 24px; }
.ask p { color: var(--muted); }
.ask__go { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; margin-top: 18px; }

/* ---------- Footer ---------- */
.foot { background: var(--carbon); color: #E9E2F2; padding-block: 56px 48px; }
.foot a { color: #fff; }
.foot__in { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 40px; }
.foot h2 { font: 500 17px/1.3 var(--f-head); color: var(--tissue); margin-bottom: 12px; }
.foot nav a { display: block; text-decoration: none; padding-block: 3px; }
.foot nav a:hover { text-decoration: underline; }
.foot__brand p { max-width: 26em; color: #CFC6DC; }
.logo--light { color: var(--tissue); margin-bottom: 12px; }
.hours { display: grid; grid-template-columns: auto auto; gap: 2px 18px; margin: 0; justify-content: start; font-size: 15px; }
.hours dt { color: #CFC6DC; }
.hours dd { margin: 0; font-variant-numeric: tabular-nums; }

/* ---------- Narrow screens ---------- */
@media (max-width: 1000px) {
  .top__in { flex-wrap: wrap; row-gap: 10px; }
  .nav { order: 3; width: 100%; gap: 22px; overflow-x: auto; }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hero__text { padding-inline: var(--gutter); }
  .hero__photo img { aspect-ratio: 16 / 10; height: auto; }
  .sizes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work__head, .book__head, .care { grid-template-columns: 1fr; }
  .care__photos { position: static; grid-template-columns: 1fr 1fr; }
  .foot__in { grid-template-columns: 1fr 1fr; }
  .foot__brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .top { padding-block: 12px; }
  .top__in { gap: 12px; }
  .top__tools { gap: 14px; }
  .top__book { display: none; }
  .acct span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .logo__mark { width: 34px; height: 38px; }
  .logo__name { font-size: 24px; }
  .hero__text { padding-block: 16px 30px; }
  .hero__lead { font-size: 17px; }
  .book { padding-top: 50px; }
  .sheet { padding: 22px 16px; }
  .sizes { gap: 12px; }
  .size { padding: 8px 8px 12px; }
  .size__name { font-size: 20px; }
  .size__text { font-size: 14px; }
  .size[aria-pressed="true"]::after { top: 14px; inset-inline-end: 14px; width: 26px; height: 26px; }
  .cal__grid { gap: 4px; }
  .day { min-height: 50px; }
  .day b { font-size: 17px; }
  .day small { font-size: 10px; }
  .strip { height: 66px; }
  .strip__tick { font-size: 11px; }
  .strip__tick:nth-child(even) { visibility: hidden; }
  .fields { grid-template-columns: 1fr; }
  .how__steps { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .appt { flex-direction: column; align-items: flex-start; }
  .appt__side { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
  .foot__in { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .logo__line { stroke-dashoffset: 0; }
  .logo__drop { opacity: 1; }
  html { scroll-behavior: auto; }
}

/* Persian headings use the text font, bolder: Reem Kufi draws a final ی with two dots, the Arabic way, which Persian
   readers notice at once. Reem Kufi stays only in the logo's name (جوهر has no ی). */
:root:lang(fa) { --f-head: "Noto Sans Arabic", Tahoma, sans-serif; }
:lang(fa) :is(h1, h2, h3, .size__name, .appt__when, .daystrip__day, .list__title) { font-weight: 700; }
:lang(fa) .logo__name { font-family: "Reem Kufi", sans-serif; }

/* ---------- Polish pass (29 Oct) ---------- */
/* The footer always sits at the bottom, even on short pages (no yellow strip under it). */
body { display: flex; flex-direction: column; min-height: 100vh; }
body > main { flex: 1 0 auto; }
.foot { margin-top: 0; }

/* Secondary actions: an outlined button, never a bare underlined link. */
.btn--ghost { background: transparent; color: var(--violet); box-shadow: inset 0 0 0 1.5px var(--violet); }
.btn--ghost:hover { background: var(--violet-tint); color: var(--violet-dark); }
.btn--ghost:active { background: #E2D8F2; }
.sheet .btn--ghost, .appt .btn--ghost, .ask .btn--ghost { background: #fff; }
.sheet .btn--ghost:hover, .appt .btn--ghost:hover, .ask .btn--ghost:hover { background: var(--violet-tint); }
.hero__go { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; }
.hero__next { margin-top: 22px; color: var(--muted); font-size: 15.5px; display: flex; gap: 8px; align-items: baseline; }
.pg__who { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }

/* Aftercare: the three stages on one thin violet line, like a stencil line. */
.stages { list-style: none; margin: 10px 0 0; padding: 0; position: relative; }
.stages::before { content: ""; position: absolute; inset-inline-start: 7px; top: 14px; bottom: 14px; width: 1.5px; background: var(--violet); }
.stage { position: relative; padding-inline-start: 38px; padding-bottom: 8px; }
.stage::before { content: ""; position: absolute; inset-inline-start: 0; top: 10px; width: 16px; height: 16px; border-radius: 50%; background: var(--tissue); border: 1.5px solid var(--violet); }
.stage h2 { margin-top: 0; padding-top: 4px; }
.care .stage h2 { margin-top: 0; }
.stage + .stage { margin-top: 18px; }

/* ---------- Flavour pass (29 Oct): one story told with one thin violet line ---------- */

/* Header: sticks to the top. Once the page moves, it gets a solid tissue background and a torn stencil-paper edge. */
.top { position: sticky; top: 0; z-index: 30; background: var(--tissue); transition: padding .25s ease; }
.top::after { content: ""; position: absolute; inset-inline: 0; bottom: -10px; height: 11px; background: var(--tissue); opacity: 0;
  transition: opacity .25s ease; pointer-events: none;
  -webkit-mask: radial-gradient(circle at 8px 0, #000 8px, transparent 8.5px) 0 0 / 16px 11px repeat-x;
          mask: radial-gradient(circle at 8px 0, #000 8px, transparent 8.5px) 0 0 / 16px 11px repeat-x; }
.top--stuck { padding-block: 10px; }
.top--stuck::after { opacity: 1; }
.top--stuck .logo__mark { width: 34px; height: 38px; }
.logo__mark { transition: width .25s ease, height .25s ease; }
html { scroll-padding-top: 90px; }

/* Menu links: on hover a hand-drawn fine line draws under the word instead of a plain underline. */
.nav a, .top__tools > .acct, .top__tools > .lang { text-decoration: none !important; padding-block: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 8' preserveAspectRatio='none'%3E%3Cpath d='M1 5C14 2 26 7 40 4S66 1 80 5 106 6 119 3' fill='none' stroke='%234A2C82' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 0 100% / 0% 7px;
  transition: background-size .35s cubic-bezier(.5, 0, .3, 1), color .15s; }
[dir="rtl"] .nav a, [dir="rtl"] .top__tools > .acct, [dir="rtl"] .top__tools > .lang { background-position: 100% 100%; }
.nav a:hover, .top__tools > .acct:hover, .top__tools > .lang:hover, .nav a[aria-current], .top__tools > a[aria-current] { background-size: 100% 7px; color: var(--violet); }

/* Hero: the olive branch grows across the page on load and runs under the photo, like the stencil line it continues. */
.hero { position: relative; isolation: isolate; }
.book { position: relative; z-index: 2; }
.hero__text { position: relative; z-index: 2; }
.hero__photo { z-index: 3; }
.br { position: absolute; z-index: 1; width: min(58vw, 840px); inset-inline-start: 0; bottom: -250px; pointer-events: none; overflow: visible;
  transform: rotate(24deg); transform-origin: 50% 50%; }
[dir="rtl"] .br { transform: scaleX(-1) rotate(24deg); }
.br path, .br ellipse { fill: none; stroke: var(--violet); stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: draw var(--t, .45s) cubic-bezier(.45, 0, .25, 1) calc(var(--d) + .2s) forwards; }
.br .br__leaf, .br .br__olive { opacity: .9; }

/* The slip on the photo: the next free time, as a torn stencil ticket. Tapping it fills in the booking. */
.slip { position: absolute; z-index: 4; inset-inline-start: -56px; bottom: 44px; width: 250px; padding: 18px 20px 16px; background: #fff;
  color: var(--carbon); text-decoration: none; display: flex; flex-direction: column; gap: 3px;
  animation: slip .6s cubic-bezier(.3, .7, .3, 1) 1.4s both; }
.slip[hidden] { display: none; }
.slip::before { content: ""; position: absolute; inset-inline: 0; top: -9px; height: 10px; background: #fff;
  -webkit-mask: radial-gradient(circle at 7px 10px, #000 7px, transparent 7.5px) 0 0 / 14px 10px repeat-x;
          mask: radial-gradient(circle at 7px 10px, #000 7px, transparent 7.5px) 0 0 / 14px 10px repeat-x; }
.slip__label { font-size: 13px; color: var(--muted); }
.slip__when { font: 500 19px/1.3 var(--f-head); color: var(--carbon); }
.slip__what { font-size: 14px; color: var(--muted); }
.slip__go { margin-top: 10px; padding-top: 10px; border-top: 1.5px dashed var(--edge); color: var(--violet); font-weight: 600; font-size: 15px; }
.slip:hover { color: var(--carbon); }
.slip:hover .slip__go { color: var(--violet-dark); text-decoration: underline; text-underline-offset: .2em; }
@keyframes slip { from { opacity: 0; transform: translateY(16px); } }

/* Scroll moments (only where the browser can tie them to scrolling; elsewhere everything simply shows). */
@supports (animation-timeline: view()) {
  /* Work: each photo is uncovered from the top, like stencil paper being peeled off the skin. */
  .gallery__item img { animation: peel linear both; animation-timeline: view(); animation-range: entry 5% cover 35%; }
  @keyframes peel { from { clip-path: inset(0 0 100% 0); transform: translateY(18px); } to { clip-path: inset(0 0 0 0); transform: none; } }

  /* How it goes: a violet line draws through the four steps as they scroll into view. */
  .how__steps { position: relative; padding-top: 48px; }
  .how__steps::before { content: ""; position: absolute; inset-inline: 0; top: 15px; height: 1.5px; background: var(--violet);
    transform-origin: left; animation: rail linear both; animation-timeline: view(); animation-range: entry 20% cover 50%; }
  [dir="rtl"] .how__steps::before { transform-origin: right; }
  .how__steps li { position: relative; }
  /* The step numbers move onto the line. */
  .how__steps li::before { content: counter(how); position: absolute; top: -48px; inset-inline-start: 0; width: 30px; height: 30px; border-radius: 50%;
    background: var(--tissue); border: 1.5px solid var(--violet); color: var(--violet); font: 500 15px/1 var(--f-text); display: grid; place-items: center; }
  :lang(fa) .how__steps li::before { content: counter(how, persian); }
  .how__steps h3::before { display: none; }
  @keyframes rail { from { transform: scaleX(0); } }
}

@media (max-width: 1000px) {
  /* Narrow screens: the branch lies in the gap between the buttons and the photo; the slip sits under the photo. */
  .hero { overflow-x: clip; }
  .hero__text { padding-bottom: 96px; }
  .br { position: relative; grid-row: 1; grid-column: 1; align-self: end; width: 118vw; inset: auto; margin-inline-start: -12vw;
    margin-bottom: -125px; transform: rotate(25deg); }
  [dir="rtl"] .br { transform: scaleX(-1) rotate(25deg); }
  .hero__text { grid-row: 1; grid-column: 1; }
  .hero__photo { position: relative; display: flex; flex-direction: column; }
  .slip { position: relative; inset: auto; align-self: flex-end; margin: -40px 16px 0; width: min(270px, calc(100% - 32px)); }
  @supports (animation-timeline: view()) { .how__steps::before, .how__steps li::before { display: none; } .how__steps { padding-top: 0; } .how__steps h3::before { display: inline-grid; } }
}
@media (prefers-reduced-motion: reduce) {
  .br path, .br ellipse { stroke-dashoffset: 0; }
  .gallery__item img { clip-path: none !important; transform: none !important; }
}
