/* ============================================================
   new module tease — Intech Studio
   black / off-white, Grifter, glitch details
   ============================================================ */

@font-face {
  font-family: 'Grifter';
  src: url('../fonts/GRIFTER-Light.woff2') format('woff2');
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: 'Grifter';
  src: url('../fonts/GRIFTER-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Grifter';
  src: url('../fonts/GRIFTER-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Grifter';
  src: url('../fonts/GRIFTER-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #0b0b0c;
  --ink: #f2f0ed;
  --ink-dim: #8a8884;
  --line: rgba(242, 240, 237, 0.85);
  --line-dim: rgba(242, 240, 237, 0.25);
  --noise-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --mono: ui-monospace, 'Cascadia Mono', Consolas, 'Courier New', monospace;
  --frame-w: min(92vw, 880px);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Grifter', system-ui, sans-serif;
  font-weight: 400;
  min-height: 100svh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- atmosphere overlays ---------- */

.noise {
  position: fixed;
  inset: -100px;
  z-index: 50;
  pointer-events: none;
  opacity: 0.05;
  background-image: var(--noise-img);
  animation: grain 0.6s steps(4) infinite;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-40px, 30px); }
  50%  { transform: translate(30px, -50px); }
  75%  { transform: translate(-30px, -20px); }
  100% { transform: translate(0, 0); }
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 49;
  pointer-events: none;
  opacity: 0.35;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(0, 0, 0, 0.12) 3px,
    rgba(0, 0, 0, 0.12) 4px
  );
}

/* ---------- top bar ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem clamp(1rem, 4vw, 2rem);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
  text-transform: uppercase;
  mix-blend-mode: difference;
}

.topbar__item em { font-style: normal; color: var(--ink); }

.blink { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- page + frames ---------- */

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.2rem, 3vh, 2rem);
  padding: clamp(4.5rem, 10vh, 6.5rem) 1rem clamp(3rem, 6vh, 4rem);
}

.frame {
  position: relative;
  width: var(--frame-w);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.012);
}

/* corner ticks */
.tick {
  position: absolute;
  width: 9px;
  height: 9px;
  pointer-events: none;
}
.tick--tl { top: -5px; left: -5px; border-top: 1px solid var(--ink); border-left: 1px solid var(--ink); }
.tick--tr { top: -5px; right: -5px; border-top: 1px solid var(--ink); border-right: 1px solid var(--ink); }
.tick--bl { bottom: -5px; left: -5px; border-bottom: 1px solid var(--ink); border-left: 1px solid var(--ink); }
.tick--br { bottom: -5px; right: -5px; border-bottom: 1px solid var(--ink); border-right: 1px solid var(--ink); }

/* ---------- hero ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 1.6rem);
  width: var(--frame-w);
}

.frame--photo {
  width: min(100%, 560px);
}

.tease-title {
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-align: center;
  white-space: nowrap;
}

.cursor {
  display: inline-block;
  margin-left: 0.1em;
  animation: blink 1s steps(1) infinite;
  font-weight: 300;
}

/* ---------- glitch text ---------- */

.glitch { position: relative; display: inline-block; }

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

/* texture glitch: same-ink displaced copies, torn by a noise mask */
.glitch.is-glitching::before {
  opacity: 0.75;
  color: var(--ink);
  -webkit-mask-image: var(--noise-img);
  mask-image: var(--noise-img);
  -webkit-mask-size: 90px 90px;
  mask-size: 90px 90px;
  animation: glitch-shift-a 0.28s steps(2) infinite;
  clip-path: inset(15% 0 55% 0);
}

.glitch.is-glitching::after {
  opacity: 0.55;
  color: var(--ink);
  -webkit-mask-image: var(--noise-img);
  mask-image: var(--noise-img);
  -webkit-mask-size: 140px 140px;
  mask-size: 140px 140px;
  animation: glitch-shift-b 0.32s steps(2) infinite;
  clip-path: inset(60% 0 10% 0);
}

.glitch.is-glitching .tease-title__text,
.glitch--soft.is-glitching { animation: glitch-jitter 0.2s steps(2) infinite; }

@keyframes glitch-shift-a {
  0%   { transform: translate(-4px, -2px); clip-path: inset(10% 0 60% 0); }
  50%  { transform: translate(3px, 1px);   clip-path: inset(40% 0 30% 0); }
  100% { transform: translate(-2px, 2px);  clip-path: inset(70% 0 5% 0); }
}

@keyframes glitch-shift-b {
  0%   { transform: translate(4px, 2px);   clip-path: inset(65% 0 8% 0); }
  50%  { transform: translate(-3px, -1px); clip-path: inset(25% 0 55% 0); }
  100% { transform: translate(2px, -2px);  clip-path: inset(45% 0 35% 0); }
}

@keyframes glitch-jitter {
  0%   { transform: translate(1px, 0); }
  50%  { transform: translate(-1px, 1px); }
  100% { transform: translate(0, -1px); }
}

/* ---------- photo + loader ---------- */

.photo {
  position: relative;
  width: 100%;
  overflow: hidden;
  user-select: none;
}

.photo__img {
  display: block;
  width: 100%;
  height: auto;
  filter: grayscale(1) contrast(1.04);
  transform: scale(1.02);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* glitch slice bands over the photo */
.photo__glitch-slices {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.photo.is-glitching .photo__glitch-slices {
  opacity: 0.35;
  background-image: var(--noise-img);
  background-size: 180px 180px;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0 22%, #000 22% 26%,
    transparent 26% 45%, #000 45% 47%,
    transparent 47% 58%, #000 58% 62%,
    transparent 62% 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0 22%, #000 22% 26%,
    transparent 26% 45%, #000 45% 47%,
    transparent 47% 58%, #000 58% 62%,
    transparent 62% 100%
  );
  animation: slice-jump 0.25s steps(3) infinite;
}

.photo.is-glitching .photo__img { animation: img-shudder 0.25s steps(3) infinite; }

@keyframes slice-jump {
  0%   { transform: translateX(-6px); }
  50%  { transform: translateX(8px); }
  100% { transform: translateX(-3px); }
}

@keyframes img-shudder {
  0%   { transform: scale(1.02) translate(3px, 0); }
  50%  { transform: scale(1.02) translate(-4px, 1px); }
  100% { transform: scale(1.02) translate(2px, -1px); }
}

/* fake OS loading widget over the module */
.loader {
  position: absolute;
  left: 50%;
  top: 47%;
  transform: translate(-50%, -50%);
  width: clamp(90px, 22%, 140px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  color: var(--ink);
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
}

.loader__label {
  font-size: clamp(0.52rem, 1.4vw, 0.66rem);
  letter-spacing: 0.06em;
}

.loader__bar {
  width: 100%;
  height: clamp(8px, 1.8vw, 11px);
  border: 1px solid var(--ink);
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  gap: 2px;
  padding: 2px;
}

.loader__seg {
  flex: 1;
  background: transparent;
  transition: background 0.12s steps(1);
}

.loader__seg.on { background: var(--ink); }

.loader__pct {
  font-size: clamp(0.48rem, 1.2vw, 0.58rem);
  letter-spacing: 0.1em;
  color: var(--ink-dim);
}

/* ---------- signup ---------- */

.frame--signup {
  padding: clamp(1.6rem, 4.5vw, 2.6rem) clamp(1.2rem, 6vw, 4rem);
  text-align: center;
}

.signup__title {
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  font-weight: 400;
  letter-spacing: 0.05em;
  margin-bottom: clamp(1rem, 2.5vw, 1.5rem);
  white-space: nowrap;
}

.signup__form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.9rem, 2.5vw, 1.3rem);
}

.field {
  position: relative;
  width: min(100%, 560px);
}

.field__input {
  width: 100%;
  background: transparent;
  border: 1px solid var(--line-dim);
  color: var(--ink);
  font-family: 'Grifter', system-ui, sans-serif;
  font-weight: 300;
  font-size: clamp(0.75rem, 1.8vw, 0.85rem);
  letter-spacing: 0.05em;
  padding: 1em 1.2em;
  outline: none;
  border-radius: 0;
  transition: border-color 0.25s ease;
}

.field__input::placeholder { color: var(--ink-dim); }

.field__input:focus { border-color: var(--line); }

.field__input.is-error {
  border-color: var(--ink);
  border-style: dashed;
  animation: field-shake 0.3s steps(4);
}

@keyframes field-shake {
  0%   { transform: translateX(-5px); }
  33%  { transform: translateX(5px); }
  66%  { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

/* scanning line inside the input on focus */
.field__scanner {
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 1px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.field__input:focus ~ .field__scanner { transform: scaleX(1); }

.btn {
  position: relative;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  font-family: 'Grifter', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(0.62rem, 1.6vw, 0.72rem);
  letter-spacing: 0.2em;
  padding: 1.1em 3.2em;
  cursor: pointer;
  overflow: hidden;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  will-change: transform;
}

.btn:hover,
.btn:focus-visible {
  background: transparent;
  color: var(--ink);
}

.btn:active { transform: scale(0.97); }

.btn__text { position: relative; display: inline-block; }

.btn__text::before,
.btn__text::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
}

.btn:hover .btn__text::before {
  opacity: 0.6;
  color: currentColor;
  -webkit-mask-image: var(--noise-img);
  mask-image: var(--noise-img);
  -webkit-mask-size: 60px 60px;
  mask-size: 60px 60px;
  animation: glitch-shift-a 0.3s steps(2) infinite;
}

.btn:hover .btn__text::after {
  opacity: 0.45;
  color: currentColor;
  -webkit-mask-image: var(--noise-img);
  mask-image: var(--noise-img);
  -webkit-mask-size: 100px 100px;
  mask-size: 100px 100px;
  animation: glitch-shift-b 0.34s steps(2) infinite;
}

/* success state */
.signup__done { padding: clamp(1rem, 3vw, 2rem) 0; }

.signup__done-title {
  font-size: clamp(0.95rem, 2.4vw, 1.25rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.signup__done-sub {
  margin-top: 0.8rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* ---------- marquee ---------- */

.marquee {
  width: var(--frame-w);
  overflow: hidden;
  border-top: 1px solid var(--line-dim);
  padding-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 28s linear infinite;
}

.marquee__chunk { white-space: nowrap; }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- mobile ---------- */

@media (max-width: 640px) {
  .topbar__item--mid { display: none; }

  .tease-title { white-space: normal; line-height: 1.35; }

  .signup__title { white-space: normal; line-height: 1.4; }

  .signup__done-title { white-space: normal; }

  .btn { width: min(100%, 560px); padding: 1.1em 1em; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .noise,
  .blink,
  .cursor,
  .marquee__track { animation: none; }

  .glitch.is-glitching::before,
  .glitch.is-glitching::after { animation: none; opacity: 0; }

  .photo.is-glitching .photo__img,
  .photo.is-glitching .photo__glitch-slices { animation: none; }

  .photo__img { transition: none; }
}
