@font-face {
  font-family: 'Barlow Condensed';
  src: url('fonts/barlow-condensed-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'Barlow Condensed';
  src: url('fonts/barlow-condensed-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'Barlow';
  src: url('fonts/barlow-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces-600-italic.woff2') format('woff2');
  font-weight: 600;
  font-style: italic;
  font-display: block;
}

:root {
  --wall: #100e0c;
  --cream: #f4efe4;
  --ink: #1c1612;
  --brass: #c6a56a;
  --tile-w: 108px;
  --tile-h: 132px;
  --gap: 6px;
  --glyph: 104px;
  --frame-top: 198px;
}

* {
  box-sizing: border-box;
  cursor: none !important;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--wall);
  color: var(--cream);
}

html {
  scrollbar-width: none;
}

body::-webkit-scrollbar,
html::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

#fit {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  background: var(--wall);
}

#stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  overflow: hidden;
  transform-origin: 0 0;
  background:
    radial-gradient(ellipse 78% 62% at 50% 46%, #2c241c 0%, rgba(44, 36, 28, 0) 68%),
    var(--wall);
}

#drift {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  -webkit-animation: drift 900s linear infinite;
  animation: drift 900s linear infinite;
}

#snow {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.flake {
  position: absolute;
  top: -16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  -webkit-animation-name: fall;
  animation-name: fall;
  -webkit-animation-timing-function: linear;
  animation-timing-function: linear;
  -webkit-animation-iteration-count: infinite;
  animation-iteration-count: infinite;
}

.flake.front {
  z-index: 5;
}

#mast {
  position: absolute;
  z-index: 4;
  top: 42px;
  left: 78px;
  right: 78px;
  height: 132px;
}

#brand {
  position: absolute;
  left: 0;
  top: 28px;
  margin: 0;
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-weight: 600;
  font-style: normal;
  font-size: 34px;
  line-height: 1;
  color: #f6f0e6;
}

#brand:after {
  content: '';
  display: block;
  width: 46px;
  height: 2px;
  margin-top: 12px;
  background: var(--brass);
  border-radius: 1px;
}

#hello-block {
  position: absolute;
  right: 0;
  top: 8px;
  text-align: right;
}

#hello {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-weight: 600;
  font-style: italic;
  font-size: 48px;
  line-height: 1;
  color: #f7f1e6;
}

#when {
  margin-top: 12px;
  font-family: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.04em;
  color: rgba(246, 240, 228, 0.78);
}

#clock {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 600;
  font-size: 30px;
  letter-spacing: 0.06em;
  color: #f7f1e6;
  margin-right: 12px;
  font-variant-numeric: tabular-nums;
}

.dot {
  margin-right: 12px;
  color: var(--brass);
}

#badge {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 36px;
  width: 128px;
  height: 128px;
  margin-left: -64px;
  border-radius: 50%;
  background: linear-gradient(#f8f3ea, #e7dcc8);
  box-shadow:
    0 0 0 4px #c6a56a,
    0 0 0 7px #1a1612,
    0 14px 28px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

#badge.on {
  opacity: 1;
}

#badge-photo {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

#badge-initials {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 700;
  font-size: 58px;
  line-height: 128px;
  text-align: center;
  color: var(--ink);
  letter-spacing: 0.04em;
}

#badge-slit {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  margin-top: -2px;
  background: rgba(20, 14, 10, 0.45);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

#frame {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: var(--frame-top);
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  padding: 22px;
  background: #0c0b0a;
  border-radius: 18px;
  box-shadow:
    0 0 0 1px rgba(198, 165, 106, 0.42),
    0 0 0 11px #1a1714,
    0 28px 70px rgba(0, 0, 0, 0.5),
    inset 0 0 0 2px #050403;
}

#stage.is-festive #frame {
  box-shadow:
    0 0 0 1px rgba(198, 165, 106, 0.55),
    0 0 0 11px #1a1714,
    0 0 48px rgba(120, 36, 36, 0.18),
    0 28px 70px rgba(0, 0, 0, 0.5),
    inset 0 0 0 2px #050403;
}

#stage.is-festive #frame:before {
  content: '';
  position: absolute;
  left: 36px;
  right: 36px;
  top: 8px;
  height: 8px;
  background-image: radial-gradient(circle, rgba(255, 220, 170, 0.95) 0 1.5px, transparent 2.6px);
  background-size: 42px 8px;
  background-repeat: repeat-x;
  opacity: 0.75;
  pointer-events: none;
}

#grid {
  display: grid;
  grid-template-columns: repeat(15, var(--tile-w));
  grid-template-rows: repeat(5, var(--tile-h));
  gap: var(--gap);
}

.tile {
  position: relative;
  width: var(--tile-w);
  height: var(--tile-h);
  -webkit-perspective: 700px;
  perspective: 700px;
}

.half,
.leaf {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  overflow: hidden;
}

.half.top,
.leaf.top {
  top: 0;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(#f7f2e8, #efe4d4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), inset 0 -5px 6px rgba(80, 60, 30, 0.08);
}

.half.bottom,
.leaf.bottom {
  bottom: 0;
  border-radius: 0 0 5px 5px;
  background: linear-gradient(#e4d8c4, #f3ebdd);
  box-shadow: inset 0 5px 6px rgba(60, 40, 20, 0.14);
}

.glyph {
  position: absolute;
  left: 0;
  width: 100%;
  top: 0;
  height: var(--tile-h);
  line-height: var(--tile-h);
  text-align: center;
  font-family: 'Barlow Condensed', 'Arial Narrow', 'Helvetica Neue', sans-serif;
  font-weight: 700;
  font-size: var(--glyph);
  color: var(--ink);
  letter-spacing: 0;
}

.half.bottom .glyph,
.leaf.bottom .glyph {
  top: calc(var(--tile-h) / -2);
}

.leaf {
  visibility: hidden;
  z-index: 6;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.leaf.top {
  -webkit-transform-origin: center bottom;
  transform-origin: center bottom;
}

.leaf.bottom {
  -webkit-transform-origin: center top;
  transform-origin: center top;
}

.groove {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  margin-top: -2px;
  background: rgba(12, 9, 7, 0.55);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22);
  z-index: 5;
  pointer-events: none;
}

.tile.flipping .leaf {
  will-change: transform;
}

#vignette {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  z-index: 7;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 52%, rgba(0, 0, 0, 0.28) 100%);
}

noscript p {
  font-family: Georgia, serif;
  color: #f4efe4;
  padding: 48px;
  font-size: 28px;
}

@-webkit-keyframes flap-top {
  0% { -webkit-transform: rotateX(0deg); transform: rotateX(0deg); }
  100% { -webkit-transform: rotateX(-90deg); transform: rotateX(-90deg); }
}

@keyframes flap-top {
  0% { -webkit-transform: rotateX(0deg); transform: rotateX(0deg); }
  100% { -webkit-transform: rotateX(-90deg); transform: rotateX(-90deg); }
}

@-webkit-keyframes flap-bottom {
  0% { -webkit-transform: rotateX(90deg); transform: rotateX(90deg); }
  46% { -webkit-transform: rotateX(90deg); transform: rotateX(90deg); }
  100% { -webkit-transform: rotateX(0deg); transform: rotateX(0deg); }
}

@keyframes flap-bottom {
  0% { -webkit-transform: rotateX(90deg); transform: rotateX(90deg); }
  46% { -webkit-transform: rotateX(90deg); transform: rotateX(90deg); }
  100% { -webkit-transform: rotateX(0deg); transform: rotateX(0deg); }
}

@-webkit-keyframes fall {
  0% { -webkit-transform: translate3d(0, -20px, 0); transform: translate3d(0, -20px, 0); }
  100% { -webkit-transform: translate3d(24px, 1120px, 0); transform: translate3d(24px, 1120px, 0); }
}

@keyframes fall {
  0% { -webkit-transform: translate3d(0, -20px, 0); transform: translate3d(0, -20px, 0); }
  100% { -webkit-transform: translate3d(24px, 1120px, 0); transform: translate3d(24px, 1120px, 0); }
}

@-webkit-keyframes fall-alt {
  0% { -webkit-transform: translate3d(0, -20px, 0); transform: translate3d(0, -20px, 0); }
  100% { -webkit-transform: translate3d(-28px, 1120px, 0); transform: translate3d(-28px, 1120px, 0); }
}

@keyframes fall-alt {
  0% { -webkit-transform: translate3d(0, -20px, 0); transform: translate3d(0, -20px, 0); }
  100% { -webkit-transform: translate3d(-28px, 1120px, 0); transform: translate3d(-28px, 1120px, 0); }
}

@-webkit-keyframes drift {
  0% { -webkit-transform: translate(0, 0); transform: translate(0, 0); }
  25% { -webkit-transform: translate(7px, 5px); transform: translate(7px, 5px); }
  50% { -webkit-transform: translate(-3px, 8px); transform: translate(-3px, 8px); }
  75% { -webkit-transform: translate(-8px, -4px); transform: translate(-8px, -4px); }
  100% { -webkit-transform: translate(0, 0); transform: translate(0, 0); }
}

@keyframes drift {
  0% { -webkit-transform: translate(0, 0); transform: translate(0, 0); }
  25% { -webkit-transform: translate(7px, 5px); transform: translate(7px, 5px); }
  50% { -webkit-transform: translate(-3px, 8px); transform: translate(-3px, 8px); }
  75% { -webkit-transform: translate(-8px, -4px); transform: translate(-8px, -4px); }
  100% { -webkit-transform: translate(0, 0); transform: translate(0, 0); }
}
