/* ===== Tokens ===== */
:root {
  --bg-void: #07060d;
  --bg-panel: #0f0d1c;
  --accent-electric: #4d9fff;
  --accent-violet: #9b5cff;
  --accent-spark: #d6e8ff;
  --text-primary: #f3f1fa;
  --text-muted: #a7a3c2;
}

/* ===== Fonts ===== */
@font-face {
  font-family: 'Vazirmatn';
  src: url('../assets/fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../assets/fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../assets/fonts/Vazirmatn-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../assets/fonts/Vazirmatn-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}

/* ===== Reset ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }

/* ===== Hero ===== */
.hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg-void);
}

.hero__fog,
.hero__bolts {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.hero__fog { z-index: 0; }
.hero__bolts { z-index: 3; }

/* Ambient glow pooling behind the figure — no ring, no border, just
   light grounding the silhouette against the fog. */
.hero__glow {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(64%, 620px);
  height: 58%;
  background: radial-gradient(ellipse at 50% 100%, rgba(77, 159, 255, 0.24), rgba(155, 92, 255, 0.12) 45%, transparent 75%);
  filter: blur(18px);
  z-index: 1;
}

.hero__photo {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 96%;
  max-width: 86%;
  width: auto;
  object-fit: contain;
  object-position: bottom;
  z-index: 4;
  filter: drop-shadow(0 18px 50px rgba(0, 0, 0, 0.6));
}

/* Big background wordmark — sits behind the photo, poster-style.
   The two words sit on one line and ease apart as the page scrolls
   (see hero-fx.js), so it reads as one calm, deliberate motion rather
   than a layout reflow — driven by a transform, not by animating gap. */
.hero__wordmark {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  text-align: center;
  font-weight: 800;
  font-size: clamp(2.7rem, 13.5vw, 12rem);
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--text-primary);
  text-transform: uppercase;
  white-space: nowrap;
}

.hero__wordmark-word {
  display: inline-block;
  transition: transform 0.15s ease-out;
  will-change: transform;
}
.hero__wordmark-word--left { transform: translateX(calc(-1 * var(--wm-spread, 0px))); }
.hero__wordmark-word--right { transform: translateX(var(--wm-spread, 0px)); }

.hero__scroll-cue {
  position: absolute;
  bottom: clamp(14px, 3vh, 26px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  width: 26px;
  height: 42px;
  border: 2px solid rgba(167, 163, 194, 0.45);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 7px;
  transition: opacity 0.6s ease;
}

.hero__scroll-cue span {
  width: 4px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent-electric);
  animation: hero-scroll-cue 1.6s ease-in-out infinite;
}

.hero__scroll-cue.is-hidden {
  opacity: 0;
}

@keyframes hero-scroll-cue {
  0% { transform: translateY(0); opacity: 1; }
  60% { transform: translateY(12px); opacity: 0.2; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ===== Bio ===== */
.bio {
  background: var(--bg-panel);
  padding: 10vh 1.5rem;
}

.bio__grid {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
}

@media (max-width: 860px) {
  .bio__grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

.bio__paragraph {
  margin: 0 0 1.4rem;
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.95;
  color: var(--text-primary);
}
.bio__paragraph:last-child { margin-bottom: 0; }

.bio__media {
  display: flex;
  justify-content: center;
  perspective: 900px;
}

.tilt {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;
  width: min(100%, 360px);
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.25s ease;
  will-change: transform;
}

.tilt__inner {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(167, 163, 194, 0.18);
  border-radius: 20px;
  background: radial-gradient(ellipse at 50% 30%, rgba(77, 159, 255, 0.18), transparent 65%), var(--bg-void);
  aspect-ratio: 6 / 7;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(155, 92, 255, 0.06);
}

.tilt__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transform: translateZ(40px) scale(1.06);
}

.tilt__glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(240px circle at var(--mx) var(--my), rgba(214, 232, 255, 0.18), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.tilt:hover .tilt__glare { opacity: 1; }

/* ===== Shared ===== */
.eyebrow {
  margin: 0 0 0.75rem;
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--accent-electric);
  text-transform: uppercase;
}

/* ===== Contact ===== */
.contact {
  background: var(--bg-void);
  padding: 10vh 1.5rem;
}

.contact__head,
.contact__form {
  max-width: 560px;
  margin: 0 auto;
}

.contact__title {
  margin: 0 0 0.75rem;
  font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: var(--text-primary);
}

.contact__text {
  margin: 0 0 2.5rem;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
}

.field__label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.field__input {
  font: inherit;
  color: var(--text-primary);
  background: var(--bg-panel);
  border: 1px solid rgba(167, 163, 194, 0.22);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  transition: border-color 0.2s ease;
}
.field__input:focus {
  outline: none;
  border-color: var(--accent-electric);
}
.field__textarea {
  resize: vertical;
  min-height: 120px;
}

.contact__submit {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font: inherit;
  font-weight: 600;
  color: var(--bg-void);
  background: linear-gradient(90deg, var(--accent-electric), var(--accent-violet));
  border: none;
  border-radius: 10px;
  padding: 0.85rem 1.6rem;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.1s ease;
}
.contact__submit:hover { opacity: 0.9; }
.contact__submit:active { transform: translateY(1px); }

.contact__hint {
  margin: 1.1rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.contact__email {
  color: var(--accent-electric);
  text-decoration: none;
}
.contact__email:hover { text-decoration: underline; }

/* ===== Footer ===== */
.footer {
  background: var(--bg-void);
  border-top: 1px solid rgba(167, 163, 194, 0.15);
  padding: 2.5rem 1.5rem 1.5rem;
}

.footer__main {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer__brand-name {
  display: block;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

.footer__motto {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer__social {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.footer__icon {
  display: inline-flex;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.footer__icon:hover,
.footer__icon:focus-visible {
  color: var(--accent-electric);
}

.footer__bottom {
  max-width: 720px;
  margin: 1.75rem auto 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .hero__scroll-cue span { animation: none; }
  .reveal {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .bio__paragraph { font-size: 1.05rem; line-height: 1.85; }
}

/* Phones/portrait viewports: a literal 16:9 box is too short for the
   content. Switch to a taller ratio instead of dropping aspect-ratio
   altogether — without it the box's height is "auto", and percentage
   heights on the absolutely-positioned photo/glow resolve to nothing.
   Placed last so it wins the cascade over the base hero rules above. */
@media (max-aspect-ratio: 4/5) {
  .hero {
    /* Closer to square than 4:5 — the cropped photo is wider than it
       is tall, so a taller box just leaves dead space above it. */
    aspect-ratio: 1 / 1;
    max-height: none;
  }
  .hero__photo { max-width: 96%; }
  .hero__wordmark { gap: 0.41em; }
}
