/* =====================================================================
   Lonely Fish — shared styles (Dracula theme)
   ===================================================================== */

:root {
  --bg:        #282a36;
  --bg-soft:   #2f3140;
  --line:      #44475a;
  --fg:        #f8f8f2;
  --comment:   #6272a4;
  --cyan:      #8be9fd;
  --green:     #50fa7b;
  --purple:    #bd93f9;
  --pink:      #ff79c6;
  --orange:    #ffb86c;
  --red:       #ff5555;
  --yellow:    #f1fa8c;

  --maxw: 1100px;
  --mono: "SF Mono", "JetBrains Mono", "Fira Code", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { background: var(--bg); scroll-behavior: smooth; }
html, body {
  min-height: 100%;
  color: var(--fg);
  font-family: var(--sans);
  overflow-x: hidden;
}
/* body MUST stay transparent or its background paints over the z-index:-10 canvas */
body { background: transparent; line-height: 1.6; }

a { color: inherit; }
img { max-width: 100%; display: block; }

/* Dracula-themed text selection instead of the OS default blue */
::selection      { background: var(--purple); color: var(--bg); }
::-moz-selection { background: var(--purple); color: var(--bg); }

/* visible keyboard focus ring (doesn't show on mouse clicks) */
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* ----------------------- background layer stack ----------------------- */
#ascii-bg { position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -10; pointer-events: none; display: block; }

.bg-glow { position: fixed; inset: 0; z-index: -8; pointer-events: none;
  background: radial-gradient(ellipse 80% 70% at 50% -10%,
              rgba(189,147,249,0.16), rgba(40,42,54,0) 70%); }

.bg-grid { position: fixed; inset: 0; z-index: -7; pointer-events: none; opacity: 0.30;
  background-image:
    linear-gradient(rgba(68,71,90,0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(68,71,90,0.25) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 100% 100% at 50% 30%, #000 40%, transparent 85%);
          mask-image: radial-gradient(ellipse 100% 100% at 50% 30%, #000 40%, transparent 85%); }

.bg-vignette { position: fixed; inset: 0; z-index: -6; pointer-events: none;
  background: radial-gradient(ellipse 90% 90% at 50% 50%,
              rgba(40,42,54,0) 55%, rgba(40,42,54,0.55) 100%); }

/* ------------------------------- layout ------------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.6rem; }
main { position: relative; z-index: 1; }
section { padding: 5rem 0; }

.eyebrow { color: var(--green); font-family: var(--mono); font-size: 0.78rem;
  letter-spacing: 0.3em; text-transform: uppercase; }
.eyebrow::before { content: "// "; color: var(--comment); }

h1, h2, h3 { line-height: 1.1; letter-spacing: -0.01em; }
h2.section-title { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 0.6rem; }
.section-sub { color: var(--cyan); max-width: 54ch; margin-bottom: 2.6rem; }
.section-sub a { color: var(--green); text-decoration: none; }   /* links stand apart from cyan body */
.section-sub a:hover { text-decoration: underline; }

/* -------------------------------- nav -------------------------------- */
.site-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem 1.8rem; font-family: var(--mono);
  transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
  border-bottom: 1px solid transparent; }
.site-nav.scrolled { background: rgba(40,42,54,0.72);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); }
.site-nav .brand { font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  font-size: 0.95rem; text-decoration: none; }
.site-nav .brand .dot { color: var(--purple); }
.site-nav .brand:hover .dot { color: var(--cyan); }
.nav-links { display: flex; gap: 1.6rem; align-items: center; }
.nav-links a { color: var(--comment); text-decoration: none; font-size: 0.82rem;
  letter-spacing: 0.12em; text-transform: uppercase; transition: color 0.2s ease; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--cyan); }
.nav-toggle { display: none; background: none; border: 0; color: var(--fg);
  font-size: 1.4rem; cursor: pointer; }

/* ------------------------------ buttons ------------------------------ */
.btn { display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.8rem 1.4rem; border-radius: 7px; font-family: var(--mono);
  font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; transition: all 0.22s ease; border: 1px solid transparent; }
.btn-primary { border-color: var(--purple); color: var(--purple); background: transparent; }
.btn-primary:hover { background: var(--purple); color: var(--bg); }
.btn-ghost { border-color: rgba(248,248,242,0.3); color: var(--fg); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan);
  background: rgba(40,42,54,0.5);                                   /* frosted glass on hover */
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* ------------------------------- hero -------------------------------- */
.hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; text-align: left; }
.hero h1 { font-size: clamp(2.6rem, 8.5vw, 6rem); font-weight: 800; margin: 1.2rem 0; }
.hero h1 .accent { color: var(--cyan); }
/* glitch word swap: keep it on one line; scrambling "dud" chars flash pink before settling */
/* monospace so every glyph (letters AND scramble duds) is equal width —
   guarantees the duds can never overflow and overlap the trailing text */
.hero h1 .glitch { white-space: nowrap; font-family: var(--mono); font-weight: 700;
  /* font-weight 700 is a REAL loaded weight (see the Google Fonts URL) — using the
     inherited 800 triggered faux-bold, whose metrics broke the width measurement */
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.glitch .dud { color: var(--pink); }
.hero .lead { color: var(--cyan); font-size: 1.1rem; max-width: 50ch; }
.hero .lead strong { color: var(--fg); font-weight: 600; }
.hero .actions { display: flex; gap: 1rem; margin-top: 2.4rem; flex-wrap: wrap; }

/* home: "what I do" discipline cards */
.disciplines { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.disc { border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 12px; padding: 1.6rem;
  background: rgba(40,42,54,0.55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease; }
.disciplines .disc:nth-child(1) { border-left-color: var(--cyan); }
.disciplines .disc:nth-child(2) { border-left-color: var(--purple); }
.disciplines .disc:nth-child(3) { border-left-color: var(--pink); }
.disc:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,0.3); }
.disc h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.disc p { color: var(--comment); font-size: 0.95rem; line-height: 1.6; }

/* ---------------------------- work / gallery ---------------------------- */
.work-grid { display: grid; gap: 1.4rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.work-card { position: relative; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; background: rgba(40,42,54,0.5);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);  /* frosted: ASCII bleeds through, blurred */
  text-decoration: none; color: inherit; will-change: transform;
  transition: transform 0.18s ease, border-color 0.25s ease, box-shadow 0.25s ease; display: block; }
.work-card:hover { transform: translateY(-4px); border-color: var(--purple);
  box-shadow: 0 14px 40px rgba(0,0,0,0.35); }
.work-thumb { aspect-ratio: 16 / 10; display: grid; place-items: center;
  font-family: var(--mono); color: var(--bg); font-size: 0.8rem; letter-spacing: 0.2em;
  text-transform: uppercase; position: relative; overflow: hidden; }
.work-thumb .ph { color: rgba(40,42,54,0.85); font-weight: 700; }
.work-body { padding: 1.1rem 1.2rem 1.3rem; }
.work-body h3 { font-size: 1.15rem; margin-bottom: 0.3rem; }
.work-body .meta { color: var(--comment); font-family: var(--mono); font-size: 0.78rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.8rem; }
.tag { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem; border-radius: 5px; border: 1px solid var(--line); color: var(--comment); }
/* distinct Dracula colors per tag within a card, cycling so each one differs */
.tags .tag:nth-child(6n+1) { color: var(--purple); border-color: rgba(189,147,249,0.5); }
.tags .tag:nth-child(6n+2) { color: var(--cyan);   border-color: rgba(139,233,253,0.5); }
.tags .tag:nth-child(6n+3) { color: var(--green);  border-color: rgba(80,250,123,0.5); }
.tags .tag:nth-child(6n+4) { color: var(--pink);   border-color: rgba(255,121,198,0.5); }
.tags .tag:nth-child(6n+5) { color: var(--orange); border-color: rgba(255,184,108,0.5); }
.tags .tag:nth-child(6n+6) { color: var(--yellow); border-color: rgba(241,250,140,0.5); }

/* mac-browser-style window chrome on cards (fits the terminal/ASCII theme) */
.work-card { padding-top: 34px;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }  /* no text/image selection while tilting */
.work-shot { -webkit-user-drag: none; user-drag: none; }
.work-card::before {
  content: "lonely.fish"; position: absolute; top: 0; left: 0; right: 0; height: 34px; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  background: #21222c; border-bottom: 1px solid var(--line);   /* Dracula darker-bg shade */
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em; color: var(--comment);
}
.work-card::after {
  content: ""; position: absolute; top: 12px; left: 14px; z-index: 3;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--red);   /* Dracula red #ff5555 / yellow #f1fa8c / green #50fa7b */
  box-shadow: 17px 0 0 var(--yellow), 34px 0 0 var(--green);
}

/* work page: project sections, screenshot cards, video embeds */
.work-section { margin-bottom: 3.5rem; }
.work-section > .eyebrow { display: block; margin-bottom: 0.4rem; }
.work-section > h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin-bottom: 1.4rem; }
.work-shot { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block;
  background: linear-gradient(135deg, var(--line), var(--bg-soft)); }  /* fallback before image loads */
.work-card.shot::before { content: attr(data-title); }   /* window title = project name */
.video-grid { display: grid; gap: 1.4rem; margin-bottom: 1.6rem;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }
.video-embed { position: relative; padding-top: 56.25%; border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* work page: full-page scroll-driven showcase (scoped to <html class="fp">) */
html.fp, html.fp body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.fullpage { position: fixed; top: 0; left: 0; width: 100%;
  transition: transform 0.85s cubic-bezier(0.76, 0, 0.24, 1); will-change: transform; }
.page { height: 100vh; width: 100%; display: flex; align-items: center; justify-content: center;
  padding: 4.5rem 1.6rem; text-align: center; }   /* symmetric = truly centered */
.page .wrap { width: 100%; max-width: none; padding: 0; }   /* full width, no double padding (keeps the card centered) */
.page > .wrap > .eyebrow { display: inline-block; margin-bottom: 0.5rem; }
.page h2 { font-size: clamp(1.3rem, 3.2vw, 2rem); margin-bottom: 1rem; font-weight: 600; }
.page.intro .big-title { font-size: clamp(3rem, 12vw, 8rem); font-weight: 800; line-height: 1; margin: 0.4rem 0 1rem; }
.page.intro .section-sub { margin-left: auto; margin-right: auto; }
.scroll-hint { margin-top: 2.4rem; font-family: var(--mono); color: var(--comment);
  font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase;
  animation: scrollbob 1.8s ease-in-out infinite; }
@keyframes scrollbob { 0%, 100% { transform: translateY(0); opacity: .55; } 50% { transform: translateY(6px); opacity: 1; } }
/* big centered screenshot — natural ratio, no crop */
.work-card.big { display: inline-block; margin: 0 auto; }
.work-card.big .work-shot { width: auto; height: auto; aspect-ratio: auto;
  max-width: min(1340px, 92vw); max-height: 70vh; }
/* fullpage section dots */
.fp-dots { position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 60;
  display: flex; flex-direction: column; gap: 12px; }
.fp-dots button { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--comment);
  background: transparent; cursor: pointer; padding: 0; transition: all 0.25s ease; }
.fp-dots button.active { background: var(--cyan); border-color: var(--cyan); transform: scale(1.25); }
.fp-dots button:hover { border-color: var(--cyan); }

/* in-card carousel: flip through a project's screenshots/videos */
.carousel { position: relative; }
.carousel .slide { display: none; }
.carousel .slide.active { display: block; }
.carousel .video-embed.slide { width: min(1340px, 92vw); }
.car-btn { position: absolute; top: calc(50% + 17px); transform: translateY(-50%); z-index: 5;
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); background: rgba(33,34,44,0.7);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: var(--fg); font-size: 1.5rem; line-height: 1; cursor: pointer; transition: all 0.2s ease; }
.car-btn:hover, .car-btn.pressed { border-color: var(--cyan); color: var(--cyan); }
.car-btn.pressed { transform: translateY(-50%) scale(1.12); }   /* feedback for arrow-key presses */
.car-prev { left: 12px; }
.car-next { right: 12px; }
.car-count { position: absolute; bottom: 12px; right: 14px; z-index: 5;
  font-family: var(--mono); font-size: 0.72rem; color: var(--fg);
  background: rgba(33,34,44,0.7); padding: 0.2rem 0.55rem; border-radius: 6px; border: 1px solid var(--line); }
/* glitch transition when flipping slides — giant Dracula blocks flicker in/out */
.car-glitch { position: absolute; left: 0; right: 0; top: 34px; bottom: 0; z-index: 4;
  overflow: hidden; pointer-events: none; }
.g-block { position: absolute; aspect-ratio: 1; mix-blend-mode: screen; border-radius: 2px; }

/* ---------------------------- projects ----------------------------- */
.project { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 1.6rem 1.8rem;
  background: rgba(40,42,54,0.5);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);  /* frosted glass */
  margin-bottom: 1.2rem; will-change: transform;
  transition: transform 0.18s ease, border-color 0.25s ease, box-shadow 0.25s ease; }
.project:hover { border-color: var(--purple); box-shadow: 0 14px 40px rgba(0,0,0,0.35); }
.project-head { display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; }
.project-head h3 { font-size: 1.3rem; }
.status { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 0.25rem 0.6rem; border-radius: 999px; white-space: nowrap; }
.status.prototyping { color: var(--orange); border: 1px solid var(--orange); }
.status.progress    { color: var(--cyan);   border: 1px solid var(--cyan); }
.status.playtest    { color: var(--green);  border: 1px solid var(--green); }
.status.paused      { color: var(--comment); border: 1px solid var(--comment); }
.project p { color: var(--comment); margin-top: 0.8rem; text-wrap: pretty; }
.progress-track { margin-top: 1.2rem; height: 6px; border-radius: 999px;
  background: var(--line); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--purple), var(--cyan)); }

/* ----------------------------- contact ----------------------------- */
.contact-grid { display: grid; gap: 2.4rem; grid-template-columns: 1.3fr 1fr; align-items: start; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-family: var(--mono); font-size: 0.74rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--comment); margin-bottom: 0.4rem; }
.field input, .field textarea { width: 100%; background: rgba(40,42,54,0.5);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);  /* frosted glass */
  border: 1px solid var(--line); border-radius: 8px; padding: 0.8rem 0.9rem;
  color: var(--fg); font-family: var(--sans); font-size: 0.95rem; transition: border-color 0.2s ease; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--purple); }
.field textarea { resize: vertical; min-height: 140px; }
.form-note { font-family: var(--mono); font-size: 0.8rem; margin-top: 0.6rem; min-height: 1.2em; }
.form-note.ok { color: var(--green); }
.form-note.err { color: var(--red); }
.contact-aside { background: rgba(40,42,54,0.5);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);   /* frosted glass panel */
  border: 1px solid var(--line); border-radius: 12px; padding: 1.6rem 1.8rem; }
.contact-aside .row:last-child { margin-bottom: 0; }
.contact-aside h3 { font-size: 1rem; font-family: var(--mono); color: var(--comment);
  text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.6rem; }
.contact-aside a { color: var(--cyan); text-decoration: none; }
.contact-aside a:hover { text-decoration: underline; }
.contact-aside .ico { width: 1.05em; height: 1.05em; vertical-align: -0.17em; margin-right: 0.45em; fill: currentColor; }
.contact-aside .row { margin-bottom: 1.4rem; }

/* ------------------------------ footer ------------------------------ */
.site-footer { position: relative; z-index: 1; border-top: 1px solid var(--line);
  margin-top: 3rem; padding: 2.4rem 0; font-family: var(--mono);
  background: rgba(40,42,54,0.5);                                   /* frosted glass */
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.site-footer .wrap { display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; color: var(--comment); font-size: 0.8rem; }
.site-footer a { color: var(--comment); text-decoration: none; }
.site-footer a:hover { color: var(--cyan); }
.site-footer .fish { color: var(--cyan); cursor: pointer; transition: color 0.2s ease;
  -webkit-user-select: none; user-select: none; }
.site-footer .fish:hover { color: var(--pink); }

/* ---------------------------- responsive ---------------------------- */
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links { position: fixed; inset: 0 0 auto 0; top: 0; flex-direction: column;
    background: rgba(40,42,54,0.96); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    padding: 5rem 1.8rem 2rem; gap: 1.4rem; transform: translateY(-110%);
    transition: transform 0.3s ease; border-bottom: 1px solid var(--line); }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { font-size: 1rem; }
  .contact-grid { grid-template-columns: 1fr; }
  section { padding: 4rem 0; }

  /* tighter, less-awkward mobile spacing */
  .hero { min-height: 100vh; padding: 6rem 0 4rem; }
  .hero h1 { margin: 0.8rem 0; }
  .hero .lead { font-size: 1rem; }
  .hero .actions { flex-direction: column; align-items: stretch; gap: 0.8rem; margin-top: 2rem; }
  .hero .actions .btn { justify-content: center; }
  .disciplines { gap: 1rem; }
  .disc { padding: 1.3rem 1.4rem; }
  .section-sub { margin-bottom: 2rem; }

  /* work page (fullpage) on mobile */
  .page { padding: 5rem 1.1rem; }
  .page h2 { font-size: 1.35rem; }
  .page.intro .big-title { font-size: clamp(3rem, 18vw, 5rem); }
  .work-card.big .work-shot { max-height: 56vh; max-width: calc(100vw - 2.2rem); }
  .fp-dots { right: 10px; gap: 10px; }
  .car-btn { width: 34px; height: 34px; font-size: 1.2rem; }
  .car-prev { left: 8px; } .car-next { right: 8px; }
}

/* respect prefers-reduced-motion: make motion effectively instant site-wide */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
