@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 300;
  font-display: block;
  src: url("fonts/Vazirmatn-Light.woff2") format("woff2");
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("fonts/Vazirmatn-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 600;
  font-display: block;
  src: url("fonts/Vazirmatn-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url("fonts/Vazirmatn-Bold.woff2") format("woff2");
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 800;
  font-display: block;
  src: url("fonts/Vazirmatn-ExtraBold.woff2") format("woff2");
}

:root {
  --bg: #05060a;
  --bg-2: #0a0c16;
  --ink: #f4f5ff;
  --muted: #9aa0b8;
  --violet: #7c5cff;
  --cyan: #22d3ee;
  --rose: #ff5c8a;
  --gold: #ffd479;
  --line: rgba(255, 255, 255, 0.08);
  --font: "Vazirmatn", sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: radial-gradient(120% 90% at 50% -10%, #141a3a 0%, var(--bg-2) 38%, var(--bg) 72%);
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

img,
svg,
canvas {
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

/* ---------- background layers ---------- */
#loom {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

.veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 50% 45%, rgba(124, 92, 255, 0.14), transparent 70%),
    radial-gradient(40% 40% at 80% 80%, rgba(34, 211, 238, 0.1), transparent 70%),
    radial-gradient(40% 40% at 15% 20%, rgba(255, 92, 138, 0.1), transparent 70%);
  mix-blend-mode: screen;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(100% 80% at 50% 50%, transparent 45%, rgba(3, 4, 8, 0.78) 100%);
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 6s steps(6) infinite;
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -2%); }
  80% { transform: translate(3%, 1%); }
}

/* ---------- layout ---------- */
.topbar,
.stage,
.footer {
  position: relative;
  z-index: 4;
}

.topbar {
  position: fixed;
  top: 0;
  inset-inline: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(18px, 3.2vw, 34px) clamp(20px, 4vw, 54px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand__mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.6s;
}

.brand:hover .brand__mark {
  transform: rotate(-8deg) scale(1.06);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.5), 0 12px 40px rgba(124, 92, 255, 0.35);
}

.brand__mark svg { width: 30px; height: 30px; }

.brand__name {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand__name b {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
}

.brand__name i {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.32em;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  color: #d9dcff;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.6);
  animation: pulse 2.2s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.55); }
  70% { box-shadow: 0 0 0 12px rgba(34, 211, 238, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}

/* ---------- hero ---------- */
.stage {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 22px 96px;
  gap: clamp(18px, 2.6vw, 30px);
}

.headline {
  margin: 0;
  font-weight: 800;
  font-size: clamp(40px, 9.2vw, 112px);
  line-height: 1.16;
  letter-spacing: -0.01em;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1vw, 12px);
}

.headline__line {
  display: flex;
  justify-content: center;
  gap: 0.28em;
  flex-wrap: wrap;
}

.word {
  display: inline-block;
  white-space: nowrap;
  background: linear-gradient(180deg, #ffffff 20%, #c9ccf2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  transform: translateY(0.5em);
  clip-path: inset(0 -6% 0 -6%);
  animation: rise 1.05s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(0.35s + var(--i) * 0.13s);
}

.word.accent {
  background: linear-gradient(115deg, var(--violet), var(--cyan) 45%, var(--rose) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  background-size: 220% 100%;
  animation: rise 1.05s cubic-bezier(0.16, 1, 0.3, 1) forwards,
    sheen 5.5s ease-in-out infinite 1.6s;
}

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

@keyframes sheen {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.thread {
  width: min(320px, 62vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  overflow: hidden;
  position: relative;
}

.thread span {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--violet), transparent);
  transform: translateX(-100%);
  animation: weave 3.4s ease-in-out infinite;
}

@keyframes weave {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

.note {
  margin: 0;
  max-width: 34ch;
  font-weight: 300;
  font-size: clamp(14px, 1.7vw, 17px);
  line-height: 2;
  color: var(--muted);
}

/* ---------- footer ---------- */
.footer {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(16px, 2.6vw, 28px) clamp(20px, 4vw, 54px);
  font-size: 12px;
  color: rgba(154, 160, 184, 0.75);
}

.footer__sig {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  line-height: 1.55;
  text-align: left;
}

.footer__sig > span:first-child {
  color: rgba(216, 219, 244, 0.92);
}

.footer__by {
  color: rgba(154, 160, 184, 0.8);
}

.footer__by::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 1px;
  margin-inline-end: 7px;
  vertical-align: middle;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  opacity: 0.7;
}

/* ---------- reveal-on-load ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(10px);
  animation: rise 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.15s;
}

@media (max-width: 520px) {
  .brand__name i { letter-spacing: 0.2em; }
  .footer { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .word, [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ---------- content protection ---------- */
body.is-shielded .topbar,
body.is-shielded .stage,
body.is-shielded .footer {
  filter: blur(22px) saturate(0.4);
  opacity: 0.12;
  transition: none;
}

.shield {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  opacity: 0;
  visibility: hidden;
  background: rgba(5, 6, 10, 0.72);
  backdrop-filter: blur(16px);
  transition: opacity 0.18s ease, visibility 0.18s ease;
  pointer-events: none;
}

body.is-shielded .shield {
  opacity: 1;
  visibility: visible;
}

.shield__mark {
  font-size: 30px;
  color: var(--violet);
  text-shadow: 0 0 26px rgba(124, 92, 255, 0.8);
}

.shield__text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(232, 234, 255, 0.95);
}

.shield__hint {
  margin-top: 4px;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  color: #e9ebff;
  background: rgba(124, 92, 255, 0.18);
  border: 1px solid rgba(124, 92, 255, 0.45);
  box-shadow: 0 0 24px rgba(124, 92, 255, 0.22);
  animation: hintPulse 1.8s ease-in-out infinite;
}

@keyframes hintPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 24px rgba(124, 92, 255, 0.22); }
  50% { transform: scale(1.04); box-shadow: 0 0 34px rgba(124, 92, 255, 0.42); }
}

@media print {
  body > *:not(.print-notice) { display: none !important; }
  .print-notice {
    display: block !important;
    position: static;
    padding: 40px;
    font-family: var(--font);
    color: #000;
    text-align: center;
  }
  body {
    background: #fff !important;
    overflow: visible;
  }
}

.print-notice { display: none; }
