/* styles.css — SPIDERFROG side-scroll (HTML + CSS only)
   - Regular horizontal scrolling (no rotation tricks)
   - Scroll-snap per panel
   - Images always fully visible in the viewport (no cropping)
*/

:root{
  --bg: #0b0c10;
  --panel-bg: #0f1117;
  --ink: #e8e8ea;
  --muted: rgba(232,232,234,.72);
  --hairline: rgba(255,255,255,.12);
  --shadow: 0 18px 50px rgba(0,0,0,.55);
  --radius: 18px;

  --topbar-h: 64px;
  --bottombar-h: 40px;

  --pad: 12px;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  overflow: hidden; /* scrolling happens inside .strip */
}

/* ---------- header/nav ---------- */
.topbar{
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
  background: linear-gradient(to bottom, rgba(255,255,255,.06), rgba(255,255,255,.02));
}

.brand{
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  min-width: 160px;
}
.brand .title{
  font-weight: 800;
  letter-spacing: .08em;
  font-size: 14px;
}
.brand .sub{
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.nav{
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.nav a{
  text-decoration: none;
  color: var(--ink);
  font-size: 12px;
  padding: 8px 10px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(255,255,255,.03);
  white-space: nowrap;
}
.nav a:hover{ background: rgba(255,255,255,.07); }
.nav a:focus{
  outline: 2px solid rgba(255,255,255,.25);
  outline-offset: 2px;
}

/* ---------- the horizontal strip ---------- */
.strip{
  height: calc(100vh - var(--topbar-h) - var(--bottombar-h));

  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100vw;

  overflow-x: auto;
  overflow-y: hidden;

  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

/* each panel = one viewport width */
.panel{
  scroll-snap-align: start;

  height: 100%;
  display: grid;
  place-items: center;
  padding: var(--pad);

  background:
    radial-gradient(900px 600px at 20% 15%, rgba(255,255,255,.05), transparent 60%),
    radial-gradient(700px 500px at 80% 90%, rgba(255,255,255,.04), transparent 60%),
    var(--bg);
}

/* ---------- frame + image (fit fully in viewport) ---------- */
.frame{
  /* Force the viewer to fit inside the visible comic area */
  width: calc(100vw - (var(--pad) * 2));
  height: calc(100vh - var(--topbar-h) - var(--bottombar-h) - (var(--pad) * 2));

  margin: 0;
  border-radius: var(--radius);
  background: var(--panel-bg);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow);

  display: flex;
  flex-direction: column;
  overflow: hidden;

  min-width: 0;
  min-height: 0;
}

.frame img{
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;

  width: 100%;
  height: 100%;
  object-fit: contain; /* key: no cropping */

  display: block;
  background: #0a0b0f;

  user-select: none;
  -webkit-user-drag: none;
}

.caption{
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--hairline);
  background: rgba(255,255,255,.03);
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* highlight the targeted panel subtly (when you click nav links) */
.panel:target .frame{
  border-color: rgba(255,255,255,.28);
}

/* ---------- footer ---------- */
.bottombar{
  height: var(--bottombar-h);
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 12px;
  background: rgba(255,255,255,.02);
}

/* ---------- small screens ---------- */
@media (max-width: 480px){
  :root{
    --topbar-h: 72px;
    --pad: 10px;
  }
  .brand{ min-width: 130px; }
  .nav a{ padding: 7px 9px; }
}
