:root {
  color-scheme: dark;
  --ink: #0a0a0a;
  --paper: #f5eee2;
  --gold: #d8b37a;
  --border: #4b3b2a;
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--paper);
  background: radial-gradient(ellipse at 50% 0%, #231a12 0%, var(--ink) 49%);
}
button, a { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #ffe1ac; outline-offset: 3px; }
.welcome {
  width: min(100%, 50rem);
  min-height: 100svh;
  display: grid;
  align-content: center;
  gap: clamp(1rem, 3.3svh, 2rem);
  margin: 0 auto;
  padding: max(3.5rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
}
.intro { display: grid; justify-items: center; gap: clamp(.55rem, 1.8svh, 1.1rem); }
.aglaya { display: block; position: relative; width: clamp(6rem, 17svh, 10rem); }
.centinela { display: block; width: clamp(10rem, 48vw, 14.25rem); height: auto; }
.tagline { margin: 0; color: #e1bf8e; font-size: clamp(.86rem, 3.75vw, 1.03rem); letter-spacing: .035em; text-align: center; }
h1, h2 {
  margin: 0;
  font: 400 clamp(1.7rem, 5.6vw, 3rem)/1.09 "Baskervville", Georgia, serif;
  text-align: center;
}
.languages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(.32rem, 1.2vw, .65rem);
}
.language {
  min-width: 0;
  min-height: clamp(2.75rem, 6.1svh, 3.55rem);
  display: grid;
  place-items: center;
  padding: .24rem .12rem;
  border: 1px solid var(--border);
  border-radius: .55rem;
  color: var(--paper);
  background: linear-gradient(155deg,#191612,#10100f 80%);
  font-size: clamp(.78rem, 3.3vw, 1rem);
  line-height: 1.2;
  text-align: center;
  transition: border-color 140ms, background 140ms;
}
.language:hover, .language:focus-visible { border-color: var(--gold); background: #242017; }
.music, .close {
  position: absolute;
  top: max(.5rem, env(safe-area-inset-top));
  right: max(.75rem, env(safe-area-inset-right));
  min-height: 2.75rem;
  min-width: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 2rem;
  color: var(--gold);
  background: #11100f;
}
.music { display: flex; align-items: center; gap: .45rem; padding: 0 .7rem; font-size: .76rem; }
.music span:first-child { font-size: 1rem; }
dialog {
  inset: 0;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--paper);
  background: #000;
}
.stage { min-height: 100svh; display: grid; place-items: center; position: relative; padding: 3.65rem 1rem 1rem; }
.close { z-index: 1; font-size: 1.55rem; line-height: 1; }
.cover { width: min(100%, 34rem); display: grid; justify-items: center; gap: clamp(.85rem, 3svh, 1.65rem); }
.product { display: block; max-width: 100%; width: min(31rem, 100%); max-height: 32svh; object-fit: contain; }
.geo-brand { display: block; height: auto; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; width: min(100%, 25rem); }
.actions > * {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .55rem;
  min-height: 3.15rem;
  padding: .4rem;
  border-radius: .55rem;
  text-decoration: none;
  font-weight: 650;
}
.primary { border: 1px solid var(--gold); background: #dfbd85; color: #15100a; }
.secondary { border: 1px solid var(--border); background: #13110e; color: var(--paper); }
.stage:has(.screen:not([hidden])) {
  height: 100svh;
  height: 100dvh;
  min-height: 0;
  padding: .25rem 0 0;
}
.screen {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  justify-items: center;
}
video {
  display: block;
  width: min(100%, 48rem);
  height: 100%;
  min-height: 0;
  background: #000;
  object-fit: contain;
}
.caption-strip {
  width: min(100%, 48rem);
  min-height: 4.1rem;
  margin: 0;
  padding: .45rem .8rem calc(.65rem + env(safe-area-inset-bottom));
  display: grid;
  place-content: center;
  background: #000;
  color: #fff8ed;
  font-size: clamp(.9rem, 3.8vw, 1.12rem);
  line-height: 1.25;
  text-align: center;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
body:has(dialog[open]) { overflow: hidden; }
@media (min-width: 52rem) { .languages { grid-template-columns: repeat(6,minmax(0,1fr)); } }
@media (max-height: 620px) {
  .welcome { padding-top: 2.95rem; gap: .7rem; }
  .intro { gap: .45rem; }
  .intro .aglaya { width: 5.55rem; }
  .languages { gap: .28rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.language {
  grid-auto-flow: column;
  grid-template-columns: auto minmax(0, max-content);
  justify-content: center;
  gap: .32rem;
  padding-inline: .28rem;
}
.flag {
  display: grid;
  place-items: center;
  width: 1.14rem;
  height: .79rem;
  font: 1rem/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  border-radius: .08rem;
}
.senyera {
  background: repeating-linear-gradient(to bottom, #ffcf40 0 11.111%, #c52a32 11.111% 22.222%);
}
.ikurrina {
  background:
    linear-gradient(90deg, transparent 44%, #fff 44% 56%, transparent 56%),
    linear-gradient(transparent 43%, #fff 43% 57%, transparent 57%),
    linear-gradient(35deg, transparent 44%, #158356 44% 56%, transparent 56%),
    linear-gradient(-35deg, transparent 44%, #158356 44% 56%, transparent 56%),
    #ce303d;
}
@media (max-width: 375px) {
  .language { gap: .24rem; }
}
@media (max-height: 560px) {
  .welcome { padding: 2.45rem .75rem .5rem; gap: .6rem; }
  .intro { gap: .38rem; }
  .intro .aglaya { width: 5.15rem; }
  h1 { font-size: clamp(1.32rem, 6vw, 1.6rem); }
}

.aglaya img { display: block; width: 100%; height: auto; }
.cover .aglaya { width: clamp(7rem, 23svh, 12rem); }
.aglaya::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  mask-image: url("https://y87tifnxxfnkhflb.public.blob.vercel-storage.com/aglaya-mark.png");
  mask-size: 100% 100%;
  background-image: linear-gradient(110deg, transparent 44%, #ffeec3 49%, #fffdf1 50%, transparent 56%);
  background-size: 250% 35%;
  background-position: 100% 100%;
  background-repeat: no-repeat;
  mix-blend-mode: screen;
  opacity: .78;
  animation: gold-reflection 4.8s ease-in-out infinite;
}
@keyframes gold-reflection {
  0%, 40% { background-position: 100% 100%; }
  78%, 100% { background-position: 0% 100%; }
}
@media (prefers-reduced-motion: reduce) { .aglaya::after { animation: none; } }

.intro .aglaya {
  width: clamp(8.5rem, 22svh, 13rem);
  isolation: isolate;
  animation: aglaya-entrance 780ms cubic-bezier(.2,.75,.25,1) both;
}
.intro .aglaya img {
  filter: drop-shadow(0 0 14px #c5944236) drop-shadow(0 3px 6px #0009);
}
.intro .aglaya::after {
  background-image: linear-gradient(115deg, transparent 41%, #ffd483 46%, #fff7d3 50%, transparent 57%);
  background-size: 280% 100%;
  opacity: .82;
  animation: gold-sweep 4.6s ease-in-out infinite;
}
@keyframes aglaya-entrance {
  from { opacity: .25; transform: translateY(5px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes gold-sweep {
  0% { background-position: 100% 0; }
  30%, 100% { background-position: 0 0; }
}
@media (max-height: 620px) {
  .welcome { padding-top: max(2rem, env(safe-area-inset-top)); }
  .intro .aglaya { width: 7.3rem; }
}
@media (max-height: 560px) {
  .welcome { padding-top: max(1.55rem, env(safe-area-inset-top)); }
  .intro .aglaya { width: 6.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  .intro .aglaya, .intro .aglaya::after { animation: none; }
}

.cover-centinela, .geo-brand { width: clamp(9rem, 45vw, 13rem); }
@media (max-height: 620px) {
  .cover { gap: .65rem; }
  .cover .aglaya { width: 7rem; }
  .cover .product { max-height: 29svh; }
}

#selected-language {
  display: flex;
  direction: ltr;
  align-items: center;
  justify-content: center;
  gap: .65rem;
}
#selected-language .flag {
  flex: none;
  width: 1.65rem;
  height: 1.13rem;
  font-size: 1.42rem;
}
