/* ============================================================
   RETRO ASOBI — retroasobimusic.com
   Modern responsive site with a retro-OS aesthetic.
   All GUI art here is placeholder — swap colors/borders/images
   in the :root section and /assets when the artist delivers.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Desktop */
  --desktop: #17706e;
  --desktop-deep: #0e4a49;

  /* Window plastic */
  --plastic: #ece9dc;
  --plastic-dark: #cfcabb;
  --plastic-light: #fffdf5;
  --outline: #1a1a20;

  /* Title bar */
  --title-a: #10218b;
  --title-b: #3a6fd8;
  --title-text: #ffffff;
  --title-inactive-a: #6e6e78;
  --title-inactive-b: #9c9ca6;

  /* Accents */
  --accent: #e4485c;        /* primary CTA — famicom red */
  --accent-dark: #962434;
  --teal: #40d0c0;
  --yellow: #ffc840;
  --blue: #4068e0;
  --pink: #d870c8;
  --ink: #22222a;
  --ink-soft: #4a4a55;

  /* Type */
  --font-pixel: 'Silkscreen', 'Courier New', monospace;
  --font-body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Layout */
  --maxw: 1080px;
  --radius: 2px;
  --bevel-out: inset -2px -2px 0 rgba(0,0,0,.28), inset 2px 2px 0 rgba(255,255,255,.85);
  --bevel-in:  inset 2px 2px 0 rgba(0,0,0,.28), inset -2px -2px 0 rgba(255,255,255,.85);
  --shadow-win: 4px 4px 0 rgba(10, 30, 30, .45);
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.06rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--desktop);
  /* Subtle dither texture, replace with artist wallpaper later */
  background-image:
    radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(160deg, var(--desktop) 0%, var(--desktop-deep) 100%);
  background-size: 4px 4px, cover;
  background-attachment: fixed;
}
img { max-width: 100%; height: auto; }
.pixel { image-rendering: pixelated; }
h1, h2, h3, .pixel-font { font-family: var(--font-pixel); line-height: 1.25; }
a { color: var(--title-a); }
a:focus-visible, button:focus-visible { outline: 3px dashed var(--yellow); outline-offset: 2px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--yellow); color: var(--ink); padding: .6em 1em;
  font-family: var(--font-pixel);
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- CRT scanlines (toggleable) ---------- */
body.crt::after {
  content: "";
  position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, transparent 0 2px, rgba(0,0,0,.08) 2px 4px);
}

/* ---------- Boot overlay ---------- */
#boot {
  position: fixed; inset: 0; z-index: 10000;
  background: #0a0a12; color: #c8ffc8;
  font-family: var(--font-pixel);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.2rem; cursor: pointer; text-align: center; padding: 1rem;
}
#boot .boot-logo { font-size: clamp(1.1rem, 4vw, 2rem); color: var(--teal); }
#boot .boot-bar {
  width: min(320px, 70vw); height: 18px;
  border: 2px solid #c8ffc8; padding: 2px;
}
#boot .boot-bar > span {
  display: block; height: 100%; width: 0; background: var(--teal);
  animation: bootfill 1.1s steps(12) forwards;
}
@keyframes bootfill { to { width: 100%; } }
#boot .boot-hint { font-size: .65rem; opacity: .7; }
#boot.done { display: none; }

/* ---------- Top nav (taskbar style) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  background: var(--plastic);
  border-bottom: 2px solid var(--outline);
  box-shadow: var(--bevel-out), 0 3px 0 rgba(10,30,30,.35);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: .45rem .8rem;
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--font-pixel); font-size: .95rem;
  color: var(--ink); text-decoration: none;
}
.brand img { width: 26px; height: 26px; }
.topnav { display: flex; gap: .15rem; margin-left: auto; align-items: center; flex-wrap: wrap; }
.topnav a {
  font-family: var(--font-pixel); font-size: .72rem;
  color: var(--ink); text-decoration: none;
  padding: .5em .7em; border: 2px solid transparent;
}
.topnav a:hover { background: var(--plastic-dark); border-color: var(--outline); box-shadow: var(--bevel-out); }
.topnav .nav-cta {
  background: var(--accent); color: #fff;
  border: 2px solid var(--outline); box-shadow: var(--bevel-out);
  margin-left: .4rem;
}
.topnav .nav-cta:hover { background: var(--accent-dark); }
.menu-toggle {
  display: none; margin-left: auto;
  font-family: var(--font-pixel); font-size: .75rem;
  background: var(--plastic); color: var(--ink);
  border: 2px solid var(--outline); box-shadow: var(--bevel-out);
  padding: .5em .8em; cursor: pointer;
}
@media (max-width: 760px) {
  .menu-toggle { display: block; }
  .topnav {
    display: none; width: 100%; flex-direction: column; align-items: stretch;
    padding-top: .5rem; border-top: 2px solid var(--outline); margin-top: .45rem;
  }
  .topnav.open { display: flex; }
  .topnav a { border: 2px solid var(--outline); box-shadow: var(--bevel-out); background: var(--plastic-light); text-align: center; }
  .topnav .nav-cta { margin-left: 0; }
}

/* ---------- Window component ---------- */
.window {
  background: var(--plastic);
  border: 2px solid var(--outline);
  box-shadow: var(--bevel-out), var(--shadow-win);
}
.window + .window { margin-top: 1.5rem; }
.titlebar {
  display: flex; align-items: center; gap: .55rem;
  background: linear-gradient(90deg, var(--title-a), var(--title-b));
  color: var(--title-text);
  padding: .4rem .6rem;
  border-bottom: 2px solid var(--outline);
  font-family: var(--font-pixel); font-size: .78rem;
  user-select: none;
}
.titlebar img { width: 18px; height: 18px; }
.titlebar .win-btns { margin-left: auto; display: flex; gap: 4px; }
.titlebar .win-btns span {
  width: 18px; height: 18px; display: grid; place-items: center;
  background: var(--plastic); color: var(--ink);
  border: 1px solid var(--outline); box-shadow: var(--bevel-out);
  font-size: .6rem; line-height: 1;
}
.win-body { padding: clamp(1rem, 3vw, 1.8rem); }

/* ---------- Layout ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 1.6rem .9rem 4rem; }
.section { margin-top: 2.2rem; scroll-margin-top: 70px; }
.section-label {
  font-family: var(--font-pixel); font-size: .7rem; letter-spacing: .08em;
  color: #dff5f2; text-shadow: 1px 1px 0 rgba(0,0,0,.5);
  margin: 0 0 .5rem .2rem; text-transform: uppercase;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--font-pixel); font-size: .8rem;
  padding: .8em 1.2em; cursor: pointer; text-decoration: none;
  background: var(--plastic); color: var(--ink);
  border: 2px solid var(--outline); box-shadow: var(--bevel-out), 3px 3px 0 rgba(10,30,30,.4);
  transition: transform .06s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translate(2px, 2px); box-shadow: var(--bevel-in); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #ef5b6e; }
.btn-lg { font-size: .95rem; padding: 1em 1.5em; }
.btn img { width: 20px; height: 20px; }

/* ---------- Hero ---------- */
.hero .win-body { padding: clamp(1.4rem, 4vw, 2.6rem); }
.hero-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 2rem; align-items: center; }
@media (max-width: 820px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 {
  font-size: clamp(1.35rem, 3.6vw, 2.2rem);
  margin: 0 0 .8rem;
  color: var(--ink);
}
.hero h1 .hl { color: var(--accent); }
.hero .tagline { font-size: 1.12rem; color: var(--ink-soft); margin: 0 0 1.4rem; }
.hero-ctas { display: flex; gap: .8rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.hero-tags { display: flex; gap: .5rem; flex-wrap: wrap; padding: 0; margin: 0; list-style: none; }
.hero-tags li {
  font-family: var(--font-pixel); font-size: .62rem;
  background: var(--plastic-light); border: 2px solid var(--outline);
  padding: .35em .6em; box-shadow: var(--bevel-out);
}

/* Hero right column: train gif + desktop icons */
.hero-right { display: flex; flex-direction: column; gap: 1.2rem; }
.hero-gif {
  width: 100%; height: auto; display: block;
  border: 2px solid var(--outline); box-shadow: var(--bevel-in);
  background: var(--desktop-deep);
}

/* Desktop icons (hero right) */
.desk-icons {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;
  justify-items: center;
}
@media (max-width: 820px) { .desk-icons { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 520px) { .desk-icons { grid-template-columns: repeat(2, 1fr); } }
.desk-icon {
  display: flex; flex-direction: column; align-items: center; gap: .45rem;
  text-decoration: none; color: var(--ink);
  font-family: var(--font-pixel); font-size: .62rem; text-align: center;
  padding: .7rem .5rem; width: 100%;
  border: 2px solid transparent;
}
.desk-icon img { width: 56px; height: 56px; }
.desk-icon:hover { background: rgba(64, 208, 192, .25); border: 2px dotted var(--title-a); }
.desk-icon span { background: var(--plastic-light); padding: .15em .4em; border: 1px solid var(--outline); }

/* ---------- Embeds ---------- */
.embed {
  background: #000;
  border: 2px solid var(--outline);
  box-shadow: var(--bevel-in);
}
.embed iframe { display: block; width: 100%; border: 0; }
.embed.ratio-video { aspect-ratio: 16 / 9; }
.embed.ratio-video iframe { height: 100%; }
.reel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
@media (max-width: 760px) { .reel-grid { grid-template-columns: 1fr; } }
.reel-card h3 { margin: 0 0 .6rem; font-size: .85rem; }
.reel-card p { margin: .6rem 0 0; color: var(--ink-soft); font-size: .95rem; }

/* ---------- Tabs (music players) ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: -2px; position: relative; z-index: 2; }
.tab-btn {
  font-family: var(--font-pixel); font-size: .7rem;
  background: var(--plastic-dark); color: var(--ink);
  border: 2px solid var(--outline); border-bottom: none;
  padding: .6em 1em; cursor: pointer;
}
.tab-btn[aria-selected="true"] { background: var(--plastic-light); padding-bottom: .85em; }
.tab-panel {
  border: 2px solid var(--outline); background: var(--plastic-light);
  padding: 1rem; box-shadow: var(--bevel-out);
}
.tab-panel[hidden] { display: none; }
.tab-panel .note { font-size: .9rem; color: var(--ink-soft); margin: .8rem 0 0; }

/* ---------- Services ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
@media (max-width: 860px) { .svc-grid { grid-template-columns: 1fr; } }
.svc-card {
  background: var(--plastic-light);
  border: 2px solid var(--outline); box-shadow: var(--bevel-out);
  padding: 1.3rem; display: flex; flex-direction: column; gap: .6rem;
}
.svc-card img { width: 48px; height: 48px; }
.svc-card h3 { margin: .2rem 0 0; font-size: .9rem; }
.svc-card p { margin: 0; color: var(--ink-soft); font-size: .97rem; flex-grow: 1; }
.svc-card ul { margin: 0; padding-left: 1.1rem; color: var(--ink-soft); font-size: .92rem; }
.svc-cta-row { text-align: center; margin-top: 1.6rem; }

/* Process strip */
.process {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem;
  margin-top: 1.6rem; counter-reset: step;
}
@media (max-width: 760px) { .process { grid-template-columns: repeat(2, 1fr); } }
.process li {
  list-style: none; counter-increment: step;
  background: var(--plastic-light); border: 2px solid var(--outline);
  box-shadow: var(--bevel-out); padding: .9rem; font-size: .92rem; color: var(--ink-soft);
}
.process li strong { display: block; font-family: var(--font-pixel); font-size: .68rem; color: var(--ink); margin-bottom: .3rem; }
.process li strong::before { content: counter(step) ". "; color: var(--accent); }

/* ---------- Testimonials ---------- */
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
@media (max-width: 860px) { .testi-grid { grid-template-columns: 1fr; } }
.testi {
  background: var(--plastic-light); border: 2px solid var(--outline);
  box-shadow: var(--bevel-out); padding: 1.2rem;
  display: flex; flex-direction: column; gap: .8rem; margin: 0;
}
.testi blockquote { margin: 0; font-size: .98rem; color: var(--ink-soft); }
.testi blockquote::before { content: "“"; font-family: var(--font-pixel); color: var(--accent); font-size: 1.4rem; display: block; }
.testi figcaption { font-family: var(--font-pixel); font-size: .62rem; color: var(--ink); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: auto 1fr; gap: 1.6rem; align-items: start; }
@media (max-width: 640px) { .about-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.avatar-frame {
  width: 180px; height: 180px; display: grid; place-items: center;
  background: var(--desktop); border: 2px solid var(--outline); box-shadow: var(--bevel-in);
  overflow: hidden;
}
.avatar-frame img.avatar-photo { width: 100%; height: 100%; object-fit: cover; }
.avatar-frame img.avatar-fallback { width: 96px; height: 96px; }
.avatar-caption {
  font-family: var(--font-pixel); font-size: .55rem; color: var(--ink-soft);
  text-align: center; margin: .5rem 0 0; max-width: 180px;
}
.about-grid p { margin-top: 0; }

/* ---------- FAQ ---------- */
.faq details {
  background: var(--plastic-light); border: 2px solid var(--outline);
  box-shadow: var(--bevel-out); margin-bottom: .7rem;
}
.faq summary {
  cursor: pointer; padding: .85rem 1rem;
  font-family: var(--font-pixel); font-size: .72rem; list-style: none;
}
.faq summary::before { content: "▸ "; color: var(--accent); }
.faq details[open] summary::before { content: "▾ "; }
.faq details > p { margin: 0; padding: 0 1rem 1rem; color: var(--ink-soft); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.8rem; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-grid h3 { font-size: .85rem; margin: 0 0 .8rem; }
.email-box {
  display: flex; gap: .6rem; flex-wrap: wrap; align-items: center;
  background: var(--plastic-light); border: 2px solid var(--outline);
  box-shadow: var(--bevel-in); padding: .8rem 1rem; margin-bottom: 1rem;
  font-size: .95rem; word-break: break-all;
}
.socials { display: flex; gap: .7rem; flex-wrap: wrap; padding: 0; margin: 0; list-style: none; }
.socials a {
  display: inline-flex; align-items: center; gap: .45em;
  font-family: var(--font-pixel); font-size: .68rem; text-decoration: none;
  color: var(--ink); background: var(--plastic-light);
  border: 2px solid var(--outline); box-shadow: var(--bevel-out);
  padding: .6em .8em;
}
.socials a:hover { background: var(--teal); }
.copy-chip { cursor: pointer; }
.copy-chip.copied { background: var(--teal); }

/* ---------- 88x31 button marquee ---------- */
.button-strip { overflow: hidden; border-top: 2px solid var(--outline); background: var(--plastic-dark); padding: .55rem 0; }
/* On larger screens the strip docks above the fixed taskbar; on mobile it stays in the page flow to save space */
@media (min-width: 760px) {
  body.has-strip .button-strip {
    position: fixed; bottom: 52px; left: 0; right: 0; z-index: 1090;
  }
}
.button-track { display: flex; gap: 10px; width: max-content; animation: scrollx 40s linear infinite; }
.button-strip:hover .button-track { animation-play-state: paused; }
.button-track img { width: 88px; height: 31px; image-rendering: pixelated; }
@keyframes scrollx { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .button-track { animation: none; flex-wrap: wrap; width: auto; padding: 0 .8rem; }
}

/* ---------- Footer / bottom taskbar (fixed dock) ---------- */
footer.taskbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1100;
  background: var(--plastic);
  border-top: 2px solid var(--outline);
  box-shadow: var(--bevel-out);
  font-family: var(--font-pixel); font-size: .68rem;
  padding-bottom: env(safe-area-inset-bottom);
}
.taskbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: .5rem .8rem;
  display: flex; align-items: center; gap: .8rem; flex-wrap: nowrap;
  min-height: 30px;
}
/* Reserve space so the dock never covers content */
body.has-dock { padding-bottom: 70px; }
@media (min-width: 760px) {
  body.has-strip { padding-bottom: 122px; }
}
@media (max-width: 640px) {
  footer.taskbar .footer-links { display: none; }
}
.site-credits {
  font-family: var(--font-pixel); font-size: .6rem;
  color: #dff5f2; text-shadow: 1px 1px 0 rgba(0,0,0,.5);
  text-align: center; margin: 2.4rem 0 0;
}
.site-credits a { color: inherit; }
.start-btn {
  display: inline-flex; align-items: center; gap: .4em;
  font-family: var(--font-pixel); font-size: .72rem; font-weight: bold;
  background: var(--plastic); border: 2px solid var(--outline);
  box-shadow: var(--bevel-out); padding: .45em .8em; cursor: pointer;
}
.start-btn img { width: 16px; height: 16px; }
.start-btn[aria-expanded="true"] { box-shadow: var(--bevel-in); }
.start-menu {
  position: fixed; bottom: 56px; left: 12px; z-index: 1200;
  min-width: 210px; background: var(--plastic);
  border: 2px solid var(--outline); box-shadow: var(--bevel-out), var(--shadow-win);
  padding: .4rem; display: none;
}
.start-menu.open { display: block; }
.start-menu a, .start-menu button {
  display: flex; align-items: center; gap: .6em; width: 100%;
  font-family: var(--font-pixel); font-size: .7rem; text-align: left;
  color: var(--ink); text-decoration: none; background: none;
  border: none; padding: .55em .6em; cursor: pointer;
}
.start-menu a:hover, .start-menu button:hover { background: var(--title-a); color: #fff; }
.start-menu img { width: 18px; height: 18px; }
.start-menu hr { border: none; border-top: 2px solid var(--plastic-dark); margin: .3rem 0; }
.task-clock {
  margin-left: auto; background: var(--plastic-light);
  border: 2px solid var(--outline); box-shadow: var(--bevel-in);
  padding: .4em .7em;
}
.task-counter {
  margin-left: auto;
  background: #0a0a12; color: var(--teal);
  border: 2px solid var(--outline); box-shadow: var(--bevel-in);
  padding: .4em .7em; letter-spacing: .15em;
}
.task-counter + .task-clock { margin-left: 0; }
.footer-links { display: flex; gap: .9rem; flex-wrap: wrap; }
.footer-links a { color: var(--ink); }
.footer-note { width: 100%; font-size: .58rem; color: var(--ink-soft); }
.footer-note a { color: inherit; }

/* ---------- Sparkle cursor trail ---------- */
.sparkle {
  position: fixed; z-index: 9999; pointer-events: none;
  font-size: 12px; animation: spark .7s ease-out forwards;
}
@keyframes spark {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-16px) scale(.4); }
}

/* ---------- Mystery page ---------- */
.crt-screen {
  background: #0a0a12; color: #c8ffc8;
  border: 2px solid var(--outline); box-shadow: var(--bevel-in);
  padding: clamp(1.2rem, 4vw, 2.4rem);
  font-family: var(--font-pixel);
}
.crt-screen h2 { color: var(--teal); font-size: 1rem; }
.crt-screen p { font-size: .78rem; line-height: 1.9; }
.synth-keys { display: flex; gap: 6px; flex-wrap: wrap; margin: 1.4rem 0; }
.synth-keys button {
  font-family: var(--font-pixel); font-size: .7rem;
  background: #12122a; color: #c8ffc8;
  border: 2px solid #c8ffc8; padding: 1.1em .9em; cursor: pointer;
  min-width: 52px;
}
.synth-keys button:active, .synth-keys button.playing { background: var(--teal); color: #0a0a12; }

/* ---------- Utility ---------- */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.small { font-size: .85rem; color: var(--ink-soft); }
