/* Google Fonts Arsenal */
@import url('https://fonts.googleapis.com/css2?family=Arsenal:ital,wght@0,400;0,700;1,400;1,700&display=swap');

:root {
  /* Brand green palette: #87aa83 / rgb(135,170,131) */
  --color-carm-50: #eef4ed;
  --color-carm-100: #d6e5d4;
  --color-carm-200: #b6d0b2;
  --color-carm-300: #9dbf99;
  --color-carm-400: #87aa83;
  --color-carm-500: #6f9169;
  --color-carm-600: #587450;
  --color-carm-700: #3f5439;
  --color-carm-800: #263021;
  --color-carm-900: #141a12;
  --color-carm-950: #0a0d09;

  --color-ink: #000000;
  --color-surface: #060806;
  --color-surface-2: #0b0f0a;

  --font-sans: 'Arsenal', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Mono', 'Consolas', 'Courier New', monospace;

  --shadow-glow-sm: 0 0 8px rgba(135, 170, 131, 0.35);
  --shadow-glow: 0 0 24px rgba(135, 170, 131, 0.25);
  --shadow-glow-lg: 0 0 45px rgba(135, 170, 131, 0.4);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background-color: var(--color-ink);
  color: #e6ece5;
  font-family: var(--font-sans);
  height: 100%;
}

body {
  background-color: var(--color-ink);
  color: #e6ece5;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Ambient glow backgrounds */
.bg-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: 
    radial-gradient(circle at 50% 30%, rgba(135, 170, 131, 0.15) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(111, 145, 105, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 20% 70%, rgba(63, 84, 57, 0.12) 0%, transparent 50%),
    var(--color-ink);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: 
    linear-gradient(to right, rgba(135, 170, 131, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(135, 170, 131, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 20%, transparent 100%);
}

canvas#particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Container */
.container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 900px;
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Typography */
.display {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.05;
  color: var(--color-carm-100);
  font-size: clamp(3.2rem, 8vw, 6.5rem);
  text-shadow:
    0 0 2px rgba(135, 170, 131, 0.9),
    0 0 20px rgba(135, 170, 131, 0.4),
    0 0 40px rgba(135, 170, 131, 0.2);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(1.5rem, 4vw, 2.75rem);
  color: var(--color-carm-300);
  letter-spacing: 0.15em;
  text-shadow: 0 0 12px rgba(135, 170, 131, 0.35);
  margin-bottom: 2.5rem;
  display: inline-block;
  position: relative;
}

.eyebrow {
  font-size: 0.875rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-carm-400);
  margin-bottom: 1rem;
}

.eyebrow-prompt::before {
  content: '> ';
  font-family: var(--font-mono);
  color: var(--color-carm-600);
}

.caret::after {
  content: '';
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 0.2em;
  vertical-align: text-bottom;
  background-color: var(--color-carm-300);
  box-shadow: 0 0 10px rgba(135, 170, 131, 0.7);
  animation: caret-blink 1.1s steps(1) infinite;
}

@keyframes caret-blink {
  0%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* 3D Spinning Coin / Photo Frame */
.coin-stage {
  perspective: 1000px;
  -webkit-perspective: 1000px;
  width: min(320px, 75vw);
  height: min(320px, 75vw);
  margin: 1.5rem auto 2.5rem auto;
  position: relative;
}

.coin-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  /* Fixed continuous spin speed 2x (6 seconds) */
  animation: spin3d 6s linear infinite;
}

@keyframes spin3d {
  0% {
    transform: rotateY(0deg) rotateX(3deg);
  }
  50% {
    transform: rotateY(180deg) rotateX(-3deg);
  }
  100% {
    transform: rotateY(360deg) rotateX(3deg);
  }
}

.coin-side {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  background-color: #000;
  border: 3px solid var(--color-carm-300);
  box-shadow:
    inset 0 0 0 4px #000,
    inset 0 0 0 6px rgba(135, 170, 131, 0.6),
    0 0 25px rgba(135, 170, 131, 0.35),
    0 0 50px rgba(135, 170, 131, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.coin-side img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.coin-side.front {
  transform: rotateY(0deg);
}

.coin-side.back {
  transform: rotateY(180deg);
}

/* Glow ring around stage */
.coin-stage::before {
  content: '';
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(135, 170, 131, 0.2) 0%, transparent 70%);
  pointer-events: none;
  animation: pulse-glow 3s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
  0% { opacity: 0.4; transform: scale(0.96); }
  100% { opacity: 0.85; transform: scale(1.05); }
}

/* Reticle / Bracketed Frame */
.bracketed {
  position: relative;
  padding: 2.5rem 2rem;
  background-color: rgba(11, 15, 10, 0.75);
  border: 1px solid rgba(135, 170, 131, 0.25);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.6),
    var(--shadow-glow-sm);
  width: 100%;
}

.bracketed::before,
.bracketed::after {
  content: '';
  position: absolute;
  width: 1.25rem;
  height: 1.25rem;
  border-color: var(--color-carm-400);
  border-style: solid;
  pointer-events: none;
  transition: border-color 200ms ease;
}

.bracketed::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
  border-top-left-radius: 4px;
}

.bracketed::after {
  right: -1px;
  bottom: -1px;
  border-width: 0 2px 2px 0;
  border-bottom-right-radius: 4px;
}

/* Footer status bar */
.status-bar {
  margin-top: 2rem;
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  color: var(--color-carm-400);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.85;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-carm-300);
  box-shadow: 0 0 8px var(--color-carm-300);
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.5; }
}

.hairline {
  width: 100%;
  max-width: 400px;
  height: 1px;
  margin: 2rem auto;
  background: linear-gradient(
    to right,
    transparent,
    rgba(135, 170, 131, 0.45),
    transparent
  );
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .coin-wrapper {
    animation: none;
  }
  .status-dot, .caret::after, .coin-stage::before {
    animation: none;
  }
}
