/* ─── Fonts ─────────────────────────────────────────────────── */
@font-face {
  font-family: 'Mono';
  src: url('../fonts/Mono-Light.ttf') format('truetype');
  font-weight: 300;
}
@font-face {
  font-family: 'Mono';
  src: url('../fonts/Mono-Regular.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Mono';
  src: url('../fonts/Mono-Bold.ttf') format('truetype');
  font-weight: 700;
}
@font-face {
  font-family: 'Sans';
  src: url('../fonts/Sans-Text.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Sans';
  src: url('../fonts/Sans-Bold.ttf') format('truetype');
  font-weight: 700;
}

/* ─── Tokens ─────────────────────────────────────────────────── */
:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #999999;
  --accent: #e05a3a;
  --font-mono: 'Mono', 'Courier New', monospace;
  --font-body: 'Sans', -apple-system, sans-serif;
  --pad: clamp(1.5rem, 6vw, 3rem);
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
}

/* ─── Page wrapper ───────────────────────────────────────────── */
#page-wrap {
  min-height: 100vh;
}

/* ─── Block zone: nearly-full-viewport, footer peeks below ──── */
#block-zone {
  position: relative;
  height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--pad);
}

#block-inner {
  max-width: 560px;
  width: 100%;
}

/* ─── Axis slider — pinned to bottom of zone, never moves ───── */
#axis-slider {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.axis-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: #ccc;
  letter-spacing: 0.05em;
  user-select: none;
}
#block-range {
  -webkit-appearance: none;
  appearance: none;
  width: 72px;
  height: 1px;
  background: #e0e0e0;
  outline: none;
  border: none;
  cursor: pointer;
}
#block-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fg);
  cursor: pointer;
  transition: background 0.15s;
}
#block-range::-webkit-slider-thumb:hover {
  background: var(--accent);
}
#block-range::-moz-range-thumb {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fg);
  border: none;
  cursor: pointer;
}

/* ─── Block text ─────────────────────────────────────────────── */
p.block-text {
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  line-height: 1.75;
  color: var(--fg);
  text-align: center;
}

/* ─── Links ──────────────────────────────────────────────────── */
a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid #ddd;
  transition: border-color 0.15s, color 0.15s;
}
a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Block text links: underline hidden during typing, fades in after */
#block-inner a {
  border-bottom-color: transparent;
  transition: border-color 0.6s ease, color 0.15s;
}
#block-inner.typed a {
  border-bottom-color: #ddd;
}

/* ─── Typewriter characters ──────────────────────────────────── */
@keyframes ch-in {
  to { opacity: 1; }
}
.ch {
  opacity: 0;
}
.typing .ch {
  animation: ch-in 1ms calc(var(--i) * 5ms) linear forwards;
}

/* ─── Info section ───────────────────────────────────────────── */
#info {
  padding: clamp(3rem, 8vh, 5rem) var(--pad) clamp(2rem, 5vh, 3rem);
  border-top: 1px solid #f0f0f0;
}

.info-inner {
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}

/* ─── Footer ─────────────────────────────────────────────────── */
#site-footer {
  padding: 1.25rem var(--pad);
  border-top: 1px solid #f0f0f0;
}

.footer-inner {
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.socials {
  list-style: none;
  display: flex;
  gap: 0.85rem;
  align-items: center;
}
.socials a {
  display: flex;
  align-items: center;
  color: #ccc;
  border-bottom: none;
  transition: color 0.15s;
}
.socials a:hover { color: var(--muted); }

.archive-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: lowercase;
  margin-bottom: 1rem;
}

.mini-archive {
  list-style: none;
  margin-bottom: 2.5rem;
}
.mini-archive li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.mini-archive li a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  border-bottom: none;
  color: var(--fg);
}
.mini-archive li a:hover { color: var(--accent); }
.mini-archive li span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.mini-archive li.see-all {
  border-bottom: none;
  margin-top: 0.75rem;
  justify-content: flex-start;
}
.mini-archive li.see-all a {
  font-size: 0.78rem;
  color: var(--muted);
  border-bottom: 1px solid #eee;
}
.mini-archive li.see-all a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ─── Footer two-col layout ──────────────────────────────────── */
.footer-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
@media (max-width: 520px) {
  .footer-cols { grid-template-columns: 1fr; }
}

/* ─── Thoughts: full-width column above footer-cols ─────────── */
.footer-thoughts {
  margin-bottom: 2rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: lowercase;
  margin-bottom: 0.75rem;
}

.item-list {
  list-style: none;
}
.item-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: baseline;
}
.item-list li.see-all-inline {
  display: block;
  border-bottom: none;
  padding-top: 0.6rem;
}
.item-list li.see-all-inline a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.item-list li .item-title {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--fg);
  line-height: 1.5;
}
.item-list li .item-title a { border-bottom: none; color: inherit; }
.item-list li .item-title a:hover { color: var(--accent); }
.item-list li .item-sub {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.1rem;
  font-family: var(--font-body);
}
.item-list li .item-year {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}

.colophon {
  font-size: 0.72rem;
  color: #ccc;
  font-family: var(--font-mono);
}
.colophon a { color: #ccc; border-bottom: 1px solid #eee; }
.colophon a:hover { color: var(--muted); }

/* ─── Screenshots carousel ───────────────────────────────────── */
#screenshots {
  display: none; /* shown by JS when manifest has entries */
  margin-top: 2rem;
}

#screenshots-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
}
#screenshots-track:active { cursor: grabbing; }
#screenshots-track::-webkit-scrollbar { display: none; }

.shot-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
}
.shot-item img {
  display: block;
  height: 180px;
  width: auto;
  max-width: 320px;
  object-fit: cover;
}
.shot-date {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
  margin-top: 0.4rem;
  letter-spacing: 0.03em;
}

/* ─── Floating image preview ─────────────────────────────────── */
#img-preview {
  position: fixed;
  width: 200px;
  aspect-ratio: 4/3;
  object-fit: cover;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transform: scale(0.94) translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
#img-preview.visible {
  opacity: 0.75;
  transform: scale(1) translateY(0);
}

/* ─── Coming soon note ───────────────────────────────────────── */
#coming-soon-note {
  position: fixed;
  top: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  z-index: 31;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
  margin-top: 2.4rem;
}
#coming-soon-note.visible { opacity: 1; }

/* ─── Mode toggle ────────────────────────────────────────────── */
#mode-toggle {
  display: flex;
  position: fixed;
  top: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  gap: 2px;
  z-index: 30;
  background: #f5f5f5;
  border-radius: 6px;
  padding: 2px;
}
.mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.mode-btn:hover { color: var(--fg); }
.mode-btn.active {
  background: var(--bg);
  color: var(--fg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ─── LLM view ───────────────────────────────────────────────── */
#llm-view {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 25;
  align-items: center;
  justify-content: center;
}
.llm-inner {
  max-width: 560px;
  width: 100%;
  padding: 0 var(--pad);
  text-align: center;
}
.llm-hello {
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  line-height: 1.75;
  color: var(--fg);
  font-family: var(--font-body);
  margin-bottom: 1.5rem;
}
#copy-btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: transparent;
  color: var(--muted);
  border: none;
  border-bottom: 1px solid #ddd;
  padding: 0;
  cursor: pointer;
  letter-spacing: 0;
  transition: color 0.15s, border-color 0.15s;
}
#copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.llm-confirm {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  margin-top: 0.6rem;
  opacity: 0;
  transition: opacity 0.3s;
  height: 1.2em;
}
.llm-confirm.visible { opacity: 1; }
.llm-note {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #ccc;
  margin-top: 2rem;
}

/* ─── Body mode switching ────────────────────────────────────── */
body[data-mode="llm"] #page-wrap,
body[data-mode="llm"] #img-preview {
  display: none;
}
body[data-mode="llm"] #llm-view {
  display: flex;
}
body[data-mode="llm"] #site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 26;
  background: var(--bg);
}
