:root {
  --deep-navy: #0a1e3f;
  --brand-navy: #1f3d7a;
  --sapphire-navy: #1b3a6b;
  --glacier-blue: #a9d4e5;
  --mist-blue: #dceef4;
  --pure-white: #fbfcfd;
  --champagne-gold: #c5a572;
  --ink: #10233c;
  --muted: #5f7489;
  --line: rgba(27, 58, 107, 0.14);
  --panel: rgba(251, 252, 253, 0.08);
  --shadow: 0 24px 70px rgba(10, 30, 63, 0.14);
  --error: #b5524a;
  --product-bg-image: image-set(
    url("assets/aesthein-product-bg.webp") type("image/webp"),
    url("assets/aesthein-product-bg.png") type("image/png")
  );
  --splash-logo-mask: image-set(
    url("assets/aesthein-mark-mask.webp") type("image/webp"),
    url("assets/aesthein-mark-mask.png") type("image/png")
  );
}

@property --splash-current-width {
  syntax: "<length>";
  inherits: true;
  initial-value: 162px;
}

@property --splash-current-height {
  syntax: "<length>";
  inherits: true;
  initial-value: 168px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--pure-white);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    linear-gradient(
      180deg,
      rgba(251, 252, 253, 0.9) 0%,
      rgba(220, 238, 244, 0.72) 50%,
      rgba(251, 252, 253, 0.94) 100%
    ),
    var(--product-bg-image) center / cover no-repeat;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background: var(--product-bg-image) center / cover no-repeat;
  opacity: 0.12;
  filter: saturate(0.88) blur(1px);
}

.splash-backdrop {
  position: fixed;
  inset: 0;
  z-index: 19;
  background: var(--brand-navy);
  pointer-events: none;
  opacity: 1;
  visibility: visible;
}

.splash-logo,
.splash {
  --splash-current-width: min(31.32vw, 162px);
  --splash-current-height: min(32.37vw, 168px);
}

.splash-logo {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 20;
  width: var(--splash-current-width);
  height: var(--splash-current-height);
  background: rgba(251, 252, 253, 0.94);
  -webkit-mask-image: var(--splash-logo-mask);
  mask-image: var(--splash-logo-mask);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  pointer-events: none;
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%);
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 21;
  background: var(--brand-navy);
  -webkit-mask-image:
    var(--splash-logo-mask),
    linear-gradient(#fff 0 0);
  mask-image:
    var(--splash-logo-mask),
    linear-gradient(#fff 0 0);
  -webkit-mask-size:
    var(--splash-current-width) var(--splash-current-height),
    100% 100%;
  mask-size:
    var(--splash-current-width) var(--splash-current-height),
    100% 100%;
  -webkit-mask-position:
    center,
    0 0;
  mask-position:
    center,
    0 0;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  overflow: hidden;
  pointer-events: none;
  opacity: 1;
  visibility: visible;
  transition:
    opacity 160ms ease 440ms,
    visibility 0s linear 600ms;
}

body.is-ready .splash {
  opacity: 0;
  visibility: hidden;
  animation: splash-window-exit 600ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

body.is-ready .splash-logo,
body.is-ready .splash-backdrop {
  opacity: 0;
  visibility: hidden;
}

body.is-ready .splash-backdrop {
  transition:
    opacity 600ms cubic-bezier(0.33, 1, 0.68, 1),
    visibility 0s linear 600ms;
}

body.is-ready .splash-logo {
  transition:
    opacity 520ms cubic-bezier(0.33, 1, 0.68, 1) 80ms,
    visibility 0s linear 600ms;
}

html.has-viewed-brochure .splash-backdrop,
html.has-viewed-brochure .splash-logo,
html.has-viewed-brochure .splash {
  display: none;
}

a {
  color: inherit;
}

.shell {
  width: min(100%, 620px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(42px, env(safe-area-inset-top)) 18px max(34px, env(safe-area-inset-bottom));
}

.hero {
  padding: 8px 4px 26px;
  text-align: center;
}

.eyebrow {
  margin: 0;
  color: var(--sapphire-navy);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand {
  margin: 8px 0 0;
  color: var(--brand-navy);
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 13vw, 5.35rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: 0.08em;
}

.gold-line {
  width: 68px;
  height: 2px;
  margin: 22px auto 24px;
  background: var(--champagne-gold);
}

h2 {
  margin: 0;
  color: var(--deep-navy);
  font-size: 1.26rem;
  line-height: 0.9;
}

.hero .eyebrow,
.hero h2,
.viewer-header .eyebrow {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
}

.hero h2 {
  font-weight: 500;
  letter-spacing: 0.08em;
}

.language-panel {
  padding: 16px;
  border: 1px solid rgba(169, 212, 229, 0.24);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 38px rgba(10, 30, 63, 0.04);
  backdrop-filter: blur(5px);
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.language-card {
  position: relative;
  display: grid;
  align-items: center;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  min-height: 78px;
  padding: 14px 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(251, 252, 253, 0.94), rgba(220, 238, 244, 0.74)),
    rgba(251, 252, 253, 0.82);
  box-shadow: 0 10px 26px rgba(10, 30, 63, 0.08);
  text-decoration: none;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease,
    background 150ms ease;
  animation: card-in 420ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
  animation-delay: calc(var(--stagger-index, 0) * 24ms);
}

.language-card:focus-visible,
.language-card:hover {
  border-color: rgba(197, 165, 114, 0.75);
  background:
    linear-gradient(135deg, rgba(251, 252, 253, 0.98), rgba(169, 212, 229, 0.8)),
    rgba(251, 252, 253, 0.92);
  box-shadow: 0 16px 34px rgba(10, 30, 63, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.language-card.is-detected {
  border-color: rgba(197, 165, 114, 0.72);
  box-shadow: 0 12px 30px rgba(197, 165, 114, 0.16);
}

.language-flag {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(10, 30, 63, 0.14);
  border-radius: 50%;
  background: var(--pure-white);
  box-shadow:
    inset 0 0 0 2px rgba(251, 252, 253, 0.72),
    0 8px 18px rgba(10, 30, 63, 0.08);
}

.language-flag img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.language-text {
  display: block;
  min-width: 0;
}

.detected-badge {
  position: absolute;
  top: 9px;
  right: 10px;
  color: var(--champagne-gold);
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

[dir="rtl"] .detected-badge {
  right: auto;
  left: 10px;
}

.language-native {
  display: block;
  min-width: 0;
  color: var(--deep-navy);
  font-size: clamp(0.98rem, 4vw, 1.08rem);
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.language-english {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.viewer-shell {
  display: grid;
  width: min(100%, 980px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
}

.viewer-header {
  display: grid;
  align-items: center;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(169, 212, 229, 0.72);
  border-radius: 8px;
  background: rgba(251, 252, 253, 0.84);
  box-shadow: 0 14px 40px rgba(10, 30, 63, 0.1);
  backdrop-filter: blur(18px);
}

.viewer-header h1 {
  margin: 3px 0 0;
  color: var(--deep-navy);
  font-size: 1.08rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.icon-link {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(27, 58, 107, 0.14);
  border-radius: 8px;
  background: var(--deep-navy);
  color: var(--pure-white);
  font-size: 1.2rem;
  font-weight: 800;
  text-decoration: none;
}

.icon-link:focus-visible,
.icon-link:hover {
  border-color: rgba(197, 165, 114, 0.8);
  outline: none;
}

.icon-link[aria-disabled="true"] {
  opacity: 0.42;
  pointer-events: none;
}

.pdf-frame-wrap {
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(169, 212, 229, 0.72);
  border-radius: 8px;
  background: rgba(251, 252, 253, 0.9);
  box-shadow: var(--shadow);
}

.pdf-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 112px);
  min-height: 620px;
  border: 0;
  background: var(--pure-white);
}

.pdf-frame[hidden] {
  display: none;
}

.pdf-status {
  display: grid;
  min-height: 620px;
  align-content: center;
  justify-items: center;
  gap: 10px;
  place-items: center;
  padding: 28px;
  text-align: center;
}

.pdf-status[hidden] {
  display: none;
}

.pdf-status p {
  margin: 0;
  color: var(--deep-navy);
  font-size: 1.05rem;
  font-weight: 800;
}

.pdf-status span {
  min-height: 1.1em;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.pdf-status-graphic {
  width: 42px;
  height: 42px;
  margin-bottom: 8px;
  border-radius: 50%;
}

.pdf-status-graphic.is-loading,
.pdf-status-graphic.is-slow {
  border: 2px solid rgba(197, 165, 114, 0.22);
  border-top-color: var(--champagne-gold);
  animation: spin 900ms linear infinite;
}

.pdf-status-graphic.is-slow {
  border-top-color: var(--sapphire-navy);
  animation-duration: 1300ms;
}

.pdf-status-graphic.is-error {
  position: relative;
  border: 1px solid rgba(181, 82, 74, 0.28);
}

.pdf-status-graphic.is-error::before,
.pdf-status-graphic.is-error::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: var(--error);
  content: "";
}

.pdf-status-graphic.is-error::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.pdf-status-graphic.is-error::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.pdf-status code {
  display: block;
  max-width: min(100%, 520px);
  margin-top: 12px;
  padding: 10px 12px;
  overflow-wrap: anywhere;
  border: 1px solid rgba(27, 58, 107, 0.12);
  border-radius: 8px;
  background: rgba(220, 238, 244, 0.62);
  color: var(--sapphire-navy);
  font-size: 0.78rem;
}

.retry-button {
  min-width: 128px;
  margin-top: 8px;
  padding: 11px 18px;
  border: 1px solid rgba(10, 30, 63, 0.82);
  border-radius: 8px;
  background: var(--deep-navy);
  color: var(--pure-white);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
}

.retry-button:focus-visible,
.retry-button:hover {
  border-color: rgba(197, 165, 114, 0.8);
  outline: none;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes splash-window-exit {
  0% {
    --splash-current-width: min(31.32vw, 162px);
    --splash-current-height: min(32.37vw, 168px);
  }

  100% {
    --splash-current-width: min(360vw, 1866px);
    --splash-current-height: min(371.96vw, 1928px);
  }
}

@media (max-width: 430px) {
  .shell {
    padding: 30px 12px 24px;
  }

  .hero {
    padding-bottom: 20px;
  }

  .language-panel {
    padding: 10px;
  }

  .language-grid {
    gap: 8px;
  }

  .language-card {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    min-height: 74px;
    padding: 12px 10px;
  }

  .language-flag {
    width: 34px;
    height: 34px;
  }

  .viewer-shell {
    padding: 10px;
    gap: 10px;
  }

  .viewer-header {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    padding: 10px;
  }

  .icon-link {
    width: 40px;
    height: 40px;
  }

  .pdf-frame {
    height: calc(100vh - 94px);
    min-height: 520px;
  }

  .pdf-status {
    min-height: 520px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash-backdrop,
  .splash-logo,
  .splash {
    display: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
