/* ==========================================================
   SERGIO STUDIO — APPEARANCE SYSTEM
   The light site remains the source design. This final layer
   translates its semantic surfaces for a mineral dark setting.
========================================================== */

:root {
  --appearance-duration: 420ms;
  --appearance-ease: cubic-bezier(.23, 1, .32, 1);
  --theme-canvas: #ffffff;
  --theme-canvas-warm: #f7f6f2;
  --theme-surface: #fafaf8;
  --theme-surface-elevated: #ffffff;
  --theme-surface-deep: #111111;
  --theme-product-field: #f2f1ef;
  --theme-text-display: #111111;
  --theme-text-reading: #1c1c1c;
  --theme-text-secondary: #666666;
  --theme-text-quiet: #777277;
  --theme-border: rgba(17, 17, 17, .12);
  --theme-border-strong: rgba(17, 17, 17, .28);
  --theme-input: #f2f1ee;
  --theme-hover: #f2f1ef;
  --theme-selected: #ece4da;
  --theme-accent: #f3d6e4;
  --theme-success: #2e7d32;
  --theme-error: #c62828;
  --theme-info: #5e7480;
  --appearance-mark: #1b181f;
  --appearance-counter: rgba(255, 255, 255, .82);
}

html[data-theme="dark"] {
  --color-background: #151219;
  --color-surface: #1b1820;
  --color-text-primary: #eeeae4;
  --color-text-secondary: #b8b1b5;
  --color-border: #2b2730;
  --color-accent: #d8b9c9;
  --color-success: #83b28a;
  --color-error: #d98b82;
  --theme-canvas: #151219;
  --theme-canvas-warm: #18151c;
  --theme-surface: #1b1820;
  --theme-surface-elevated: #201c25;
  --theme-surface-deep: #121016;
  --theme-product-field: #e7e3de;
  --theme-text-display: #eeeae4;
  --theme-text-reading: #d4ceca;
  --theme-text-secondary: #b8b1b5;
  --theme-text-quiet: #8f888e;
  --theme-border: #2b2730;
  --theme-border-strong: #413a45;
  --theme-input: #1a171e;
  --theme-hover: #26212b;
  --theme-selected: #302630;
  --theme-accent: #d8b9c9;
  --theme-success: #83b28a;
  --theme-error: #d98b82;
  --theme-info: #8fa8b8;
  --appearance-mark: #cfc8c5;
  --appearance-counter: rgba(11, 9, 14, .92);
  color-scheme: dark;
}

html,
body {
  background-color: var(--theme-canvas);
}

html[data-theme="dark"] body {
  color: var(--theme-text-reading);
}

html.appearance-transitioning body,
html.appearance-transitioning main,
html.appearance-transitioning header,
html.appearance-transitioning footer,
html.appearance-transitioning section,
html.appearance-transitioning article,
html.appearance-transitioning aside,
html.appearance-transitioning nav,
html.appearance-transitioning form,
html.appearance-transitioning input,
html.appearance-transitioning textarea,
html.appearance-transitioning select,
html.appearance-transitioning button,
html.appearance-transitioning details,
html.appearance-transitioning summary,
html.appearance-transitioning div,
html.appearance-transitioning span,
html.appearance-transitioning svg,
html.appearance-transitioning path {
  transition-property: background-color, border-color, color, fill, stroke;
  transition-duration: var(--appearance-duration);
  transition-timing-function: var(--appearance-ease);
}

/* Appearance control */
.appearance-toggle {
  position: fixed;
  right: max(8px, env(safe-area-inset-right));
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 25;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--appearance-mark);
  background: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    opacity 220ms ease,
    visibility 220ms ease,
    color var(--appearance-duration) var(--appearance-ease);
}

html.appearance-control-ready .appearance-toggle {
  opacity: .74;
  visibility: visible;
  pointer-events: auto;
}

.appearance-toggle:hover {
  opacity: 1;
}

.appearance-toggle:focus-visible {
  opacity: 1;
  outline: 1px solid var(--theme-accent);
  outline-offset: -10px;
}

.appearance-toggle__icon {
  display: block;
  width: 20px;
  height: 20px;
  overflow: visible;
}

.appearance-toggle__disc {
  fill: currentColor;
}

.appearance-toggle__disc--under {
  fill: var(--appearance-counter);
}

.appearance-toggle__rays {
  fill: none;
  stroke: currentColor;
  stroke-width: .9;
  stroke-linecap: round;
  transform-origin: 10px 10px;
  transition:
    opacity var(--appearance-duration) var(--appearance-ease),
    transform var(--appearance-duration) var(--appearance-ease);
}

.appearance-toggle__rays--under {
  stroke: var(--appearance-counter);
  stroke-width: 2.1;
}

.appearance-toggle__cutout {
  transform: translate(6px, -6px);
  transition: transform var(--appearance-duration) var(--appearance-ease);
}

html[data-theme="dark"] .appearance-toggle__cutout {
  transform: translate(-3.15px, 3.15px);
}

html[data-theme="dark"] .appearance-toggle__rays {
  opacity: 0;
  transform: scale(.55);
}

body:has(.hero):not(.scene-nav) .appearance-toggle,
body.nav-panel-open .appearance-toggle,
body.cookie-preferences-open .appearance-toggle,
body:has(.cookie-consent.is-visible) .appearance-toggle {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Dark foundation */
html[data-theme="dark"] main {
  color: var(--theme-text-reading);
  background-color: var(--theme-canvas);
}

html[data-theme="dark"] main :where(h1, h2, h3, h4, h5, h6) {
  color: var(--theme-text-display);
}

html[data-theme="dark"] main :where(a, button, summary, label, input, textarea, select) {
  color: inherit;
}

html[data-theme="dark"] main :where(section, article, aside, header, form, details) {
  border-color: var(--theme-border);
}

html[data-theme="dark"] :focus-visible {
  outline-color: var(--theme-accent);
}

html[data-theme="dark"] ::selection {
  color: #17141b;
  background: var(--theme-accent);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: var(--theme-text-quiet);
}

html[data-theme="dark"] .form-field-error,
html[data-theme="dark"] .form-status {
  color: var(--theme-error);
}

/* Shared navigation */
html[data-theme="dark"] .page-header,
html[data-theme="dark"] body.scene-nav .site-nav,
html[data-theme="dark"] body.scene-nav .site-announcement {
  color: var(--theme-text-display);
  background-color: rgba(21, 18, 25, .86);
  border-color: var(--theme-border);
}

html[data-theme="dark"] .site-nav--surface,
html[data-theme="dark"] .site-nav--surface .nav-button,
html[data-theme="dark"] .site-nav--surface .nav-links a,
html[data-theme="dark"] .site-nav--surface .nav-primary-link {
  color: var(--theme-text-display);
}

html[data-theme="dark"] .nav-logo-image,
html[data-theme="dark"] .site-nav img.icon {
  filter: brightness(0) saturate(100%) invert(92%) sepia(8%) saturate(153%) hue-rotate(344deg) brightness(103%);
}

html[data-theme="dark"] .nav-secondary-panel,
html[data-theme="dark"] .nav-panel {
  color: var(--theme-text-reading);
  background: var(--theme-surface-elevated);
  border-color: var(--theme-border);
}

html[data-theme="dark"] :where(
  .nav-panel__header,
  .mobile-navigation__item,
  .mobile-navigation__utility a,
  .nav-panel--search,
  .nav-panel--language,
  .language-menu__links a
) {
  border-color: var(--theme-border);
}

html[data-theme="dark"] :where(
  .nav-megapanel__eyebrow,
  .nav-megapanel__note,
  .mobile-navigation__eyebrow
) {
  color: var(--theme-text-quiet);
}

html[data-theme="dark"] .nav-megapanel__description {
  color: var(--theme-text-secondary);
}

html[data-theme="dark"] .nav-megapanel__text-link {
  border-color: var(--theme-border-strong);
}

html[data-theme="dark"] .nav-megapanel__feature,
html[data-theme="dark"] .site-search-form {
  background: var(--theme-surface);
}

html[data-theme="dark"] .nav-saved__count {
  color: #17141b;
  background: var(--theme-accent);
}

/* Footer */
html[data-theme="dark"] .site-footer {
  color: var(--theme-text-reading);
  background: var(--theme-surface-deep);
}

html[data-theme="dark"] .site-footer__group,
html[data-theme="dark"] .site-footer__group:last-child {
  border-color: var(--theme-border);
}

/* Buttons and form actions */
html[data-theme="dark"] main :where(
  .button--dark,
  .contact-form__submit,
  .commissions-form__submit,
  .product-form__add
) {
  color: #17141b;
  background: #e5ded9;
  border-color: #e5ded9;
}

html[data-theme="dark"] main :where(
  .button--dark,
  .contact-form__submit,
  .commissions-form__submit,
  .product-form__add
):hover:not(:disabled) {
  color: var(--theme-text-display);
  background: var(--theme-surface-elevated);
  border-color: var(--theme-border-strong);
}

html[data-theme="dark"] main .button--light {
  color: #17141b;
  background: #eeeae4;
  border-color: #eeeae4;
}

html[data-theme="dark"] :where(input, textarea, select) {
  caret-color: var(--theme-accent);
}

/* Cookie interface */
html[data-theme="dark"] .cookie-consent {
  background: rgba(11, 9, 14, .34);
}

html[data-theme="dark"] .cookie-banner__content,
html[data-theme="dark"] .cookie-preferences__panel {
  color: var(--theme-text-reading);
  background: rgba(32, 28, 37, .97);
  border-color: var(--theme-border-strong);
}

html[data-theme="dark"] .cookie-preferences {
  background: rgba(11, 9, 14, .72);
}

html[data-theme="dark"] :where(
  .cookie-banner__actions,
  .cookie-action,
  .cookie-preferences__header,
  .cookie-category,
  .cookie-banner__actions .cookie-action,
  .cookie-preferences__actions .cookie-action
) {
  border-color: var(--theme-border);
}

html[data-theme="dark"] :where(
  .cookie-banner__text,
  .cookie-preferences__introduction,
  .cookie-category__text
) {
  color: var(--theme-text-secondary);
}

html[data-theme="dark"] .cookie-category__status {
  color: var(--theme-text-quiet);
}

html[data-theme="dark"] .cookie-toggle__track {
  color: var(--theme-border-strong);
}

html[data-theme="dark"] .cookie-toggle__thumb {
  background: var(--theme-text-display);
}

/* Homepage */
html[data-theme="dark"] :where(
  .collection-hero,
  .collection-grid,
  .journal,
  .home-commissions,
  .home-commissions-closing
) {
  color: var(--theme-text-reading);
  background-color: var(--theme-canvas);
}

html[data-theme="dark"] :where(.house, .home-commissions) {
  color: var(--theme-text-reading);
  background-color: var(--theme-canvas-warm);
}

html[data-theme="dark"] :where(.product-card, .journal-card__image) {
  background: var(--theme-surface);
}

html[data-theme="dark"] :where(
  .journal__title,
  .house-label,
  .home-commissions__eyebrow,
  .home-commissions-closing__credit
) {
  color: var(--theme-text-quiet);
}

html[data-theme="dark"] :where(
  .house-intro,
  .home-commissions__text
) {
  color: var(--theme-text-secondary);
}

html[data-theme="dark"] :where(
  .house-link span:first-child,
  .journal__explore span:first-child,
  .home-commissions__link
) {
  border-color: var(--theme-border-strong);
}

html[data-theme="dark"] .journal__dot {
  background: var(--theme-border-strong);
}

html[data-theme="dark"] .journal__dot[aria-current="true"] {
  background: var(--theme-text-secondary);
}

/* Collection listing */
html[data-theme="dark"] :where(
  .collection-intro,
  .collection-toolbar,
  .collection-grid,
  .collection-card,
  .collection-card__info,
  .collection-editorial,
  .collection-closing,
  .collection-chapter,
  .yemanja-editorial,
  .rings-commission
) {
  color: var(--theme-text-reading);
  background-color: var(--theme-canvas);
  border-color: var(--theme-border);
}

html[data-theme="dark"] :where(
  .collection-intro__media,
  .collection-card__media,
  .collection-editorial__media,
  .collection-closing__media
) {
  background: var(--theme-product-field);
  box-shadow: inset 0 0 0 1px var(--theme-border);
}

html[data-theme="dark"] :where(
  .collection-intro__eyebrow,
  .collection-toolbar__count,
  .collection-card__material,
  .collection-editorial__eyebrow,
  .collection-chapter__eyebrow,
  .yemanja-editorial__credit,
  .rings-commission__eyebrow,
  .rings-commission__details
) {
  color: var(--theme-text-quiet);
}

html[data-theme="dark"] :where(
  .collection-intro__description,
  .collection-chapter__description,
  .rings-commission__text
) {
  color: var(--theme-text-secondary);
}

html[data-theme="dark"] .collection-card__wishlist {
  color: #17141b;
  background: rgba(238, 234, 228, .86);
}

html[data-theme="dark"] .collection-filter {
  color: var(--theme-text-reading);
  background: transparent;
  border-color: var(--theme-border-strong);
}

html[data-theme="dark"] .collection-filter.is-active {
  color: #17141b;
  background: #e5ded9;
  border-color: #e5ded9;
}

html[data-theme="dark"] .collection-sort select {
  color: var(--theme-text-reading);
  background-color: var(--theme-input);
  border-color: var(--theme-border-strong);
}

/* Product pages */
html[data-theme="dark"] :where(
  .product-page-body,
  .product-page,
  .product-services,
  .product-commission-prompt
) {
  color: var(--theme-text-reading);
  background-color: var(--theme-canvas);
}

html[data-theme="dark"] :where(
  .product-breadcrumbs,
  .product-info__purchase,
  .product-accordions,
  .product-accordion,
  .product-specifications > div,
  .product-custom-request,
  .product-commission-prompt,
  .product-service,
  .product-size__options,
  .product-size__option
) {
  border-color: var(--theme-border);
}

html[data-theme="dark"] :where(
  .product-gallery__main,
  .product-gallery__thumbnail,
  .related-product-card__image
) {
  background: var(--theme-product-field);
  box-shadow: inset 0 0 0 1px var(--theme-border);
}

html[data-theme="dark"] .product-gallery__zoom {
  color: #17141b;
  background: rgba(238, 234, 228, .86);
  border-color: rgba(23, 20, 27, .18);
}

html[data-theme="dark"] .product-gallery__thumbnail.is-active {
  border-color: var(--theme-text-display);
}

html[data-theme="dark"] :where(
  .product-info__tax-note,
  .product-specifications dt,
  .product-custom-request__field label span,
  .related-product-card__price,
  .product-commission-prompt__eyebrow,
  .product-service__content p,
  .product-size__option-copy small,
  .product-custom-request__privacy
) {
  color: var(--theme-text-quiet);
}

html[data-theme="dark"] :where(
  .product-size__select-wrapper,
  .product-size__select,
  .product-size__select option,
  .product-custom-request__field input,
  .product-custom-request__field textarea
) {
  color: var(--theme-text-reading);
  background: var(--theme-input);
  border-color: var(--theme-border-strong);
}

html[data-theme="dark"] .product-form__add:disabled {
  color: var(--theme-text-quiet);
  background: var(--theme-surface);
  border-color: var(--theme-surface);
}

html[data-theme="dark"] .related-products {
  color: var(--theme-text-reading);
  background: var(--theme-canvas-warm);
}

html[data-theme="dark"] .related-products__control {
  color: var(--theme-text-reading);
  border-color: var(--theme-border-strong);
}

html[data-theme="dark"] .related-products__control:hover,
html[data-theme="dark"] .product-size__option:has(input:checked) {
  background: var(--theme-hover);
}

html[data-theme="dark"] .product-size__marker {
  border-color: var(--theme-text-secondary);
}

html[data-theme="dark"] .product-size__option input:checked + .product-size__marker {
  background: var(--theme-accent);
  box-shadow: inset 0 0 0 2px var(--theme-canvas);
}

/* Curiosities landing */
html[data-theme="dark"] :where(
  .curiosities-intro,
  .curiosities-lapidary-feature
) {
  color: var(--theme-text-reading);
  background: var(--theme-canvas);
}

html[data-theme="dark"] .curiosities-intro__line {
  background: var(--theme-text-display);
}

html[data-theme="dark"] .curiosities-intro__description {
  color: var(--theme-text-secondary);
}

html[data-theme="dark"] :where(.curiosities-feed, .curiosity-card) {
  background: var(--theme-surface-deep);
}

html[data-theme="dark"] .curiosity-card__link {
  color: #eeeae4;
}

html[data-theme="dark"] .curiosities-newsletter {
  color: var(--theme-text-reading);
  background: var(--theme-canvas-warm);
}

html[data-theme="dark"] :where(
  .curiosities-newsletter__description,
  .curiosities-lapidary-feature__eyebrow
) {
  color: var(--theme-text-quiet);
}

html[data-theme="dark"] .curiosities-newsletter__form,
html[data-theme="dark"] .curiosities-lapidary-feature__link {
  border-color: var(--theme-border-strong);
}

html[data-theme="dark"] .curiosities-lapidary-feature__media {
  background: var(--theme-surface);
}

/* Curiosity articles */
html[data-theme="dark"] :where(
  .curiosity-article__header,
  .curiosity-article,
  .curiosity-article__body,
  .curiosity-article__related,
  .curiosity-article__next,
  .curiosity-article__pathways
) {
  color: var(--theme-text-reading);
  background-color: var(--theme-canvas);
  border-color: var(--theme-border);
}

html[data-theme="dark"] :where(
  .curiosity-article__category,
  .curiosity-article__date,
  .curiosity-article__eyebrow,
  .curiosity-article__caption,
  .curiosity-article__related-category,
  .curiosity-article__related-date
) {
  color: var(--theme-text-quiet);
}

html[data-theme="dark"] :where(
  .curiosity-article__standfirst,
  .curiosity-article__copy,
  .curiosity-article__body p
) {
  color: var(--theme-text-reading);
}

html[data-theme="dark"] :where(
  .curiosity-article__quote,
  .curiosity-article__callout,
  .curiosity-article__aside
) {
  color: var(--theme-text-reading);
  background: #1d1922;
  border-color: var(--theme-border);
}

html[data-theme="dark"] :where(
  .curiosity-article__asset-placeholder,
  .curiosity-article__media-placeholder
) {
  color: var(--theme-text-secondary);
  background-color: #211d25;
  border-color: var(--theme-border-strong);
}

html[data-theme="dark"] :where(
  .curiosity-article__related-card,
  .curiosity-article__related-item
) {
  border-color: var(--theme-border);
}

/* Material Lapidary */
html[data-theme="dark"] body:has(.lapidary),
html[data-theme="dark"] .lapidary {
  color: var(--theme-text-reading);
  background: var(--theme-canvas-warm);
}

html[data-theme="dark"] :where(
  .lapidary-hero,
  .lapidary-mobile-jump,
  .lapidary-index,
  .lapidary-preface,
  .lapidary-section,
  .lapidary-card,
  .lapidary-subsection,
  .lapidary-no-results
) {
  color: var(--theme-text-reading);
  background-color: var(--theme-canvas-warm);
  border-color: var(--theme-border-strong);
}

html[data-theme="dark"] .lapidary-card {
  background: var(--theme-surface-elevated);
}

html[data-theme="dark"] .lapidary-cards {
  background: var(--theme-border-strong);
  border-color: var(--theme-border-strong);
}

html[data-theme="dark"] :where(
  .lapidary-hero__eyebrow,
  .lapidary-index__label,
  .lapidary-section__heading p,
  .lapidary-index__status
) {
  color: var(--theme-text-quiet);
}

html[data-theme="dark"] .lapidary-index input {
  color: var(--theme-text-reading);
  border-color: var(--theme-text-secondary);
}

html[data-theme="dark"] :where(
  .lapidary-index__sections,
  .lapidary-card__top,
  .lapidary-prose th,
  .lapidary-prose td
) {
  border-color: var(--theme-border);
}

html[data-theme="dark"] .lapidary-prose th:first-child,
html[data-theme="dark"] .lapidary-prose td:first-child {
  background: var(--theme-canvas-warm);
}

html[data-theme="dark"] .lapidary-media-placeholder {
  color: var(--theme-text-secondary);
  border-color: var(--theme-border-strong);
  background-color: #211d25;
}

/* Service, care, forms and legal pages */
html[data-theme="dark"] :where(
  .care-page,
  .contact-page,
  .newsletter-page,
  .newsletter-hero,
  .commissions-page,
  .service-page,
  .legal-page,
  .contact-success-page,
  .language-holding,
  .saved-page
) {
  color: var(--theme-text-reading);
  background: var(--theme-canvas);
}

html[data-theme="dark"] :where(
  .care-contact,
  .service-contact,
  .newsletter-campaign
) {
  color: var(--theme-text-reading);
  background: var(--theme-canvas-warm);
}

html[data-theme="dark"] :where(
  .care-film__media,
  .care-contact__media,
  .saved-card figure
) {
  background: var(--theme-surface);
}

html[data-theme="dark"] .care-film__caption {
  color: var(--theme-text-reading);
  background: rgba(32, 28, 37, .9);
}

html[data-theme="dark"] :where(
  .care-topic,
  .care-guide,
  .care-guide__item,
  .care-intro__beliefs,
  .contact-details,
  .contact-details__item,
  .newsletter-signup__field,
  .commissions-introduction,
  .commissions-steps,
  .commissions-steps li,
  .service-index,
  .service-index__list li,
  .service-accordion,
  .service-accordion__item,
  .legal-layout,
  .legal-index,
  .legal-section,
  .legal-document,
  .legal-table th,
  .legal-table td,
  .legal-facts div,
  .saved-empty,
  .saved-selection__tools
) {
  border-color: var(--theme-border);
}

html[data-theme="dark"] .care-topic:hover {
  background: var(--theme-hover);
}

html[data-theme="dark"] .care-topic__symbol--gold {
  color: #d6b86a;
}

html[data-theme="dark"] :where(
  .care-section-header__text,
  .care-guide__summary-text,
  .care-guide__note,
  .care-intro__beliefs-text,
  .form-privacy-notice,
  .newsletter-signup__consent span,
  .commissions-introduction__copy p,
  .commissions-steps p,
  .commissions-form-section__header > p:last-child,
  .commissions-form__consent,
  .service-accordion__summary-text,
  .service-accordion__status,
  .legal-status,
  .legal-facts dt,
  .saved-card__info p
) {
  color: var(--theme-text-secondary);
}

html[data-theme="dark"] :where(
  .commissions-eyebrow,
  .commissions-steps span,
  .commissions-form__field label span,
  .commissions-form__field--file p,
  .service-section__label,
  .legal-intro__updated,
  .legal-index__label,
  .legal-section__number
) {
  color: var(--theme-text-quiet);
}

html[data-theme="dark"] :where(
  .contact-form__field input,
  .contact-form__field textarea,
  .commissions-form__field input,
  .commissions-form__field select,
  .commissions-form__field textarea,
  .newsletter-signup__field
) {
  color: var(--theme-text-reading);
  background: var(--theme-input);
  border-color: var(--theme-border-strong);
}

html[data-theme="dark"] .care-intro__beliefs-link {
  border-color: var(--theme-border-strong);
}

html[data-theme="dark"] .care-intro__beliefs-link:hover {
  color: #17141b;
  background: #e5ded9;
}

/* Search */
html[data-theme="dark"] .search-page__interface {
  --pagefind-ui-primary: var(--theme-text-display);
  --pagefind-ui-text: var(--theme-text-reading);
  --pagefind-ui-background: var(--theme-canvas);
  --pagefind-ui-border: var(--theme-border);
  --pagefind-ui-tag: var(--theme-surface);
}

html[data-theme="dark"] .search-page__interface .pagefind-ui__search-input,
html[data-theme="dark"] .search-page__interface .pagefind-ui__result-thumb,
html[data-theme="dark"] .search-page__interface .pagefind-ui__button:hover {
  color: var(--theme-text-reading);
  background: var(--theme-input);
}

html[data-theme="dark"] .search-page__interface :where(
  .pagefind-ui__results,
  .pagefind-ui__result,
  .pagefind-ui__button
) {
  border-color: var(--theme-border);
}

html[data-theme="dark"] .search-page__interface .pagefind-ui__result-excerpt {
  color: var(--theme-text-secondary);
}

html[data-theme="dark"] .search-page__interface mark {
  color: #17141b;
  background: var(--theme-accent);
}

/* Studio page */
html[data-theme="dark"] :where(
  .house-intro,
  .house-craft
) {
  color: var(--theme-text-reading);
  background: var(--theme-canvas);
}

html[data-theme="dark"] .house-founder {
  color: var(--theme-text-reading);
  background: var(--theme-canvas-warm);
}

html[data-theme="dark"] .house-founder__media {
  background: var(--theme-surface);
}

html[data-theme="dark"] :where(
  .house-intro__location,
  .house-founder__places
) {
  border-color: var(--theme-border);
}

/* Beauty atlas long-form special */
html[data-theme="dark"] body:has(.beauty-atlas),
html[data-theme="dark"] .beauty-atlas {
  color: var(--theme-text-reading);
  background: var(--theme-canvas-warm);
}

html[data-theme="dark"] :where(
  .beauty-atlas__hero,
  .beauty-atlas__mobile-contents,
  .beauty-atlas__chapter-title,
  .beauty-atlas__article hr,
  .beauty-atlas__article blockquote,
  .beauty-atlas__article th,
  .beauty-atlas__article td,
  .beauty-atlas__top,
  .beauty-atlas__contents
) {
  border-color: var(--theme-border-strong);
}

html[data-theme="dark"] :where(
  .beauty-atlas__category,
  .beauty-atlas__contents > div > p,
  .beauty-atlas__mobile-contents a span,
  .beauty-atlas__contents a span
) {
  color: var(--theme-text-quiet);
}

html[data-theme="dark"] .beauty-atlas__hero figure {
  background: var(--theme-surface);
  box-shadow: inset 0 0 0 1px var(--theme-border);
}

html[data-theme="dark"] .beauty-atlas__object-entry {
  border-color: var(--theme-border-strong);
  background: #17141b;
}

html[data-theme="dark"] .beauty-atlas__object-media {
  background: #211d25;
}

html[data-theme="dark"] .beauty-atlas__article blockquote {
  background: #1d1922;
}

html[data-theme="dark"] .beauty-atlas__object-entry .beauty-atlas__image-note {
  border-color: var(--theme-border-strong);
  background: transparent;
}

html[data-theme="dark"] .beauty-atlas__source-note {
  color: var(--theme-text-quiet);
}

html[data-theme="dark"] .beauty-atlas__article td:first-child,
html[data-theme="dark"] .beauty-atlas__article th:first-child {
  background: var(--theme-canvas-warm);
}

@media (max-width: 47.99rem) {
  .appearance-toggle {
    right: max(2px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .appearance-toggle,
  .appearance-toggle__rays,
  .appearance-toggle__cutout,
  html.appearance-transitioning * {
    transition-duration: .01ms !important;
  }
}
