/* 8-Bit Corner: a Commodore-style screen (VIC-II blues) for the Commodore 64 and 128 software */
@font-face { font-family: 'Press Start 2P'; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/PressStart2P-400.woff2) format('woff2'); }

body.c64 {
  --p-bg: #120e33; --p-ink: #e6e3ff; --p-accent: #8f82ff; --p-accent2: #ffd75e; --p-dim: #aba6d6;
  --p-panel: rgba(143, 130, 255, 0.06); --p-edge: rgba(143, 130, 255, 0.28); --p-head: 'Press Start 2P', monospace;
  --vic-border: #7869c4; --vic-screen: #40318d; --vic-text: #9f94ff;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the pixel font runs wide: smaller headings than the other project pages */
body.c64 .p-h2 { font-size: clamp(0.9rem, 2.4vw, 1.25rem); line-height: 1.5; }
body.c64 .p-feats b, body.c64 .p-card h3 { font-size: 0.78rem; line-height: 1.6; letter-spacing: 0.02em; }
body.c64 h1.c64-title { margin: 26px 0 0; font: 400 clamp(1.3rem, 4.6vw, 2.4rem) 'Press Start 2P', monospace; color: var(--p-ink);
  text-shadow: 0 0 18px rgba(143, 130, 255, 0.55); }

.c64-hero { background: radial-gradient(ellipse at 50% 40%, #241c63 0%, var(--p-bg) 70%); }

/* the computer screen: border colour round a 40-column screen */
.vic {
  width: min(640px, 100%); margin: 0 auto; padding: clamp(14px, 4.5vw, 34px) clamp(16px, 5vw, 40px); border-radius: 18px;
  background: var(--vic-border);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.95), 0 0 0 10px #1c1840, 0 0 0 11px #3a3375, inset 0 0 40px rgba(0, 0, 0, 0.35);
}
.vic-screen {
  position: relative; container-type: inline-size; aspect-ratio: 320 / 200; overflow: hidden; background: var(--vic-screen);
  text-align: left;
}
.vic-text {
  margin: 0; padding: 0; font: 400 calc(100cqw / 40) / 1 'Press Start 2P', monospace; color: var(--vic-text);
  white-space: pre; -webkit-font-smoothing: none; font-smooth: never;
}
.vic-cursor { display: inline-block; width: 1ch; height: 1em; vertical-align: top; background: var(--vic-text); animation: blink 0.53s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.vic-pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; image-rendering: pixelated;
  opacity: 0; transition: opacity 0.5s; }
.vic-pic.on { opacity: 1; }
/* scan lines */
.vic-screen::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px); }

/* the video and screenshots are 4:3-ish C64 frames, not 16:9 */
body.c64 .vid, body.c64 .shots { max-width: 760px; }
body.c64 .vid video { aspect-ratio: auto; }
body.c64 .shot img { image-rendering: pixelated; }
body.c64 .shot-thumbs button img { aspect-ratio: 1152 / 988; object-fit: cover; }

/* typed commands */
.c64-code { display: inline-block; margin: 6px 0 0; padding: 14px 18px; border-radius: 10px; background: var(--vic-screen);
  border: 6px solid var(--vic-border); font: 400 0.8rem / 1.7 'Press Start 2P', monospace; color: var(--vic-text); white-space: pre; max-width: 100%; overflow-x: auto; }

.c64-table { width: 100%; border-collapse: collapse; margin: 6px 0 0; font-size: 0.97rem; }
.c64-table th, .c64-table td { padding: 12px 10px; border-bottom: 1px solid var(--p-edge); text-align: left; vertical-align: top; color: var(--p-dim); }
.c64-table th { color: var(--p-ink); font-weight: 600; }
.c64-table td:first-child { white-space: nowrap; }
.c64-table a { color: var(--p-accent); }
@media (max-width: 560px) {
  .c64-table thead { display: none; }
  .c64-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--p-edge); }
  .c64-table td { display: block; padding: 4px 0; border: 0; }
}

.p-section a:not(.p-btn) { color: var(--p-accent); }
.c64-status { display: inline-block; margin-top: 18px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--p-edge);
  color: var(--p-accent2); font-size: 0.92rem; }

@media (prefers-reduced-motion: reduce) { .vic-cursor { animation: none; } .vic-pic { transition: none; } }

/* the hero's text column takes the full width, so the screen sizes to the page, not to its 40-column text */
.c64-hero .p-hero-text { width: 100%; min-width: 0; }
.vic-screen { width: 100%; }

/* hub: the Software and Hardware doors */
.c64-doors { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.c64-door { display: flex; flex-direction: column; gap: 10px; padding: 28px 26px; border-radius: 18px; text-decoration: none; color: var(--p-dim);
  background: linear-gradient(160deg, rgba(143, 130, 255, 0.14), rgba(143, 130, 255, 0.03)); border: 1px solid var(--p-edge);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; }
.c64-door:hover { transform: translateY(-4px); border-color: var(--p-accent); box-shadow: 0 18px 46px -20px var(--p-accent); }
.c64-door:focus-visible { outline: 2px solid var(--p-ink); outline-offset: 3px; }
.c64-door-k { font: 400 0.62rem 'Press Start 2P', monospace; color: var(--vic-text); opacity: 0.8; }
.c64-door h2 { margin: 0; font: 400 clamp(1.1rem, 3vw, 1.5rem) 'Press Start 2P', monospace; color: var(--p-ink); }
.c64-door p { margin: 0; line-height: 1.55; }
.c64-door-go { margin-top: auto; padding-top: 8px; color: var(--p-accent2); font-weight: 600; }

/* sub-pages */
.c64-sub { max-width: 1040px; margin: 0 auto; padding: 120px 16px 10px; text-align: center; }
.c64-sub .c64-title { margin-top: 6px; }
.c64-crumb { margin: 0 0 26px; text-align: left; font-size: 0.92rem; color: var(--p-dim); }
.c64-crumb a { color: var(--p-accent); }
.c64-meta { margin: -14px 0 24px; color: var(--p-accent2); font-size: 0.95rem; }
.c64-item-grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 760px) { .c64-item-grid { grid-template-columns: 1fr; } }
.c64-shot { margin: 0; padding: 10px; border-radius: 16px; background: linear-gradient(160deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.02)); border: 1px solid var(--p-edge); }
.c64-shot img { display: block; width: 100%; height: auto; border-radius: 8px; cursor: zoom-in; }
.c64-shot figcaption { margin-top: 10px; text-align: center; color: var(--p-dim); font-size: 0.88rem; }
.c64-list { margin: 0; padding-left: 1.2em; color: var(--p-dim); line-height: 1.6; }
.c64-list li { margin-bottom: 6px; }
.c64-list b { color: var(--p-ink); }
.c64-h3 { margin: 40px 0 16px; font: 400 0.95rem 'Press Start 2P', monospace; color: var(--p-ink); }
.c64-get { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.c64-dl { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: 14px; text-decoration: none;
  background: var(--p-panel); border: 1px solid var(--p-edge); color: var(--p-dim); transition: transform 0.2s, border-color 0.2s; }
.c64-dl b { color: var(--p-accent); font-size: 1.05rem; }
.c64-dl span { font: 400 0.62rem 'Press Start 2P', monospace; color: var(--p-ink); margin: 4px 0; }
.c64-dl small { font-size: 0.86rem; line-height: 1.45; }
.c64-dl:hover { transform: translateY(-3px); border-color: var(--p-accent); }
.c64-dl:focus-visible { outline: 2px solid var(--p-ink); outline-offset: 3px; }
.c64-tm { margin-top: 30px; font-size: 0.85rem; }
.p-section a.c64-dl { color: var(--p-dim); }
.c64-hero { min-height: auto; padding-bottom: 30px; }
.p-section a.c64-door { color: var(--p-dim); }

/* ---- hub cards drawn as objects: a 5.25" floppy and a made-up 8-bit computer ---- */
@font-face { font-family: 'VT323'; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/VT323-400.woff2) format('woff2'); }
.c64-doors { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 40px; align-items: center; }
.fd, .hw { position: relative; display: block; container-type: inline-size; text-decoration: none; color: inherit;
  transition: transform 0.25s, filter 0.25s; filter: drop-shadow(0 26px 30px rgba(0, 0, 0, 0.6)); }
.fd { width: min(100%, 440px); justify-self: center; --fd-hole: var(--p-bg); }
.hw { width: min(100%, 560px); justify-self: center; }
.fd:hover { transform: translateY(-6px) rotate(-1.5deg); }
.hw:hover { transform: translateY(-6px); }
.fd:focus-visible, .hw:focus-visible { outline: 2px solid var(--p-ink); outline-offset: 6px; border-radius: 8px; }
.fd-art, .hw-art { display: block; width: 100%; height: auto; }

/* the paper label: top of the sleeve, above the hub hole (sizes in % of the 5.25" sleeve) */
.fd-label { position: absolute; left: 11%; top: 4.6%; width: 66%; height: 30%; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #f6f1e3, #ece4cf); border-radius: 2px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  color: #23305e; overflow: hidden; transform: rotate(-0.6deg);
  background-image: linear-gradient(180deg, transparent 0 calc(100% - 1px), rgba(64, 99, 170, 0.28) calc(100% - 1px)), linear-gradient(180deg, #f6f1e3, #ece4cf);
  background-size: 100% 4.6cqw, 100% 100%; background-position: 0 1.2cqw, 0 0; }
.fd-band { display: flex; justify-content: space-between; padding: 0.9cqw 2.2cqw; background: #c8402f; color: #fff;
  font: 700 2.3cqw/1.2 'Space Grotesk', sans-serif; letter-spacing: 0.12em; }
.fd-title { padding: 0.6cqw 2.4cqw 0; font: 400 7.6cqw/1 'VT323', monospace; color: #172453; }
.fd-line { padding: 0 2.4cqw; font: 400 4.1cqw/1.1 'VT323', monospace; color: #2a3a72; }
.fd-go { margin-top: auto; padding: 0 2.4cqw 1.4cqw; font: 400 4.1cqw/1 'VT323', monospace; color: #b2321f; }

/* the computer: its text sits on the case, left of the vents (sizes in % of the 600-wide drawing) */
.hw-text { position: absolute; left: 6%; top: 6.6%; width: 60%; height: 27%; display: flex; flex-direction: column; gap: 0.6cqw; }
.hw-title { font: 700 5.4cqw/1 'Orbitron', sans-serif; letter-spacing: 0.06em; color: #3b3326; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55); }
.hw-line { font: 600 2.55cqw/1.35 'Space Grotesk', sans-serif; color: #5a5040; }
.hw-go { margin-top: auto; font: 700 2.6cqw/1 'Space Grotesk', sans-serif; color: #2f5fb3; }
@media (prefers-reduced-motion: reduce) { .fd, .hw { transition: none; } .fd:hover, .hw:hover { transform: none; } }
