/* =====================================================================
   ANDREW JASPERSON — stark, bold grotesque portfolio
   Plain CSS. No build step. Edit freely.
   ===================================================================== */

/* ---- Design tokens ---- */
:root {
  --bg:        #0a0a0a;   /* near-black */
  --fg:        #f4f4f0;   /* off-white  */
  --fg-dim:    #8a8a86;   /* muted text */
  --line:      #2a2a28;   /* hairlines  */
  --accent:    #c5ff00;   /* acid green — hover highlight + selection */

  --font-display: "Anton", "Arial Narrow", "Helvetica Neue", sans-serif;
  --font-grotesk: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;

  --pad: clamp(1.25rem, 4vw, 4rem);
  --ease: cubic-bezier(0.76, 0, 0.24, 1);
  --dur: 0.7s;
}

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

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-grotesk);
  min-height: 100vh;
  overflow-x: hidden;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

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

[hidden] { display: none !important; }

/* =====================================================================
   TOP BAR
   ===================================================================== */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem var(--pad);
  mix-blend-mode: difference;        /* stays legible over any backdrop */
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.topbar__brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}

.topbar__nav { display: flex; gap: 1.75rem; }

.topbar__link {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  position: relative;
}
.topbar__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.topbar__link:hover::after { transform: scaleX(1); }

/* Hide brand on landing (the whole screen is already the name) */
body[data-view="landing"] .topbar__brand { opacity: 0; pointer-events: none; }

/* =====================================================================
   LANDING
   ===================================================================== */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  padding: var(--pad);
  position: relative;
  overflow: hidden;             /* clip the J that hangs off the left edge */
}

.landing__name {
  font-family: var(--font-display);
  line-height: 0.82;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  font-size: clamp(4rem, 18vw, 18rem);
  margin-left: -0.06em;         /* push left so JASPERSON's J clips off-screen */
}
.landing__line { display: block; }

.landing__name .landing__line {
  transition: transform 0.5s var(--ease), opacity 0.5s var(--ease);
}
.landing__name:hover .landing__line:first-child { transform: translateX(-0.04em); }
.landing__name:hover .landing__line:last-child  { transform: translateX(0.04em); }

.landing__enter {
  position: absolute;
  left: var(--pad);
  bottom: clamp(1.5rem, 4vh, 3rem);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-dim);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }

/* =====================================================================
   WORK INDEX
   ===================================================================== */
.work {
  min-height: 100vh;
  padding: clamp(6rem, 14vh, 9rem) var(--pad) var(--pad);
}

.work__heading {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 5rem);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--line);
  padding-bottom: clamp(1rem, 3vw, 2rem);
  margin-bottom: 0.5rem;
}

.work__list { list-style: none; }

.work__item {
  border-bottom: 1px solid var(--line);
}

.work__row {
  width: 100%;
  display: grid;
  grid-template-columns: 4rem 1fr auto;
  align-items: baseline;
  gap: 1.5rem;
  padding: clamp(1rem, 3.5vw, 2.4rem) 0;
  text-align: left;
  transition: padding 0.5s var(--ease), color 0.4s var(--ease);
}
.work__row:hover { padding-left: clamp(0.5rem, 2vw, 2rem); }

.work__num {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
}

.work__title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 7vw, 5.5rem);
  line-height: 0.9;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  transition: transform 0.5s var(--ease), opacity 0.4s var(--ease);
}
.work__row:hover .work__title { transform: translateX(0.5rem); }

/* Dim the other rows when one is hovered */
.work__list:hover .work__title { opacity: 0.35; }
.work__list .work__row:hover .work__title { opacity: 1; color: var(--accent); }

.work__year {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  white-space: nowrap;
}

/* =====================================================================
   CURSOR-FOLLOWING PREVIEW
   ===================================================================== */
.preview {
  position: fixed;
  top: 0; left: 0;
  z-index: 40;
  width: clamp(180px, 22vw, 340px);
  aspect-ratio: 4 / 3;                 /* CRT tube proportions */
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  transition: opacity 0.35s var(--ease), transform 0.45s var(--ease);
  overflow: hidden;
  border-radius: 10px / 14px;          /* faint tube curvature */
}
.preview.is-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* The picture itself — oversaturated, slightly blown out like an old tube */
.preview__media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(2.2) contrast(1.25) brightness(1.08);
  animation: crt-jitter 3.2s steps(1) infinite;
}

/* Scanlines — fine dark horizontal lines that drift downward */
.preview::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0)    0px,
    rgba(0, 0, 0, 0)    2px,
    rgba(0, 0, 0, 0.38) 3px,
    rgba(0, 0, 0, 0.38) 4px
  );
  mix-blend-mode: multiply;
  animation: crt-scan 7s linear infinite;
}

/* Convergence color-fringing on the edges + vignette + flicker */
.preview::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(120% 120% at 50% 50%,
              transparent 52%, rgba(0, 0, 0, 0.55) 100%);
  box-shadow:
    inset 3px 0 7px -2px rgba(255, 0, 90, 0.55),
    inset -3px 0 7px -2px rgba(0, 200, 255, 0.55),
    inset 0 0 22px rgba(0, 0, 0, 0.5);
  mix-blend-mode: screen;
  animation: crt-flicker 0.13s steps(2) infinite;
}

@keyframes crt-scan   { from { background-position-y: 0; } to { background-position-y: 4px; } }
@keyframes crt-flicker{ 0%,100% { opacity: 0.92; } 50% { opacity: 1; } }
@keyframes crt-jitter { 0%,93%,100% { transform: translateX(0); } 95% { transform: translateX(-1px); } 97% { transform: translateX(1px); } }

/* =====================================================================
   DETAIL OVERLAY
   ===================================================================== */
.detail,
.about,
.contact {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  overflow-y: auto;
  padding: clamp(5rem, 12vh, 7rem) var(--pad) var(--pad);
}

.detail__close {
  position: fixed;
  top: 1.1rem;
  right: var(--pad);
  z-index: 70;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  mix-blend-mode: difference;
}
.detail__close::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.detail__close:hover::after { transform: scaleX(1); }

.detail__head {
  border-bottom: 1px solid var(--line);
  padding-bottom: clamp(1.5rem, 4vw, 3rem);
  margin-bottom: clamp(1.5rem, 4vw, 3rem);
}
.detail__index { font-size: 0.85rem; letter-spacing: 0.1em; color: var(--fg-dim); }
.detail__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 13vw, 11rem);
  line-height: 0.86;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin: 0.4rem 0 1.25rem;
}
.detail__meta {
  display: flex;
  gap: 2rem;
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.detail__tagline {
  margin-top: 1.25rem;
  font-size: clamp(1.1rem, 2.4vw, 1.75rem);
  max-width: 48ch;
  line-height: 1.25;
}

.detail__body {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}
.detail__desc {
  max-width: 60ch;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.6;
  color: #d6d6d2;
}
.detail__media { display: grid; gap: clamp(0.75rem, 2vw, 1.5rem); }
.detail__media .block { width: 100%; aspect-ratio: 16 / 9; }
.detail__media .block--tall { aspect-ratio: 3 / 4; }

/* Responsive video embed (Vimeo) */
.detail__media .embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}
.detail__media .embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Audio player */
.detail__media .audio {
  border: 1px solid var(--line);
  padding: clamp(1rem, 3vw, 1.75rem);
  display: grid;
  gap: 0.75rem;
}
.detail__media .audio__label {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.detail__media .audio audio { width: 100%; }

/* Real images, when you add them */
.detail__media img { width: 100%; height: auto; display: block; }

/* =====================================================================
   ABOUT
   ===================================================================== */
.about__inner { max-width: 60ch; }
.about__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 10vw, 7rem);
  text-transform: uppercase;
  line-height: 0.9;
  margin-bottom: 2rem;
}
.about__lead { font-size: clamp(1.25rem, 2.6vw, 2rem); line-height: 1.3; margin-bottom: 2.5rem; }

.about__link {
  color: inherit;
  text-decoration: none;
  border-bottom: 2px solid var(--line);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.about__link:hover { color: var(--accent); border-color: var(--accent); }
.about__body { color: var(--fg-dim); margin-bottom: 2rem; line-height: 1.6; }
.about__contact {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 4vw, 2.5rem);
  color: var(--fg);
  text-decoration: none;
  text-transform: uppercase;
  border-bottom: 2px solid var(--fg);
  padding-bottom: 0.1em;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.about__contact:hover { color: var(--accent); border-color: var(--accent); }

/* =====================================================================
   CONTACT
   ===================================================================== */
.contact__inner { max-width: 52ch; }

.contact__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 10vw, 7rem);
  text-transform: uppercase;
  line-height: 0.9;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.contact__form { display: grid; gap: clamp(1.5rem, 4vw, 2.5rem); }

.contact__field { display: grid; gap: 0.6rem; }

.contact__label {
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.contact input,
.contact textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  font-family: var(--font-grotesk);
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  padding: 0.65rem 0;
  outline: none;
  transition: border-color 0.3s var(--ease);
}
.contact textarea { resize: vertical; min-height: 7rem; line-height: 1.4; }

.contact input::placeholder,
.contact textarea::placeholder { color: #5a5a56; }

.contact input:focus,
.contact textarea:focus { border-color: var(--accent); }

/* Honeypot — visually and acoustically hidden, but bots still fill it */
.contact__honey {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.contact__submit {
  justify-self: start;
  margin-top: 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 3rem);
  text-transform: uppercase;
  color: var(--fg);
  border: 2px solid var(--fg);
  padding: 0.35em 0.8em;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.contact__submit:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.contact__success-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 5rem);
  text-transform: uppercase;
  color: var(--accent);
  line-height: 0.9;
  margin-bottom: 1rem;
}
.contact__success-body { color: var(--fg-dim); font-size: 1.1rem; }

/* =====================================================================
   PLACEHOLDER MEDIA BLOCKS (replace with real <img>/<video>)
   ===================================================================== */
.block {
  background: #161614;
  position: relative;
  overflow: hidden;
}
.block[data-fill] { background: var(--fill); }
.block::after {
  content: attr(data-label);
  position: absolute;
  inset: auto auto 0.75rem 0.9rem;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244,244,240,0.45);
}

/* =====================================================================
   TRANSITION WIPE
   ===================================================================== */
.wipe {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--fg);
  transform: scaleY(0);
  transform-origin: bottom;
  pointer-events: none;
}

/* =====================================================================
   ENTRANCE ANIMATIONS (driven by .is-entering class from JS)
   ===================================================================== */
.work.is-entering .work__heading,
.work.is-entering .work__item {
  animation: rise 0.7s var(--ease) both;
}
.work.is-entering .work__item:nth-child(1) { animation-delay: 0.05s; }
.work.is-entering .work__item:nth-child(2) { animation-delay: 0.10s; }
.work.is-entering .work__item:nth-child(3) { animation-delay: 0.15s; }
.work.is-entering .work__item:nth-child(4) { animation-delay: 0.20s; }
.work.is-entering .work__item:nth-child(5) { animation-delay: 0.25s; }
.work.is-entering .work__item:nth-child(6) { animation-delay: 0.30s; }

.detail.is-entering .detail__title { animation: rise 0.7s var(--ease) both; }
.detail.is-entering .detail__tagline,
.detail.is-entering .detail__desc,
.detail.is-entering .detail__media { animation: rise 0.7s var(--ease) 0.1s both; }

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

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 640px) {
  .work__row { grid-template-columns: 2.25rem 1fr; }
  .work__year { grid-column: 2; }
  .preview { display: none; }   /* no cursor on touch */
  .detail__meta { flex-direction: column; gap: 0.5rem; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}
