/* ==========================================================================
   AbstractRealmss — Brand Spec v1.3
   Design tokens · grain · brackets · spec components
   ========================================================================== */

:root {
  --arss-midnight: #0A1A3F;
  --arss-silver: #C8CDD6;
  --arss-ether: #F5F4F0;
  --arss-night: #06112B;
  --arss-twilight: #162847;
  --arss-line: #2A3856;
  --arss-muted: #9BA3B0;
  --arss-body: #5C6577;
  --arss-paper: #E8E6E0;
  --arss-azure: #2E5AA8;
  --arss-aqua: #5FA6C4;
  --arss-font-display: 'Libre Caslon Text', Georgia, serif;
  --arss-font-body: 'Manrope', 'Helvetica Neue', sans-serif;
  --arss-h1: clamp(48px, 7vw, 72px);
  --arss-h2: clamp(32px, 4vw, 48px);
  --arss-body-size: 16px;
  --arss-label-size: 10px;
  --arss-divider: 0.4px;
}

/* --- Grain overlay (disabled) --- */
.arss-grain {
  position: relative;
}

.arss-grain::after {
  display: none;
}

/* --- L-shaped ceremonial brackets --- */
.arss-brackets {
  position: relative;
}

.arss-brackets::before,
.arss-brackets::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--arss-silver);
  border-style: solid;
  pointer-events: none;
  opacity: 0.65;
}

.arss-brackets::before {
  top: 0;
  left: 0;
  border-width: var(--arss-divider) 0 0 var(--arss-divider);
}

.arss-brackets::after {
  bottom: 0;
  right: 0;
  border-width: 0 var(--arss-divider) var(--arss-divider) 0;
}

/* --- Semantic divider --- */
.arss-divider {
  height: var(--arss-divider);
  background: var(--arss-silver);
  opacity: 0.55;
  margin: 20px 0;
}

/* --- Typography spec --- */
.arss-kicker {
  font-size: var(--arss-label-size);
  letter-spacing: 0.12em;
  font-weight: 700;
  text-transform: uppercase;
}

.arss-h2--light,
.arss-section--midnight .arss-h2 {
  color: var(--arss-ether);
  font-weight: 500;
  line-height: 1.15;
}

.arss-section__lead--light {
  color: var(--arss-muted);
}

.arss-section--midnight {
  background: var(--arss-midnight);
  color: var(--arss-muted);
}

/* --- Hero photo placeholder (lifestyle tone) --- */
.arss-hero__photo {
  aspect-ratio: 4/5;
  max-width: 420px;
  margin-left: auto;
  border-radius: 4px;
  overflow: hidden;
  border: var(--arss-divider) solid rgba(200, 205, 214, 0.35);
}

.arss-hero__photo-inner {
  width: 100%;
  height: 100%;
  min-height: 360px;
  background:
    linear-gradient(145deg, rgba(6, 17, 43, 0.2), rgba(10, 26, 63, 0.75)),
    radial-gradient(circle at 30% 70%, rgba(95, 166, 196, 0.25), transparent 55%),
    linear-gradient(160deg, var(--arss-twilight), var(--arss-night));
}

.arss-hero__title {
  font-size: var(--arss-h1);
  line-height: 1.08;
}

.arss-h2 {
  font-size: var(--arss-h2);
  line-height: 1.15;
}

/* --- Video block --- */
.arss-video__frame {
  position: relative;
  border: var(--arss-divider) solid rgba(200, 205, 214, 0.35);
  border-radius: 4px;
  overflow: hidden;
  background: var(--arss-night);
}

.arss-video__player,
.arss-video__embed {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  border: 0;
}

.arss-video__embed iframe {
  width: 100%;
  height: 100%;
  min-height: 360px;
  border: 0;
}

/* --- Realms dropdown --- */
.arss-nav__item--realms {
  position: relative;
}

.arss-nav__realms-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 11px;
  border: none;
  border-radius: 999px;
  background: transparent;
  font: 500 12px/1 var(--arss-font-body);
  color: var(--arss-body);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.arss-nav__realms-btn:hover,
.arss-nav__realms-btn[aria-expanded="true"] {
  background: rgba(10, 26, 63, 0.07);
  color: var(--arss-midnight);
}

.arss-realms-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 280px;
  padding: 16px;
  border-radius: 12px;
  background: var(--arss-ether);
  border: var(--arss-divider) solid var(--arss-silver);
  box-shadow: 0 16px 48px rgba(6, 17, 43, 0.14);
  z-index: 1100;
}

.arss-realms-menu__kicker {
  margin: 0 0 10px;
  font: 700 10px/1 var(--arss-font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--arss-azure);
}

.arss-realms-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.arss-realms-menu__list a {
  display: block;
  padding: 10px 12px;
  border-radius: 0;
  text-decoration: none;
  transition: background 0.2s;
}

.arss-realms-menu__list a:hover {
  background: rgba(183, 197, 244, 0.08);
}

.arss-realms-menu__list strong {
  display: block;
  font: 500 16px/1.25 var(--arss-font-display);
  color: var(--arss-midnight);
  margin-bottom: 4px;
}

.arss-realms-menu__list span {
  font-size: 13px;
  line-height: 1.5;
  color: var(--arss-body);
}

body.arss-home .arss-header.is-at-top .arss-nav__realms-btn {
  color: var(--arss-ether);
}

body.arss-home .arss-header.is-at-top .arss-nav__realms-btn:hover,
body.arss-home .arss-header.is-at-top .arss-nav__realms-btn[aria-expanded="true"] {
  background: rgba(245, 244, 240, 0.1);
  color: var(--arss-ether);
}

/* --- Dark realm cards --- */
.arss-realm-card--dark {
  background: rgba(22, 40, 71, 0.55);
  border-color: var(--arss-line);
}

.arss-realm-card--dark .arss-realm-card__title {
  color: var(--arss-ether);
}

.arss-realm-card--dark .arss-realm-card__text {
  color: var(--arss-muted);
}

/* --- Light steps --- */
.arss-steps--light {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.arss-steps--light .arss-step--light {
  background: var(--arss-ether);
  border: var(--arss-divider) solid rgba(200, 205, 214, 0.65);
}

.arss-steps--light .arss-step__title {
  color: var(--arss-midnight);
}

.arss-steps--light .arss-step__text {
  color: var(--arss-body);
}

/* --- Product detail page --- */
.arss-pdp {
  display: contents;
}

.arss-pdp div.product {
  position: relative;
}

body.arss-woocommerce.single-product .arss-pdp div.product {
  padding: 32px 0 64px;
}

body.arss-woocommerce.single-product div.product .woocommerce-product-gallery {
  border: var(--arss-divider) solid var(--arss-silver);
}

/* --- Intent layer --- */
.arss-intent {
  margin: 24px 0;
  padding: 20px;
  border: var(--arss-divider) solid var(--arss-silver);
  border-radius: 12px;
  background: var(--arss-ether);
}

.arss-intent__label,
.arss-label {
  margin: 0 0 12px;
  font: 700 var(--arss-label-size)/1 var(--arss-font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--arss-midnight);
}

.arss-intent__toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.arss-intent__option {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 140px;
  min-width: 0;
  padding: 14px;
  border: var(--arss-divider) solid var(--arss-silver);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.arss-intent__option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.arss-intent__option.is-active {
  border-color: var(--arss-midnight);
  background: rgba(10, 26, 63, 0.04);
}

.arss-intent__option-title {
  font: 600 12px/1.3 var(--arss-font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--arss-midnight);
  overflow-wrap: break-word;
}

.arss-intent__option-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--arss-body);
  overflow-wrap: break-word;
}

.arss-intent__gift {
  margin-top: 16px;
}

.arss-field {
  display: block;
  margin-bottom: 14px;
}

.arss-field span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--arss-midnight);
}

.arss-field input,
.arss-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: var(--arss-divider) solid var(--arss-silver);
  border-radius: 10px;
  font: 400 15px/1.5 var(--arss-font-body);
  color: var(--arss-midnight);
  background: var(--arss-ether);
}

.arss-intent__note {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--arss-body);
}

/* --- Customization overlay --- */
.arss-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: stretch;
}

.arss-overlay[hidden] {
  display: none !important;
}

.arss-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 17, 43, 0.92);
  backdrop-filter: blur(8px);
}

.arss-overlay__shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh;
  background: linear-gradient(180deg, var(--arss-night), var(--arss-midnight));
  color: var(--arss-ether);
}

.arss-overlay__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(20px, 4vw, 36px);
  border-bottom: var(--arss-divider) solid rgba(200, 205, 214, 0.25);
}

.arss-overlay__title {
  margin: 0;
  font: 400 clamp(28px, 4vw, 40px)/1.1 var(--arss-font-display);
  color: var(--arss-ether);
}

.arss-overlay__close {
  border: none;
  background: none;
  color: var(--arss-ether);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
}

.arss-overlay__body {
  overflow-y: auto;
  padding: clamp(20px, 4vw, 36px);
  display: grid;
  gap: 24px;
  align-content: start;
}

.arss-dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 180px;
  padding: 32px;
  border: var(--arss-divider) dashed rgba(200, 205, 214, 0.55);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.arss-dropzone:hover,
.arss-dropzone.is-dragover {
  border-color: var(--arss-aqua);
  background: rgba(95, 166, 196, 0.08);
}

.arss-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.arss-dropzone__title {
  font: 500 18px/1.3 var(--arss-font-display);
  color: var(--arss-ether);
}

.arss-dropzone__hint {
  font-size: 13px;
  color: var(--arss-muted);
}

.arss-preview-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.arss-preview-tabs__btn {
  padding: 10px 16px;
  border: var(--arss-divider) solid rgba(200, 205, 214, 0.35);
  border-radius: 999px;
  background: transparent;
  font: 700 10px/1 var(--arss-font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--arss-muted);
  cursor: pointer;
}

.arss-preview-tabs__btn.is-active {
  background: var(--arss-ether);
  color: var(--arss-midnight);
  border-color: var(--arss-ether);
}

.arss-preview-stage {
  position: relative;
  padding: 16px;
  border: var(--arss-divider) solid rgba(200, 205, 214, 0.25);
  border-radius: 12px;
  background: rgba(6, 17, 43, 0.35);
}

.arss-preview-stage__img {
  display: none;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 8px;
}

.arss-preview-stage__img.is-active {
  display: block;
}

.arss-overlay__footer {
  position: sticky;
  bottom: 0;
  padding: 16px clamp(20px, 4vw, 36px) calc(16px + env(safe-area-inset-bottom));
  border-top: var(--arss-divider) solid rgba(200, 205, 214, 0.25);
  background: rgba(6, 17, 43, 0.85);
  backdrop-filter: blur(12px);
}

.arss-overlay__footer form {
  display: flex;
  justify-content: center;
}

.arss-error {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(180, 60, 60, 0.15);
  border: var(--arss-divider) solid rgba(220, 100, 100, 0.4);
  color: #f5c4c4;
  font-size: 14px;
}

/* --- Gift checkout --- */
.arss-gift-wrap {
  margin: 24px 0;
  padding: 24px;
  border: var(--arss-divider) solid var(--arss-silver);
  border-radius: 12px;
  background: var(--arss-ether);
}

.arss-gift-fields {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: var(--arss-divider) solid var(--arss-silver);
}

.arss-gift-fields.is-open {
  display: block;
}

.arss-gift-wrap .woocommerce-input-wrapper label,
.arss-gift-wrap label {
  font-weight: 600;
  color: var(--arss-midnight);
}

/* --- Breadcrumb --- */
.arss-breadcrumb {
  padding: 12px 0;
  -webkit-overflow-scrolling: touch;
}

.arss-breadcrumb__list {
  flex-wrap: nowrap;
  white-space: nowrap;
}

.arss-breadcrumb__item a {
  color: var(--arss-azure);
}

.arss-breadcrumb__sep {
  color: var(--arss-silver);
  flex-shrink: 0;
}

/* --- Nav scroll on desktop --- */
.arss-nav__list {
  overflow-x: auto;
  scrollbar-width: none;
  max-width: min(640px, 52vw);
}

/* --- Header midnight bar when scrolled on inner pages --- */
body:not(.arss-home) .arss-header.is-scrolled .arss-header__bar {
  background: rgba(10, 26, 63, 0.94);
  border-color: rgba(200, 205, 214, 0.2);
}

body:not(.arss-home) .arss-header.is-scrolled .arss-brand__name,
body:not(.arss-home) .arss-header.is-scrolled .arss-nav__list a,
body:not(.arss-home) .arss-header.is-scrolled .arss-nav__realms-btn,
body:not(.arss-home) .arss-header.is-scrolled .arss-tool,
body:not(.arss-home) .arss-header.is-scrolled .arss-menu-btn span {
  color: var(--arss-ether);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .arss-intent__toggle {
    grid-template-columns: 1fr;
  }

  .arss-realms-menu {
    position: static;
    transform: none;
    margin-top: 8px;
    min-width: 0;
  }

  .arss-nav__list {
    max-width: none;
    overflow: visible;
  }

  .arss-hero__layout {
    grid-template-columns: 1fr;
  }

  .arss-hero__photo {
    margin-inline: auto;
    max-width: 300px;
  }
}

@media (max-width: 560px) {
  .arss-overlay__header,
  .arss-overlay__body,
  .arss-overlay__footer {
    padding-inline: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .arss-grain::after {
    display: none;
  }
}
