:root {
  --noise-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' 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='0.015'/%3E%3C/svg%3E");
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: #000000;
  color: #ffffff;
  font-family: 'LINE Seed JP', Georgia, serif;
  font-weight: 700;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@property --glow-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes rotateGlow {
  to { --glow-angle: 360deg; }
}

@keyframes flickerGlow {
  0%, 100% { opacity: 1; }
  15% { opacity: 0.6; }
  30% { opacity: 0.9; }
  50% { opacity: 0.5; }
  65% { opacity: 0.85; }
  80% { opacity: 0.55; }
  90% { opacity: 0.95; }
}

.card-scene {
  perspective: 1200px;
  max-width: 480px;
  width: 100%;
  position: relative;
}

.card {
  position: relative;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.container,
.card-back {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  outline: 1px solid rgba(255, 255, 255, 0.15);
  outline-offset: 5px;
  background: #000000;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.container {
  transform: translateZ(1px);
}

.container {
  max-width: 480px;
  padding: 32px 32px 24px;
  position: relative;
}

.card-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
}

.card-back canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  z-index: 1;
  border-radius: 12px;
}

.container::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  background: conic-gradient(
    from var(--glow-angle),
    transparent 0%,
    transparent 20%,
    rgba(255, 255, 255, 0.08) 30%,
    rgba(255, 255, 255, 0.8) 40%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 60%,
    transparent 100%
  );
  padding: 2px;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: rotateGlow 10s linear infinite, flickerGlow 3s ease-in-out infinite;
  pointer-events: none;
}

.container::after,
.card-back::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  pointer-events: none;
  z-index: 2;
  background:
    var(--noise-url),
    linear-gradient(
      var(--holo-angle, 0deg),
      transparent 0%,
      rgba(255, 255, 255, 0.05) var(--sheen-pos, 50%),
      transparent 100%
    );
  mix-blend-mode: screen;
}

.inner-dash {
  position: absolute;
  inset: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  pointer-events: none;
  overflow: visible;
}

.inner-dash rect {
  x: 0.5px;
  y: 0.5px;
  width: calc(100% - 1px);
  height: calc(100% - 1px);
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.container > *:not(.inner-dash) {
  opacity: 0;
  animation: fadeIn 0.6s ease-out forwards;
}

.container > :nth-child(2) { animation-delay: 0s; }
.container > :nth-child(3) { animation-delay: 0.1s; }
.container > :nth-child(4) { animation-delay: 0.2s; }
.container > :nth-child(5) { animation-delay: 0.3s; }
.container > :nth-child(6) { animation-delay: 0.4s; }
.container > :nth-child(7) { animation-delay: 0.5s; }

.header-row {
  position: relative;
  width: 100%;
  aspect-ratio: 208 / 100;
  margin-bottom: 32px;
}

.scene {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

p {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 20px;
}

h1.intro {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 20px;
}

p.last {
  margin-bottom: 0;
}

a, .sep {
  color: #ffffff;
  text-decoration: none;
  opacity: 0.5;
}

a:hover {
  opacity: 1;
  transition: opacity 0.15s ease;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px -32px -24px;
  padding: 24px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  font-family: 'Doto', monospace;
  font-size: 14px;
  text-transform: uppercase;
  font-weight: 400;
  color: #ffffff;
}

.version-label,
.tallinn-time {
  opacity: 0.8;
}

.container {
  width: 480px;
}

@media (max-width: 560px) {
  .card-scene {
    zoom: calc((100vw - 48px) / 510);
    max-width: calc(100vw - 48px);
  }
  .card-scene .container {
    max-width: 100%;
  }
}

/* Static information floor — hidden unless JS fails or is disabled */
#static-floor {
  display: none;
  max-width: 480px;
  width: 100%;
  padding: 32px;
  font-weight: 400;
  line-height: 1.6;
}
body.experience-failed #static-floor { display: block; }
body.experience-failed .card-scene { display: none; }
#static-floor h1 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 16px;
}
#static-floor p {
  font-size: 15px;
  margin-bottom: 12px;
  opacity: 0.7;
}
#static-floor a {
  color: #ffffff;
  text-decoration: none;
  opacity: 0.5;
}
#static-floor a:hover {
  opacity: 1;
  transition: opacity 0.15s ease;
}
#static-floor .floor-version {
  margin-top: 16px;
  font-family: 'Doto', monospace;
  font-size: 13px;
  text-transform: uppercase;
  opacity: 0.3;
}
#portrait-error {
  font-size: 14px;
  opacity: 0.4;
  margin-bottom: 16px;
  font-weight: 400;
}

@media (prefers-reduced-motion: reduce) {
  .container::before { animation: none; background: none; }
  .container::after,
  .card-back::after { background: none; }
  .container > *:not(.inner-dash) { opacity: 1; animation: none; }
}
