/* ============================================================
   Sean — Web Development
   Grayscale technical landing page
   ============================================================ */

:root {
  --bg: #0a0a0a;
  --bg-2: #101010;
  --fg: #f4f4f5;
  --muted: #8a8a8f;
  --dim: #5a5a5f;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #ffffff;

  --font-sans: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* fluid type */
  --title-size: clamp(3.25rem, 16vw, 11rem);
  --sub-size: clamp(1rem, 4.2vw, 2.1rem);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  background: radial-gradient(120% 120% at 50% 0%, var(--bg-2) 0%, var(--bg) 60%);
  color: var(--fg);
  font-family: var(--font-sans);
  overflow: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    100% 100% at 50% 45%,
    transparent 55%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

/* subtle moving scanline for a "technical" feel */
.scanline {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.015) 0px,
    rgba(255, 255, 255, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

/* ---------- Layout ---------- */
.stage {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 4rem);
  padding-top: max(clamp(1.5rem, 5vw, 4rem), env(safe-area-inset-top));
  padding-bottom: max(clamp(1.5rem, 5vw, 4rem), env(safe-area-inset-bottom));
  padding-left: max(clamp(1.5rem, 5vw, 4rem), env(safe-area-inset-left));
  padding-right: max(clamp(1.5rem, 5vw, 4rem), env(safe-area-inset-right));
}

.brand {
  margin-top: auto;
  margin-bottom: auto;
}

/* ---------- Eyebrow ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 2.6vw, 0.85rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(1rem, 3vw, 1.75rem);
}

.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px 1px rgba(255, 255, 255, 0.6);
}

/* ---------- Title ---------- */
.title {
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.03em;
  perspective: 900px;
}

.title .line {
  display: block;
}

.title .name {
  font-size: var(--title-size);
}

/* gradient for the name — applies to the whole line (no-JS fallback)
   and to each split character */
.title .name,
.title .name .char {
  background: linear-gradient(180deg, #ffffff 0%, #b8b8bd 60%, #6d6d72 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* per-character / per-word wrappers created by JS */
.title .name .word {
  display: inline-block;
  white-space: nowrap;
}

.title .name .char {
  display: inline-block;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, opacity;
}

.title .name .space {
  display: inline-block;
}

.title .sub {
  font-size: var(--sub-size);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-top: clamp(0.4rem, 1.5vw, 0.9rem);
  text-transform: uppercase;
}

/* ---------- Links ---------- */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(2rem, 6vw, 3.25rem);
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 48px; /* touch target */
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color 0.25s ease, background 0.25s ease,
    transform 0.25s ease, color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.link svg {
  color: var(--muted);
  transition: color 0.25s ease, transform 0.25s ease;
}

@media (hover: hover) {
  .link:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
  }
  .link:hover svg {
    color: var(--fg);
    transform: rotate(-8deg);
  }
}

.link:active {
  transform: translateY(0) scale(0.98);
}

.link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Footer ---------- */
.footer {
  position: absolute;
  left: max(clamp(1.5rem, 5vw, 4rem), env(safe-area-inset-left));
  right: max(clamp(1.5rem, 5vw, 4rem), env(safe-area-inset-right));
  bottom: max(clamp(1.25rem, 4vw, 2.5rem), env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.footer .tag {
  color: var(--muted);
}

.footer .status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cfcfd4;
  box-shadow: 0 0 0 0 rgba(207, 207, 212, 0.6);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(207, 207, 212, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(207, 207, 212, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(207, 207, 212, 0);
  }
}

/* initial state for JS-animated elements (hidden before GSAP runs) */
.js [data-anim] {
  opacity: 0;
  will-change: transform, opacity;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .scanline,
  .pulse {
    animation: none;
  }
  .js [data-anim] {
    opacity: 1;
  }
}

/* very small / short screens: tighten spacing */
@media (max-height: 560px) {
  .eyebrow {
    margin-bottom: 0.75rem;
  }
  .links {
    margin-top: 1.5rem;
  }
  .footer {
    display: none;
  }
}
