/* ================================================
   sebsoong.com — shared stylesheet v3
   vaporwave · CRT-default · mobile-ready
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;700;800&family=DM+Mono:wght@300;400;500&display=swap');

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

/* ── Variables ──────────────────────────────────── */

:root {
  --bg:      #09080f;
  --bg2:     #0e0c1a;
  --surface: rgba(255,255,255,0.032);
  --border:  rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.13);
  --text:    #ede8ff;
  --muted:   #c4bedd;
  --subtle:  #9b92b8;

  --pink:    #ff71ce;
  --purple:  #b967ff;
  --mint:    #05ffa1;
  --cyan:    #01cdfe;
  --yellow:  #ffe66d;

  --glow-pink:   rgba(255,113,206,.3);
  --glow-purple: rgba(185,103,255,.3);
  --glow-mint:   rgba(5,255,161,.3);
  --glow-cyan:   rgba(1,205,254,.3);
}

/* ── Base ───────────────────────────────────────── */

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

body {
  font-family: 'DM Mono', monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: clip;   /* clip, not hidden — hidden creates scroll container that breaks position:fixed */
  cursor: none;
  line-height: 1.6;
  background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(185,103,255,.12) 0%, transparent 70%);
}

/* grain texture */
.grain {
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  opacity: .35; pointer-events: none; z-index: 1;
}

/* ── CRT layers ─────────────────────────────────── */

.crt-scanlines {
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 3px,
    rgba(0,0,0,.09) 3px, rgba(0,0,0,.09) 4px
  );
  pointer-events: none; z-index: 9990;
  opacity: 0; transition: opacity .5s ease;
}
.crt-vignette {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 46%, rgba(0,0,0,.7) 100%),
    linear-gradient(to bottom, rgba(0,0,0,.18) 0%, transparent 8%, transparent 92%, rgba(0,0,0,.22) 100%);
  pointer-events: none; z-index: 9989;
  opacity: 0; transition: opacity .5s ease;
}
/* subtle phosphor RGB column pattern */
.crt-rgb {
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    90deg,
    rgba(255,0,80,.012) 0px, rgba(255,0,80,.012) 1px,
    transparent 1px, transparent 3px
  );
  pointer-events: none; z-index: 9988;
  opacity: 0; transition: opacity .5s ease;
  mix-blend-mode: screen;
}

/* CRT ON */
body.crt .crt-scanlines { opacity: 1; }
body.crt .crt-vignette  { opacity: 1; }
body.crt .crt-rgb       { opacity: 1; }
body.crt { filter: contrast(1.05) brightness(0.97) saturate(1.08); }

/* heading glow */
body.crt h1         { text-shadow: 0 0 20px var(--glow-pink), 0 0 44px var(--glow-purple); }
body.crt .card-name { text-shadow: 0 0 12px var(--glow-pink); }
body.crt .wordmark  { text-shadow: 0 0 10px var(--glow-purple); }

/* small text brightness boost so scanlines don't crush it */
body.crt .card-desc,
body.crt .card-tag,
body.crt .card-url,
body.crt .hero-sub,
body.crt .hero-label,
body.crt .footer-text,
body.crt .back-btn,
body.crt .status-pill { filter: brightness(1.3); }

/* card phosphor */
body.crt .card {
  box-shadow: 0 0 0 1px rgba(185,103,255,.15), inset 0 0 18px rgba(185,103,255,.04);
}
body.crt .card:hover {
  box-shadow: 0 0 0 1px var(--purple), 0 0 28px rgba(185,103,255,.22), inset 0 0 22px rgba(185,103,255,.06);
}

/* flicker */
@keyframes flicker {
  0%,89%,91%,94%,96%,100% { opacity:1; }
  90%  { opacity:.97; }
  95%  { opacity:.98; }
}
body.crt .wrap { animation: flicker 16s ease-in-out infinite; }

/* ── CRT Toggle ─────────────────────────────────── */

.crt-toggle {
  position: fixed; bottom: 24px; right: 24px; z-index: 9995;
  display: flex; align-items: center; gap: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
  background: rgba(9,8,15,.9);
  border: 1px solid var(--border);
  border-radius: 100px; padding: 8px 16px;
  cursor: pointer;
  transition: border-color .2s, color .2s, box-shadow .2s, background .2s;
  backdrop-filter: blur(14px);
  user-select: none;
}
.crt-toggle:hover {
  border-color: rgba(185,103,255,.45);
  color: var(--purple);
  box-shadow: 0 0 16px rgba(185,103,255,.15);
}
.crt-toggle .toggle-led {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.15);
  transition: background .25s, box-shadow .25s;
  flex-shrink: 0;
}
body.crt .crt-toggle {
  border-color: rgba(255,113,206,.45);
  color: var(--pink);
  box-shadow: 0 0 16px rgba(255,113,206,.18);
}
body.crt .crt-toggle .toggle-led {
  background: var(--pink);
  box-shadow: 0 0 6px var(--pink), 0 0 12px rgba(255,113,206,.5);
  animation: led-pulse 2s ease-in-out infinite;
}
@keyframes led-pulse {
  0%,100% { box-shadow: 0 0 4px var(--pink), 0 0 10px rgba(255,113,206,.5); }
  50%     { box-shadow: 0 0 8px var(--pink), 0 0 20px rgba(255,113,206,.7); }
}

/* ── Orbs ───────────────────────────────────────── */

.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; }
.orb-1 { width: 700px; height: 700px; background: radial-gradient(circle, rgba(185,103,255,.18) 0%, transparent 70%); top: -250px; left: -200px; animation: drift1 24s ease-in-out infinite alternate; }
.orb-2 { width: 550px; height: 550px; background: radial-gradient(circle, rgba(255,113,206,.14) 0%, transparent 70%); top: 10%; right: -220px; animation: drift2 30s ease-in-out infinite alternate; }
.orb-3 { width: 450px; height: 450px; background: radial-gradient(circle, rgba(1,205,254,.09) 0%, transparent 70%); bottom: -120px; left: 30%; animation: drift3 20s ease-in-out infinite alternate; }
.orb-4 { width: 300px; height: 300px; background: radial-gradient(circle, rgba(5,255,161,.07) 0%, transparent 70%); top: 60%; right: 20%; animation: drift1 26s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(60px,80px); } }
@keyframes drift2 { to { transform: translate(-40px,60px); } }
@keyframes drift3 { to { transform: translate(45px,-40px); } }

/* ── Cursor ─────────────────────────────────────── */

.cursor {
  /* Anchored at viewport origin — JS moves via transform3d, never left/top.
     translate3d is GPU-composited and unaffected by any scroll container. */
  position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999;
  width: 5px; height: 5px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(255,113,206,.7), 0 0 10px rgba(255,113,206,.55);
  /* transition only visual props — NOT transform (we update that every frame) */
  transition: width .1s, height .1s, background .15s, box-shadow .15s, border-radius .15s;
  will-change: transform;
}
.cursor-ring {
  position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9998;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid rgba(255,113,206,.45);
  transition: width .5s cubic-bezier(.16,1,.3,1), height .5s cubic-bezier(.16,1,.3,1), border-color .2s, opacity .2s;
  will-change: transform;
}
body:has(a:hover) .cursor      { background: var(--cyan); box-shadow: 0 0 0 1.5px rgba(1,205,254,.8), 0 0 12px rgba(1,205,254,.65); }
body:has(a:hover) .cursor-ring { width: 52px; height: 52px; border-color: rgba(1,205,254,.45); }
body:has(button:hover) .cursor      { background: var(--purple); box-shadow: 0 0 0 1.5px rgba(185,103,255,.8), 0 0 12px rgba(185,103,255,.65); }
body:has(button:hover) .cursor-ring { width: 26px; height: 26px; border-color: rgba(185,103,255,.55); }
body:has(textarea:focus) .cursor,
body:has(input:focus) .cursor  { background: var(--mint); border-radius: 1px; width: 2px; height: 16px; box-shadow: 0 0 0 1px rgba(5,255,161,.5), 0 0 10px rgba(5,255,161,.5); }
body:has(textarea:focus) .cursor-ring,
body:has(input:focus) .cursor-ring { opacity: 0; }

/* ── Layout ─────────────────────────────────────── */

.wrap { position: relative; z-index: 2; max-width: 1100px; margin: 0 auto; padding: 0 32px; }

/* ── Header ─────────────────────────────────────── */

header { padding: 36px 0 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.header-left { display: flex; align-items: center; gap: 16px; }

.wordmark { font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; transition: color .2s; }

.back-btn {
  font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted);
  letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none; padding: 4px 0;
  display: flex; align-items: center; gap: 6px;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.back-btn:hover { color: var(--pink); border-color: rgba(255,113,206,.4); }

.status-pill {
  display: flex; align-items: center; gap: 7px;
  font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted); letter-spacing: .08em;
  background: rgba(255,255,255,0.025); border: 1px solid var(--border); border-radius: 100px; padding: 5px 14px;
}
.status-dot { width: 6px; height: 6px; background: var(--mint); border-radius: 50%; animation: pulse 2.4s ease infinite; }
@keyframes pulse {
  0%,100% { opacity:1; box-shadow: 0 0 0 0 rgba(5,255,161,.5); }
  50%      { opacity:.8; box-shadow: 0 0 0 5px rgba(5,255,161,0); }
}

/* ── Hero ───────────────────────────────────────── */

.hero { padding: 60px 0 52px; animation: fadeUp .7s cubic-bezier(.22,1,.36,1) both; }
.hero-label {
  font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted);
  letter-spacing: .2em; text-transform: uppercase; margin-bottom: 20px;
  display: flex; align-items: center; gap: 14px;
}
.hero-label::before { content: ''; display: block; width: 32px; height: 1px; background: linear-gradient(90deg, transparent, var(--subtle)); }

h1 { font-family: 'Syne', sans-serif; font-size: clamp(44px,7vw,96px); font-weight: 800; line-height: .93; letter-spacing: -.035em; }
h1 .accent { color: var(--pink); }
h1 .dim    { color: rgba(110,101,133,.5); }

.hero-sub { margin-top: 20px; font-family: 'DM Mono', monospace; font-size: 14px; color: var(--muted); max-width: 400px; line-height: 1.85; letter-spacing: .01em; }

/* ── Divider ────────────────────────────────────── */

.divider { width: 100%; height: 1px; margin-bottom: 36px; background: linear-gradient(90deg, transparent, var(--border2) 20%, var(--border2) 80%, transparent); }

/* ── Section label ──────────────────────────────── */

.section-label {
  font-family: 'DM Mono', monospace; font-size: 10px; color: var(--muted);
  letter-spacing: .22em; text-transform: uppercase; margin-bottom: 14px;
  display: flex; align-items: center; gap: 12px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Grid ───────────────────────────────────────── */

.grid { display: grid; grid-template-columns: repeat(12,1fr); gap: 10px; margin-bottom: 28px; }
.span-3  { grid-column: span 3; }
.span-4  { grid-column: span 4; }
.span-5  { grid-column: span 5; }
.span-6  { grid-column: span 6; }
.span-7  { grid-column: span 7; }
.span-12 { grid-column: span 12; }

/* ── Cards ──────────────────────────────────────── */

.card {
  position: relative;
  background: linear-gradient(135deg, rgba(255,255,255,.035) 0%, rgba(255,255,255,.015) 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px 24px 20px;
  text-decoration: none; color: inherit; overflow: hidden;
  transition: border-color .25s, transform .25s cubic-bezier(.22,1,.36,1), box-shadow .25s, background .25s;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 184px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), inset 0 0 0 1px rgba(255,255,255,.02);
}
.card::before { content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity .35s; pointer-events: none; border-radius: inherit; }
.card::after  { content: ''; position: absolute; top: 0; left: 10%; right: 10%; height: 1px; background: linear-gradient(90deg,transparent,rgba(255,255,255,.12),transparent); }

.card:hover {
  border-color: var(--border2);
  transform: translateY(-4px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 18px 44px rgba(0,0,0,.42), 0 4px 14px rgba(0,0,0,.3);
  background: linear-gradient(135deg, rgba(255,255,255,.05) 0%, rgba(255,255,255,.02) 100%);
}
.card:hover::before { opacity: 1; }
.card:active { transform: translateY(-1px); }

.card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.card-bottom { margin-top: auto; padding-top: 18px; }

.card-icon {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 6px; font-size: 16px;
  background: rgba(255,255,255,.03);
  transition: border-color .2s, transform .25s cubic-bezier(.22,1,.36,1), box-shadow .2s;
}
.card:hover .card-icon { transform: scale(1.1) rotate(-3deg); box-shadow: 0 4px 12px rgba(0,0,0,.3); }

.card-arrow {
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--border);
  color: var(--muted); font-size: 12px;
  transition: border-color .2s, color .2s, transform .25s cubic-bezier(.22,1,.36,1), box-shadow .2s;
}
.card:hover .card-arrow { transform: translate(3px,-3px); }

.card-tag  { font-family: 'DM Mono', monospace; font-size: 9.5px; color: var(--muted); letter-spacing: .18em; text-transform: uppercase; margin-bottom: 5px; }
.card-name { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 700; letter-spacing: -.025em; line-height: 1.05; margin-bottom: 8px; }
.card-desc { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--muted); line-height: 1.7; margin-bottom: 10px; }
.card-url  { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--muted); letter-spacing: .04em; }

.card-line { position: absolute; bottom: 0; left: 0; width: 0%; height: 2px; transition: width .45s cubic-bezier(.22,1,.36,1); border-radius: 0 0 0 8px; }
.card:hover .card-line { width: 100%; }

/* ── Footer ─────────────────────────────────────── */

footer { position: relative; z-index: 2; border-top: 1px solid var(--border); padding: 18px 0; margin-top: 8px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; }
.footer-text  { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted); letter-spacing: .08em; }

/* ── Animations ─────────────────────────────────── */

@keyframes fadeUp { from { opacity:0; transform:translateY(22px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.card { animation: fadeUp .55s cubic-bezier(.22,1,.36,1) both; }
.card:nth-child(1) { animation-delay:.04s; }
.card:nth-child(2) { animation-delay:.09s; }
.card:nth-child(3) { animation-delay:.14s; }
.card:nth-child(4) { animation-delay:.19s; }
.card:nth-child(5) { animation-delay:.24s; }
.card:nth-child(6) { animation-delay:.29s; }
.card:nth-child(7) { animation-delay:.34s; }
.card:nth-child(8) { animation-delay:.39s; }
.card:nth-child(9) { animation-delay:.44s; }

/* ── Scrollbar ──────────────────────────────────── */

::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(185,103,255,.2); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(185,103,255,.5); }

/* ================================================================
   MOBILE
   ================================================================ */

@media (max-width: 768px) {
  body { cursor: auto; }
  .cursor, .cursor-ring { display: none !important; }
  .crt-toggle { bottom: 16px; right: 16px; padding: 6px 12px; font-size: 9px; }
  .wrap { padding: 0 18px; }
  header { padding: 24px 0 0; }
  .wordmark { font-size: 11px; }
  .back-btn { font-size: 10px; }
  .status-pill { font-size: 10px; padding: 4px 12px; }
  .hero { padding: 38px 0 32px; }
  h1 { font-size: clamp(36px,11vw,60px); }
  .hero-sub { font-size: 13px; margin-top: 14px; max-width: 100%; }
  .hero-label { font-size: 10px; margin-bottom: 14px; }
  .divider { margin-bottom: 24px; }
  .grid { gap: 8px; margin-bottom: 20px; }
  .span-3, .span-4, .span-5, .span-6, .span-7 { grid-column: span 12; }
  .card { padding: 18px; min-height: 140px; border-radius: 6px; }
  .card-name { font-size: 20px; }
  .card-desc { font-size: 11px; }
  footer { padding: 14px 0; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 5px; }
  .section-label { font-size: 9px; margin-bottom: 10px; }
}

@media (max-width: 390px) {
  .wrap { padding: 0 14px; }
  h1 { font-size: 34px; }
  .card { padding: 14px; }
}