:root {
  color-scheme: light;
  --paper: #f9f6f2;
  --ink: #272039;
  --muted: #62566d;
  --line: #ded4e2;
  --plum: #422c53;
  --lavender: #eee7f3;
  --gold: #ffdaaa;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 5% 15rem, #eee3f3 0, transparent 39rem),
    radial-gradient(ellipse at 95% 31rem, #f6e4d1 0, transparent 34rem), var(--paper);
  color: var(--ink);
  font: 1rem/1.6 "Segoe UI", system-ui, sans-serif;
}
a { color: inherit; text-underline-offset: .25em; }
a:focus-visible { outline: 2px solid #99638a; outline-offset: 5px; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-weight: 400; }
h1, h2 { font-family: var(--serif); line-height: 1.06; }
h2 { font-size: clamp(2rem, 4.9vw, 4.25rem); letter-spacing: -.04em; }
p { margin: 0 0 1rem; }
[id] { scroll-margin-top: 1.3rem; }
.wrap { width: min(calc(100% - 3rem), 75rem); margin-inline: auto; }
.skip-link { position: absolute; z-index: 10; top: .5rem; left: .5rem; transform: translateY(-200%); background: white; padding: .65rem 1rem; }
.skip-link:focus { transform: none; }
.site-header {
  min-height: 5.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .5rem 1.5rem;
  padding-block: .7rem;
}
.brand { display: inline-flex; gap: .55rem; align-items: center; font: 1.35rem var(--serif); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 2rem; aspect-ratio: 1; border: 1px solid #bdacc8; border-radius: 50%; color: #644775; font: 1.1rem/1 system-ui, sans-serif; }
.site-header nav { display: flex; flex-wrap: wrap; gap: .5rem clamp(.7rem, 3vw, 2.5rem); font-size: .89rem; }
.site-header nav a { text-decoration: none; font-weight: 600; }
.site-header nav a:hover { text-decoration: underline; }
.eyebrow { display: flex; align-items: center; gap: .65rem; margin: 0 0 1rem; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow > span:empty { width: 1.55rem; height: 1px; background: currentColor; }
.home-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(29rem, 46vw, 38rem);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 1rem;
  padding: clamp(2rem, 6vw, 5.4rem);
  border-radius: 1.65rem;
  background: #38274c;
  color: #fff8f0;
}
.home-hero::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  content: "";
  background: url("./assets/kryla-gallery/67.webp") center 41% / cover no-repeat;
  filter: saturate(.8);
  opacity: .72;
}
.home-hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: linear-gradient(98deg, #21162ff9 5%, #2b1c38eb 41%, #35254952 84%), linear-gradient(0deg, #241732d6, transparent 45%);
}
.hero-copy { min-width: 0; }
.home-hero .eyebrow { color: var(--gold); }
.home-hero h1 { font-size: clamp(3.3rem, 7.5vw, 7rem); letter-spacing: -.067em; }
.hero-subtitle { max-width: 24rem; margin: 1.15rem 0 1.9rem; color: #f4e6f2; font-size: clamp(1.1rem, 2vw, 1.4rem); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .75rem; padding: .75rem 1.2rem; border-radius: 99rem; background: var(--plum); color: white; font-weight: 650; text-decoration: none; transition: background .18s ease, transform .18s ease; }
.button:hover { background: #513661; transform: translateY(-2px); }
.button-light { background: #fff7ec; color: #2c1e3a; }
.button-light:hover { background: #ffe2bd; }
.hero-feature { display: grid; justify-items: center; justify-self: center; gap: 1.05rem; width: min(100%, 24rem); text-decoration: none; }
.hero-card-fan, .guide-fan { --card-width: clamp(8rem, 15.5vw, 13.4rem); position: relative; display: grid; place-items: center; width: 100%; padding-block: 1.1rem; }
.hero-card-fan img, .guide-fan img { width: var(--card-width); border: 1px solid #ffe0c779; border-radius: .75rem; box-shadow: 0 1rem 2.25rem #170a2775; transition: transform .28s ease; }
.hero-card-fan .fan-center, .guide-fan .fan-center { position: relative; z-index: 1; transform: rotate(3deg); }
.fan-left, .fan-right { position: absolute; }
.hero-card-fan .fan-left, .guide-fan .fan-left { transform: translateX(-47%) rotate(-15deg) scale(.91); }
.hero-card-fan .fan-right, .guide-fan .fan-right { transform: translateX(49%) rotate(17deg) scale(.91); }
.hero-feature:hover .fan-center { transform: translateY(-.3rem) rotate(0deg); }
.hero-caption { display: flex; align-items: center; gap: 1rem; color: #fff2e4; font-size: .83rem; font-weight: 650; text-align: center; }
.hero-caption span:last-child { color: var(--gold); font-size: 1.2rem; }
.collection { padding-block: clamp(3.8rem, 8vw, 7rem); }
.deck-list { display: grid; gap: 1.25rem; margin-top: 1.6rem; }
.deck-entry { border: 1px solid var(--line); border-radius: 1.3rem; overflow: clip; background: #fffbf8; }
.deck-link { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); text-decoration: none; }
.deck-link:focus-visible { outline-offset: -5px; }
.deck-art, .guide-art {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 62% 34%, #facab0 0, #b68ab8 37%, #533d70 100%);
  padding: 1.5rem;
}
.deck-art::before, .guide-art::before { position: absolute; z-index: -1; content: ""; width: 70%; aspect-ratio: 1; border-radius: 50%; border: 1px solid #fff2de8f; box-shadow: 0 0 0 1rem #ffefdc21; }
.deck-art img { width: clamp(7.5rem, 12vw, 10.75rem); border: 1px solid #f4d4df; border-radius: .45rem; box-shadow: 0 .8rem 2.1rem #38224c66; transform: rotate(-6deg); transition: transform .25s ease; }
.deck-link:hover .deck-art img { transform: translateY(-.25rem) rotate(-2deg); }
.deck-copy { align-self: center; padding: clamp(1.6rem, 5vw, 4.3rem); }
.deck-copy h3 { margin-bottom: .75rem; font: clamp(1.85rem, 4.2vw, 3.5rem)/1.07 var(--serif); letter-spacing: -.04em; overflow-wrap: anywhere; }
.deck-copy p:not(.eyebrow), .intro-panel p:not(.eyebrow) { max-width: 34rem; color: var(--muted); }
.deck-action, .text-link { display: inline-flex; align-items: center; gap: .6rem; font-weight: 650; }
.deck-action > span, .text-link > span { font-size: 1.2rem; }
.deck-link:hover .deck-action { text-decoration: underline; text-underline-offset: .25em; }
.collection-gallery { margin-top: 1.35rem; }
.intro-panel { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 1.5rem 4rem; padding: clamp(1.5rem, 5vw, 4rem); border-radius: 1.3rem; background: var(--lavender); }
.intro-panel h2 { font-size: clamp(2rem, 4vw, 3.55rem); }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .7rem 1.5rem; margin-top: clamp(3rem, 6vw, 5rem); padding-block: 1.55rem 2.25rem; border-top: 1px solid var(--line); }
.site-footer .eyebrow { margin-bottom: .25rem; }
.footer-name { margin: 0; font: 1.4rem var(--serif); }

.guide-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: stretch;
  gap: clamp(1.5rem, 5vw, 4rem);
  padding: clamp(1.5rem, 5vw, 4rem);
  border-radius: 1.6rem;
  border: 1px solid #e7dce9;
  background: radial-gradient(ellipse at 82% 10%, #f7dccc, transparent 52%),
    linear-gradient(132deg, #fbf6f2 12%, #eee3f2 80%);
}
.guide-hero .hero-copy { align-self: center; }
.guide-hero h1 { font-size: clamp(2.2rem, 5.4vw, 5.1rem); letter-spacing: -.045em; overflow-wrap: anywhere; }
.intro { margin: 1rem 0 .7rem; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.2rem); }
.guide-art { min-height: 20rem; border-radius: 1rem; }
.guide-fan { --card-width: clamp(6.4rem, 13vw, 11.25rem); }
.guide-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem; margin-top: 1.3rem; }
.guide-actions > a:not(.button) { font-size: .92rem; font-weight: 650; }
.guide-layout { display: grid; grid-template-columns: minmax(12rem, .4fr) minmax(0, 1fr); gap: clamp(1.5rem, 7vw, 6rem); padding-top: clamp(2rem, 6vw, 4.75rem); }
.guide-nav { position: sticky; top: 1.5rem; align-self: start; border-left: 1px solid var(--line); padding-left: 1.1rem; }
.guide-nav a { display: block; padding: .26rem 0; color: var(--muted); text-decoration: none; font-size: .93rem; }
.guide-nav a:hover { color: var(--ink); text-decoration: underline; }
.guide-nav .eyebrow { margin-bottom: .55rem; }
.reading { max-width: 45rem; margin: 0 0 2.7rem; }
.reading h2 { margin-bottom: .75rem; font-size: clamp(1.8rem, 3.6vw, 2.9rem); }
.reading h3 { font-size: 1.08rem; font-weight: 700; }
.steps { padding-left: 1.35rem; }
.steps li { margin-block: .55rem; padding-left: .3rem; }
.guide-section { padding-top: 1.7rem; border-top: 1px solid var(--line); }

.card-gallery {
  margin-top: clamp(2rem, 5vw, 4rem);
  padding: clamp(1rem, 4vw, 3.25rem);
  border: 1px solid #e6dce8;
  border-radius: 1.6rem;
  background: linear-gradient(158deg, #fffdf9 35%, #f2e9f3 100%);
}
.gallery-intro { display: grid; grid-template-columns: 1.05fr .95fr; align-items: end; gap: 1rem 2rem; margin-bottom: 1.65rem; }
.gallery-intro p:not(.eyebrow) { margin: 0; color: var(--muted); }
.gallery-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem; padding: 1rem; border-radius: .95rem; background: #efe7f1; }
.gallery-draw { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.gallery-draw span { margin-right: .35rem; font-weight: 650; }
.gallery-draw button, .gallery-more, .viewer-panel button {
  min-height: 2.55rem;
  min-width: 2.55rem;
  border: 1px solid #c9bad3;
  border-radius: 99rem;
  background: #fffaf9;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.gallery-draw button:hover, .gallery-more:hover { background: var(--plum); border-color: var(--plum); color: white; }
button:focus-visible, input:focus-visible { outline: 2px solid #77478a; outline-offset: 3px; }
.gallery-search { display: grid; gap: .25rem; min-width: min(100%, 13rem); color: var(--muted); font-size: .8rem; font-weight: 650; }
.gallery-search input { width: 100%; min-width: 0; min-height: 2.55rem; padding: .42rem .75rem; border: 1px solid #c9bad3; border-radius: .55rem; background: #fffaf9; color: var(--ink); font: inherit; font-size: 1rem; }
.gallery-status { margin: 1rem 0 .65rem; color: var(--muted); font-size: .86rem; }
.card-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(.55rem, 1.5vw, 1.15rem); }
.card-tile { display: grid; align-content: start; min-width: 0; gap: .55rem; padding: 0 0 .6rem; border: 1px solid #e6dce8; border-radius: .7rem; overflow: clip; background: #fffaf9; color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: transform .22s ease, box-shadow .22s ease; }
.card-tile:hover { transform: translateY(-.22rem); box-shadow: 0 .55rem 1.2rem #3c265522; }
.card-tile img { width: 100%; aspect-ratio: 7/12; object-fit: contain; background: #e9dfed; }
.card-tile span { display: block; padding-inline: .55rem; font-size: .83rem; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.gallery-result { margin-top: 1.15rem; padding: 1rem; border: 1px solid #d8c6df; border-radius: .95rem; background: #f6eff8; }
.gallery-result h3 { margin-bottom: .6rem; font: 1.4rem var(--serif); }
.gallery-more { display: block; margin: 1.25rem auto 0; padding-inline: 1.2rem; }
.card-viewer { max-width: calc(100% - 1rem); max-height: calc(100% - 1rem); padding: 0; border: 1px solid #78648c; border-radius: 1rem; background: #282035; color: #fff7f0; box-shadow: 0 1rem 3rem #170a275c; }
.card-viewer::backdrop { background: #1b1228dd; }
.viewer-panel { padding: .75rem clamp(.5rem, 2vw, 1.15rem); }
.viewer-header, .viewer-stage { display: flex; align-items: center; justify-content: space-between; gap: clamp(.35rem, 2vw, .9rem); }
.viewer-position { margin: 0; font-size: .86rem; }
.viewer-stage { margin: .65rem 0; }
.viewer-stage img { min-width: 0; height: min(69dvh, 52rem); width: min(54vw, 30rem); object-fit: contain; }
.viewer-panel button { flex: 0 0 auto; background: #453551; border-color: #705d81; color: white; font-size: 1.2rem; }
.viewer-panel button:hover { background: #5d456e; }
.viewer-panel button:disabled { opacity: .4; cursor: default; }
#card-viewer-title { text-align: center; font: 1.25rem var(--serif); }
[hidden] { display: none !important; }

@media (max-width: 48rem) {
  .wrap { width: min(calc(100% - 2rem), 75rem); }
  .site-header { min-height: 4.5rem; }
  .home-hero, .guide-hero { grid-template-columns: 1fr; }
  .home-hero { gap: 2.1rem; padding: 2rem 1.5rem; }
  .home-hero::after { background: linear-gradient(165deg, #20152ff7 15%, #30203ad4 55%, #41285087); }
  .hero-feature { gap: .8rem; }
  .hero-card-fan { --card-width: clamp(7.25rem, 32vw, 12rem); }
  .deck-link, .intro-panel, .guide-layout { grid-template-columns: 1fr; }
  .deck-art { min-height: 15rem; }
  .deck-art::before, .guide-art::before { width: min(60%, 16rem); }
  .guide-art { min-height: 15rem; }
  .guide-fan { --card-width: clamp(6rem, 27vw, 10rem); }
  .guide-nav { position: static; display: flex; flex-wrap: wrap; gap: .35rem .9rem; border-left: 0; border-bottom: 1px solid var(--line); padding: 0 0 .8rem; }
  .guide-nav .eyebrow { flex-basis: 100%; margin: 0; }
  .gallery-intro { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 30rem) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-draw span { flex-basis: 100%; }
  .gallery-search { width: 100%; }
  .viewer-stage { display: grid; grid-template-columns: 1fr 1fr; }
  .viewer-stage img { grid-column: 1 / -1; grid-row: 1; width: min(76vw, 22rem); height: auto; max-height: 63dvh; justify-self: center; }
  .viewer-stage [data-step="1"] { justify-self: end; }
}
@media (max-width: 25rem) {
  .site-header { justify-content: flex-start; }
  .site-header nav { width: 100%; }
  .home-hero h1 { font-size: clamp(2.8rem, 13vw, 3.3rem); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
