/* Tokens */

:root {
  --bg: #070B12;
  --bg-deep: #05080E;
  --surface: #0D141E;
  --surface-2: #0A1019;
  --surface-3: #0B111A;
  --surface-card: #0C131E;
  --surface-ph: #0E1622;

  --ink: #E8ECF2;
  --ink-soft: #D2DAE3;
  --ink-card: #C9D1DB;
  --ink-nav: #C3CDD9;
  --muted: #B9C3CF;
  --muted-news: #A9B4C2;
  --muted-2: #9AA6B6;
  --muted-3: #8A97A8;
  --faint: #7D8A9C;
  --white: #FFFFFF;
  --black: #000;

  --gold-title: #F4E6BE;
  --gold-text: #F1E2B8;
  --gold-brand: #EED79C;
  --gold-link: #E3C77F;
  --gold-link-hover: #F6E3B0;
  --gold-logo: #E2C68A;
  --gold: #D9BC7A;
  --gold-underline: #D6B46A;
  --gold-orn: #C9A45C;
  --gold-line-14: rgba(201, 164, 92, .14);
  --gold-line-18: rgba(201, 164, 92, .18);
  --gold-line-22: rgba(201, 164, 92, .22);
  --gold-line-32: rgba(201, 164, 92, .32);
  --gold-line-34: rgba(201, 164, 92, .34);
  --gold-line-38: rgba(201, 164, 92, .38);
  --gold-line-50: rgba(201, 164, 92, .5);
  --gold-line-55: rgba(201, 164, 92, .55);
  --frame-outer: linear-gradient(115deg, #6F5833 0%, #C7A968 18%, #7A623A 40%, #B39456 64%, #6A5430 100%);

  --btn-gold-ink: #2A1904;
  --btn-gold-ink-hover: #1C1002;
  --btn-gold-glint: rgba(255, 236, 180, .45);

  --aether: #5CC4F5;
  --aether-soft: #9ED8F7;
  --aether-06: rgba(92, 196, 245, .06);
  --aether-35: rgba(92, 196, 245, .35);
  --aether-40: rgba(92, 196, 245, .4);
  --aether-60: rgba(92, 196, 245, .6);
  --aether-70: rgba(92, 196, 245, .7);

  --online: #3DDC84;
  --online-halo: rgba(61, 220, 132, .18);

  --white-03: rgba(255, 255, 255, .03);
  --white-06: rgba(255, 255, 255, .06);
  --shade-55: rgba(0, 0, 0, .55);
  --shade-60: rgba(0, 0, 0, .6);
  --shade-70: rgba(0, 0, 0, .7);
  --shade-85: rgba(0, 0, 0, .85);

  --bg-0: rgba(7, 11, 18, 0);
  --bg-30: rgba(7, 11, 18, .3);
  --bg-35: rgba(7, 11, 18, .35);
  --bg-55: rgba(7, 11, 18, .55);
  --bg-60: rgba(7, 11, 18, .6);
  --bg-72: rgba(7, 11, 18, .72);
  --bg-80: rgba(7, 11, 18, .8);
  --bg-85: rgba(7, 11, 18, .85);
  --bg-94: rgba(7, 11, 18, .94);
  --bg-96: rgba(7, 11, 18, .96);
  --surface-0: rgba(13, 20, 30, 0);
  --surface-82: rgba(13, 20, 30, .82);

  --font-display: 'Cormorant Unicase', Georgia, serif;
  --font-body: 'Ysabeau Office', 'Segoe UI', system-ui, sans-serif;
  --wrap-max: 1280px;
  --gutter: 32px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }
}

/* Base */

body {
  margin: 0;
  background: var(--bg);
}

a {
  color: var(--gold-link);
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  :where(a):hover {
    color: var(--gold-link-hover);
  }
}

:focus-visible {
  outline: 2px solid var(--aether);
  outline-offset: 4px;
}

.wrap {
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  box-sizing: border-box;
  width: 100%;
}

[hidden] {
  display: none !important;
}

/* Motion */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.in {
  animation: rise 700ms var(--ease-out) both;
}

.d1 {
  animation-delay: 80ms;
}

.d2 {
  animation-delay: 150ms;
}

.d3 {
  animation-delay: 220ms;
}

.d4 {
  animation-delay: 290ms;
}

.d5 {
  animation-delay: 360ms;
}

.d6 {
  animation-delay: 430ms;
}

:where(.rv-on) [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}

:where(.rv-on) [data-reveal][data-d="1"] {
  transition-delay: 70ms;
}

:where(.rv-on) [data-reveal][data-d="2"] {
  transition-delay: 140ms;
}

:where(.rv-on) [data-reveal][data-visible] {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .in {
    animation: fade 200ms ease both;
  }

  :where(.rv-on) [data-reveal] {
    transform: none;
    transition: opacity 300ms ease;
  }
}

/* Layout */

.site {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Logo */

.logo {
  display: block;
  flex: none;
  color: var(--gold-logo);
}

/* Navigation */

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 24px;
  font-size: 15px;
  font-weight: 500;
  flex: 1 1 auto;
}

.nav a {
  padding: 6px 0;
  color: var(--ink-nav);
}

@media (hover: hover) and (pointer: fine) {
  .nav a:hover {
    color: var(--white);
  }
}

.nav a[aria-current="page"] {
  color: var(--white);
  border-bottom: 1px solid var(--gold-underline);
}

@media (max-width: 1199px) {
  html.js .nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    font-size: 17px;
  }

  html.js .nav a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0;
  }

  html.js .nav a[aria-current="page"] {
    border-bottom: 0;
    -webkit-text-decoration: underline 1px var(--gold-underline);
    text-decoration: underline 1px var(--gold-underline);
    text-underline-offset: 8px;
  }
}

@media (pointer: coarse) {
  .nav {
    row-gap: 12px;
  }

  .nav a {
    position: relative;
  }

  .nav a::before {
    content: "";
    position: absolute;
    inset: 50% 0 auto;
    height: 44px;
    transform: translateY(-50%);
  }
}

/* Language menu */

.lang {
  position: relative;
}

.lang__button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 12px;
  background: var(--white-03);
  border: 1px solid var(--gold-line-32);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.lang__chevron {
  transition: transform 160ms var(--ease-out);
}

.lang__chevron--open {
  transform: rotate(180deg);
}

.lang__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 210px;
  max-height: 340px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--gold-line-38);
  box-shadow: 0 18px 40px var(--shade-55);
  transform-origin: top right;
  animation: pop 160ms var(--ease-out) both;
}

.lang__option {
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 0 12px;
  font-size: 15px;
  text-align: left;
  background: transparent;
  color: var(--ink-nav);
  font-weight: 500;
}

.lang__option--current {
  background: var(--gold-line-14);
  color: var(--gold-text);
  font-weight: 700;
}

.lang__code {
  font-size: 13px;
  color: var(--faint);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(.96);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lang__menu {
    animation: fade 200ms ease both;
  }

  .lang__chevron {
    transition: none;
  }
}

/* Header */

.header {
  position: relative;
  z-index: 3;
  border-bottom: 1px solid var(--gold-line-18);
  background: var(--bg-72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.header__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 32px;
  min-height: 72px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gold-brand);
}

@media (pointer: coarse) {
  .brand {
    position: relative;
  }

  .brand::before {
    content: "";
    position: absolute;
    inset: 50% 0 auto;
    height: 44px;
    transform: translateY(-50%);
  }
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: .03em;
  color: var(--gold-text);
}

.brand__tagline {
  font-size: 13px;
  color: var(--muted-2);
  margin-top: 4px;
}

.header__tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.social {
  display: flex;
  gap: 4px;
}

.social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--ink-nav);
}

@media (hover: hover) and (pointer: fine) {
  .social__link:hover {
    color: var(--white);
  }
}

.account {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--gold-line-55);
  color: var(--gold-text);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.account::before,
.account::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  background: var(--bg);
  border: 1px solid var(--gold-orn);
  transform: translateY(-50%) rotate(45deg);
}

.account::before {
  left: -5px;
}

.account::after {
  right: -5px;
}

.header__panel {
  display: contents;
}

.header__toggle {
  display: none;
}

@media (max-width: 1199px) {
  html.js .header__bar {
    column-gap: 16px;
  }

  html.js .header__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    margin-left: auto;
    padding: 0 14px;
    background: var(--white-03);
    border: 1px solid var(--gold-line-32);
    color: var(--ink);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
  }

  html.js .header__panel {
    display: none;
  }

  html.js .header--open .header__panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-basis: 100%;
    padding-bottom: 12px;
    animation: menu-drop 220ms var(--ease-out) both;
  }

  html.js .header__tools {
    max-width: 400px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "account account"
      "social lang";
    align-items: center;
    gap: 16px 12px;
  }

  html.js .account {
    grid-area: account;
    justify-self: start;
  }

  html.js .social {
    grid-area: social;
    margin-left: -12px;
  }

  html.js .lang {
    grid-area: lang;
  }
}

@media (min-width: 641px) and (max-width: 1199px) {
  html.js .header__tools {
    max-width: none;
    grid-template-columns: auto auto auto;
    grid-template-areas: "account social lang";
    justify-content: start;
    column-gap: 24px;
  }
}

@media (max-width: 359px) {
  html.js .header__toggle {
    justify-content: center;
    width: 44px;
    padding: 0;
  }

  .header__toggle-label {
    display: none;
  }
}

@keyframes menu-drop {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.js .header--open .header__panel {
    animation: fade 200ms ease both;
  }
}

/* Breadcrumbs */

.crumbs {
  display: flex;
  gap: 10px;
  font-size: 15px;
  color: var(--muted-2);
}

.crumbs__link {
  color: var(--muted-2);
}

.crumbs__current {
  color: var(--ink-soft);
}

@media (pointer: coarse) {
  .crumbs__link {
    position: relative;
  }

  .crumbs__link::before {
    content: "";
    position: absolute;
    inset: 50% 0 auto;
    height: 44px;
    transform: translateY(-50%);
  }
}

/* Footer */

.footer {
  border-top: 1px solid var(--gold-line-18);
  background: var(--bg-deep);
  padding: 48px 0 28px;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.footer__top {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 64px;
}

.footer__about {
  flex: 2 1 300px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 420px;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: .03em;
  color: var(--gold-text);
}

.footer__disclaimer {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--faint);
}

.footer__column {
  flex: 1 1 140px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}

.footer__column--wide {
  flex-basis: 200px;
}

.footer__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--muted-2);
  margin-bottom: 4px;
}

.footer__link {
  color: var(--ink-nav);
}

@media (pointer: coarse) {
  .footer__column {
    gap: 25px;
  }

  .footer__link {
    position: relative;
  }

  .footer__link::before {
    content: "";
    position: absolute;
    inset: 50% 0 auto;
    height: 44px;
    transform: translateY(-50%);
  }
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--white-06);
  font-size: 12px;
  color: var(--faint);
}

.footer__version {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer__mark {
  width: 6px;
  height: 6px;
  background: var(--aether);
  transform: rotate(45deg);
}

/* Frame */

.fr {
  padding: 1px;
  background: var(--frame-outer);
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px);
  transition: filter 200ms ease;
}

.a {
  height: 100%;
  box-sizing: border-box;
  padding: 4px;
  background: var(--surface-2);
  clip-path: polygon(13.6px 0, calc(100% - 13.6px) 0, 100% 13.6px, 100% calc(100% - 13.6px), calc(100% - 13.6px) 100%, 13.6px 100%, 0 calc(100% - 13.6px), 0 13.6px);
}

.b {
  height: 100%;
  box-sizing: border-box;
  padding: 1px;
  background: var(--gold-line-34);
  clip-path: polygon(11.9px 0, calc(100% - 11.9px) 0, 100% 11.9px, 100% calc(100% - 11.9px), calc(100% - 11.9px) 100%, 11.9px 100%, 0 calc(100% - 11.9px), 0 11.9px);
  transition: background-color 200ms ease;
}

.c {
  height: 100%;
  box-sizing: border-box;
  background: var(--surface);
  clip-path: polygon(11.5px 0, calc(100% - 11.5px) 0, 100% 11.5px, 100% calc(100% - 11.5px), calc(100% - 11.5px) 100%, 11.5px 100%, 0 calc(100% - 11.5px), 0 11.5px);
}

@media (hover: hover) and (pointer: fine) {
  .fr--hoverable:hover {
    filter: brightness(1.18);
  }

  .fr--hoverable:hover .b {
    background-color: var(--aether-60);
  }
}

/* Gold button */

.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-sizing: border-box;
  height: 64px;
  min-width: min(360px, 100%);
  max-width: 100%;
  padding: 2px 6px;
  background: var(--gold) content-box;
  border-style: solid;
  border-width: 0 37px;
  border-image: url("../images/btn-gold.webp") 0 110 fill / 0 37px stretch;
  color: var(--btn-gold-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 25px;
  letter-spacing: .03em;
  white-space: nowrap;
  text-shadow: 0 1px 0 var(--btn-gold-glint);
  filter: drop-shadow(0 10px 22px var(--shade-60));
  transition: filter 200ms ease, transform 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .btn-gold:hover {
    color: var(--btn-gold-ink-hover);
    filter: brightness(1.12) drop-shadow(0 0 16px var(--aether-40)) drop-shadow(0 10px 22px var(--shade-60));
  }
}

.btn-gold:active {
  transform: scale(.97);
}

.btn-gold:focus-visible {
  outline: 2px solid var(--aether);
  outline-offset: 4px;
}

@media (max-width: 440px) {
  .btn-gold {
    width: 100%;
    font-size: 22px;
  }
}

@media (max-width: 375px) {
  .btn-gold {
    font-size: 19px;
  }
}

@media (max-width: 359px) {
  .btn-gold {
    font-size: 18px;
  }

  .btn-gold > svg {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-gold:active {
    transform: none;
  }
}

/* Line button */

.btn-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--gold-line-50);
  color: var(--gold-text);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 150ms ease, background-color 150ms ease, transform 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .btn-line:hover {
    border-color: var(--aether-70);
    background-color: var(--aether-06);
    color: var(--white);
  }
}

.btn-line:active {
  transform: scale(.97);
}

@media (prefers-reduced-motion: reduce) {
  .btn-line:active {
    transform: none;
  }
}

/* Eyebrow */

.eyebrow {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 600;
  color: var(--aether);
}

/* Item slot */

.slot {
  display: block;
  outline: 1px solid var(--gold-line-34);
  outline-offset: -1px;
  background: var(--bg-deep);
}

/* Site additions (not in the mockups) */

/* The display/body fonts have no CJK glyphs; fall back to system Chinese fonts */
:root:lang(zh) {
  --font-display: 'Cormorant Unicase', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', serif;
  --font-body: 'Ysabeau Office', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif;
}
