/* ============================================================
   MinChi Park — shared foundation for every page
   tokens · base typography · site header · footer · 3D book
   ============================================================ */

:root {
  color-scheme: light;
  --paper: #f8efb5;
  --ink: #000;
  --ink-soft: color-mix(in srgb, var(--ink) 65%, transparent);
  --ink-faint: color-mix(in srgb, var(--ink) 35%, transparent);
  --font: "Source Serif 4", Georgia, "Times New Roman", serif;
  --size: 17px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font: 400 var(--size)/1.7 "Source Serif 4", Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
  color: var(--ink);
  transition: background-color 480ms ease;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--ink) 25%, transparent);
  text-underline-offset: 4px;
  transition: text-decoration-color 120ms ease;
}

a:hover {
  text-decoration-color: color-mix(in srgb, var(--ink) 85%, transparent);
}

.soft { color: var(--ink-soft); }

/* ---------- site header: big name, nav row under it ---------- */

/* explicit metrics so the header renders identically on every page,
   regardless of the surrounding layout's fonts or line-heights */
.site-head {
  margin-bottom: 56px;
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  line-height: 1.7;
}

.brand-h1 {
  font-size: inherit;
  font-weight: 400;
  line-height: inherit;
  margin: 0;
}

.brand {
  display: block;
  font-weight: 400;
  width: fit-content;
  font-size: 24px;
  line-height: 1.3;
  margin-bottom: 16px;
  color: var(--ink);
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  font-size: 17px;
  line-height: 1.7;
}

.site-nav a {
  display: inline-block;
  font-weight: 400;
  color: var(--ink-soft);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a.active {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--ink) 25%, transparent);
  text-underline-offset: 4px;
}

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

.footer {
  margin-top: 64px;
  color: var(--ink-soft);
}

/* ---------- 3D book (CodePen filipz/VYwqwXN structure) ----------
   Pages set their own --bw/--bh and hover triggers. */

.book-scene {
  position: relative;
  display: block;
  width: var(--bw);
  height: var(--bh);
  --bw: 188px;
  --bh: 282px;
}

.book-3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.b-back-cover {
  position: absolute;
  width: 96%;
  height: 96%;
  top: 2%;
  left: 2%;
  z-index: 1;
  background: linear-gradient(90deg, #6e6a64 0%, #8a857e 55%, #7a756e 100%);
  border-radius: 0 6px 6px 0;
  box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.18);
}

.b-inside {
  position: absolute;
  width: 90%;
  height: 94%;
  top: 3%;
  left: 5%;
  z-index: 2;
}

.b-page {
  position: absolute;
  top: 0;
  right: 0;
  width: 98%;
  height: 100%;
  background: #f7f4ee;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 0 6px 6px 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transform: translateX(0);
  transition: transform 700ms cubic-bezier(0.455, 0.03, 0.515, 0.955);
}

.b-image {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 2px 6px 6px 2px;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.08),
    0 8px 14px rgba(0, 0, 0, 0.06);
  transform: perspective(2000px) translateX(0) rotateY(0deg) scaleX(1);
  transform-origin: left center;
  transition:
    transform 700ms cubic-bezier(0.25, 1, 0.5, 1),
    box-shadow 700ms cubic-bezier(0.25, 1, 0.5, 1);
}

/* promote only the book being hovered, never all 135 at once */
.book-cell:hover .b-image,
.book-scene:hover .b-image {
  will-change: transform;
}

.b-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.b-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 9%;
  height: 100%;
  margin-left: 7.3%;
  z-index: 4;
  border-left: 2px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
  pointer-events: none;
  transition: margin-left 700ms cubic-bezier(0.25, 1, 0.5, 1);
}

.b-light {
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: 2px 6px 6px 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.5));
  opacity: 0.08;
  transform: perspective(2000px) rotateY(0deg);
  transform-origin: left center;
  pointer-events: none;
  transition:
    opacity 700ms cubic-bezier(0.25, 1, 0.5, 1),
    transform 700ms cubic-bezier(0.25, 1, 0.5, 1);
}


/* ---------- utilities ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 999;
  padding: 10px 14px;
  background: var(--paper);
  border: 1px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
  transition: top 140ms ease;
}

.skip-link:focus {
  top: 8px;
}

