/* ============================================================
   EARLIAN SOLUTIONS — Coming Soon
   "Earlian" draws itself · "Solutions" arrives by stamp
   ============================================================ */

:root {
  --paper:      #F5F1E6;
  --paper-deep: #EDE7D8;
  --ink:        #1C1A16;
  --ink-soft:   #57524A;
  --accent:     #1E9BD8;   /* azure — from the Messages video sky */
  --coral:      #F0715A;   /* coral — the tee tint in the video */
  --rule:       #C9C1AE;
  --serif: "Permanent Marker", "Comic Sans MS", cursive;
  --sans:  "Special Elite", "Courier New", monospace;
}

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

html, body { height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 3D vault background ---------- */
#vault {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  filter: blur(12px) saturate(0.85);
  opacity: 0.55;
}
.scroll-space { height: 650vh; }

/* ---------- Mantra ticker ---------- */
.ticker {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
  padding: 10px 0;
  opacity: 0;
  animation: fadeUp 1.4s ease 6.2s forwards;
}
.ticker-inner {
  display: inline-flex;
  white-space: nowrap;
  animation: tick 55s linear infinite;
}
.ticker-inner span {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.55;
}
@keyframes tick {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Wordmark glitch (chromatic split, like the video cuts) ---------- */
.word-svg {
  animation: glitch 9s steps(1) 8s infinite;
}
@keyframes glitch {
  0%, 91.9%, 94.1%, 100% { filter: none; transform: translate(0, 0); }
  92%   { filter: drop-shadow(3px 0 0 rgba(30,155,216,0.75)) drop-shadow(-3px 0 0 rgba(240,113,90,0.75)); transform: translate(-2px, 1px); }
  93%   { filter: drop-shadow(-4px 0 0 rgba(30,155,216,0.75)) drop-shadow(4px 0 0 rgba(240,113,90,0.75)); transform: translate(2px, -1px); }
  94%   { filter: drop-shadow(2px 0 0 rgba(30,155,216,0.6)) drop-shadow(-2px 0 0 rgba(240,113,90,0.6)); transform: translate(0, 0); }
}

::selection { background: var(--accent); color: var(--paper); }

/* ---------- Stage ---------- */
.stage {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  pointer-events: none;
  animation: stageSettle 1.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes stageSettle {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Kicker ---------- */
.kicker {
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
  opacity: 0;
  animation: fadeUp 1.2s ease 0.5s forwards;
}

/* ---------- "Earlian" — drawn, then filled ---------- */
.word-svg {
  width: min(78vw, 640px);
  height: auto;
  display: block;
  margin: 0 auto;
  overflow: visible;
}
.draw-text {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 148px;
  fill: var(--ink);
  fill-opacity: 0;
  stroke: var(--ink);
  stroke-width: 1.1;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation:
    draw 3s cubic-bezier(0.5, 0, 0.2, 1) 0.7s forwards,
    fillIn 1.4s ease 2.9s forwards;
}
@keyframes draw {
  to { stroke-dashoffset: 0; }
}
@keyframes fillIn {
  to { fill-opacity: 1; }
}

/* ---------- Rule ---------- */
.mid-rule {
  height: 1px;
  background: var(--rule);
  width: 0;
  margin: 10px auto 26px;
  animation: ruleGrow 1.1s cubic-bezier(0.22, 1, 0.36, 1) 3.1s forwards;
}
@keyframes ruleGrow {
  to { width: min(52vw, 340px); }
}

/* ---------- "Solutions" — stamped letter by letter ---------- */
.solutions {
  font-family: var(--serif);
  font-size: clamp(17px, 2.8vw, 24px);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-right: -0.28em; /* optically recenter letterspaced text */
}
.solutions span {
  display: inline-block;
  opacity: 0;
  transform: scale(1.6);
  filter: blur(2px);
  animation: stamp 0.45s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
  animation-delay: calc(3.6s + var(--i) * 0.09s);
}
@keyframes stamp {
  60% { opacity: 1; transform: scale(0.94); filter: blur(0); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

/* ---------- Tagline ---------- */
.tagline {
  font-family: var(--serif);
  font-size: clamp(15px, 2vw, 19px);
  color: var(--ink-soft);
  margin-top: 34px;
  transform: rotate(-1.2deg);
  opacity: 0;
  animation: fadeUp 1.4s ease 5s forwards;
}

/* ---------- Footer ---------- */
.soon-footer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 22px 28px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0;
  animation: fadeUp 1.4s ease 5.6s forwards;
}
.footer-links a {
  color: var(--ink-soft);
  text-decoration: none;
  margin-left: 24px;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.footer-links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- Shared motion ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Vignette ---------- */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(28, 26, 22, 0.08) 100%);
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .draw-text { font-size: 200px; }
  .word-svg { width: 92vw; }
  .soon-footer {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding-bottom: 26px;
  }
  .footer-links a { margin: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01s !important;
    animation-delay: 0s !important;
  }
}
