/* Voxel dev diary — "first light".
   One idea carries the whole page: a cube shows three faces, each catching
   light differently. Top = low dawn sun (amber), two sides in dusk shadow.
   Background is a deep dusk indigo, not black; the world's green is a guest,
   not the host. */

:root {
  /* dusk */
  --night:       #15131f;
  --night-2:     #1b1730;
  --panel:       #1e1933;
  --panel-2:     #241e3c;
  --border:      #2d2748;
  --border-soft: #241f3a;

  /* ink */
  --text:        #ece8f6;
  --text-dim:    #a098ba;
  --text-faint:  #6f6789;

  /* the three faces of a single block of light */
  --face-top:    #ffbb63;  /* sun rakes the top */
  --face-left:   #b4663b;  /* warm shadow */
  --face-right:  #463a64;  /* cool shadow */
  --face-top-new:#ffe2ad;  /* a freshly placed block, still bright */

  /* accents */
  --light:       #ffb35c;  /* the light itself */
  --light-soft:  #ffd49a;
  --terrain:     #8cc36e;  /* the world's green — used sparingly */

  --maxw: 1080px;
  --measure: 40rem;

  --display: "Archivo Expanded", "Archivo", system-ui, sans-serif;
  --serif:   "Newsreader", Georgia, "Times New Roman", serif;
  --mono:    "Space Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--night);
  /* a single low sun, off to the upper-left, the way the cubes are lit */
  background-image:
    radial-gradient(1100px 700px at 12% -8%, rgba(255, 169, 84, 0.10), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(110, 80, 170, 0.10), transparent 55%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* cube faces, filled from here so the markup stays colourless */
.face-top   { fill: var(--face-top); }
.face-left  { fill: var(--face-left); }
.face-right { fill: var(--face-right); }
.cube { display: block; width: 22px; height: 24px; }

a { color: var(--light); }

::selection { background: rgba(255, 179, 92, 0.28); color: #fff; }

:focus-visible {
  outline: 2px solid var(--light);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- header / footer --- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem clamp(1.1rem, 4vw, 2rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.brand .cube--brand { width: 22px; height: 24px; }
.brand-dim { color: var(--text-faint); }

.nav-log {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--text-dim);
  text-decoration: none;
}
.nav-log:hover { color: var(--light); }
.nav-log span { color: var(--light); }

.site-nav { display: inline-flex; align-items: center; gap: 1.1rem; }
.nav-play {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  text-decoration: none;
  color: var(--light);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.32rem 0.7rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.nav-play:hover { border-color: var(--light); background: rgba(255, 179, 92, 0.08); }

/* hero call-to-action buttons */
.hero-cta { display: flex; gap: 0.8rem; margin-top: 1.8rem; flex-wrap: wrap; }
.cta {
  font-family: var(--mono);
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: 0.7rem 1.3rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.cta:hover { transform: translateY(-2px); border-color: var(--light); }
.cta--primary {
  background: linear-gradient(180deg, var(--face-top), var(--light));
  border-color: var(--light);
  color: #2a1c08;
  font-weight: 700;
}
.cta--primary:hover { background: linear-gradient(180deg, var(--face-top-new), var(--face-top)); }

.site-footer {
  max-width: var(--maxw);
  margin: 6rem auto 2.5rem;
  padding: 1.5rem clamp(1.1rem, 4vw, 2rem) 0;
  border-top: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.foot-brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--text-dim); }
.foot-brand .cube--foot { width: 16px; height: 18px; }
.dim { color: var(--text-faint); }

/* --- shared scaffolding --- */

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(1.1rem, 4vw, 2rem);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--light);
  margin: 0 0 1rem;
}
.eyebrow .sep { color: var(--text-faint); margin: 0 0.5em; }
.eyebrow .stamp { color: var(--text-dim); }

.section-label {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0;
}

/* --- hero --- */

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: clamp(1.5rem, 5vw, 4rem);
  padding: clamp(2rem, 7vw, 5rem) 0 clamp(2.5rem, 6vw, 4.5rem);
}

.hero-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.3rem, 6vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  margin: 0 0 1.4rem;
  text-wrap: balance;
}

.lede {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 32ch;
  margin: 0;
}

.hero-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
}
.hero-sun {
  position: absolute;
  top: 8%;
  left: 18%;
  width: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 196, 120, 0.55), rgba(255, 179, 92, 0) 70%);
  filter: blur(6px);
  pointer-events: none;
}
.voxel-scene {
  position: relative;
  width: clamp(220px, 30vw, 330px);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 28px 30px rgba(0, 0, 0, 0.45));
}
.vx-cube .face-top { stroke: rgba(255, 226, 173, 0.35); stroke-width: 0.5; }
.vx-cube--new .face-top { fill: var(--face-top-new); }
.vx-cube--new { filter: drop-shadow(0 0 14px rgba(255, 196, 120, 0.7)); }

/* page-load: the world assembles one block at a time, back-to-front */
.vx-cube {
  animation: vx-rise 0.6s cubic-bezier(0.2, 0.75, 0.2, 1) backwards;
  animation-delay: calc(var(--i) * 0.13s + 0.15s);
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes vx-rise {
  from { opacity: 0; transform: translateY(-16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- build log --- */

.log { padding-top: 0.5rem; }
.log-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 0.5rem;
}
.log-count {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
/* the build tower — a line threading every block's centre */
.entry-list::before {
  content: "";
  position: absolute;
  top: 1.9rem;
  bottom: 1.9rem;
  left: 11px;
  width: 2px;
  background: linear-gradient(var(--border), var(--border-soft));
}
.entry-row { margin: 0; }

.entry-row a {
  display: grid;
  grid-template-columns: 24px 8.5rem 1fr;
  align-items: start;
  gap: 0 1.4rem;
  padding: 1.4rem 0;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border-soft);
  transition: transform 0.16s ease;
}
.entry-row:last-child a { border-bottom: none; }
.entry-row a:hover { transform: translateX(3px); }

.entry-marker {
  position: relative;
  z-index: 1;
  display: block;
  /* a disc of page colour so the tower line breaks cleanly behind the cube */
  margin-top: -2px;
}
.entry-marker .cube--marker {
  width: 24px;
  height: 26px;
  filter: drop-shadow(0 0 0 6px var(--night));
  transition: transform 0.16s ease, filter 0.16s ease;
}
.entry-row a:hover .cube--marker {
  transform: translateY(-2px);
  filter: drop-shadow(0 6px 10px rgba(255, 179, 92, 0.35));
}

.entry-meta {
  font-family: var(--mono);
  padding-top: 0.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.entry-date {
  font-size: 0.86rem;
  color: var(--light);
  letter-spacing: 0.02em;
}
.entry-num {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.entry-title {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.005em;
  line-height: 1.15;
  margin-bottom: 0.35rem;
}
.entry-row a:hover .entry-title { color: var(--light-soft); }
.entry-summary {
  display: block;
  font-family: var(--serif);
  color: var(--text-dim);
  font-size: 1.02rem;
  line-height: 1.5;
  max-width: 52ch;
}

.empty { color: var(--text-dim); }

/* --- entry page --- */

.entry { padding-top: clamp(1.5rem, 5vw, 3rem); }
.entry-head {
  max-width: var(--measure);
  padding-bottom: 1.6rem;
  margin-bottom: 2.4rem;
  border-bottom: 1px solid var(--border-soft);
}
.entry-head .eyebrow { margin-bottom: 0.9rem; }
.entry-head h1 {
  font-family: var(--display);
  font-weight: 800;
  margin: 0;
  font-size: clamp(2rem, 5.2vw, 3.1rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

/* --- prose: the diary voice --- */

.prose {
  max-width: var(--measure);
  font-family: var(--serif);
  font-size: 1.16rem;
  line-height: 1.72;
  color: #ded8ec;
}
.prose > :first-child { margin-top: 0; }

.prose h2 {
  font-family: var(--display);
  font-weight: 700;
  margin: 2.8rem 0 0.9rem;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
/* a small lit block leads each section, like a heading in the log */
.prose h2::before {
  content: "";
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  margin-right: 0.6rem;
  vertical-align: 0.02em;
  background: linear-gradient(135deg, var(--face-top) 0 50%, var(--face-right) 50% 100%);
  border-radius: 2px;
  box-shadow: 0 0 12px -2px rgba(255, 179, 92, 0.5);
}
.prose h3 {
  font-family: var(--display);
  font-weight: 700;
  margin: 2.2rem 0 0.6rem;
  font-size: 1.18rem;
}

.prose p { margin: 0 0 1.25rem; }

.prose a {
  color: var(--light);
  text-decoration: none;
  background-image: linear-gradient(var(--light), var(--light));
  background-size: 100% 1px;
  background-position: 0 1.12em;
  background-repeat: no-repeat;
  transition: background-size 0.15s ease, color 0.15s ease;
}
.prose a:hover { color: var(--light-soft); }

.prose img,
.prose video {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2rem auto;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--night-2);
  box-shadow: 0 20px 40px -24px rgba(0, 0, 0, 0.8);
}

.prose figure { margin: 2rem 0; }
.prose figure img { margin: 0 auto 0.6rem; }
.prose figcaption {
  text-align: center;
  color: var(--text-faint);
  font-size: 0.82rem;
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 0.12em 0.42em;
  color: var(--light-soft);
}
.prose pre {
  background: var(--night-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--face-left);
  border-radius: 6px;
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
  line-height: 1.55;
  font-size: 0.92rem;
}
.prose pre code { background: none; border: none; padding: 0; color: #d8d2e8; font-size: 0.95em; }

.prose blockquote {
  margin: 1.6rem 0;
  padding: 0.4rem 0 0.4rem 1.3rem;
  border-left: 3px solid var(--light);
  color: var(--text-dim);
  font-style: italic;
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: 0.4rem 0; }
.prose li::marker { color: var(--light); }

.prose hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 2.8rem 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6rem 0;
  font-family: var(--mono);
  font-size: 0.86rem;
}
.prose th, .prose td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.8rem;
  text-align: left;
}
.prose th {
  background: var(--panel);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* --- responsive --- */

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: left;
  }
  .hero-art { order: -1; min-height: 200px; justify-content: flex-start; }
  .hero-sun { left: 4%; }
  .lede { max-width: none; }
}

@media (max-width: 560px) {
  body { font-size: 17px; }
  .entry-list::before { display: none; }
  .entry-row a {
    grid-template-columns: 24px 1fr;
    gap: 0.3rem 1rem;
  }
  .entry-meta {
    grid-column: 2;
    flex-direction: row;
    align-items: baseline;
    gap: 0.7rem;
    margin-bottom: 0.5rem;
  }
  .entry-body { grid-column: 2; }
  .prose { font-size: 1.08rem; }
}

/* --- quiet down when asked --- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
