:root {
  --navy: #0b1730;
  --navy-soft: #162846;
  --ink: #151515;
  --ivory: #f5f1e8;
  --paper: #fbfaf7;
  --gold: #dcc580;
  --gold-deep: #a98b3f;
  --line: rgba(19, 27, 42, 0.14);
  --shadow: 0 22px 70px rgba(16, 24, 40, 0.12);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body { width: 100%; min-height: 100%; margin: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button { color: inherit; font: inherit; }

.app-shell { min-height: 100dvh; background: var(--paper); }

.app-header {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  height: calc(76px + var(--safe-top));
  padding: calc(10px + var(--safe-top)) clamp(18px, 3vw, 48px) 10px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 24px;
  background: rgba(251, 250, 247, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
}

.brand-button {
  border: 0;
  background: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
  cursor: pointer;
}

.brand-seal,
.card-mark,
.loader-seal {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(184, 151, 70, 0.66);
  background: var(--navy);
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.brand-copy { display: grid; gap: 3px; text-align: left; }
.brand-copy strong { font: 700 16px/1.1 Georgia, "Times New Roman", serif; letter-spacing: 0.08em; }
.brand-copy small { color: #7d6a3c; font-size: 9px; font-weight: 700; letter-spacing: 0.18em; }

.site-switcher {
  display: flex;
  padding: 4px;
  border-radius: 999px;
  background: #ece9e2;
  border: 1px solid rgba(20, 20, 20, 0.06);
}

.site-tab {
  min-width: 126px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #6a6965;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.09em;
  cursor: pointer;
  transition: 180ms ease;
}

.site-tab.is-active { background: var(--navy); color: #fff; box-shadow: 0 7px 18px rgba(11, 23, 48, 0.18); }
.site-tab[data-site="beauty"].is-active { background: #171512; color: var(--gold); }

.header-actions { display: flex; justify-self: end; gap: 8px; }
.icon-button {
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.icon-button svg, .mobile-dock svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.header-actions[hidden] { display: none; }

.app-main { min-height: 100dvh; padding-top: calc(76px + var(--safe-top)); }

.welcome-view {
  min-height: calc(100dvh - 76px - var(--safe-top));
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(600px, 1.18fr);
  grid-template-rows: 1fr auto;
  gap: 44px clamp(40px, 6vw, 100px);
  align-items: center;
  padding: clamp(50px, 8vh, 110px) clamp(26px, 6vw, 110px) 32px;
  background:
    radial-gradient(circle at 12% 18%, rgba(220, 197, 128, 0.22), transparent 31%),
    linear-gradient(135deg, #fbfaf7 0%, #f1ede4 100%);
}
.welcome-view[hidden] { display: none; }

.welcome-copy { max-width: 660px; }
.eyebrow { margin: 0 0 24px; color: #8e7339; font-size: 11px; font-weight: 800; letter-spacing: 0.24em; }
.welcome-copy h1 { margin: 0; font: 500 clamp(50px, 5.4vw, 92px)/0.94 Georgia, "Times New Roman", serif; letter-spacing: -0.055em; }
.welcome-copy h1 span { color: #8e7650; }
.intro { max-width: 590px; margin: 28px 0 0; color: #65635f; font-size: clamp(16px, 1.4vw, 20px); line-height: 1.7; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.primary-action, .install-action {
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.primary-action { border: 1px solid var(--navy); background: var(--navy); color: #fff; box-shadow: 0 12px 24px rgba(11, 23, 48, 0.18); }
.install-action { border: 1px solid rgba(14, 20, 31, 0.18); background: transparent; }

.catalog-choices { display: grid; grid-template-columns: repeat(2, minmax(250px, 1fr)); gap: clamp(16px, 2vw, 28px); }
.catalog-card {
  position: relative;
  isolation: isolate;
  min-height: clamp(430px, 58vh, 620px);
  padding: 30px;
  border: 0;
  border-radius: 28px;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.catalog-card:hover { transform: translateY(-6px); box-shadow: 0 30px 90px rgba(16, 24, 40, 0.18); }
.catalog-card::before, .catalog-card::after { content: ""; position: absolute; pointer-events: none; }
.catalog-card::before { inset: auto -28% -24% 20%; aspect-ratio: 1; border: 1px solid rgba(220, 197, 128, 0.28); border-radius: 50%; }
.catalog-card::after { inset: auto -6% -6% auto; width: 54%; aspect-ratio: 1; border-radius: 50%; background: rgba(220, 197, 128, 0.07); }
.catalog-card--maya { background: linear-gradient(155deg, #0a152c 0%, #172a49 100%); color: #fff; }
.catalog-card--beauty { background: linear-gradient(155deg, #f9f7f0 0%, #e9dfc9 100%); color: #171512; border: 1px solid rgba(120, 95, 43, 0.12); }
.card-number { position: absolute; top: 32px; right: 32px; color: var(--gold); font: 400 22px/1 Georgia, serif; }
.card-mark { position: absolute; z-index: 2; top: 30px; left: 30px; width: 66px; height: 66px; font-size: 24px; }
.card-mark--light { background: #f8f4e8; color: #9d7d35; }
.card-content { position: absolute; z-index: 2; left: 30px; right: 30px; bottom: 96px; display: grid; gap: 14px; }
.card-content small { color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: 0.18em; }
.catalog-card--beauty .card-content small { color: #96752c; }
.card-content strong { font: 500 clamp(28px, 2.6vw, 44px)/1 Georgia, "Times New Roman", serif; letter-spacing: -0.035em; }
.card-content > span { color: rgba(255,255,255,0.62); font-size: 14px; line-height: 1.55; }
.catalog-card--beauty .card-content > span { color: rgba(23, 21, 18, 0.58); }
.card-link { position: absolute; z-index: 2; left: 30px; bottom: 32px; font-size: 11px; font-weight: 800; letter-spacing: 0.14em; }
.card-link b { margin-left: 8px; color: var(--gold); font-size: 18px; }
.welcome-footer { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 20px; padding-top: 24px; border-top: 1px solid var(--line); color: #8a867e; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; }

.browser-view { position: relative; height: calc(100dvh - 76px - var(--safe-top)); background: #fff; }
.browser-view[hidden] { display: none; }
#siteFrame { width: 100%; height: 100%; display: block; border: 0; background: #fff; }
.frame-loader { position: absolute; z-index: 3; inset: 0; display: grid; place-content: center; justify-items: center; gap: 15px; background: var(--paper); transition: opacity 220ms ease; }
.frame-loader.is-hidden { opacity: 0; pointer-events: none; }
.frame-loader p { margin: 0; color: #6e6b64; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; }
.loader-seal { animation: breathe 1.2s ease-in-out infinite alternate; }
@keyframes breathe { to { transform: scale(1.08); box-shadow: 0 0 0 10px rgba(220,197,128,0.1); } }

.mobile-dock { display: none; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(28px + var(--safe-bottom)); transform: translate(-50%, 16px); max-width: min(90vw, 440px); padding: 13px 18px; border-radius: 999px; background: rgba(17, 18, 21, 0.94); color: #fff; text-align: center; font-size: 12px; opacity: 0; pointer-events: none; transition: 180ms ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1100px) {
  .app-header { grid-template-columns: minmax(160px, 1fr) auto minmax(100px, 1fr); gap: 12px; }
  .site-tab { min-width: 104px; padding-inline: 14px; }
  .welcome-view { grid-template-columns: 1fr; gap: 42px; align-items: start; }
  .welcome-copy { text-align: center; justify-self: center; }
  .intro { margin-inline: auto; }
  .welcome-actions { justify-content: center; }
  .catalog-card { min-height: 430px; }
}

@media (max-width: 820px) and (min-width: 681px) {
  .brand-copy { display: none; }
}

@media (max-width: 680px) {
  .app-header {
    height: calc(64px + var(--safe-top));
    padding: calc(8px + var(--safe-top)) 14px 8px;
    grid-template-columns: 1fr auto;
  }
  .site-switcher { display: none; }
  .brand-seal { width: 42px; height: 42px; }
  .brand-copy strong { font-size: 14px; }
  .brand-copy small { font-size: 7px; }
  .header-actions { gap: 5px; }
  .icon-button { width: 40px; height: 40px; }
  .app-main { padding-top: calc(64px + var(--safe-top)); padding-bottom: calc(70px + var(--safe-bottom)); }
  .welcome-view { min-height: calc(100dvh - 134px - var(--safe-top) - var(--safe-bottom)); padding: 38px 15px 24px; }
  .welcome-copy h1 { font-size: clamp(42px, 13vw, 60px); }
  .eyebrow { font-size: 9px; }
  .intro { font-size: 15px; }
  .welcome-actions { display: grid; grid-template-columns: 1fr; }
  .catalog-choices { grid-template-columns: 1fr; }
  .catalog-card { min-height: 330px; border-radius: 22px; }
  .card-content { bottom: 82px; }
  .card-content strong { font-size: 32px; }
  .welcome-footer { display: grid; text-align: center; justify-content: center; line-height: 1.6; }
  .browser-view { height: calc(100dvh - 134px - var(--safe-top) - var(--safe-bottom)); }
  .mobile-dock {
    position: fixed;
    z-index: 40;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: calc(70px + var(--safe-bottom));
    padding: 7px 22px var(--safe-bottom);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: rgba(251, 250, 247, 0.96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(20px);
  }
  .dock-item { border: 0; background: none; display: grid; place-items: center; align-content: center; gap: 4px; color: #7d7b75; font-size: 10px; font-weight: 650; cursor: pointer; }
  .dock-item svg { width: 21px; height: 21px; }
  .dock-item.is-active { color: var(--navy); }
  .dock-monogram { font: 600 18px/1 Georgia, serif; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
