/* Floppy Key — a 90s desk. Night by default: navy-black room, chalk outlines,
   coral and teal disks with cream handwritten labels, one beige drive.
   Day: lilac-grey plastic with navy ink. The disks themselves never change. */
:root {
  /* Theme tokens: night (default). */
  --bg: #100E22;
  --dot: #1D1A38;
  --fg: #EEECF7;
  --fg-soft: #A8A4CC;
  --line: #CFC9F2;        /* outlines and hard shadows */
  --surface: #1C1938;     /* cards, buttons, panels */
  --tray: #07061A;        /* the disk box */
  --tray-lip: #26224A;
  --rule: #34305C;        /* ruled lines on panels */
  --brand-disk: #FF6A55;
  --focus: #FFD23F;

  /* Fixed colors: the objects look the same day and night. */
  --disk-ink: #1D1A3F;
  --coral: #FF6A55;
  --teal: #20B8A8;
  --violet: #8E77FF;
  --sun: #FFD23F;
  --metal: #C9CCD8;
  --label: #FFFDF6;
  --disk-rule: #C9C3E3;
  --beige: #DCD3BF;
  --beige-dark: #BFB49C;
  --led: #39E07A;

  --f-pixel: "Silkscreen", "VT323", ui-monospace, monospace;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-hand: "Gochi Hand", "Comic Sans MS", cursive;
  --f-mono: "VT323", ui-monospace, monospace;

  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(2rem, 4vw, 2.6rem);
  --step-4: clamp(2.6rem, 7vw, 4.8rem);

  --gutter: clamp(16px, 4vw, 48px);
  --radius: 14px;
  --shadow: 4px 4px 0 var(--line);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #ECEAF4;
  --dot: #E1DEEE;
  --fg: #1D1A3F;
  --fg-soft: #4A4670;
  --line: #1D1A3F;
  --surface: #FFFDF6;
  --tray: #1D1A3F;
  --tray-lip: #2A2660;
  --rule: #C9C3E3;
  --brand-disk: #1D1A3F;
  --focus: #7B61F2;
  --violet: #7B61F2;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--step-0)/1.6 var(--f-body);
  padding-inline: var(--gutter);
  /* Faint dot grid, like a cutting mat. */
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  transition: background-color .25s ease, color .25s ease;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2 { text-wrap: balance; margin: 0; }
p { margin: 0; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--gutter); top: 8px; background: var(--sun); color: var(--disk-ink); padding: 6px 10px; z-index: 10; }

/* ---------- Header ---------- */
.top {
  max-width: 1160px; margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 22px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; --body: var(--brand-disk); }
.brand-text { display: grid; line-height: 1; gap: 4px; }
.brand-name { font: 700 1.35rem/1 var(--f-pixel); letter-spacing: 0.02em; }
/* Part of the logo: always in English, like the name. */
.brand-sub { font: 400 1.05rem/1 var(--f-mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--fg-soft); }
.nav { display: flex; align-items: center; gap: clamp(12px, 3vw, 28px); font-weight: 700; flex-wrap: wrap; }
.nav a { text-decoration: none; }
.nav a:hover { text-decoration: underline wavy var(--coral) 2px; text-underline-offset: 6px; }
.toggles { display: flex; gap: 8px; }
.chip {
  font: 700 0.8rem var(--f-pixel); color: var(--fg);
  background: var(--surface); border: 2px solid var(--line); border-radius: 8px;
  padding: 4px 10px; cursor: pointer; box-shadow: 2px 2px 0 var(--line);
}
.chip:active { transform: translate(2px, 2px); box-shadow: none; }

main { max-width: 1160px; margin-inline: auto; display: grid; gap: clamp(72px, 10vw, 128px); padding-block: 24px 96px; }

.eyebrow { font: 400 1.2rem var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-soft); }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 800 1rem var(--f-body); text-decoration: none; cursor: pointer;
  padding: 12px 20px; border-radius: 10px; border: 2px solid var(--line);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-primary { background: var(--coral); color: var(--disk-ink); box-shadow: var(--shadow); }
.btn-ghost { background: var(--surface); color: var(--fg); box-shadow: 2px 2px 0 var(--line); }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--line); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--line); }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 72px); align-items: center;
}
.hero-copy { display: grid; gap: 22px; min-width: 0; }
.hero-title { font: 800 var(--step-4)/1.02 var(--f-body); letter-spacing: -0.02em; display: grid; }
.hero-title .hl {
  font-family: var(--f-pixel); font-weight: 700; letter-spacing: 0; font-size: 0.7em; white-space: nowrap;
  color: var(--disk-ink); background: var(--sun); justify-self: start;
  padding: 0 0.18em; margin-block: 0.08em; transform: rotate(-1.5deg);
  box-shadow: var(--shadow); border: 2px solid var(--line);
}
.lead { font-size: var(--step-1); max-width: 34ch; color: var(--fg-soft); }

.drive-stage { position: relative; display: grid; justify-items: center; padding-top: 150px; }
.disk { position: absolute; width: 190px; filter: drop-shadow(6px 6px 0 var(--line)); }
.disk svg { width: 100%; height: auto; }
.disk-hero { --body: var(--coral); top: 0; animation: insert 2.6s cubic-bezier(.5,0,.2,1) .4s both; }
.disk-label {
  position: absolute; left: 22%; right: 22%; bottom: 25%;
  font: 400 1.7rem/1 var(--f-hand); color: var(--disk-ink); text-align: center; transform: rotate(-3deg);
}
.drive {
  position: relative; z-index: 2; width: min(100%, 360px);
  background: var(--beige); border: 3px solid var(--line); border-radius: 12px;
  box-shadow: 8px 8px 0 var(--line); padding: 18px 20px 16px;
  display: grid; gap: 14px;
}
.drive-slot { height: 14px; background: var(--disk-ink); border-radius: 4px; box-shadow: inset 0 4px 0 #000; }
.drive-face { display: flex; align-items: center; gap: 12px; }
.drive-led {
  width: 14px; height: 8px; border-radius: 2px; background: #6b6a5a; border: 1px solid var(--disk-ink);
  animation: led 2.6s steps(1) .4s both;
}
.drive-text { font: 400 1.25rem var(--f-mono); color: #5C5848; letter-spacing: 0.08em; }
.drive-btn { margin-left: auto; width: 30px; height: 12px; background: var(--beige-dark); border: 2px solid var(--disk-ink); border-radius: 3px; }
.drive-status { margin-top: 22px; font: 400 1.35rem var(--f-mono); letter-spacing: 0.06em; opacity: 0; animation: show .1s linear 2.9s forwards; }
.blink { color: var(--teal); animation: blink 1s steps(1) infinite; }

/* The disk drops into the slot and stays there, its shutter peeking out. */
@keyframes insert {
  0%   { transform: translateY(-30px) rotate(-8deg); }
  35%  { transform: translateY(0) rotate(0); }
  55%  { transform: translateY(0) rotate(0); }
  100% { transform: translateY(104px) rotate(0); }
}
@keyframes led { 0% { background: #6b6a5a; } 70% { background: var(--led); box-shadow: 0 0 10px var(--led); } 100% { background: var(--led); box-shadow: 0 0 10px var(--led); } }
@keyframes show { to { opacity: 1; } }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Disk box ---------- */
.section-head { display: grid; gap: 8px; margin-bottom: 32px; }
.section-head h2, .studio h2 { font: 800 var(--step-3)/1.1 var(--f-body); letter-spacing: -0.01em; }
.section-head p { color: var(--fg-soft); font-size: var(--step-1); }

.box {
  list-style: none; margin: 0; padding: clamp(18px, 3vw, 32px);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 3vw, 32px);
  background: var(--tray); border-radius: 20px; border: 2px solid var(--tray-lip);
  /* The disk box: a dark tray with a lid lip. */
  box-shadow: inset 0 10px 0 var(--tray-lip);
}
.card {
  height: 100%;
  display: grid; gap: 16px; align-content: start;
  background: var(--surface); border-radius: var(--radius); padding: 22px;
  text-decoration: none; color: var(--fg);
  transition: transform .18s ease;
}
:root[data-theme="light"] .card { background: var(--bg); }
a.card:hover { transform: translateY(-8px) rotate(-1.5deg); }
.card-disk { position: relative; width: min(100%, 180px); justify-self: center; filter: drop-shadow(5px 5px 0 #000); }
:root[data-theme="light"] .card-disk { filter: drop-shadow(5px 5px 0 var(--disk-ink)); }
.card-disk svg { width: 100%; height: auto; display: block; }
.card-label {
  position: absolute; left: 21%; right: 21%; bottom: 24%;
  font: 400 1.5rem/1 var(--f-hand); color: var(--disk-ink); text-align: center; transform: rotate(-2deg);
}
.card-soon .card-disk { opacity: 0.85; }
.card-meta { display: grid; gap: 6px; }
.card-title { font: 800 1.15rem/1.25 var(--f-body); }
.card-genre { color: var(--fg-soft); font-size: 0.95rem; }
.tag {
  justify-self: start; font: 700 0.72rem var(--f-pixel); letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px; border: 2px solid var(--line); background: var(--surface); color: var(--fg);
}
.tag-live { background: var(--led); color: var(--disk-ink); }

/* ---------- Feature ---------- */
.feature {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px); align-items: center;
}
.crt {
  background: #0B0B0B; border: 3px solid var(--line); border-radius: 22px;
  padding: clamp(10px, 2vw, 18px); box-shadow: 10px 10px 0 var(--teal), 10px 10px 0 2px var(--line);
  min-width: 0;
}
.crt img { border-radius: 10px; display: block; width: 100%; height: auto; }
/* The second feature: picture on the right, in the game's gold. */
.feature-flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.feature-flip .crt { order: 2; }
.crt-sun { box-shadow: 10px 10px 0 var(--sun), 10px 10px 0 2px var(--line); }
.feature h2.title-sun span { color: var(--sun); }
.feature-copy { display: grid; gap: 18px; min-width: 0; }
.feature h2 { font: 700 var(--step-3)/1 var(--f-pixel); display: grid; gap: 6px; }
.feature h2 span { font: 400 var(--step-2)/1.1 var(--f-hand); color: var(--coral); }
.feature-copy > p { max-width: 46ch; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.facts li { display: flex; gap: 12px; align-items: baseline; }
.facts b { font: 700 1.3rem var(--f-pixel); min-width: 3.2ch; font-variant-numeric: tabular-nums; color: var(--violet); }
.note { font: 400 1.2rem var(--f-mono); color: var(--fg-soft); }

/* ---------- Studio ---------- */
.studio { display: grid; gap: 28px; }
.studio-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.studio-grid > p { font-size: var(--step-1); max-width: 40ch; }
.specs {
  margin: 0; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px 20px;
}
.specs div { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 12px; padding-block: 12px; border-bottom: 2px dashed var(--rule); }
.specs div:last-child { border-bottom: 0; }
.specs dt { font: 400 1.2rem var(--f-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-soft); }
.specs dd { margin: 0; font-weight: 700; }

/* ---------- Contact: a giant disk label ---------- */
.label-card {
  background: var(--surface); border: 3px solid var(--line); border-radius: 18px;
  padding: clamp(24px, 5vw, 48px); display: grid; gap: 16px; box-shadow: 10px 10px 0 var(--violet), 10px 10px 0 2px var(--line);
  background-image: repeating-linear-gradient(to bottom, transparent 0 46px, var(--rule) 46px 48px);
  background-position: 0 30px;
}
.label-card h2 { font: 400 var(--step-4)/1 var(--f-hand); transform: rotate(-1.5deg); justify-self: start; }
.label-card p { font-size: var(--step-1); max-width: 48ch; }
.contact-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 6px; }
.mail { font: 400 1.5rem var(--f-mono); user-select: all; background: var(--bg); padding: 4px 10px; border-radius: 6px; }

/* ---------- Footer ---------- */
.foot {
  max-width: 1160px; margin-inline: auto; padding-block: 28px 40px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  font: 400 1.2rem var(--f-mono); color: var(--fg-soft); border-top: 2px solid var(--line);
}

/* ---------- Devblog ---------- */
.nav a[aria-current="page"] { text-decoration: underline var(--coral) 3px; text-underline-offset: 6px; }
main.blog { gap: 32px; padding-top: 8px; }

.blog-head { display: grid; gap: 10px; }
.blog-title { font: 700 var(--step-4)/1 var(--f-pixel); letter-spacing: 0; }
.blog-sub { font-size: var(--step-1); color: var(--fg-soft); max-width: 46ch; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; }
.filter {
  display: inline-flex; align-items: center; gap: 8px;
  font: 700 0.85rem var(--f-pixel); text-decoration: none; color: var(--fg);
  background: var(--surface); border: 2px solid var(--line); border-radius: 8px;
  padding: 6px 12px; box-shadow: 2px 2px 0 var(--line);
}
.filter:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--line); }
.filter[aria-current="true"] { background: var(--sun); color: var(--disk-ink); }
.filter-dot { width: 12px; height: 12px; border-radius: 3px; background: var(--body); border: 2px solid var(--disk-ink); }
.filter-count { font: 400 1.05rem/1 var(--f-mono); opacity: 0.75; }

.posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }
.posts > li[hidden] { display: none; }
.post-card {
  display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(18px, 3vw, 32px); align-items: center;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 16px; text-decoration: none; color: var(--fg);
  box-shadow: 6px 6px 0 var(--body), 6px 6px 0 2px var(--line);
  transition: transform .15s ease;
}
.post-card:hover { transform: translate(-2px, -3px) rotate(-0.4deg); }
.post-card:hover .post-card-read { text-decoration: underline wavy var(--coral) 2px; text-underline-offset: 6px; }
.post-card-cover { width: 100%; aspect-ratio: 630 / 500; object-fit: cover; border-radius: 10px; border: 2px solid var(--line); background: #0B0B0B; }
.post-card-body { display: grid; gap: 10px; align-content: center; min-width: 0; padding-right: 8px; }
.post-card-title { font: 800 var(--step-2)/1.15 var(--f-body); text-wrap: balance; }
.post-card-summary { color: var(--fg-soft); max-width: 60ch; }
.post-card-read { font-weight: 800; justify-self: start; }
.post-card-read::after { content: " →"; }
.posts-empty { font: 400 1.4rem var(--f-mono); color: var(--fg-soft); }

.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.post-meta time, .post-version { font: 400 1.2rem/1 var(--f-mono); color: var(--fg-soft); letter-spacing: 0.04em; }
.post-version { color: var(--fg); }
.tag-game { background: var(--body); color: var(--disk-ink); text-decoration: none; }
a.tag-game:hover { box-shadow: 2px 2px 0 var(--line); }

/* An entry: one readable column. */
.post { width: min(100%, 760px); margin-inline: auto; display: grid; gap: 28px; }
.back { font: 400 1.25rem var(--f-mono); color: var(--fg-soft); text-decoration: none; justify-self: start; }
.back:hover { color: var(--fg); }
.post-head { display: grid; gap: 14px; padding-bottom: 24px; border-bottom: 2px dashed var(--rule); }
.post-title { font: 800 var(--step-3)/1.1 var(--f-body); letter-spacing: -0.01em; }
.lang-note { display: none; font: 400 1.2rem var(--f-mono); color: var(--fg-soft); }
:root[lang="es"] .lang-note[data-for="es"], :root[lang="en"] .lang-note[data-for="en"] { display: block; }

.prose { font-size: 1.1rem; line-height: 1.7; overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font: 800 var(--step-2)/1.2 var(--f-body); margin-top: 2em; scroll-margin-top: 16px; }
.prose h2::before { content: "▮ "; color: var(--body); font-family: var(--f-mono); }
.prose h3, .prose h4 { font: 800 var(--step-1)/1.3 var(--f-body); margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.4em; margin-bottom: 0; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--body); font-weight: 800; }
.prose a { text-decoration-color: var(--coral); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose strong { font-weight: 800; }
.prose code { font: 400 1.15em var(--f-mono); background: var(--surface); padding: 0 6px; border-radius: 4px; }
.prose pre { background: var(--tray); color: #EEECF7; padding: 16px; border-radius: 10px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { margin-inline: 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--body); color: var(--fg-soft); }
.prose hr { border: 0; border-top: 2px dashed var(--rule); margin-block: 2.2em; }
.prose figure { margin: 2em 0; display: grid; gap: 12px; justify-items: center; }
.prose figure img {
  border: 3px solid var(--line); border-radius: 12px; background: #0B0B0B;
  box-shadow: 8px 8px 0 var(--body), 8px 8px 0 2px var(--line);
}
.prose figcaption { font: 400 1.25rem/1.3 var(--f-hand); color: var(--fg-soft); text-align: center; transform: rotate(-1deg); }

.post-cta {
  display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 20px; align-items: center; margin-top: 16px;
  background: var(--surface); border: 3px solid var(--line); border-radius: 18px; padding: clamp(18px, 4vw, 28px);
  box-shadow: 8px 8px 0 var(--violet), 8px 8px 0 2px var(--line);
}
.post-cta-disk { width: 72px; height: 72px; filter: drop-shadow(3px 3px 0 var(--line)); }
.post-cta-copy { display: grid; gap: 14px; min-width: 0; }
.post-cta-game { font: 400 var(--step-2)/1.1 var(--f-hand); }

.post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.post-nav-link {
  display: grid; gap: 4px; text-decoration: none; padding: 14px 16px;
  border: 2px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 2px 2px 0 var(--line);
}
.post-nav-link:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line); }
.post-nav-link.older { grid-column: 2; text-align: right; }
.post-nav-dir { font: 400 1.1rem var(--f-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-soft); }
.newer .post-nav-dir::before { content: "← "; }
.older .post-nav-dir::after { content: " →"; }
.post-nav-title { font-weight: 800; line-height: 1.3; }

/* ---------- Narrow screens ---------- */
@media (max-width: 860px) {
  .hero, .feature, .feature-flip, .studio-grid { grid-template-columns: minmax(0, 1fr); }
  .feature-flip .crt { order: 0; }
  .drive-stage { order: -1; padding-top: 130px; }
  .disk { width: 160px; }
  .box { grid-template-columns: minmax(0, 1fr); }
  .card { grid-template-columns: 120px minmax(0, 1fr); align-items: center; }
  .card-disk { width: 120px; }
  .card-label { font-size: 1.1rem; }
  .post-card { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .post-card-body { padding: 4px 6px 8px; }
}
@media (max-width: 560px) {
  .post-nav { grid-template-columns: minmax(0, 1fr); }
  .post-nav-link.older { grid-column: auto; }
  .post-cta { grid-template-columns: minmax(0, 1fr); }
  .post-cta-disk { width: 56px; height: 56px; }
  .prose figure img { box-shadow: 5px 5px 0 var(--body), 5px 5px 0 2px var(--line); }
}
@media (max-width: 420px) {
  .nav { gap: 12px; font-size: 0.95rem; }
  .specs div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body { transition: none; }
  .disk-hero { animation: none; transform: translateY(104px); }
  .drive-led { animation: none; background: var(--led); }
  .drive-status { animation: none; opacity: 1; }
  .blink { animation: none; }
  .btn, .card, .post-card { transition: none; }
}
