/* Roshanan interaction layer — polished, tactile and accessible. */
:root {
  --ease-roshanan: cubic-bezier(.22, 1, .36, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  --lift: calc(8px * var(--motion, 1));
  --reveal-distance: calc(28px * var(--motion, 1));
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--copper) 55%, transparent);
  outline-offset: 4px;
}

/* Buttons: visible sheen, lift and tactile press feedback across the whole site. */
.button,
.wp-element-button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.roshanan-quiz-options button,
.roshanan-quiz-nav button,
.roshanan-form-card button,
.roshanan-topic-filters button,
.roshanan-fortune button,
.roshanan-newsletter-form button,
.add-circle {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: transform calc(.34s * var(--motion, 1)) var(--ease-roshanan), box-shadow .34s var(--ease-soft), border-color .3s ease, color .3s ease, background-color .3s ease;
}
.button::before,
.wp-element-button::before,
.woocommerce a.button::before,
.woocommerce button.button::before,
.roshanan-quiz-options button::before,
.roshanan-form-card button::before,
.roshanan-fortune button::before,
.roshanan-newsletter-form button::before,
.add-circle::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -2px;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 18%, rgba(255,255,255,.42) 46%, transparent 72%);
  transform: translateX(125%);
  transition: transform calc(.72s * var(--motion, 1)) var(--ease-roshanan);
}
.button:hover::before,
.wp-element-button:hover::before,
.woocommerce a.button:hover::before,
.woocommerce button.button:hover::before,
.roshanan-quiz-options button:hover::before,
.roshanan-form-card button:hover::before,
.roshanan-fortune button:hover::before,
.roshanan-newsletter-form button:hover::before,
.add-circle:hover::before { transform: translateX(-125%); }
.button:hover,
.wp-element-button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.roshanan-form-card button:hover,
.roshanan-fortune button:hover,
.roshanan-newsletter-form button:hover,
.add-circle:hover { transform: translateY(calc(-3px * var(--motion, 1))); box-shadow: 0 16px 34px rgba(20,38,31,.18); }
.button:active,
.wp-element-button:active,
.woocommerce a.button:active,
.woocommerce button.button:active,
.roshanan-quiz-options button:active,
.roshanan-form-card button:active,
.roshanan-fortune button:active,
.roshanan-newsletter-form button:active,
.add-circle:active { transform: translateY(0) scale(.975); }

/* Header remains compact regardless of the uploaded logo dimensions. */
.site-header.is-scrolled {
  background: rgba(251,248,242,.985);
  box-shadow: 0 12px 38px rgba(28,24,18,.09);
}
.brand > img { transition: transform .55s var(--ease-roshanan), box-shadow .4s ease; }
.brand:hover > img { transform: rotate(2deg) scale(1.035); box-shadow: 0 13px 30px rgba(30,21,12,.16); }
.header-actions > a,
.header-actions > button { transition: transform .3s var(--ease-roshanan), background-color .25s ease, color .25s ease; }
.header-actions > a:hover,
.header-actions > button:hover { color: var(--copper); transform: translateY(-2px); }

/* Cards and content blocks. */
.category-card,
.product-card,
.magazine-card,
.roshanan-journal-grid article,
.woocommerce ul.products li.product,
.roshanan-quiz-card,
.roshanan-form-card,
.roshanan-wholesale-benefits article,
.roshanan-fortune,
.corporate,
.matcher,
.story-visual__main,
.story-visual__card {
  backface-visibility: hidden;
  will-change: transform;
}

.category-card,
.product-card,
.magazine-card,
.roshanan-journal-grid article,
.woocommerce ul.products li.product,
.roshanan-quiz-card,
.roshanan-form-card,
.roshanan-wholesale-benefits article {
  position: relative;
  isolation: isolate;
  transition: transform calc(.5s * var(--motion, 1)) var(--ease-roshanan), box-shadow .5s var(--ease-roshanan), border-color .35s ease;
}
.category-card:hover,
.product-card:hover,
.magazine-card:hover,
.roshanan-journal-grid article:hover,
.woocommerce ul.products li.product:hover,
.roshanan-wholesale-benefits article:hover {
  transform: translateY(calc(-1 * var(--lift)));
  border-color: color-mix(in srgb, var(--copper) 50%, transparent);
  box-shadow: 0 28px 70px rgba(29,23,15,var(--shadow-alpha,.07));
}
.roshanan-quiz-card,
.roshanan-form-card {
  border-color: color-mix(in srgb, var(--line) 78%, transparent);
  box-shadow: 0 28px 85px rgba(38,28,17,.09), inset 0 1px rgba(255,255,255,.8);
}

/* Images and video react gently instead of sitting flat. */
.product-card__visual,
.magazine-card__image,
.roshanan-journal-image,
.woocommerce ul.products li.product > a:first-child,
.story-visual__main,
.story-visual__card,
.hero__arch,
.matcher__visual,
.entry-content img,
.roshanan-video-grid video { overflow: hidden; }
.product-card__visual img,
.magazine-card__image img,
.roshanan-journal-image img,
.woocommerce ul.products li.product img,
.story-visual img,
.matcher__visual img,
.entry-content img,
.roshanan-video-grid video {
  transition: transform calc(.8s * var(--motion, 1)) var(--ease-roshanan), filter .55s ease, box-shadow .55s ease;
}
.product-card:hover .product-card__visual img,
.magazine-card:hover .magazine-card__image img,
.roshanan-journal-grid article:hover .roshanan-journal-image img,
.woocommerce ul.products li.product:hover img,
.entry-content img:hover,
.roshanan-video-grid video:hover {
  transform: scale(calc(1 + .045 * var(--motion, 1)));
  filter: saturate(1.05) contrast(1.025);
  box-shadow: 0 24px 55px rgba(20,34,28,.13);
}
.product-card__visual,
.woocommerce ul.products li.product img { aspect-ratio: var(--product-ratio, 4/5); }
.product-card__visual img,
.woocommerce ul.products li.product img { width: 100%; object-fit: cover; }
.product-card__visual img { height: 100%; }
.woocommerce ul.products li.product img { height: auto; }

/* Corrected Persian typography for inner pages. */
.section-heading h2,
.story-copy h2,
.entry-content > h2,
.woocommerce-products-header__title,
.page-hero h1 { text-wrap: balance; }
.page-hero h1 { font-size: clamp(28px, calc(3.2vw * var(--heading-scale, 1)), 46px); }
.roshanan-page-intro { max-width: 780px; margin: 4px auto 34px; }
.roshanan-page-intro h2 { margin: 7px auto 12px; font-size: clamp(30px, calc(3.35vw * var(--heading-scale, 1)), 48px); line-height: 1.45; letter-spacing: -.025em; }
.roshanan-page-intro p { max-width: 660px; font-size: 14px; line-height: 1.95; }
.roshanan-quiz-step h3 { font-size: clamp(24px, calc(2.6vw * var(--heading-scale, 1)), 36px); line-height: 1.55; letter-spacing: -.02em; }
.entry-content > .roshanan-quiz,
.entry-content > .roshanan-wholesale,
.entry-content > .roshanan-journal,
.entry-content > .roshanan-wishlist { max-width: 100%; }

.page-hero h1::after,
.roshanan-page-intro h2::after,
.section-heading h2::after,
.entry-content > h2::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  margin-top: 15px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--copper), color-mix(in srgb, var(--copper) 0%, transparent));
  transform-origin: right center;
  transition: width .6s var(--ease-roshanan);
}
.page-hero:hover h1::after,
.roshanan-page-intro:hover h2::after,
.section-heading:hover h2::after,
.entry-content > h2:hover::after { width: 92px; }

/* Quiz choices now provide an obvious but refined interaction. */
.roshanan-quiz-options button {
  box-shadow: 0 8px 24px rgba(34,25,16,.045);
  transform-origin: center bottom;
}
.roshanan-quiz-options button:hover,
.roshanan-quiz-options button.is-selected {
  transform: translateY(calc(-5px * var(--motion, 1))) scale(1.012);
  box-shadow: 0 20px 45px rgba(12,52,43,.2);
}
.roshanan-quiz-progress span { box-shadow: 0 0 18px rgba(191,139,80,.35); }

/* Footer links and signup feel intentional rather than static. */
.footer-grid > div:not(.footer-brand) > a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease-roshanan);
}
.footer-grid > div:not(.footer-brand) > a:hover { transform: translateX(-4px); }
.footer-grid > div:not(.footer-brand) > a:hover::after { transform: scaleX(1); transform-origin: right; }
.social-row a:hover { color: #17261f; border-color: var(--copper-light); background: var(--copper-light); transform: translateY(-2px); }
.footer-grid .newsletter:focus-within { border-color: rgba(227,193,143,.35); box-shadow: 0 18px 45px rgba(0,0,0,.18); }

/* Persian title motion keeps letter shaping intact by revealing complete lines. */
.hero__title-line { transform-origin: right center; }
.roshanan-effects-ready .hero__title-line { opacity: 0; clip-path: inset(0 0 100% 0); animation: roshananTitleIn .95s var(--ease-roshanan) .18s forwards; }
.roshanan-effects-ready .hero__title-line--accent { animation-delay: .36s; }
.hero__title-line--accent { position: relative; width: fit-content; color: transparent !important; background: linear-gradient(105deg, #e3c18f 12%, #fff0cf 40%, #bf8b50 63%, #e3c18f 86%); background-size: 220% auto; -webkit-background-clip: text; background-clip: text; animation-name: roshananTitleIn, roshananTitleShine !important; animation-duration: .95s, 7s !important; animation-delay: .36s, 1.35s !important; animation-timing-function: var(--ease-roshanan), linear !important; animation-fill-mode: forwards, both !important; animation-iteration-count: 1, infinite !important; }
.hero__content .eyebrow, .hero__lead, .hero blockquote, .hero__actions, .hero__trust { animation: roshananSoftRise .75s var(--ease-roshanan) both; }
.hero__content .eyebrow { animation-delay: .08s; }
.hero__lead { animation-delay: .48s; }
.hero blockquote { animation-delay: .56s; }
.hero__actions { animation-delay: .64s; }
.hero__trust { animation-delay: .72s; }

.section-heading h2,
.story-copy h2,
.matcher__content h2,
.roastery-video h2,
.corporate h2,
.newsletter__inner h2,
.page-hero h1,
.roshanan-page-intro h2 { position: relative; isolation: isolate; }
.section-heading h2::before,
.story-copy h2::before,
.matcher__content h2::before,
.roastery-video h2::before,
.corporate h2::before,
.newsletter__inner h2::before { content: ""; position: absolute; z-index: -1; right: -.08em; bottom: .12em; width: 0; height: .28em; border-radius: 999px 8px 999px 8px; opacity: .22; background: linear-gradient(90deg, var(--copper), transparent); transform: rotate(-1.5deg); transition: width .9s var(--ease-roshanan); }
[data-reveal].is-visible .section-heading h2::before,
[data-reveal].is-visible.story-copy h2::before,
[data-reveal].is-visible.matcher__content h2::before,
[data-reveal].is-visible.roastery-video__grid h2::before,
[data-reveal].is-visible.corporate h2::before,
[data-reveal].is-visible.newsletter__inner h2::before,
.section-heading:hover h2::before { width: 72%; }
.roshanan-effects-ready [data-reveal] h2,
.roshanan-effects-ready [data-reveal] h1 { transition: letter-spacing .65s var(--ease-roshanan), transform .7s var(--ease-roshanan); }
.roshanan-effects-ready [data-reveal].is-visible h2,
.roshanan-effects-ready [data-reveal].is-visible h1 { animation: roshananHeadingReveal .82s var(--ease-roshanan) both; }

/* The shop image turns into an informative back face on hover/focus. */
.woocommerce ul.products li.product > a:first-child { position: relative; display: block; perspective: 1500px; overflow: visible; }
.woocommerce ul.products li.product > a:first-child > img { position: relative; z-index: 2; display: block; height: auto; margin-bottom: 18px; backface-visibility: hidden; -webkit-backface-visibility: hidden; transform-style: preserve-3d; transform-origin: center; transition: transform calc(.88s * var(--motion,1)) var(--ease-roshanan), filter .55s ease; }
.roshanan-loop-flip-back { position: absolute; z-index: 1; top: 0; right: 0; left: 0; aspect-ratio: var(--product-ratio,4/5); padding: 34px 28px 27px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; border-radius: calc(var(--card-radius) - 1px) calc(var(--card-radius) - 1px) 0 0; background: radial-gradient(circle at 18% 13%, rgba(227,193,143,.25), transparent 29%), linear-gradient(145deg, #194e40, #082a23 66%, #061d18); backface-visibility: hidden; -webkit-backface-visibility: hidden; transform: rotateY(180deg); transition: transform calc(.88s * var(--motion,1)) var(--ease-roshanan); }
.roshanan-loop-flip-back::before { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(227,193,143,.25); border-radius: calc(var(--card-radius) - 8px); }
.roshanan-loop-flip-back > * { position: relative; z-index: 1; }
.roshanan-loop-flip-back small { color: var(--copper-light); font-size: 9px; font-weight: 800; }
.roshanan-loop-flip-back strong { margin-top: 8px; font-family: var(--heading-font); font-size: clamp(22px,2vw,30px); line-height: 1.28; }
.roshanan-loop-flip-back i { margin-top: 6px; color: rgba(255,255,255,.62); font-size: 9px; font-style: normal; }
.roshanan-loop-flip-back em { margin-top: 13px; color: rgba(255,255,255,.82); font-size: 10px; font-style: normal; line-height: 1.9; }
.roshanan-loop-flip-back b { margin-top: 19px; display: inline-flex; align-items: center; gap: 7px; color: #f1d5aa; font-size: 10px; }
.roshanan-product-flip--enabled .woocommerce ul.products li.product:hover > a:first-child > img,
.roshanan-product-flip--enabled .woocommerce ul.products li.product:focus-within > a:first-child > img { transform: rotateY(180deg) scale(1.025); filter: saturate(.93) contrast(1.04); }
.roshanan-product-flip--enabled .woocommerce ul.products li.product:hover .roshanan-loop-flip-back,
.roshanan-product-flip--enabled .woocommerce ul.products li.product:focus-within .roshanan-loop-flip-back { z-index: 3; transform: rotateY(0); }
.roshanan-product-flip--disabled .roshanan-loop-flip-back { display: none; }

@keyframes roshananTitleIn { from { opacity: 0; clip-path: inset(0 0 100% 0); transform: translateY(24px); } to { opacity: 1; clip-path: inset(0 0 0 0); transform: translateY(0); } }
@keyframes roshananTitleShine { from { background-position: 150% center; } to { background-position: -70% center; } }
@keyframes roshananSoftRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes roshananHeadingReveal { from { opacity: .25; clip-path: inset(0 0 48% 0); transform: translateY(13px); } to { opacity: 1; clip-path: inset(0 0 0 0); transform: translateY(0); } }

.text-link { position: relative; }
.text-link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -5px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease-roshanan);
}
.text-link:hover::after { transform: scaleX(1); transform-origin: right; }

/* Scroll reveal. */
.roshanan-effects-ready [data-reveal] {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition: opacity calc(.68s * var(--motion, 1)) var(--ease-roshanan), transform calc(.74s * var(--motion, 1)) var(--ease-roshanan);
  transition-delay: calc(var(--reveal-index, 0) * 65ms * var(--motion, 1));
}
.roshanan-effects-ready [data-reveal].is-visible { opacity: 1; transform: translateY(0); }

.roshanan-effect--quiet { --lift: calc(4px * var(--motion, 1)); --reveal-distance: calc(14px * var(--motion, 1)); }
.roshanan-effect--cinematic { --lift: calc(12px * var(--motion, 1)); --reveal-distance: calc(44px * var(--motion, 1)); }
.roshanan-effect--cinematic .product-card:hover,
.roshanan-effect--cinematic .magazine-card:hover { transform: translateY(calc(-1 * var(--lift))) rotateX(1.2deg); }

@media (max-width: 820px) {
  .container { width: min(var(--container-width), calc(100% - 32px)); }
  .category-card:hover,
  .product-card:hover,
  .magazine-card:hover,
  .woocommerce ul.products li.product:hover,
  .roshanan-quiz-options button:hover { transform: translateY(-3px); }
  .roshanan-page-intro h2 { font-size: clamp(28px, 8vw, 40px); }
  .footer-brand, .footer-grid .newsletter { padding: 19px; }
}

@media (max-width: 520px) {
  .page-hero h1 { font-size: 30px; }
  .roshanan-page-intro { margin-bottom: 26px; }
  .roshanan-page-intro h2 { font-size: 30px; }
  .roshanan-quiz-step h3 { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --motion: 0 !important; }
  .roshanan-effects-ready [data-reveal] { opacity: 1; transform: none; }
  .hero__cinema img,
  .hero__cinema.uses-generated-image::before { transform: scale(1.01) !important; }
  .hero__light { display: none !important; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
