/* The storefront of an Aloke store (first: Arcilla at store.arcil.la).
   Paper, clay and ink, as on arcil.la: the shop should feel like the studio
   the story page shows. Arabic first; English mirrors it. */

:root {
  --paper: #f3ece3;
  --paper-2: #ebe1d4;
  --card: #f8f3ec;
  --ink: #2a221d;
  --ink-2: #5a4d44;
  --muted: #85766a;
  --clay: #b8692f;
  --clay-ink: #94501f;
  --cream: #f7f0e6;
  --kiln: #140d0a;
  --kiln-2: #211611;
  --ember: #ffa45c;
  --line: rgba(42, 34, 29, 0.12);
  --line-2: rgba(42, 34, 29, 0.22);
  --ok: #3f7d4e;
  --warn: #b5622a;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --radius: 18px;
  --gutter: clamp(16px, 4.5vw, 64px);
  --bar-h: 72px;
  --font-display: "Cormorant Garamond", "Amiri", Georgia, serif;
  --font-accent: "Cormorant Garamond", serif;
  --font-body: "DM Sans", "IBM Plex Sans Arabic", system-ui, sans-serif;
  color-scheme: light;
}

:lang(ar) {
  --font-display: "Amiri", "IBM Plex Sans Arabic", serif;
  --font-accent: "Aref Ruqaa", "Amiri", serif;
  --font-body: "IBM Plex Sans Arabic", "DM Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.7 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overflow-x: clip;
}
:lang(ar) body { font-size: 16.5px; line-height: 1.85; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; margin: 0; text-wrap: balance; }
:lang(ar) h1, :lang(ar) h2 { line-height: 1.35; }
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 20px; height: 20px; flex: none; }

.skip {
  position: fixed; inset-inline-start: 16px; top: 12px; z-index: 50; padding: 10px 16px; border-radius: 999px;
  background: var(--ink); color: var(--cream); text-decoration: none; transform: translateY(-160%);
  transition: transform 200ms var(--ease-out);
}
.skip:focus-visible { transform: none; }

.announce {
  background: var(--kiln-2); color: var(--cream); text-align: center; font-size: 13.5px;
  padding: 8px var(--gutter); letter-spacing: 0.01em;
}

/* ---------------------------------------------------------------- bar */
.bar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.1); backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--line);
}
.bar-in {
  display: flex; align-items: center; gap: 22px; min-height: var(--bar-h);
  width: min(1320px, 100%); margin-inline: auto; padding-inline: var(--gutter);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand-mark { height: 34px; width: auto; }
.brand-word { height: 15px; width: auto; margin-top: 2px; }
.nav ul { display: flex; gap: 22px; margin: 0; padding: 0; list-style: none; }
.nav a { text-decoration: none; font-size: 15px; color: var(--ink-2); white-space: nowrap; transition: color 200ms ease; }
.nav a:hover { color: var(--ink); }
.search {
  flex: 1; max-width: 360px; margin-inline-start: auto; display: flex; align-items: center;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--card); padding-inline: 14px 4px;
}
.search input {
  flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 15px; padding: 9px 0; color: var(--ink);
}
.search input:focus { outline: none; }
.search:focus-within { border-color: var(--clay); }
.search button { border: 0; background: transparent; color: var(--ink-2); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; }
.tools { display: flex; align-items: center; gap: 6px; flex: none; }
.tool {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-width: 44px; height: 44px; justify-content: center;
  padding-inline: 10px; border-radius: 999px; text-decoration: none; color: var(--ink); transition: background-color 200ms ease;
}
.tool:hover { background: var(--paper-2); }
.account-name { font-size: 14px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-count {
  position: absolute; top: 4px; inset-inline-end: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--clay); color: #fff; font-size: 11px; line-height: 18px; text-align: center;
}
.lang { padding: 7px 14px; border: 1px solid var(--line-2); border-radius: 999px; text-decoration: none; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.lang:lang(ar) { font-family: "IBM Plex Sans Arabic", sans-serif; }
.lang:lang(en) { font-family: "DM Sans", sans-serif; }
.menu {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0; min-width: 210px; padding: 8px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); box-shadow: 0 18px 40px -20px rgba(42, 34, 29, 0.4); z-index: 30;
}
.menu a, .menu button {
  display: block; width: 100%; text-align: start; padding: 10px 12px; border-radius: 10px; border: 0; background: none;
  font: inherit; font-size: 14.5px; color: var(--ink); text-decoration: none; cursor: pointer;
}
.menu a:hover, .menu button:hover { background: var(--paper-2); }
.menu .who { padding: 8px 12px; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); margin-bottom: 4px; direction: ltr; text-align: start; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 0 22px; border-radius: 999px;
  border: 1px solid transparent; background: var(--ink); color: var(--cream); font: 500 15.5px/1 var(--font-body);
  text-decoration: none; cursor: pointer; transition: transform 160ms var(--ease-out), background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { cursor: not-allowed; background: var(--paper-2); color: var(--muted); border-color: var(--line-2); }
.btn .ic { width: 18px; height: 18px; }
[dir="rtl"] .btn .ic:last-child:not(:first-child) { transform: scaleX(-1); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-light { background: var(--cream); color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .btn:not(:disabled):hover { background: var(--clay-ink); }
  .btn-ghost:not(:disabled):hover { background: var(--paper-2); color: var(--ink); border-color: var(--ink); }
  .btn-light:hover { background: var(--ember) !important; }
}

/* ---------------------------------------------------------------- layout */
.wrap { width: min(1320px, 100%); margin-inline: auto; padding-inline: var(--gutter); }
.wrap.narrow { width: min(820px, 100%); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 22px 0 6px; padding: 0; list-style: none; font-size: 13.5px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-inline-end: 6px; opacity: 0.5; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); }

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative; overflow: hidden; min-height: min(78vh, 680px); display: grid; align-items: end;
  padding: clamp(28px, 6vw, 72px) var(--gutter); background:
    radial-gradient(80% 90% at 85% 15%, rgba(184, 105, 47, 0.16), transparent 60%),
    radial-gradient(60% 70% at 10% 90%, rgba(169, 170, 169, 0.22), transparent 60%), var(--paper-2);
}
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* The owner's photograph can be bright anywhere, so the words get two scrims:
   one rising from the bottom and one from the side the text starts on. */
.hero.has-img::after { content: ""; position: absolute; inset: 0; background:
  linear-gradient(to top, rgba(20, 13, 10, 0.74), rgba(20, 13, 10, 0.05) 60%),
  linear-gradient(to right, rgba(20, 13, 10, 0.58), rgba(20, 13, 10, 0) 62%); }
[dir="rtl"] .hero.has-img::after { background:
  linear-gradient(to top, rgba(20, 13, 10, 0.74), rgba(20, 13, 10, 0.05) 60%),
  linear-gradient(to left, rgba(20, 13, 10, 0.58), rgba(20, 13, 10, 0) 62%); }
.hero.has-img h1, .hero.has-img .lead { text-shadow: 0 1px 18px rgba(20, 13, 10, 0.35); }
.hero-mark { position: absolute; inset-inline-end: 6vw; top: 50%; transform: translateY(-50%); width: min(34vw, 380px); opacity: 0.95; }
.hero-in { position: relative; z-index: 1; max-width: 620px; }
.hero h1 { font-size: clamp(42px, 6vw, 82px); line-height: 1.05; }
:lang(ar) .hero h1 { line-height: 1.3; }
.hero .lead { margin-top: 14px; font-size: clamp(17px, 1.5vw, 20px); color: var(--ink-2); max-width: 34rem; }
.hero.has-img h1, .hero.has-img .lead { color: var(--cream); }
.hero .actions { margin-top: 26px; }
.hero.has-img .btn { background: var(--cream); color: var(--ink); }

/* ---------------------------------------------------------------- tiles */
.kinds { width: min(1320px, 100%); margin: clamp(28px, 4vw, 48px) auto 0; padding-inline: var(--gutter); }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.tile {
  display: grid; gap: 4px; padding: 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line);
  text-decoration: none; height: 100%; transition: border-color 200ms ease, transform 160ms var(--ease-out);
}
.tile:active { transform: scale(0.98); }
.tile-img { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--paper-2); color: var(--clay); margin-bottom: 10px; }
.tile-img img { width: 100%; height: 100%; object-fit: cover; }
.tile-img .ic { width: 44px; height: 44px; }
.tile-name { font: 400 22px/1.3 var(--font-display); }
:lang(ar) .tile-name { font-weight: 700; font-size: 21px; }
.tile-blurb { font-size: 14px; color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .tile:hover { border-color: var(--clay); } }

/* ---------------------------------------------------------------- shelves */
.shelf { width: min(1320px, 100%); margin: clamp(44px, 6vw, 80px) auto 0; padding-inline: var(--gutter); }
.wrap .shelf { padding-inline: 0; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.sec-head h2 { font-size: clamp(30px, 3.4vw, 44px); }
.more { display: inline-flex; align-items: center; gap: 6px; color: var(--clay-ink); text-decoration: none; font-weight: 500; white-space: nowrap; }
.more .ic { width: 17px; height: 17px; }
[dir="rtl"] .more .ic { transform: scaleX(-1); }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 22px); margin: 0; padding: 0; list-style: none; }
.card { position: relative; }
.card-link { display: grid; gap: 10px; text-decoration: none; }
.card-img { position: relative; display: block; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--paper-2); }
.card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 400ms ease, transform 600ms var(--ease-out); }
.card-img img.alt { opacity: 0; }
@media (hover: hover) and (pointer: fine) {
  .card-link:hover .card-img img:not(.alt) { transform: scale(1.03); }
  .card-link:hover .card-img img.alt { opacity: 1; }
}
.noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--clay); opacity: 0.6; }
.noimg .ic { width: 52px; height: 52px; }
.card-body { display: grid; gap: 3px; padding-inline: 2px; }
.card-kind { font-size: 12.5px; color: var(--muted); }
.card-title { font-size: 16px; font-weight: 500; line-height: 1.45; }
.next { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--clay-ink); }
.next .ic { width: 15px; height: 15px; }
.price { font-weight: 600; font-variant-numeric: tabular-nums; }
.price small { font-weight: 400; color: var(--muted); font-size: 0.85em; }
.price s { font-weight: 400; color: var(--muted); margin-inline-start: 6px; }
.heart {
  position: absolute; top: 10px; inset-inline-end: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0;
  display: grid; place-items: center; background: color-mix(in srgb, var(--cream) 88%, transparent); color: var(--ink);
  cursor: pointer; transition: transform 160ms var(--ease-out), color 200ms ease;
}
.heart:active { transform: scale(0.9); }
.heart[aria-pressed="true"] { color: var(--clay); }
.heart[aria-pressed="true"] .ic, .heart-btn[aria-pressed="true"] .ic { fill: currentColor; }
.badge {
  position: absolute; bottom: 10px; inset-inline-start: 10px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--cream); color: var(--ink);
}
.badge-sold_out { background: var(--ink); color: var(--cream); }
.badge-unique { background: var(--clay); color: #fff; }
.badge-low { background: var(--cream); color: var(--warn); }
.empty, .muted { color: var(--muted); }
.empty { padding: 48px 0; text-align: center; }

/* ---------------------------------------------------------------- listing */
.list-head { display: grid; gap: 8px; margin: 10px 0 26px; }
.list-head h1 { font-size: clamp(36px, 4.6vw, 60px); }
.list-head .lead { color: var(--ink-2); max-width: 40rem; font-size: 17px; }
.count { color: var(--muted); font-size: 14px; }
.sorter { display: flex; align-items: center; gap: 10px; justify-self: start; margin-top: 6px; font-size: 14px; color: var(--muted); }
.sorter select {
  font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 14px;
}
.pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 34px 0 0; }
.pager a { text-decoration: none; padding: 8px 16px; border: 1px solid var(--line-2); border-radius: 999px; }

/* ---------------------------------------------------------------- product */
.pdp { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); margin-top: 12px; align-items: start; }
.gallery { display: grid; gap: 12px; position: sticky; top: calc(var(--bar-h) + 16px); }
.gal-main { position: relative; margin: 0; border-radius: 22px; overflow: hidden; background: var(--paper-2); aspect-ratio: 4 / 5; }
.gal-main img { width: 100%; height: 100%; object-fit: cover; }
.gal-main.noimg { display: grid; place-items: center; color: var(--clay); }
.gal-main.noimg .ic { width: 80px; height: 80px; opacity: 0.6; }
.gal-thumbs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.gal-thumbs a { display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 2px solid transparent; transition: border-color 200ms ease; }
.gal-thumbs a[aria-current="true"] { border-color: var(--clay); }
.gal-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pdp-info { display: grid; gap: 14px; }
.kicker { font-size: 13.5px; color: var(--clay-ink); letter-spacing: 0.04em; }
:lang(ar) .kicker { letter-spacing: 0; }
.pdp h1 { font-size: clamp(36px, 4vw, 54px); line-height: 1.12; }
:lang(ar) .pdp h1 { line-height: 1.35; }
.summary { font-size: 18px; color: var(--ink-2); }
.pdp-price { font-size: 24px; }
.pdp-info > .badge { position: static; justify-self: start; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.opt {
  min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink);
  font: inherit; font-size: 14.5px; cursor: pointer; transition: border-color 200ms ease, background-color 200ms ease;
}
.opt[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--cream); }
.opt[data-out="1"] { text-decoration: line-through; opacity: 0.6; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.cta .btn:first-child { flex: 1 1 100%; }
.facts { display: grid; gap: 0; margin: 8px 0 0; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: 14.5px; }
.facts dd { margin: 0; }
.sessions h2, .pdp-body h2 { font-size: 26px; margin: 12px 0 10px; }
:lang(ar) .sessions h2, :lang(ar) .pdp-body h2 { font-weight: 700; font-size: 23px; }
.sessions ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sessions li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); font-size: 14.5px; }
.sessions li span { display: inline-flex; align-items: center; gap: 6px; }
.s-date { font-weight: 600; }
.s-seats { color: var(--clay-ink); margin-inline-start: auto; }
.pdp-body p, .prose p { margin: 0 0 12px; }
.pdp-body ul, .prose ul { margin: 0 0 12px; padding-inline-start: 20px; }
.prose { margin: 10px 0 40px; }
.prose h1 { font-size: clamp(38px, 4.4vw, 56px); margin-bottom: 18px; }
.prose h3 { font-family: var(--font-body); font-weight: 600; font-size: 18px; margin: 18px 0 8px; }
.notfound { padding: 90px 0; text-align: center; display: grid; gap: 16px; justify-items: center; }
.notfound h1 { font-size: clamp(40px, 5vw, 64px); }

/* ---------------------------------------------------------------- story */
.story { margin-top: clamp(56px, 8vw, 110px); background: radial-gradient(120% 90% at 50% 110%, #3a2216 0%, var(--kiln-2) 45%, var(--kiln) 100%); color: var(--cream); }
.story-in { width: min(1100px, 100%); margin-inline: auto; padding: clamp(48px, 7vw, 96px) var(--gutter); display: grid; grid-template-columns: minmax(0, 0.6fr) minmax(0, 1.4fr); gap: clamp(24px, 5vw, 72px); align-items: center; }
.story img { width: min(100%, 260px); justify-self: center; opacity: 0.92; }
.story h2 { font-size: clamp(34px, 4vw, 52px); }
.story p { margin: 12px 0 22px; color: rgba(247, 240, 230, 0.78); font-size: 18px; max-width: 32rem; }

/* ---------------------------------------------------------------- footer */
.foot { margin-top: clamp(56px, 8vw, 110px); background: var(--kiln); color: rgba(247, 240, 230, 0.7); font-size: 14.5px; }
.story + .foot { margin-top: 0; }
.foot-in { width: min(1320px, 100%); margin-inline: auto; padding: 40px var(--gutter) calc(40px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: auto 1fr auto; gap: 22px 40px; align-items: center; }
.foot-brand { display: grid; gap: 10px; }
.foot-brand img { height: 18px; width: auto; }
.foot-story { color: var(--cream); font-size: 14px; }
.foot-pages { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; padding: 0; list-style: none; }
.foot-pages a { color: var(--cream); text-decoration: none; }
.foot-pages a:hover { text-decoration: underline; }
.foot-social { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.foot-social a { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(247, 240, 230, 0.2); color: var(--cream); transition: border-color 200ms ease; }
.foot-social a:hover { border-color: var(--ember); }
.foot-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 22px; padding-top: 18px; border-top: 1px solid rgba(255, 220, 190, 0.08); }
.foot-meta a { color: var(--cream); text-underline-offset: 4px; }

/* ---------------------------------------------------------------- favourites */
.fav-signin { display: grid; gap: 14px; justify-items: start; padding: 26px; border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* ---------------------------------------------------------------- phone */
@media (max-width: 1100px) {
  .nav { display: none; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  :root { --bar-h: 62px; }
  .bar-in { flex-wrap: wrap; gap: 10px; padding-block: 8px; }
  .search { order: 3; flex: 1 1 100%; max-width: none; margin: 0; }
  .tools { margin-inline-start: auto; }
  .brand-mark { height: 30px; }
  .brand-word { height: 13px; }
  .account-name { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pdp { grid-template-columns: minmax(0, 1fr); }
  .gallery { position: static; }
  .hero { min-height: 0; align-content: center; }
  .hero.has-img { min-height: 70vh; align-content: end; }
  /* On a phone the mark sits ABOVE the words, in the flow, never behind them. */
  .hero-mark { position: static; transform: none; width: min(46vw, 200px); margin: 6px auto 26px; }
  .story-in { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .story p { margin-inline: auto; }
  .foot-in { grid-template-columns: minmax(0, 1fr); }
  .facts div { grid-template-columns: 7.5rem 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .card-img img, .btn, .tile, .heart { transition: none; }
}
