/* ==========================================================================
   Award Interactive — Digital Studio & Domain Desk
   Living day/night sky: 30s auto cycle, sun & moon arc, stars at night.
   All UI colors flow through CSS vars that app.js animates every frame.
   ========================================================================== */

:root {
  /* Animated by app.js (lerped day <-> night) */
  --bg-canvas: #FAF8F2;
  --bg-card: rgba(255, 255, 255, 0.88);
  --bg-control: #FAF9F5;
  --pill-bg: rgba(255, 255, 255, 0.8);
  --ink-deep: #121316;
  --ink-secondary: #27272A;
  --ink-subtle: #52525B;
  --ink-muted: #8E8E93;
  --border-subtle: rgba(18, 19, 22, 0.08);
  --border-card: rgba(197, 160, 89, 0.3);
  --ink-page: #121316;
  --ink-page-subtle: #52525B;
  --border-page: rgba(18, 19, 22, 0.06);
  --veil-o: 0;

  /* Fixed brand gold */
  --gold-primary: #C5A059;
  --gold-bright: #D4AF37;
  --gold-glow: rgba(212, 175, 55, 0.16);
  --gold-border: rgba(197, 160, 89, 0.35);
  --keycap-red: #C24128;

  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius-pill: 9999px;
  --radius-card: 14px;
  --radius-control: 7px;

  --shadow-card: 0 10px 30px -10px rgba(18, 19, 22, 0.08), 0 0 0 1px var(--border-card);
}

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

html, body {
  height: 100%;
  width: 100%;
  background-color: var(--bg-canvas);
  color: var(--ink-deep);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  position: relative;
  transition: background-color 0.2s linear;
}

body.is-turning,
body.is-turning * {
  cursor: grabbing !important;
  user-select: none;
}

/* ==========================================================================
   Living Sky Layer
   ========================================================================== */
.sky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 58vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sky-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    var(--sky-top, #DCE6F2) 0%,
    var(--sky-mid, #F2EEE2) 55%,
    var(--sky-bot, #FAF8F2) 100%);
}

.sky-dawn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 0.25;
  filter: saturate(1.15) contrast(1.02);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 60%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 60%, rgba(0,0,0,0) 100%);
}

/* Stars (opacity gated by app.js) */
.stars {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: #F5F0DC;
  animation: twinkle var(--tw-dur, 3s) ease-in-out var(--tw-delay, 0s) infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.8); }
  50%      { opacity: 1;    transform: scale(1.15); }
}

/* Occasional shooting star during deep night */
.comet {
  position: absolute;
  top: 12%;
  left: -6%;
  width: 90px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(245, 240, 220, 0.9));
  opacity: 0;
  transform: rotate(14deg);
  filter: drop-shadow(0 0 4px rgba(245, 240, 220, 0.7));
}

.comet.is-flying {
  animation: shoot 9s linear 3s infinite;
}

@keyframes shoot {
  0%   { left: -8%; top: 8%;  opacity: 0; }
  3%   { opacity: 0.9; }
  10%  { left: 78%; top: 26%; opacity: 0; }
  100% { left: 78%; top: 26%; opacity: 0; }
}

/* Sun & Moon — positioned every frame by app.js */
.celestial {
  position: absolute;
  left: 50%;
  top: 50%;
  will-change: transform, opacity;
}

.sun {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%,
    #FFF3C4 0%, #FFE08A 30%, #F5C84C 58%, #E8AE2F 78%, #D49E22 100%);
  box-shadow:
    0 0 24px rgba(255, 220, 120, 0.85),
    0 0 70px rgba(245, 200, 76, 0.45),
    0 0 160px rgba(212, 175, 55, 0.28);
  animation: sunPulse 5s ease-in-out infinite;
}

@keyframes sunPulse {
  0%, 100% { box-shadow: 0 0 24px rgba(255,220,120,0.85), 0 0 70px rgba(245,200,76,0.45), 0 0 160px rgba(212,175,55,0.28); }
  50%      { box-shadow: 0 0 30px rgba(255,220,120,0.95), 0 0 90px rgba(245,200,76,0.55), 0 0 190px rgba(212,175,55,0.34); }
}

.moon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 68% 30%, rgba(190, 186, 160, 0.5) 0 8%, transparent 9%),
    radial-gradient(circle at 38% 58%, rgba(190, 186, 160, 0.45) 0 11%, transparent 12%),
    radial-gradient(circle at 55% 72%, rgba(190, 186, 160, 0.4) 0 7%, transparent 8%),
    radial-gradient(circle at 30% 28%, rgba(255, 252, 240, 0.9) 0 12%, transparent 13%),
    radial-gradient(circle at 38% 36%, #FBF5E2 0%, #EDE5CC 55%, #D9D0B2 100%);
  box-shadow:
    0 0 18px rgba(250, 245, 225, 0.5),
    0 0 60px rgba(220, 220, 240, 0.25),
    0 0 130px rgba(200, 205, 235, 0.18);
  animation: moonPulse 7s ease-in-out infinite;
}

@keyframes moonPulse {
  0%, 100% { box-shadow: 0 0 18px rgba(250,245,225,0.5), 0 0 60px rgba(220,220,240,0.25), 0 0 130px rgba(200,205,235,0.18); }
  50%      { box-shadow: 0 0 24px rgba(250,245,225,0.62), 0 0 76px rgba(220,220,240,0.33), 0 0 150px rgba(200,205,235,0.24); }
}

/* ==========================================================================
   100vh Viewport Stage Frame
   ========================================================================== */
.viewport-stage {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 28px 8px;
  max-width: 960px;
  margin: 0 auto;
}

/* Top Masthead */
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 2px;
}

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

.brand-glyph {
  width: 22px;
  height: 22px;
  background: #121316;
  color: #FAF8F2;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.brand-glyph svg {
  width: 12px;
  height: 12px;
}

.brand-word {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--ink-page);
}

.gold-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--pill-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--gold-border);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink-page);
  box-shadow: 0 1px 4px var(--gold-glow);
}

.gold-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 6px var(--gold-bright);
}

/* ==========================================================================
   Center Content: Hero & Inquiry Box
   ========================================================================== */
.center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-top: -6px;
}

.hero-header {
  text-align: center;
  margin-bottom: 10px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 400;
  color: var(--ink-page);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 2px;
}

.hero-blurb {
  font-size: 0.82rem;
  color: var(--ink-page-subtle);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.4;
}

/* Contact Card */
.inquiry-card {
  width: 100%;
  max-width: 490px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 16px 22px;
  box-shadow: var(--shadow-card);
  position: relative;
  z-index: 10;
  transition: background-color 0.2s linear, border-color 0.2s linear;
}

.inquiry-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-deep);
}

.control {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--bg-control);
  color: var(--ink-deep);
  font-size: 0.82rem;
  font-family: inherit;
  transition: all 0.15s ease;
}

.control:focus {
  outline: none;
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.control::placeholder {
  color: var(--ink-muted);
}

.textarea {
  min-height: 42px;
  max-height: 54px;
  resize: none;
  font-size: 0.78rem;
  line-height: 1.3;
}

.hp-input {
  /* Honeypot: off-screen, invisible to humans, visible to naive bots */
  position: absolute !important;
  left: -5000px !important;
  top: 0 !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none;
}

/* Tactile Button */
.tactile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--ink-deep);
  color: #FAF8F2;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.16s ease;
  margin-top: 2px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 2px 6px rgba(0, 0, 0, 0.12),
    0 0 10px rgba(212, 175, 55, 0.1);
}

.tactile-btn:hover {
  background: var(--ink-secondary);
  border-color: var(--gold-bright);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 4px 10px rgba(0, 0, 0, 0.15),
    0 0 14px rgba(212, 175, 55, 0.2);
}

.tactile-btn:active {
  transform: translateY(0);
}

.btn-arrow {
  display: flex;
  align-items: center;
  transition: transform 0.15s ease;
}

.tactile-btn:hover .btn-arrow {
  transform: translateX(3px);
}

/* Disabled submit (Turnstile not yet passed) */
.tactile-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  border-color: rgba(212, 175, 55, 0.25);
}

.tactile-btn:disabled:hover {
  background: var(--ink-deep);
  transform: none;
  box-shadow: none;
  border-color: rgba(212, 175, 55, 0.25);
}

/* Cloudflare Turnstile widget (kept centered inside the white card) */
.cf-turnstile {
  display: flex;
  justify-content: center;
  min-height: 65px;
  margin: 2px 0 0;
}

/* Status Box */
.status-box {
  padding: 6px 10px;
  border-radius: var(--radius-control);
  font-size: 0.76rem;
  line-height: 1.35;
  display: none;
  text-align: center;
}

.status-box.success {
  display: block;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  color: #166534;
}

.status-box.error {
  display: block;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}

/* Trust Strip */
.trust-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  gap: 10px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--ink-subtle);
}

.trust-lock {
  color: var(--ink-deep);
}

/* ==========================================================================
   Small Auto-Turning Meadow
   ========================================================================== */
.interactive-stage {
  perspective: 1200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
  margin-top: -4px;
  margin-bottom: 34px;
  padding: 4px 0;
  z-index: 5;
  position: relative;
}

.interactive-stage:active {
  cursor: grabbing;
}

.stage-rotator {
  transform-style: preserve-3d;
  will-change: transform;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.08s ease-out;
}

.meadow-img {
  width: auto;
  height: auto;
  max-width: 560px;
  max-height: 28vh;
  pointer-events: none;
  user-select: none;
  filter: contrast(1.03) saturate(1.05);
  will-change: filter;
}

/* ==========================================================================
   Footer (reserved)
   ========================================================================== */
.stage-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: var(--ink-muted);
  padding-top: 4px;
  border-top: 1px solid var(--border-subtle);
}

/* Responsive */
@media (max-width: 600px) {
  html, body {
    overflow-y: auto;
    height: auto;
  }

  .viewport-stage {
    height: auto;
    min-height: 100vh;
    padding: 12px 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .meadow-img {
    max-width: 380px;
  }

  .stage-footer {
    flex-direction: column;
    gap: 4px;
    text-align: center;
    margin-top: 10px;
  }
}

/* Reduced motion: freeze sky at visitor's local phase */
@media (prefers-reduced-motion: reduce) {
  .sun, .moon, .star, .comet { animation: none !important; }
}
