/* =============================================================
   Omni Agent — styles.css
   A dormant terminal in the dark. Amber phosphor on void black,
   one breathing iris, everything else quiet.
   ============================================================= */

:root {
  --void: #030302;
  --void-2: #0a0806;

  /* amber phosphor accent — split into a bright core tone (glow, cursor)
     and a mid tone (small text) so text meets a comfortable contrast
     floor while the glow itself can stay saturated. */
  --phosphor: #ffb02e;
  --phosphor-rgb: 255, 176, 46;
  --phosphor-mid: #cc7e00;
  --phosphor-dim: #7a5013;
  --phosphor-dim-rgb: 122, 80, 19;
  --phosphor-glow: rgba(var(--phosphor-rgb), 0.05);

  /* warm greys — same split: a readable tone for actual sentences,
     a quieter tone for the whisper/corner labels, and a faint tone
     reserved for decorative strokework only. */
  --ash: #d8d4c9;
  --ash-dim: #948e7f;
  --ash-whisper: #8c846e;
  --ash-faint: #403c33;

  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;
  --font-whisper: "Newsreader", Georgia, serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

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

html,
body {
  height: 100%;
}

html {
  overflow: hidden;
  color-scheme: dark;
}

body {
  background: var(--void);
  color: var(--ash);
  font-family: var(--font-display);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow: hidden; /* no scroll, ever — layout is fluid-sized to always fit the viewport */
  display: flex;
  flex-direction: column;
}

::selection {
  background: rgba(var(--phosphor-rgb), 0.28);
  color: var(--void);
}

:focus-visible {
  outline: 1px solid var(--phosphor);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------- atmosphere */

.vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(560px 420px at 50% 42%, rgba(var(--phosphor-dim-rgb), 0.16), transparent 65%),
    radial-gradient(100% 100% at 50% 50%, transparent 45%, var(--void) 100%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.scanline {
  position: fixed;
  left: 0;
  right: 0;
  height: 140px;
  z-index: 2;
  pointer-events: none;
  top: -140px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--phosphor-glow) 45%,
    var(--phosphor-glow) 55%,
    transparent
  );
  animation: scan-sweep 9s linear infinite;
}

@keyframes scan-sweep {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(calc(100vh + 140px));
  }
}

/* ------------------------------------------------------------- stage */

.stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

/* ------------------------------------------------------------- iris */

.iris-wrap {
  width: clamp(110px, 22vw, 200px);
  margin-bottom: clamp(20px, 4vw, 36px);

  --iris-x: 0px;
  --iris-y: 0px;

  transform: translate(
    var(--iris-x),
    var(--iris-y)
  );

  transition: transform 0.6s var(--ease);

  filter: drop-shadow(
    0 0 18px rgba(var(--phosphor-rgb), 0.22)
  );
}

.iris {
  width: 100%;
  height: auto;
  overflow: visible;
}

.iris-outer {
  transform-origin: 120px 120px;
  animation: iris-rotate 120s linear infinite;
}

.ring-outer {
  fill: none;
  stroke: var(--ash-faint);
  stroke-width: 1;
}

.tick {
  stroke: var(--ash-faint);
  stroke-width: 1.5;
}

.tick-major {
  stroke: var(--phosphor-dim);
  stroke-width: 2;
}

.ring-mid {
  fill: none;
  stroke: var(--phosphor-dim);
  stroke-width: 1;
  stroke-dasharray: 2 10;
  transform-origin: 120px 120px;
  animation: iris-rotate-reverse 70s linear infinite;
}

.ring-core-halo {
  fill: var(--phosphor);
  opacity: 0.18;
  transform-origin: 120px 120px;
  animation: iris-breathe 4.5s var(--ease) infinite;
}

.ring-core {
  fill: var(--phosphor);
  transform-origin: 120px 120px;
  animation: iris-breathe 4.5s var(--ease) infinite;
}

@keyframes iris-rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes iris-rotate-reverse {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

@keyframes iris-breathe {
  0%,
  100% {
    transform: scale(0.88);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

.ring-core-halo {
  animation-name: iris-breathe-halo;
}

@keyframes iris-breathe-halo {
  0%,
  100% {
    transform: scale(0.85);
    opacity: 0.1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.26;
  }
}

/* ------------------------------------------------------------- type */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--phosphor-mid);
  margin-bottom: clamp(14px, 3vw, 22px);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1;
  color: var(--ash);
}

.wordmark-omni {
  display: block;
  font-size: clamp(2.6rem, 9vw, 5.4rem);
  letter-spacing: 0.16em;
  padding-left: 0.16em; /* optically re-center the tracked text */
}

.wordmark-agent {
  display: block;
  font-size: clamp(1.18rem, 3.1vw, 1.82rem);
  font-weight: 300;
  letter-spacing: 0.68em;
  padding-left: 0.68em;
  color: var(--phosphor-mid);
  margin-top: clamp(6px, 1.4vw, 12px);
  opacity: 0; /* JS will trigger flicker-in */
}

.terminal-line {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--ash-dim);
  margin-top: clamp(28px, 5vw, 44px);
  min-height: 1.4em;
  letter-spacing: 0.01em;
}

.cursor-block {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--phosphor);
  margin-left: 2px;
  transform: translateY(0.14em);
  animation: cursor-blink 1s step-end infinite;
}

@keyframes cursor-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.whisper {
  font-family: var(--font-whisper);
  font-style: italic;
  font-weight: 400;
  font-size: 0.92rem;
  color: var(--ash-whisper);
  max-width: 22ch;
  text-wrap: balance;
  margin: clamp(30px, 6vw, 52px) auto 0;
}

/* ------------------------------------------------------------- footer */

.site-footer {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 22px calc(18px + var(--safe-b));
  padding-left: calc(22px + var(--safe-l));
  padding-right: calc(22px + var(--safe-r));
  border-top: 1px solid var(--ash-faint);
}

.footer-domain,
.footer-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--ash-whisper);
}

.footer-meta {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.footer-contact {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--phosphor-mid);
  border-bottom: 1px solid rgba(var(--phosphor-dim-rgb), 0.4);
  padding-bottom: 2px;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.footer-contact:hover {
  color: var(--phosphor);
  border-color: var(--phosphor-mid);
}

@media (max-width: 560px) {
  .footer-domain,
  .footer-meta,
  .footer-contact {
    font-size: 0.62rem;
  }
  .site-footer {
    justify-content: center;
    text-align: center;
    gap: 8px 20px;
    padding-left: calc(14px + var(--safe-l));
    padding-right: calc(14px + var(--safe-r));
  }
  .footer-meta {
    margin: 0;
    width: 100%;
    text-align: center;
  }
}

/* short viewports (landscape phones) — tighten vertical rhythm rather
   than letting anything crowd the footer or clip. */
@media (max-height: 620px) {
  .iris-wrap {
    width: clamp(80px, 16vw, 120px);
    margin-bottom: clamp(10px, 2.5vw, 18px);
  }
  .wordmark-omni {
    font-size: clamp(2rem, 7vw, 3.2rem);
  }
  .eyebrow {
    margin-bottom: clamp(8px, 2vw, 14px);
  }
  .terminal-line {
    margin-top: clamp(14px, 3vw, 22px);
  }
  .whisper {
    margin-top: clamp(14px, 3vw, 24px);
  }
  .site-footer {
    padding-top: 12px;
    padding-bottom: calc(12px + var(--safe-b));
  }
}

/* ------------------------------------------------------------- boot sequence */

@keyframes boot-in {
  from {
    opacity: 0;
    translate: 0 8px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

.stage > * {
  animation-name: boot-in;
  animation-duration: 0.9s;
  animation-timing-function: var(--ease);
  animation-fill-mode: backwards; /* only holds the *pre-start* state, so JS-driven
                                      transforms (iris parallax) aren't fought after */
}

.stage > .iris-wrap {
  animation-delay: 0s;
}
.stage > .eyebrow {
  animation-delay: 0.2s;
}
.stage > .wordmark {
  animation-delay: 0.38s;
}
.stage > .terminal-line {
  animation-delay: 0.56s;
}
.stage > .whisper {
  animation-delay: 0.85s;
}

.site-footer {
  animation: boot-in 0.9s var(--ease) 1.1s backwards;
}

/* ------------------------------------------------------------- fluorescent flicker */

@keyframes flicker-on {
  0%   { opacity: 0; }
  8%   { opacity: 0.9; }
  10%  { opacity: 0; }
  12%  { opacity: 0.85; }
  13%  { opacity: 0; }
  20%  { opacity: 0; }
  22%  { opacity: 1; }
  24%  { opacity: 0.1; }
  26%  { opacity: 1; }
  28%  { opacity: 0; }
  35%  { opacity: 0; }
  40%  { opacity: 0.95; }
  42%  { opacity: 0.6; }
  44%  { opacity: 1; }
  48%  { opacity: 0.2; }
  52%  { opacity: 1; }
  56%  { opacity: 0.4; }
  60%  { opacity: 1; }
  65%  { opacity: 0.7; }
  70%  { opacity: 1; }
  80%  { opacity: 0.9; }
  85%  { opacity: 1; }
  90%  { opacity: 0.95; }
  100% { opacity: 1; }
}

.wordmark-agent.flicker-in {
  animation: flicker-on 1.8s var(--ease) forwards;
}

/* ------------------------------------------------------------- easter egg modal */

.love-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 3, 2, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.love-modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.love-modal {
  position: relative;
  text-align: center;
  padding: clamp(40px, 8vw, 72px) clamp(32px, 7vw, 64px);
  max-width: 420px;
  width: 90vw;
}

.love-heart {
  font-size: clamp(3.5rem, 12vw, 6rem);
  display: block;
  line-height: 1;
  margin-bottom: clamp(18px, 4vw, 28px);
  transform-origin: center;
  animation: heartbeat 0.88s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  will-change: transform;
  filter: drop-shadow(0 0 24px rgba(220, 60, 80, 0.7));
}

@keyframes heartbeat {
  0%   { transform: scale(1); }
  14%  { transform: scale(1.22); }
  28%  { transform: scale(1); }
  42%  { transform: scale(1.16); }
  70%  { transform: scale(1); }
  100% { transform: scale(1); }
}

.love-text {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  color: var(--ash);
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.love-text em {
  display: block;
  font-style: italic;
  font-family: var(--font-whisper);
  color: var(--phosphor);
  font-size: clamp(1.8rem, 5.5vw, 3rem);
  margin-top: 4px;
  text-shadow:
    0 0 18px rgba(var(--phosphor-rgb), 0.55),
    0 0 40px rgba(var(--phosphor-rgb), 0.22);
}

.love-whisper {
  font-family: var(--font-whisper);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--ash-whisper);
  margin-top: clamp(20px, 4vw, 28px);
  opacity: 0.8;
}

/* modal entrance */
.love-modal-overlay.visible .love-modal {
  animation: modal-rise 0.55s var(--ease) forwards;
}

@keyframes modal-rise {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ------------------------------------------------------------- motion & accessibility */

@media (prefers-reduced-motion: reduce) {
  .iris-outer,
  .ring-mid,
  .ring-core-halo,
  .ring-core,
  .cursor-block,
  .scanline,
  .stage > *,
  .site-footer {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
  .ring-core-halo {
    opacity: 0.18;
  }
  .wordmark-agent {
    opacity: 1;
    animation: none !important;
  }
  .love-heart {
    animation: none !important;
  }
}