/* ==========================================================================
   phlo.cloud — Dark Noir Phloem Vascular Mesh Stealth Page
   Ultra-minimal, organic, hyper-responsive (mobile portrait/landscape to 4K)
   ========================================================================== */

:root {
  --void: #030404;
  --ink: #eef3f0;
  --ink-soft: rgba(206, 220, 212, 0.56);
  --ink-whisper: rgba(168, 184, 175, 0.3);

  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease-organic: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  background-color: var(--void);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  position: relative;
  width: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
  background: radial-gradient(ellipse 84% 74% at 50% 48%, #090e0c 0%, #040605 56%, #020303 100%);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: rgba(182, 208, 194, 0.2);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   Nocturnal Botanical Noir Atmosphere (Subtle Organic Chiaroscuro)
   -------------------------------------------------------------------------- */

.noir-atmosphere {
  position: fixed;
  inset: -25%;
  z-index: 0;
  pointer-events: none;
  filter: blur(105px) saturate(0.75);
  opacity: 0.86;
}

.smoke {
  position: absolute;
  border-radius: 46% 54% 50% 50% / 52% 44% 56% 48%;
  will-change: transform, opacity;
}

.smoke--1 {
  width: clamp(24rem, 62vw, 66rem);
  height: clamp(20rem, 52vw, 54rem);
  top: 12%;
  left: 16%;
  background: radial-gradient(
    ellipse at 45% 45%,
    rgba(96, 128, 112, 0.16) 0%,
    rgba(36, 54, 46, 0.08) 46%,
    rgba(3, 4, 4, 0) 74%
  );
  animation: driftOne 28s ease-in-out infinite alternate;
}

.smoke--2 {
  width: clamp(22rem, 56vw, 58rem);
  height: clamp(22rem, 54vw, 56rem);
  bottom: 2%;
  right: 10%;
  background: radial-gradient(
    ellipse at 52% 52%,
    rgba(74, 102, 90, 0.15) 0%,
    rgba(28, 42, 36, 0.07) 48%,
    rgba(3, 4, 4, 0) 74%
  );
  animation: driftTwo 34s ease-in-out infinite alternate;
}

.smoke--3 {
  width: clamp(18rem, 44vw, 46rem);
  height: clamp(16rem, 38vw, 40rem);
  top: 38%;
  left: 52%;
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(146, 168, 156, 0.09) 0%,
    rgba(46, 62, 54, 0.04) 50%,
    rgba(3, 4, 4, 0) 75%
  );
  animation: driftThree 22s ease-in-out infinite alternate;
}

@keyframes driftOne {
  0% { transform: translate(-6%, -4%) rotate(0deg) scale(1); opacity: 0.7; }
  50% { transform: translate(7%, 6%) rotate(16deg) scale(1.1); opacity: 0.95; }
  100% { transform: translate(-2%, 9%) rotate(-12deg) scale(0.95); opacity: 0.78; }
}

@keyframes driftTwo {
  0% { transform: translate(4%, 6%) rotate(0deg) scale(1.04); opacity: 0.68; }
  50% { transform: translate(-8%, -5%) rotate(-18deg) scale(0.96); opacity: 0.92; }
  100% { transform: translate(6%, -10%) rotate(14deg) scale(1.12); opacity: 0.74; }
}

@keyframes driftThree {
  0% { transform: translate(-45%, -30%) rotate(0deg) scale(0.92); opacity: 0.58; }
  100% { transform: translate(-55%, -18%) rotate(24deg) scale(1.14); opacity: 0.9; }
}

/* --------------------------------------------------------------------------
   Living Organic Phloem Vascular Mesh Canvas
   -------------------------------------------------------------------------- */

.noir-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
  touch-action: none;
}

/* --------------------------------------------------------------------------
   Noir Chiaroscuro Vignette & Fine 35mm Grain
   -------------------------------------------------------------------------- */

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 74% 68% at 50% 49%, rgba(3, 4, 4, 0) 18%, rgba(2, 3, 3, 0.7) 78%, rgba(1, 2, 2, 0.96) 100%);
}

.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 3;
  pointer-events: none;
  opacity: 0.048;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 210px 210px;
  animation: grainDrift 7s steps(5) infinite;
}

@keyframes grainDrift {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-1.8%, 1.4%); }
  50% { transform: translate(1.4%, -1.8%); }
  75% { transform: translate(-1.2%, -1.2%); }
}

/* --------------------------------------------------------------------------
   Minimal Stealth Stage
   -------------------------------------------------------------------------- */

.stage {
  position: relative;
  z-index: 4;
  height: 100dvh;
  width: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
  padding-top: calc(clamp(1.25rem, 4vh, 2.5rem) + env(safe-area-inset-top));
  padding-bottom: calc(clamp(1.25rem, 4vh, 2.5rem) + env(safe-area-inset-bottom));
  padding-left: calc(clamp(1.25rem, 5vw, 3rem) + env(safe-area-inset-left));
  padding-right: calc(clamp(1.25rem, 5vw, 3rem) + env(safe-area-inset-right));
  pointer-events: none;
}

.centerpiece {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(1rem, 2.6vh, 1.75rem);
  transform: translateY(-2.5vh);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(4.25rem, 16vw, 9.75rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  background: linear-gradient(
    180deg,
    rgba(246, 250, 248, 0.96) 0%,
    rgba(212, 226, 218, 0.88) 48%,
    rgba(124, 148, 136, 0.5) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 22px 58px rgba(0, 0, 0, 0.96));
}

.stealth-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: clamp(0.68rem, 1.6vw, 0.78rem);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-left: 0.34em;
}

.pulse-dot {
  position: relative;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(206, 228, 216, 0.92);
  box-shadow: 0 0 12px rgba(186, 218, 200, 0.75);
  animation: breatheDot 3.8s ease-in-out infinite;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid rgba(190, 220, 204, 0.36);
  animation: haloPulse 3.8s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

@keyframes breatheDot {
  0%, 100% { opacity: 0.52; }
  50% { opacity: 1; }
}

@keyframes haloPulse {
  0% { transform: scale(0.5); opacity: 0.78; }
  75% { transform: scale(2.4); opacity: 0; }
  100% { transform: scale(2.4); opacity: 0; }
}

.whisper {
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: clamp(0.64rem, 1.35vw, 0.72rem);
  letter-spacing: 0.24em;
  text-transform: lowercase;
  color: var(--ink-whisper);
  padding-left: 0.24em;
}

/* --------------------------------------------------------------------------
   Entrance Choreography
   -------------------------------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  animation: revealOrganic 1.25s var(--ease-organic) forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes revealOrganic {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   Short Landscape Phones & Reduced Motion
   -------------------------------------------------------------------------- */

@media (max-height: 460px) {
  .centerpiece {
    gap: 0.75rem;
    transform: translateY(0);
  }

  .wordmark {
    font-size: clamp(3.25rem, 14vh, 5.25rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .smoke,
  .grain,
  .pulse-dot,
  .pulse-dot::after {
    animation: none !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    animation: none;
  }
}
