/* ==========================================================================
   GREED ISLAND — greedisland.xyz
   Mobile first. One page. An entrance, not a pitch.
   ========================================================================== */

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-italic-var-latin.woff2") format("woff2");
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-var-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --leather-deep: #06110c;
  --leather: #0a1a13;
  --leather-light: #143126;
  --paper: #e8dcc1;
  --paper-hi: #f3ead6;
  --paper-deep: #d4c29f;
  --ink: #221d10;
  --ink-soft: #5b5138;
  --brass: #c7a257;
  --brass-light: #f0dba4;
  --brass-deep: #7a5a26;
  --red: #8e3229;
  --blue: #2a617d;
  --blue-deep: #173c4e;
  --aura: #9fe0c1;
  --max: 1240px;
  --pad: clamp(1.1rem, 4vw, 3.6rem);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='.16'/%3E%3C/svg%3E");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  background-color: var(--leather-deep);
  background-image:
    var(--grain),
    radial-gradient(90% 60% at 50% -10%, #143428 0%, rgba(6, 17, 12, 0) 62%),
    radial-gradient(120% 80% at 50% 110%, #0d241b 0%, rgba(6, 17, 12, 0) 60%),
    linear-gradient(180deg, #07130e 0%, #050d09 100%);
  background-size: 220px 220px, auto, auto, auto;
  background-blend-mode: soft-light, normal, normal, normal;
  color: var(--paper);
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  background: radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, .35) 100%);
}

::selection {
  background: var(--brass);
  color: var(--leather-deep);
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p,
dl,
dd,
figure {
  margin: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--brass-light);
  outline-offset: 3px;
}

.sheet :focus-visible,
.skip:focus-visible {
  outline-color: var(--red);
}

.skip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  transform: translateY(-130%);
  padding: .85rem 1.1rem;
  background: var(--paper-hi);
  color: var(--ink);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-decoration: none;
  transition: transform .2s var(--ease);
}

.skip:focus-visible {
  transform: none;
}

/* --------------------------------------------------------------------------
   Cover
   -------------------------------------------------------------------------- */

.cover {
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(9px, 1.8vw, 24px);
}

.cover__frame {
  position: relative;
  isolation: isolate;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: clamp(1.1rem, 3vw, 2.4rem);
  border: 1px solid rgba(199, 162, 87, .3);
  border-radius: 2px;
  background-color: var(--leather);
  background-image:
    var(--grain),
    radial-gradient(120% 85% at 50% -5%, #1c3f30 0%, #0e251b 44%, #081510 100%),
    linear-gradient(145deg, rgba(255, 255, 255, .035) 0%, transparent 43%, rgba(0, 0, 0, .25) 100%);
  background-size: 220px 220px, auto, auto;
  background-blend-mode: soft-light, normal, normal;
  box-shadow:
    inset 0 0 110px rgba(0, 0, 0, .72),
    inset 0 1px 0 rgba(240, 219, 164, .12),
    0 32px 70px rgba(0, 0, 0, .45);
  overflow: hidden;
}

.cover__frame::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px dashed rgba(199, 162, 87, .2);
  border-radius: 1px;
  pointer-events: none;
}

.cover__frame::after {
  content: "";
  position: absolute;
  top: -22%;
  left: 50%;
  width: min(95vw, 900px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(159, 224, 193, .1) 0%, rgba(159, 224, 193, 0) 62%);
  pointer-events: none;
}

.plate {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: rgba(232, 220, 193, .62);
  font-size: clamp(.52rem, 1.4vw, .62rem);
  font-weight: 500;
  letter-spacing: .23em;
  line-height: 1.2;
  text-transform: uppercase;
}

.cover__plate {
  padding-bottom: clamp(.8rem, 2vh, 1.3rem);
  border-bottom: 1px solid rgba(199, 162, 87, .16);
}

.plate__left {
  display: inline-flex;
  align-items: center;
  gap: .55em;
}

.led {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--aura);
  box-shadow: 0 0 7px rgba(159, 224, 193, .9), 0 0 2px rgba(159, 224, 193, .9);
}

.cover__center {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  padding: clamp(.8rem, 2.2vh, 2rem) 0;
  text-align: center;
}

.halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(94vw, 780px);
  height: auto;
  transform: translate(-50%, -53%);
  color: var(--brass);
  opacity: .33;
  pointer-events: none;
  filter: drop-shadow(0 0 26px rgba(199, 162, 87, .08));
}

.wordmark {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: "Fraunces", "Iowan Old Style", Georgia, serif;
  font-style: italic;
  font-weight: 900;
  max-width: 100%;
  font-size: clamp(3.9rem, min(19vw, 25vh), 13.5rem);
  font-variation-settings: "SOFT" 18, "WONK" 1;
  line-height: .735;
  letter-spacing: -.038em;
  text-transform: uppercase;
  background: linear-gradient(103deg,
      #5d4318 0%,
      #b89245 12%,
      #f6e5b0 27%,
      #c5a158 39%,
      #6b4d1d 51%,
      #d8ba75 65%,
      #fff4cd 77%,
      #a37c33 89%,
      #d9bc78 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter:
    drop-shadow(0 1px 0 rgba(255, 246, 215, .18))
    drop-shadow(0 3px 0 rgba(0, 0, 0, .34))
    drop-shadow(0 18px 34px rgba(0, 0, 0, .45));
  animation: title-in 1.15s var(--ease) both;
}

.wordmark span {
  display: block;
}

.wordmark span + span {
  margin-top: .09em;
}

.kana {
  position: relative;
  z-index: 1;
  margin-top: clamp(.9rem, 2.2vh, 1.7rem);
  color: rgba(240, 219, 164, .64);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Meiryo", sans-serif;
  font-size: clamp(.58rem, 1.5vw, .76rem);
  font-weight: 500;
  letter-spacing: .48em;
  line-height: 1;
  text-indent: .48em;
  animation: kana-in 1.2s .2s var(--ease) both;
}

.specs {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  max-width: 29rem;
  margin: 0 auto clamp(1rem, 2.6vh, 1.8rem);
  border-top: 1px solid rgba(199, 162, 87, .18);
  border-bottom: 1px solid rgba(199, 162, 87, .18);
}

.specs > div {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  padding: clamp(.65rem, 1.7vh, .95rem) .4rem;
  border-left: 1px solid rgba(199, 162, 87, .13);
}

.specs > div:first-child {
  border-left: 0;
}

.specs dt {
  margin-top: .35rem;
  color: rgba(232, 220, 193, .56);
  font-size: clamp(.48rem, 1.3vw, .56rem);
  font-weight: 500;
  letter-spacing: .16em;
  line-height: 1.3;
  text-transform: uppercase;
}

.specs dd {
  color: var(--brass-light);
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.35rem, 3.6vw, 1.95rem);
  line-height: 1;
}

.cover__entry {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  padding: clamp(.3rem, 1.4vh, .9rem) 0 clamp(1rem, 2.4vh, 1.5rem);
}

.cover__foot {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: clamp(.7rem, 1.8vh, 1.1rem);
  border-top: 1px solid rgba(199, 162, 87, .14);
  color: rgba(232, 220, 193, .5);
  font-size: clamp(.48rem, 1.3vw, .56rem);
  font-weight: 500;
  letter-spacing: .15em;
  line-height: 1.4;
  text-transform: uppercase;
}

.ring-btn {
  --size: clamp(8.2rem, 19vw, 9.4rem);
  position: relative;
  display: grid;
  place-items: center;
  width: var(--size);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, rgba(27, 61, 46, .96) 0%, rgba(8, 21, 15, .99) 64%);
  color: var(--brass-light);
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(199, 162, 87, .38),
    0 0 0 7px rgba(199, 162, 87, .055),
    0 18px 40px rgba(0, 0, 0, .52),
    inset 0 1px 2px rgba(255, 255, 255, .16);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}

.ring-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(from 205deg,
      #6b4e21, #f3e0aa, #a17d39, #e6ce94, #715322,
      #c7a257, #f5e7ba, #82612a, #6b4e21);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.ring-btn::after {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px solid rgba(199, 162, 87, .26);
  border-radius: 50%;
  box-shadow: inset 0 1px 8px rgba(0, 0, 0, .55);
  pointer-events: none;
}

.ring-btn__label {
  position: relative;
  z-index: 1;
  font-size: clamp(.66rem, 1.6vw, .76rem);
  font-weight: 600;
  letter-spacing: .29em;
  line-height: 1;
  text-indent: .29em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .65);
}

.ring-btn__gem {
  position: absolute;
  top: -6px;
  left: 50%;
  z-index: 2;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: radial-gradient(circle at 34% 28%, #d8fff0 0%, #58b68e 38%, #173f2f 78%);
  box-shadow:
    0 0 0 2px #6f5223,
    0 0 0 3px rgba(199, 162, 87, .35),
    0 0 14px rgba(159, 224, 193, .45);
  transform: translateX(-50%) rotate(45deg);
  transition: box-shadow .35s var(--ease);
}

.ring-btn:hover {
  transform: scale(1.022);
  box-shadow:
    0 0 0 1px rgba(240, 219, 164, .55),
    0 0 0 9px rgba(199, 162, 87, .07),
    0 20px 46px rgba(0, 0, 0, .58),
    inset 0 1px 2px rgba(255, 255, 255, .2);
}

.ring-btn:hover .ring-btn__gem {
  box-shadow:
    0 0 0 2px #8a6a2e,
    0 0 0 4px rgba(199, 162, 87, .35),
    0 0 24px rgba(159, 224, 193, .75);
}

.ring-btn:active {
  transform: scale(.988);
}

.flash {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 52%,
      rgba(255, 247, 220, .98) 0%,
      rgba(184, 238, 209, .5) 11%,
      rgba(28, 74, 55, .28) 26%,
      rgba(6, 17, 12, 0) 52%);
}

.flash.is-on {
  opacity: 1;
  animation: flash-out 1.25s var(--ease) forwards;
}

@keyframes title-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.986);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes kana-in {
  from {
    opacity: 0;
    letter-spacing: .9em;
  }
  to {
    opacity: 1;
    letter-spacing: .48em;
  }
}

@keyframes flash-out {
  0% { opacity: 1; }
  65% { opacity: .85; }
  100% { opacity: 0; }
}

/* --------------------------------------------------------------------------
   Binder sheets
   -------------------------------------------------------------------------- */

.sheet {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: var(--max);
  margin: clamp(9px, 1.6vw, 18px) auto;
  background-color: var(--paper);
  background-image:
    var(--paper-grain),
    radial-gradient(145% 100% at 18% -5%, #f5eddb 0%, #e9ddc3 46%, #dcccaa 100%);
  background-size: 180px 180px, auto;
  color: var(--ink);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .28),
    0 28px 54px -26px rgba(0, 0, 0, .8);
}

.sheet::before {
  content: "";
  position: absolute;
  inset: 6px 0 -6px 6px;
  z-index: -1;
  background: #c9b793;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24);
}

.sheet::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  box-shadow:
    inset 0 0 46px rgba(92, 72, 40, .1),
    inset 0 1px 0 rgba(255, 255, 255, .45);
}

.sheet__body {
  position: relative;
  z-index: 1;
  padding:
    clamp(1.35rem, 4vw, 3.1rem)
    clamp(1rem, 4vw, 3.4rem)
    clamp(1.4rem, 4vw, 3rem)
    calc(clamp(1rem, 4vw, 3.4rem) + clamp(28px, 4vw, 58px));
}

.sheet__gutter {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  width: clamp(28px, 4vw, 58px);
  padding: 8% 0;
  border-right: 1px dashed rgba(34, 29, 16, .14);
  pointer-events: none;
}

.sheet__gutter span {
  width: clamp(9px, 1.1vw, 14px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #09140f;
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, .8),
    0 0 0 1px rgba(34, 29, 16, .28),
    0 1px 0 rgba(255, 255, 255, .5);
}

.sheet__tab {
  display: none;
}

.sheet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.1rem 2rem;
  margin-bottom: clamp(1.3rem, 3.4vw, 2.6rem);
  padding-bottom: clamp(.9rem, 2vw, 1.4rem);
  border-bottom: 1px solid rgba(34, 29, 16, .24);
}

.sheet-head h2 {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(2.45rem, 6.2vw, 4.7rem);
  font-variation-settings: "SOFT" 12, "WONK" 1;
  line-height: .92;
  letter-spacing: -.025em;
}

.sheet-sub {
  margin-top: .55rem;
  color: var(--ink-soft);
  font-size: clamp(.54rem, 1.6vw, .62rem);
  font-weight: 500;
  letter-spacing: .19em;
  line-height: 1.4;
  text-transform: uppercase;
}

.cardmeta {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem 1.6rem;
  margin: 0;
}

.cardmeta > div {
  display: flex;
  flex-direction: column;
  gap: .28rem;
}

.cardmeta dt {
  color: var(--ink-soft);
  font-size: clamp(.48rem, 1.4vw, .56rem);
  font-weight: 500;
  letter-spacing: .15em;
  line-height: 1;
  text-transform: uppercase;
}

.cardmeta dd {
  font-size: clamp(.7rem, 1.8vw, .8rem);
  font-weight: 600;
  line-height: 1.2;
}

.is-red {
  color: var(--red);
}

.is-blue {
  color: var(--blue);
}

.is-red::before,
.is-blue::before {
  content: "";
  display: inline-block;
  width: .5em;
  height: .5em;
  margin-right: .45em;
  background: currentColor;
  transform: rotate(45deg) translateY(-.05em);
}

.sheet-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(1.8rem, 4vw, 3rem);
  padding-top: .8rem;
  border-top: 1px solid rgba(34, 29, 16, .18);
  color: rgba(34, 29, 16, .5);
  font-size: clamp(.5rem, 1.4vw, .58rem);
  font-weight: 500;
  letter-spacing: .15em;
  line-height: 1.4;
  text-transform: uppercase;
}

.sheet-note {
  max-width: 46ch;
  margin: -1rem 0 clamp(1.4rem, 3vw, 2.2rem);
  color: var(--ink-soft);
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: clamp(.92rem, 2.2vw, 1.08rem);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Island chart
   -------------------------------------------------------------------------- */

.map-layout {
  display: grid;
  gap: clamp(1.4rem, 3vw, 2.8rem);
}

.chart {
  min-width: 0;
  border: 1px solid rgba(34, 29, 16, .58);
  background: #e9ddc3;
  box-shadow: 3px 4px 0 rgba(34, 29, 16, .13);
}

.chart__bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem .8rem .5rem;
  border-bottom: 1px solid rgba(34, 29, 16, .38);
  color: var(--ink-soft);
  font-size: clamp(.48rem, 1.4vw, .56rem);
  font-weight: 500;
  letter-spacing: .14em;
  line-height: 1.3;
  text-transform: uppercase;
}

.chart__name {
  color: var(--ink);
  font-weight: 600;
}

.chart__bar--foot {
  border-top: 1px solid rgba(34, 29, 16, .38);
  border-bottom: 0;
}

.map {
  position: relative;
  aspect-ratio: 1000 / 1120;
  overflow: hidden;
  background: #d9cbae;
}

.map__svg {
  width: 100%;
  height: 100%;
}

.map-title {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 600;
}

.pin {
  position: absolute;
  top: var(--y);
  left: var(--x);
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.pin::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px dashed rgba(142, 50, 41, 0);
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}

.pin__dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--red);
  background: #f4ecd9;
  box-shadow:
    0 0 0 3px rgba(244, 236, 217, .62),
    0 1px 3px rgba(0, 0, 0, .42);
  transition: background .2s, box-shadow .2s, transform .2s;
}

.pin__label {
  position: absolute;
  top: calc(50% + 13px);
  left: 50%;
  z-index: 2;
  padding: .16rem .36rem .18rem;
  border: 1px solid rgba(34, 29, 16, .45);
  background: #f6eeda;
  color: var(--ink);
  font-size: clamp(.5rem, 1.35vw, .58rem);
  font-weight: 600;
  letter-spacing: .09em;
  line-height: 1.2;
  white-space: nowrap;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  box-shadow: 0 1px 4px rgba(34, 29, 16, .18);
}

.pin[aria-pressed="true"] .pin__dot,
.pin:hover .pin__dot {
  background: var(--red);
  box-shadow:
    0 0 0 4px rgba(244, 236, 217, .75),
    0 0 0 6px rgba(142, 50, 41, .3),
    0 1px 3px rgba(0, 0, 0, .42);
  transform: scale(1.08);
}

.pin[aria-pressed="true"] .pin__label,
.pin:hover .pin__label,
.pin:focus-visible .pin__label {
  opacity: 1;
  transform: translate(-50%, 0);
}

.pin:focus-visible {
  outline-offset: -2px;
}

/* Pin coordinates on the 1000x1120 chart */
.pin[data-town="shiso"] { --x: 47.0%; --y: 77.86%; }
.pin[data-town="antokiba"] { --x: 33.5%; --y: 68.75%; }
.pin[data-town="rubicuta"] { --x: 60.0%; --y: 64.82%; }
.pin[data-town="aiai"] { --x: 43.0%; --y: 49.64%; }
.pin[data-town="dorias"] { --x: 69.0%; --y: 45.09%; }
.pin[data-town="soufrabi"] { --x: 27.0%; --y: 37.32%; }
.pin[data-town="masadora"] { --x: 59%; --y: 35%; }
.pin[data-town="limeiro"] { --x: 74.2%; --y: 26.07%; }

/* --------------------------------------------------------------------------
   Places
   -------------------------------------------------------------------------- */

.places {
  display: flex;
  flex-direction: column;
  gap: clamp(1.2rem, 2.4vw, 1.8rem);
  min-width: 0;
}

.town {
  padding-top: .9rem;
  border-top: 2px solid var(--ink);
}

.town__stamp {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: .85rem;
  border: 1px solid rgba(34, 29, 16, .4);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, .65), rgba(255, 255, 255, 0) 55%),
    rgba(142, 50, 41, .06);
  color: var(--red);
  box-shadow: inset 0 0 0 3px rgba(232, 220, 193, .9), inset 0 0 0 4px rgba(34, 29, 16, .12);
}

.town__stamp svg {
  width: 25px;
  height: 25px;
}

.town__kind {
  color: var(--ink-soft);
  font-size: clamp(.52rem, 1.5vw, .58rem);
  font-weight: 500;
  letter-spacing: .17em;
  line-height: 1.3;
  text-transform: uppercase;
}

.town__name {
  margin-top: .15rem;
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  line-height: 1;
  letter-spacing: -.01em;
}

.town__desc {
  max-width: 34ch;
  margin-top: .6rem;
  color: var(--ink-soft);
  font-size: clamp(.82rem, 2.1vw, .9rem);
  line-height: 1.55;
}

.place-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(34, 29, 16, .22);
  list-style: none;
}

.place {
  display: grid;
  grid-template-columns: 1.85rem minmax(0, 1fr);
  align-items: center;
  gap: .5rem;
  width: 100%;
  min-height: 44px;
  padding: .42rem .4rem;
  border: 0;
  border-bottom: 1px solid rgba(34, 29, 16, .16);
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}

.place__no {
  color: var(--ink-soft);
  font-size: clamp(.5rem, 1.4vw, .58rem);
  font-weight: 500;
  letter-spacing: .08em;
}

.place__body {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .1rem .8rem;
}

.place__name {
  font-size: clamp(.78rem, 2vw, .84rem);
  font-weight: 600;
  line-height: 1.35;
}

.place__kind {
  color: var(--ink-soft);
  font-size: clamp(.62rem, 1.7vw, .68rem);
  line-height: 1.35;
}

.place[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper-hi);
}

.place[aria-pressed="true"] .place__no,
.place[aria-pressed="true"] .place__kind {
  color: rgba(243, 234, 214, .58);
}

.place:focus-visible {
  outline-offset: -2px;
}

/* --------------------------------------------------------------------------
   The binder
   -------------------------------------------------------------------------- */

.binder {
  display: grid;
  gap: clamp(1.6rem, 3vw, 2.8rem);
  min-width: 0;
}

.slots-panel {
  min-width: 0;
}

.slots-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem .1rem;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid rgba(34, 29, 16, .22);
  color: var(--ink-soft);
  font-size: clamp(.5rem, 1.4vw, .58rem);
  font-weight: 500;
  letter-spacing: .14em;
  line-height: 1.3;
  text-transform: uppercase;
}

.slots {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: clamp(2px, .4vw, 4px);
  padding: clamp(.6rem, 1.6vw, 1rem) 0;
}

.slot {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid rgba(34, 29, 16, .2);
  background: rgba(255, 255, 255, .08);
  color: rgba(34, 29, 16, .46);
  font-family: "Archivo", sans-serif;
  font-size: clamp(.5rem, 1.05vw, .6rem);
  font-weight: 500;
  letter-spacing: .01em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

button.slot {
  border-color: rgba(142, 50, 41, .48);
  background: rgba(142, 50, 41, .08);
  color: var(--red);
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}

button.slot::after {
  content: "";
  position: absolute;
  bottom: 14%;
  width: 4px;
  height: 4px;
  background: var(--brass-deep);
  opacity: .75;
  transform: rotate(45deg);
}

button.slot[aria-pressed="true"] {
  background: var(--red);
  border-color: var(--red);
  color: var(--paper-hi);
}

button.slot[aria-pressed="true"]::after {
  background: var(--brass-light);
}

button.slot:focus-visible {
  outline-offset: 1px;
}

.slots-note {
  margin-top: .2rem;
  color: var(--ink-soft);
  font-size: clamp(.66rem, 1.8vw, .72rem);
  line-height: 1.5;
}

.spec-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
  min-width: 0;
}

.spec-card {
  width: min(100%, 382px);
  padding: clamp(.85rem, 2.2vw, 1.25rem);
  border: 8px solid var(--red);
  background: #f1e7d0;
  box-shadow:
    0 20px 44px -22px rgba(0, 0, 0, .5),
    inset 0 1px 0 rgba(255, 255, 255, .65);
  transform-style: preserve-3d;
}

.spec-card::before {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: 1;
  border: 1px solid rgba(142, 50, 41, .42);
  pointer-events: none;
}

.spec-card__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: .55rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid rgba(34, 29, 16, .38);
}

.spec-card__no,
.spec-card__rank {
  position: relative;
  z-index: 2;
  font-size: clamp(.58rem, 1.6vw, .68rem);
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.spec-card__name {
  position: relative;
  z-index: 2;
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(1.08rem, 2.7vw, 1.35rem);
  line-height: 1.05;
  text-align: center;
  letter-spacing: -.01em;
}

.spec-card__art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / .95;
  margin: .8rem 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(142, 50, 41, .08) 0%, rgba(142, 50, 41, 0) 63%);
}

.spec-card__frame {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(34, 29, 16, .22);
}

.spec-card__art svg {
  width: 80%;
  height: auto;
  color: var(--red);
  opacity: .93;
}

.spec-card__effect {
  position: relative;
  z-index: 2;
  min-height: 4.7em;
  margin-bottom: .9rem;
  color: #3a3120;
  font-size: clamp(.76rem, 2vw, .81rem);
  line-height: 1.55;
}

.spec-card__foot {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: .6rem;
  padding-top: .5rem;
  border-top: 1px solid rgba(34, 29, 16, .38);
  color: var(--ink-soft);
  font-size: clamp(.44rem, 1.3vw, .52rem);
  font-weight: 500;
  letter-spacing: .13em;
  line-height: 1.3;
  text-transform: uppercase;
}

.spec-preview__hint {
  display: none;
}

/* --------------------------------------------------------------------------
   Spell cards
   -------------------------------------------------------------------------- */

.spells {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(250px, 78vw);
  gap: 1rem;
  margin: 0 -.2rem;
  padding: .6rem .2rem 1.3rem;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-color: rgba(34, 29, 16, .3) transparent;
  scrollbar-width: thin;
}

.spells::-webkit-scrollbar {
  height: 4px;
}

.spells::-webkit-scrollbar-thumb {
  background: rgba(34, 29, 16, .28);
}

.spells:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.spell {
  --rot: 0deg;
  min-width: 0;
  scroll-snap-align: center;
  transform: rotate(var(--rot));
  transition: transform .4s var(--ease);
}

.spell:nth-child(1) { --rot: -1.3deg; }
.spell:nth-child(2) { --rot: .9deg; }
.spell:nth-child(3) { --rot: -.5deg; }
.spell:nth-child(4) { --rot: 1.2deg; }
.spell:nth-child(5) { --rot: -.8deg; }

.spell__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: clamp(.8rem, 2vw, .95rem);
  border: 7px solid var(--blue);
  background: #f0e5cd;
  box-shadow:
    0 16px 30px -20px rgba(0, 0, 0, .5),
    inset 0 1px 0 rgba(255, 255, 255, .6);
}

.spell__inner::before {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: 1;
  border: 1px solid rgba(42, 97, 125, .45);
  pointer-events: none;
}

.spell__head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: .35rem;
  border-bottom: 1px solid rgba(34, 29, 16, .34);
  font-size: clamp(.52rem, 1.5vw, .6rem);
  font-weight: 600;
  letter-spacing: .05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.spell__rank {
  color: var(--blue);
}

.spell__name {
  position: relative;
  z-index: 2;
  margin-top: .5rem;
  color: var(--blue-deep);
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(1.3rem, 2.4vw, 1.62rem);
  line-height: 1.02;
  letter-spacing: -.015em;
}

.spell__art {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  aspect-ratio: 200 / 140;
  margin: .6rem 0 .5rem;
  border-top: 1px solid rgba(42, 97, 125, .25);
  border-bottom: 1px solid rgba(42, 97, 125, .25);
  background:
    radial-gradient(circle at 50% 50%, rgba(42, 97, 125, .09) 0%, rgba(42, 97, 125, 0) 70%);
  color: var(--blue);
}

.spell__art svg {
  width: 100%;
  height: 100%;
}

.spell__class {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: .22rem;
  margin-bottom: .5rem;
}

.spell__class > span:not(.visually-hidden) {
  padding: .2rem .26rem .18rem;
  border: 1px solid rgba(42, 97, 125, .42);
  color: var(--blue-deep);
  font-size: .47rem;
  font-weight: 600;
  letter-spacing: .08em;
  line-height: 1;
}

.spell__effect {
  position: relative;
  z-index: 2;
  flex: 1;
  margin-bottom: .8rem;
  color: #3a3120;
  font-size: clamp(.76rem, 1.9vw, .8rem);
  line-height: 1.5;
}

.spell__foot {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  padding-top: .45rem;
  border-top: 1px solid rgba(34, 29, 16, .3);
  color: var(--ink-soft);
  font-size: clamp(.43rem, 1.2vw, .5rem);
  font-weight: 500;
  letter-spacing: .13em;
  line-height: 1.3;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Tilt + glare
   -------------------------------------------------------------------------- */

.tilt {
  position: relative;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .5s var(--ease);
  will-change: transform;
}

.tilt::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%),
      rgba(255, 255, 255, .42) 0%,
      rgba(255, 255, 255, 0) 62%);
  opacity: 0;
  transition: opacity .25s var(--ease);
  mix-blend-mode: soft-light;
}

@media (hover: hover) and (pointer: fine) {
  .tilt:hover {
    transition-duration: .12s;
  }

  .tilt:hover::after {
    opacity: 1;
  }

  .spell:hover {
    --rot: 0deg;
    transform: rotate(var(--rot)) translateY(-4px);
  }

  button.slot:hover {
    background: rgba(142, 50, 41, .17);
    border-color: var(--red);
    transform: translateY(-1px);
  }

  button.slot[aria-pressed="true"]:hover {
    background: var(--red);
  }

  .place:hover {
    background: rgba(34, 29, 16, .07);
  }

  .place[aria-pressed="true"]:hover {
    background: var(--ink);
  }

  .pin:hover::before {
    border-color: rgba(142, 50, 41, .45);
    transform: scale(1.3);
  }
}

/* --------------------------------------------------------------------------
   Back cover
   -------------------------------------------------------------------------- */

.back {
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(9px, 1.8vw, 24px);
}

.back__frame {
  position: relative;
  isolation: isolate;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: clamp(1.1rem, 3vw, 2.4rem);
  border: 1px solid rgba(199, 162, 87, .3);
  background-color: var(--leather);
  background-image:
    var(--grain),
    radial-gradient(110% 80% at 50% 100%, #1a3a2c 0%, #0d231a 46%, #07130e 100%),
    linear-gradient(160deg, rgba(255, 255, 255, .03) 0%, transparent 46%, rgba(0, 0, 0, .24) 100%);
  background-size: 220px 220px, auto, auto;
  background-blend-mode: soft-light, normal, normal;
  box-shadow:
    inset 0 0 110px rgba(0, 0, 0, .7),
    inset 0 1px 0 rgba(240, 219, 164, .1);
  overflow: hidden;
}

.back__frame::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px dashed rgba(199, 162, 87, .18);
  pointer-events: none;
}

.back__plate {
  padding-bottom: clamp(.8rem, 2vh, 1.3rem);
  border-bottom: 1px solid rgba(199, 162, 87, .15);
}

.back__center {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.4rem, 3.8vh, 2.4rem);
  padding: clamp(1.5rem, 5vh, 3.5rem) 0;
  text-align: center;
}

.halo--back {
  width: min(92vw, 660px);
  opacity: .26;
}

.back__center .ring-btn {
  --size: clamp(8.6rem, 20vw, 11.2rem);
  z-index: 1;
}

.back__center .halo {
  top: 48%;
}

.back__words {
  position: relative;
  z-index: 1;
  display: flex;
  gap: clamp(2.4rem, 7vw, 4rem);
  color: rgba(240, 219, 164, .5);
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: clamp(.72rem, 1.7vw, .84rem);
  font-weight: 600;
  letter-spacing: .36em;
  line-height: 1;
  text-transform: uppercase;
}

.back__words span + span {
  position: relative;
}

.back__words span + span::before {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(-1 * clamp(1.2rem, 3.5vw, 2rem));
  width: 1px;
  height: 15px;
  background: rgba(199, 162, 87, .22);
  transform: translateY(-50%);
}

.back__foot {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding-top: clamp(.8rem, 2vh, 1.2rem);
  border-top: 1px solid rgba(199, 162, 87, .14);
}

.back__fine {
  color: rgba(232, 220, 193, .5);
  font-size: clamp(.5rem, 1.35vw, .57rem);
  font-weight: 400;
  letter-spacing: .06em;
  line-height: 1.5;
}

.back__url {
  color: rgba(232, 220, 193, .64);
  letter-spacing: .19em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (min-width: 600px) {
  .sheet-head h2 {
    font-size: clamp(3rem, 5.6vw, 4.7rem);
  }

  .spells {
    grid-auto-columns: minmax(270px, 58vw);
    gap: 1.15rem;
  }
}

@media (min-width: 900px) {
  .sheet__tab {
    display: grid;
    place-items: center;
    position: absolute;
    top: 4.6rem;
    right: 0;
    z-index: 3;
    width: 30px;
    height: 98px;
    border: 1px solid rgba(34, 29, 16, .24);
    border-right: 0;
    background: #d8c7a5;
    color: rgba(34, 29, 16, .5);
    font-size: .56rem;
    font-weight: 600;
    letter-spacing: .18em;
    line-height: 1;
    writing-mode: vertical-rl;
    text-orientation: mixed;
  }

  .map-layout {
    grid-template-columns: minmax(0, 1.48fr) minmax(278px, .72fr);
    align-items: start;
  }

  .binder {
    grid-template-columns: minmax(0, 1.22fr) minmax(300px, .78fr);
    align-items: start;
  }

  .places {
    position: sticky;
    top: 1.5rem;
  }

  .pin__label {
    opacity: .7;
    transform: translate(-50%, 0);
  }

  .pin[aria-pressed="true"] .pin__label {
    opacity: 1;
    border-color: var(--ink);
    background: var(--ink);
    color: var(--paper-hi);
  }

  .spec-preview {
    position: sticky;
    top: 1.6rem;
  }

  .spells {
    grid-auto-columns: minmax(288px, 38vw);
  }
}

@media (min-width: 1100px) {
  .spells {
    grid-auto-flow: row;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(.65rem, 1.35vw, 1.05rem);
    margin: 0;
    padding: 1rem 0 2.2rem;
    overflow: visible;
    scroll-snap-type: none;
  }

  .spell {
    display: flex;
  }

  .spell__name {
    min-height: 2.04em;
  }
}

@media (min-width: 1240px) {
  .sheet {
    width: calc(100% - 24px);
  }

  .sheet-head {
    align-items: flex-end;
  }
}

@media (max-width: 520px) {
  .cover__frame {
    padding: 1rem;
  }

  .cover__foot {
    flex-direction: column;
    gap: .3rem;
    align-items: flex-start;
  }

  .specs {
    max-width: none;
  }

  .specs dt {
    letter-spacing: .11em;
  }

  .sheet-head {
    gap: .9rem;
  }

  .cardmeta {
    gap: .7rem 1.1rem;
  }

  .sheet__body {
    padding-left: calc(1rem + 26px);
  }

  .sheet__gutter {
    width: 26px;
  }

  .chart__bar {
    padding: .5rem .55rem;
    letter-spacing: .1em;
  }

  .spec-card {
    width: min(100%, 360px);
    border-width: 7px;
  }

  .spell__inner {
    border-width: 6px;
  }

  .back__center {
    gap: 1.2rem;
  }
}

@media (max-width: 370px) {
  .wordmark {
    font-size: clamp(3.6rem, 19.5vw, 5rem);
  }

  .specs dt {
    font-size: .46rem;
  }

  .slots {
    gap: 2px;
  }

  .slot {
    font-size: .46rem;
  }
}

@media (max-height: 820px) {
  .cover,
  .back {
    padding: 12px;
  }

  .cover__frame,
  .back__frame {
    padding: clamp(1rem, 2vh, 1.4rem);
  }

  .cover__center {
    padding: clamp(.6rem, 1.6vh, 1.4rem) 0;
  }

  .cover__entry {
    padding-bottom: clamp(.8rem, 1.8vh, 1.2rem);
  }

  .specs {
    margin-bottom: clamp(.8rem, 2vh, 1.3rem);
  }

  .ring-btn {
    --size: clamp(7rem, 15vw, 8.6rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
  }

  .wordmark,
  .kana {
    animation: none;
  }

  .tilt {
    transform: none !important;
  }

  .flash.is-on {
    animation: none;
    opacity: 0;
  }
}


