/* LayeredBySaki */
:root {
  --bg: #F4F1EB;
  --surface: #EAE5DC;
  --ink: #1D1B18;
  --muted: #6E675D;
  --rule: #D8D1C5;
  --accent: #A8462A;      /* Newari brick */
  --indigo: #24345F;

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter Tight", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --max: 1320px;
  --pad: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img, canvas { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
h2 { font: 400 clamp(36px, 4.4vw, 56px)/1.02 var(--serif); letter-spacing: -.01em; }
.shop h2 { font-size: clamp(30px, 3vw, 40px); }
section { scroll-margin-top: 72px; }

/* prayer-flag colours as a single hairline at the very top */
.flagline { display: flex; height: 4px; }
.flagline i { flex: 1; }
.flagline i:nth-child(1) { background: #2A57A5; }
.flagline i:nth-child(2) { background: #F2EFE8; }
.flagline i:nth-child(3) { background: #BF2A30; }
.flagline i:nth-child(4) { background: #2E7D4F; }
.flagline i:nth-child(5) { background: #E5B124; }


/* ---------- header ---------- */
.header { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--rule); }
.header__inner { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); height: 60px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.wordmark { font: 400 26px/1 var(--serif); text-decoration: none; letter-spacing: -.01em; }
.menu { display: flex; gap: 32px; }
.menu a { text-decoration: none; font-size: 14px; color: var(--muted); }
.menu a:hover { color: var(--ink); }
.cart-link { justify-self: end; background: none; border: 0; padding: 0; font: 500 14px var(--sans); color: var(--ink); cursor: pointer; }

/* ---------- buttons ---------- */
.button {
  display: inline-block; padding: 13px 22px; border: 1px solid var(--ink); border-radius: 2px;
  background: var(--ink); color: var(--bg); font: 500 14px var(--sans); text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s;
}
.button:hover { background: transparent; color: var(--ink); }
.textlink { font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--rule); }
.textlink:hover { text-decoration-color: var(--ink); }
.kicker { margin: 0 0 14px; font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }

/* ---------- hero ---------- */
.hero { background: #24345F; }
.hero__art { display: block; width: 100%; height: clamp(90px, 19vw, 240px); }
.hero__art .rise {
  font: 400 214px var(--serif); letter-spacing: -.01em; fill: url(#print-lines);
  transform: translateY(330px);
  animation: rise 3.2s cubic-bezier(.16, .84, .24, 1) .35s forwards;
}
.hero__art .ridge { transform: translateY(46px); opacity: 0; animation: settle 1.8s cubic-bezier(.2, .8, .2, 1) var(--d, 0s) forwards; }
/* each ridge settles a little after the one behind it (set here, not in style="...", for the security policy) */
.hero__art .ridge[data-d="1"] { --d: .15s; }
.hero__art .ridge[data-d="2"] { --d: .3s; }
.hero__art .ridge[data-d="3"] { --d: .45s; }
.hero__art .ridge[data-d="4"] { --d: .6s; }
.hero__art .sun { transform: translateY(70px); opacity: 0; animation: sunrise 3.4s ease-out .1s forwards; }
@keyframes rise { to { transform: translateY(0); } }
@keyframes settle { to { transform: translateY(0); opacity: 1; } }
@keyframes sunrise { to { transform: translateY(0); opacity: 1; } }

.hero__copy {
  max-width: var(--max); margin: 0 auto; padding: 4px var(--pad) 22px;
  display: grid; text-align: center;
}
.hero__copy h1 { font: 400 clamp(24px, 2.5vw, 34px)/1.08 var(--serif); letter-spacing: -.01em; color: #fff; }
.button--light { background: #F4F1EB; border-color: #F4F1EB; color: var(--ink); }
.button--light:hover { background: transparent; color: #F4F1EB; }

@media (prefers-reduced-motion: reduce) {
  .hero__art .rise, .hero__art .ridge, .hero__art .sun { animation: none; transform: none; opacity: 1; }
}


/* ---------- shop ---------- */
.shop { max-width: var(--max); margin: 0 auto; padding: 28px var(--pad) 96px; }
.shop__head { display: flex; justify-content: space-between; align-items: end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.tabs { display: flex; gap: 24px; }
.tabs[hidden] { display: none; }
.tab { background: none; border: 0; padding: 4px 0; font: 400 14px var(--sans); color: var(--muted); cursor: pointer; border-bottom: 1px solid transparent; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--ink); }

.products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px 20px; }
.product { display: flex; flex-direction: column; }
.product[hidden] { display: none; }
.product__media { display: block; position: relative; aspect-ratio: 4 / 5; background: var(--surface); overflow: hidden; }
.product__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s; }
.product__media img.main.is-ready,
.product:hover .product__media img.alt.is-ready { opacity: 1; }
.product__label { position: absolute; top: 12px; left: 12px; padding: 3px 6px; border-radius: 2px; background: var(--bg); font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.product__info { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding-top: 14px; }
.product h3 { font: 500 15px var(--sans); }
.product h3 a { text-decoration: none; }
.product h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.product .price { font-size: 15px; }
.product__meta { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--muted); }
.thumbs { grid-column: 1 / -1; display: flex; gap: 5px; margin-top: 12px; }
.thumb {
  flex: 1 1 0; min-width: 0; max-width: 36px; aspect-ratio: 4 / 5; padding: 0; cursor: pointer; overflow: hidden;
  border: 1px solid var(--rule); border-radius: 2px; background: var(--surface); opacity: .75;
  transition: opacity .15s, border-color .15s;
}
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { opacity: 1; }
.thumb.is-active { opacity: 1; border-color: var(--ink); }
.product .add {
  grid-column: 1 / -1; justify-self: start; margin-top: 10px; background: none; border: 0; padding: 0;
  font: 500 13px var(--sans); color: var(--ink); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--rule);
}
.product .add:hover { text-decoration-color: var(--ink); }
.add.is-added { color: var(--accent); }
.shop__note { margin: 48px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- footer ---------- */
.footer { background: var(--surface); }
.dhaka {
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14'%3E%3Crect width='14' height='14' fill='%2324345F'/%3E%3Cpath d='M7 0 14 7 7 14 0 7Z' fill='%23A8462A'/%3E%3Cpath d='M7 3.5 10.5 7 7 10.5 3.5 7Z' fill='%23E5B124'/%3E%3Cpath d='M7 5.5 8.5 7 7 8.5 5.5 7Z' fill='%231D1B18'/%3E%3C/svg%3E");
}
.footer__inner { max-width: var(--max); margin: 0 auto; padding: 56px var(--pad); display: grid; grid-template-columns: 1fr auto; gap: 32px; }
.footer__brand p { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.footer__col { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.footer__col h4 { margin: 0 0 6px; font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.footer__col a { text-decoration: none; }
.footer__col a:hover { text-decoration: underline; }
.footer__legal { max-width: var(--max); margin: 0 auto; padding: 16px var(--pad) 28px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--rule); }

/* ---------- product page ---------- */
.pdp { max-width: var(--max); margin: 0 auto; padding: 24px var(--pad) 96px; }
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.pdp__grid { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(24px, 5vw, 72px); align-items: start; }
.pdp__missing { padding: 80px 0; }
.pdp__missing h1 { font: 400 48px var(--serif); margin-bottom: 16px; }

.gallery__main { position: relative; aspect-ratio: 4 / 5; background: var(--surface); overflow: hidden; }
.gallery__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.gallery__img.is-ready { opacity: 1; }
.gallery__thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gallery__thumb {
  width: 76px; aspect-ratio: 4 / 5; padding: 0; overflow: hidden; cursor: pointer;
  border: 1px solid var(--rule); border-radius: 2px; background: var(--surface); opacity: .75; transition: opacity .15s, border-color .15s;
}
.gallery__thumb:hover { opacity: 1; }
.gallery__thumb.is-active { opacity: 1; border-color: var(--ink); }
.gallery__timg { display: block; width: 100%; height: 100%; object-fit: cover; }

.info { position: sticky; top: 84px; }
.info h1 { font: 400 clamp(38px, 4vw, 56px)/1.02 var(--serif); letter-spacing: -.01em; }
.info__price { font: 400 28px var(--serif); margin: 12px 0 4px; }
.info__meta { margin: 0; font-size: 14px; color: var(--muted); }
.info__desc { margin: 24px 0 28px; color: var(--ink); max-width: 52ch; }
.info__h { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 36px 0 12px; }
.spec { margin: 0; border-top: 1px solid var(--rule); }
.spec div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; text-align: right; }
/* customiser: live 3D preview (khviewer.js), sizes, colours, personalised name */
.live-3d { position: absolute; inset: 0; cursor: grab; }
.live-3d[hidden], .live-photo[hidden], .live-ruler[hidden] { display: none; }
.live-3d.is-dragging { cursor: grabbing; }
.live-3d canvas { display: block; width: 100%; height: 100%; }
.live-hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); pointer-events: none;
  font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  opacity: 0; transition: opacity .4s;
}
.live-3d.is-ready .live-hint { opacity: 1; }
.live-ruler { position: absolute; right: 7%; width: 10px; border: 1px solid var(--muted); border-left: 0; pointer-events: none; }
.live-ruler span { position: absolute; left: 16px; top: 50%; transform: translateY(-50%) rotate(180deg); writing-mode: vertical-rl; font: 500 12px var(--mono); color: var(--muted); white-space: nowrap; }
.gallery__thumb { position: relative; }
.gallery__badge { position: absolute; right: 4px; bottom: 4px; padding: 1px 4px; border-radius: 2px; background: var(--ink); color: var(--bg); font: 500 9px var(--mono); }
.options { display: grid; gap: 22px; margin-bottom: 28px; }
.opt { display: grid; gap: 10px; }
.opt[hidden] { display: none; }
.opt__label { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
.opt__hint, .opt__value { text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 13px; }
.opt__value { color: var(--ink); }
.opt__input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 2px; background: #FBF9F5;
  font: 400 17px var(--sans); color: var(--ink);
}
.opt__input:focus { outline: none; border-color: var(--ink); }
.opt__input.is-invalid { border-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--ink); border-radius: 2px; width: fit-content; }
.seg button { padding: 9px 18px; border: 0; background: none; font: 500 14px var(--sans); color: var(--ink); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--ink); }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--bg); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: grid; gap: 2px; padding: 9px 16px; border: 1px solid var(--rule); border-radius: 2px; background: none; cursor: pointer;
  font: 500 14px var(--sans); color: var(--ink); text-align: left;
}
.chip small { font-size: 12px; font-weight: 400; color: var(--muted); }
.chip:hover { border-color: var(--muted); }
.chip[aria-checked="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.colours { display: flex; gap: 10px; flex-wrap: wrap; }
.colour {
  width: 30px; height: 30px; padding: 0; border-radius: 50%; cursor: pointer; background: var(--c);
  border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--rule);
}
.colour:hover { box-shadow: 0 0 0 1px var(--muted); }
.colour[aria-checked="true"] { box-shadow: 0 0 0 2px var(--ink); }
.buy { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.qty { display: flex; border: 1px solid var(--ink); border-radius: 2px; }
.qty__btn { width: 44px; background: none; border: 0; font: 400 20px var(--sans); color: var(--ink); cursor: pointer; }
.qty__btn:hover { background: var(--surface); }
.qty__input { width: 44px; border: 0; background: none; text-align: center; font: 500 16px var(--sans); color: var(--ink); -moz-appearance: textfield; }
.qty__input::-webkit-outer-spin-button, .qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.buy__add { flex: 1; min-width: 180px; text-align: center; }

.reviews { margin-top: 96px; padding-top: 48px; border-top: 1px solid var(--rule); }
.reviews__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.reviews__summary { margin: 0; color: var(--muted); font-size: 14px; }
.reviews__grid { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(24px, 5vw, 72px); align-items: start; }
.stars { color: var(--accent); letter-spacing: 2px; }
.reviews__list { list-style: none; margin: 0; padding: 0; }
.review { padding: 20px 0; border-bottom: 1px solid var(--rule); }
.review:first-child { padding-top: 0; }
.review__top { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.review__name { font-weight: 500; }
.review__date { color: var(--muted); font-size: 13px; }
.review p { margin: 8px 0 0; white-space: pre-line; overflow-wrap: anywhere; }

.review-form { display: grid; gap: 18px; padding: 24px; background: var(--surface); }
.review-form h3 { font: 400 26px var(--serif); }
.review-form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.review-form input[type="text"], .review-form textarea {
  width: 100%; padding: 8px 0 10px; border: 0; border-bottom: 1px solid #CFC7BA; border-radius: 0;
  background: transparent; font: 400 16px var(--sans); color: var(--ink); resize: vertical;
}
.review-form input[type="text"]:focus, .review-form textarea:focus { outline: none; border-bottom-color: var(--ink); }
.review-form__end { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form-note { margin: 0; font-size: 14px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.stars-input { border: 0; margin: 0; padding: 0; }
.stars-input legend { font-size: 13px; color: var(--muted); padding: 0; margin-bottom: 4px; }
.stars-input__row { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.stars-input__row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars-input__row label { font-size: 28px; line-height: 1; color: #CFC7BA; cursor: pointer; transition: color .1s; }
.stars-input__row input:checked ~ label,
.stars-input__row label:hover, .stars-input__row label:hover ~ label { color: var(--accent); }
.stars-input__row input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 2px; }

@media (max-width: 860px) {
  .pdp__grid, .reviews__grid { grid-template-columns: 1fr; }
  .info { position: static; }
  .gallery__thumb { width: 60px; }
}

/* ---------- cart panel ---------- */
body.has-cart-open { overflow: hidden; }
.cart-panel { position: fixed; inset: 0; z-index: 50; }
.cart-panel[hidden] { display: none; }
.cart-panel__backdrop { position: absolute; inset: 0; background: rgba(29, 27, 24, .35); opacity: 0; transition: opacity .25s; }
.cart-panel__sheet {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
  display: flex; flex-direction: column; background: var(--bg); box-shadow: -12px 0 40px rgba(0, 0, 0, .12);
  transform: translateX(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); outline: none;
}
.cart-panel.is-open .cart-panel__backdrop { opacity: 1; }
.cart-panel.is-open .cart-panel__sheet { transform: none; }
.cart-panel__head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--rule); }
.cart-panel__head h2 { font: 400 30px var(--serif); }
.cart-panel__close { width: 36px; height: 36px; border: 0; background: none; font: 300 30px/1 var(--sans); color: var(--ink); cursor: pointer; }
.cart-panel__list { list-style: none; margin: 0; padding: 0 24px; flex: 1; overflow-y: auto; }
.cart-panel__empty { padding: 48px 0; color: var(--muted); line-height: 2; }
.cart-item { display: grid; grid-template-columns: 76px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.cart-item__img { display: block; aspect-ratio: 4 / 5; background: var(--surface); overflow: hidden; }
.cart-item__img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__body { display: grid; gap: 4px; align-content: start; }
.cart-item__name { font-weight: 500; text-decoration: none; }
.cart-item__name:hover { text-decoration: underline; text-underline-offset: 3px; }
.cart-item__opts { margin: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.cart-item__opts:empty { display: none; }
.cart-item__row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.cart-item__price { font-size: 15px; }
.cart-item__remove { justify-self: start; margin-top: 4px; padding: 0; border: 0; background: none; font: 400 13px var(--sans); color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cart-item__remove:hover { color: var(--ink); }
.qty--small .qty__btn { width: 32px; height: 32px; font-size: 16px; }
.qty__value { min-width: 28px; display: grid; place-items: center; font-weight: 500; font-size: 14px; }
.cart-panel__foot { padding: 20px 24px 24px; border-top: 1px solid var(--rule); display: grid; gap: 10px; }
.cart-panel__row { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.cart-panel__total { display: flex; justify-content: space-between; font-size: 17px; }
.cart-panel__total b { font: 400 26px var(--serif); }
.cart-panel__small { margin: 0; font-size: 12px; color: var(--muted); }
.cart-panel__checkout { width: 100%; text-align: center; }
.cart-panel__checkout:disabled { opacity: .4; cursor: default; }
.cart-panel__checkout:disabled:hover { background: var(--ink); color: var(--bg); }
.cart-panel__note { margin: 0; font-size: 14px; color: var(--accent); }
.cart-panel__note:empty { display: none; }
a.add { display: inline-block; }

/* ---------- thank-you page ---------- */
.thanks { max-width: 640px; margin: 0 auto; padding: 72px var(--pad) 96px; }
.thanks h1 { font: 400 clamp(40px, 6vw, 60px)/1.02 var(--serif); letter-spacing: -.01em; margin-bottom: 14px; }
.thanks__lead { color: var(--muted); margin: 0 0 32px; }
.thanks__items { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.thanks__items li { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.thanks__items li > div { display: flex; justify-content: space-between; gap: 16px; font-weight: 500; }
.thanks__items p { margin: 4px 0 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.thanks__sum { margin: 0 0 32px; }
.thanks__sum[hidden], .thanks__next[hidden] { display: none; }
.thanks__sum div { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.thanks__sum dd { margin: 0; }
.thanks__total { font-size: 18px !important; }
.thanks__total dd { font: 400 26px var(--serif); }
.thanks__next { margin: 0 0 28px; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .products { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .header__inner { grid-template-columns: 1fr auto; }
  .menu { display: none; }
  .products { grid-template-columns: 1fr 1fr; gap: 32px 12px; }
  .footer__inner { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
}
