/* Violet Wynmere — inspired by The Quest of Evolution aesthetic */

@font-face {
  font-family: "Romie Ligatures";
  src: url("../assets/fonts/RomieLigatures-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Romie";
  src: url("../assets/fonts/Romie-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cardinal Classic Long";
  src: url("../assets/fonts/CardinalClassicLong-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Palette from thequestofevolution.com */
  --bg: #181818;
  --bg-elevated: #222222;
  --ink: #ded4bf;
  --ink-muted: #999c98;
  --line: rgba(222, 212, 191, 0.55);
  --line-soft: rgba(222, 212, 191, 0.35);
  --line-strong: #ded4bf;
  --ring-inset: 4px;
  --accent: #ded4bf;
  --frame: 1px;
  --font-ui: "Romie Ligatures", "Times New Roman", serif;
  --font-body: "Romie", "Times New Roman", serif;
  --font-display: "Cardinal Classic Long", "Times New Roman", serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-book: cubic-bezier(0.65, 0, 0.35, 1);
  --header-h: clamp(3.5rem, 8vh, 5rem);
  --frame-pad: clamp(0.75rem, 2vw, 1.25rem);
  /* Top of main content — flush under fixed header */
  --chrome-top: calc(var(--frame-pad) + var(--header-h));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

html:has(body.menu-open) {
  overflow: hidden;
}

body.menu-open {
  overflow: hidden;
}

/* Paper grain overlay */
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  opacity: 0.35;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  animation: grain-shift 8s steps(6) infinite;
}

@keyframes grain-shift {
  0%,
  100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-2%, -1%);
  }
  50% {
    transform: translate(1%, 2%);
  }
  75% {
    transform: translate(-1%, 1%);
  }
}

.site-frame {
  position: fixed;
  inset: var(--frame-pad);
  border: var(--frame) solid var(--line);
  pointer-events: none;
  z-index: 9997;
}

.site-frame::before {
  content: "";
  position: absolute;
  inset: var(--ring-inset);
  border: var(--frame) solid var(--line);
  opacity: 0.35;
}

/* Header */
.site-header {
  position: fixed;
  top: var(--frame-pad);
  left: var(--frame-pad);
  right: var(--frame-pad);
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(1rem, 3vw, 2rem);
  z-index: 100;
  border-bottom: var(--frame) solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  box-sizing: border-box;
}

.logo {
  justify-self: start;
  font-family: var(--font-ui);
  font-size: clamp(0.7rem, 1.6vw, 1rem);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: none;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
  transition: opacity 0.3s var(--ease-out);
}

.logo:hover {
  opacity: 0.7;
}

.header-title {
  justify-self: center;
  text-align: center;
  font-family: var(--font-ui);
  font-size: clamp(0.65rem, 1.4vw, 0.8rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin: 0;
  font-weight: 400;
}

.header-title--empty {
  visibility: hidden;
  min-height: 0;
}

.menu-btn {
  justify-self: end;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: var(--frame) solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: border-color 0.3s, transform 0.3s var(--ease-out);
}

.menu-btn:hover {
  border-color: var(--ink);
  transform: scale(1.05);
}

.menu-btn span {
  display: block;
  width: 1rem;
  height: var(--frame);
  background: var(--ink);
  position: relative;
}

.menu-btn span::before,
.menu-btn span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: var(--frame);
  background: var(--ink);
}

.menu-btn span::before {
  top: -5px;
}

.menu-btn span::after {
  top: 5px;
}

.menu-btn[aria-expanded="true"] span {
  background: transparent;
}

.menu-btn[aria-expanded="true"] span::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-btn[aria-expanded="true"] span::after {
  top: 0;
  transform: rotate(-45deg);
}

/* portfolio menu — full-viewport novels panel (hamburger toggles) */
.portfolio-menu {
  position: fixed;
  inset: 0;
  z-index: 98;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.99);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.85s var(--ease-out),
    visibility 0.85s;
}

.portfolio-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
}

body.menu-open .site-header {
  z-index: 101;
  background: var(--bg);
}

/* portfolio panel — continues header frame; top edge meets header bottom */
.novels-camera {
  position: absolute;
  top: calc(var(--chrome-top) - 1px);
  left: var(--frame-pad);
  right: var(--frame-pad);
  bottom: var(--frame-pad);
  overflow: hidden;
  border-top: none;
  border-left: var(--frame) solid var(--line);
  border-right: var(--frame) solid var(--line);
  border-bottom: var(--frame) solid var(--line);
}

body.menu-open .novels-camera::before {
  content: "";
  position: absolute;
  inset: var(--ring-inset) var(--ring-inset) calc(-1 * var(--frame));
  border: var(--frame) solid var(--line);
  border-top: none;
  opacity: 0.35;
  pointer-events: none;
}

.novels-track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* Overlay scroll: no layout shift when the bar appears (wheel/touch still work) */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.novels-track::-webkit-scrollbar {
  display: none;
}

.novel:first-child {
  border-left: var(--frame) solid var(--line);
}

body.menu-open .novel:first-child {
  border-left-color: var(--line-soft);
}

.novel {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  border-right: var(--frame) solid var(--line);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: clamp(2rem, 4vh, 3rem) 0.75rem 1.5rem;
  text-decoration: none;
  color: inherit;
  position: relative;
  scroll-snap-align: start;
  overflow: hidden;
  transition:
    flex-grow 0.85s var(--ease-book),
    flex-shrink 0.85s var(--ease-book),
    flex-basis 0.85s var(--ease-book),
    opacity 0.5s var(--ease-out),
    background 0.5s var(--ease-out),
    border-color 0.5s var(--ease-out);
}

body.menu-open .novel {
  border-right-color: var(--line-soft);
}

.novels-track:has(.novel:hover) .novel:not(:hover),
.novels-track:has(.novel:focus-visible) .novel:not(:focus-visible) {
  flex-grow: 0.775;
  opacity: 0.55;
}

.novel:hover,
.novel:focus-visible {
  flex-grow: 1.875;
  z-index: 1;
  border-left: var(--frame) solid var(--line);
  border-right: var(--frame) solid var(--line);
  background: var(--bg-elevated);
  opacity: 1;
}

.novel--soon {
  cursor: default;
  opacity: 0.65;
}

.novel__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, color-mix(in srgb, var(--bg) 80%, transparent));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
}

.novel:hover .novel__overlay {
  opacity: 1;
}

.novel__cover {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.06);
  transition:
    opacity 0.75s var(--ease-out),
    transform 1.1s var(--ease-book);
}

.novel:hover .novel__cover,
.novel:focus-visible .novel__cover {
  opacity: 0.22;
  transform: scale(1);
}

.novel__title {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.75vw, 2.25rem);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 1.25;
  margin: 0;
  text-align: center;
  white-space: nowrap;
  z-index: 1;
  min-height: 0;
}

.novel__name {
  display: block;
}

.novel__spine {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  z-index: 1;
}

.novel__roman {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 1.5vw, 1.2rem);
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  line-height: 1;
}

.novel__cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-ui);
  font-size: clamp(0.5rem, 0.85vw, 0.65rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.75;
  transition: opacity 0.35s var(--ease-out);
}

.novel__cta-text {
  display: block;
}

.novel__cta-line {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.5s var(--ease-out);
}

.novel:hover .novel__cta,
.novel:focus-visible .novel__cta {
  opacity: 1;
}

.novel:hover .novel__cta-line,
.novel:focus-visible .novel__cta-line {
  transform: scaleX(1);
}

.portfolio-menu.is-open .novel {
  animation: novel-in 0.7s var(--ease-out) backwards;
}

.portfolio-menu.is-open .novel:nth-child(1) { animation-delay: 0.05s; }
.portfolio-menu.is-open .novel:nth-child(2) { animation-delay: 0.1s; }
.portfolio-menu.is-open .novel:nth-child(3) { animation-delay: 0.15s; }
.portfolio-menu.is-open .novel:nth-child(4) { animation-delay: 0.2s; }
.portfolio-menu.is-open .novel:nth-child(5) { animation-delay: 0.25s; }
.portfolio-menu.is-open .novel:nth-child(6) { animation-delay: 0.3s; }

@keyframes novel-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Main views */
main {
  padding-top: var(--chrome-top);
  min-height: 100dvh;
}

body.is-home main {
  padding-top: 0;
  height: 100dvh;
  overflow: hidden;
}

body.is-home .view-home.is-active {
  position: fixed;
  top: calc(var(--chrome-top) - 1px);
  left: var(--frame-pad);
  right: var(--frame-pad);
  bottom: var(--frame-pad);
  z-index: 1;
}

.view {
  display: none;
  min-height: calc(100dvh - var(--chrome-top) - var(--frame-pad));
  opacity: 0;
  animation: none;
}

.view.is-active {
  display: block;
  animation: view-in 0.8s var(--ease-out) forwards;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ——— Home: full viewport, no scroll ——— */
body.is-home {
  overflow: hidden;
  height: 100dvh;
}

.view-home.is-active {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Home + nav pages (portfolio menu, process, contact): shared 25%–50%–25% header grid */
body.is-home .site-header,
body.menu-open .site-header,
body.nav-header:not(.is-home) .site-header {
  grid-template-columns: 1fr 2fr 1fr;
  padding: 0;
  border: var(--frame) solid var(--line);
  border-bottom: var(--frame) solid var(--line);
}

body.is-home .site-header::before {
  content: "";
  position: absolute;
  inset: var(--ring-inset);
  border: var(--frame) solid var(--line);
  border-bottom: none;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

/* Menu header: top inner rule only — no vertical box around portfolio */
body.menu-open .site-header::before {
  content: "";
  position: absolute;
  top: var(--ring-inset);
  left: var(--ring-inset);
  right: var(--ring-inset);
  height: 0;
  border: none;
  border-top: var(--frame) solid var(--line);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

body.is-home .logo,
body.menu-open .logo,
body.nav-header:not(.is-home) .logo {
  position: relative;
  z-index: 1;
  grid-column: 1;
  padding: 0 clamp(1rem, 3vw, 2rem);
}

/* Home only: column dividers when center slot is empty (no nav label) */
body.is-home .header-title.header-title--empty {
  position: relative;
  z-index: 1;
  grid-column: 2;
  border-left: var(--frame) solid var(--line);
  border-right: var(--frame) solid var(--line);
  min-height: 100%;
}

/* portfolio menu + process/contact: center label, no box around the text */
body.menu-open .header-title,
body.nav-header:not(.is-home) .header-title {
  position: relative;
  z-index: 1;
  grid-column: 2;
  border: none;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: visible;
}

body.is-home .menu-btn,
body.menu-open .menu-btn,
body.nav-header:not(.is-home) .menu-btn {
  position: relative;
  z-index: 2;
  grid-column: 3;
  justify-self: end;
  align-self: center;
  margin-right: clamp(1rem, 3vw, 2rem);
  flex-shrink: 0;
}

.home-stage {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  flex: 1;
  min-height: 0;
  margin: 0;
  border-top: var(--frame) solid var(--line);
  border-bottom: var(--frame) solid var(--line);
  background-color: var(--bg);
  background-image: url("../assets/images/woodland.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
}

.home-etching {
  min-height: 100%;
  opacity: 0.92;
}

.home-center {
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  min-width: 0;
  background: var(--bg);
  border-left: var(--frame) solid var(--line);
  border-right: var(--frame) solid var(--line);
}

.home-center__frame {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  align-self: stretch;
  width: auto;
  margin: 0 var(--ring-inset) 0;
  padding: clamp(2.5rem, 7vh, 4.5rem) clamp(2rem, 4vw, 3.5rem);
  box-sizing: border-box;
}

/* Soft inner ring — matches .site-frame::before */
.home-center__frame::before {
  content: "";
  position: absolute;
  inset: var(--ring-inset) var(--ring-inset) calc(-1 * var(--frame));
  border: var(--frame) solid var(--line);
  opacity: 0.35;
  pointer-events: none;
}

.home-emblem {
  position: relative;
  width: clamp(3.25rem, 6.5vw, 4.75rem);
  height: clamp(4.25rem, 8.5vw, 6.25rem);
  margin-bottom: clamp(1.25rem, 3vh, 2rem);
  flex-shrink: 0;
}

.home-emblem::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: var(--frame) solid var(--line-soft);
  opacity: 0.45;
  pointer-events: none;
}

.home-emblem__portrait {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  object-fit: cover;
  object-position: 58% 28%;
  border: var(--frame) solid var(--line);
  box-sizing: border-box;
  background: var(--bg);
}

.home-headline {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6.5vw, 4.5rem);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 clamp(1rem, 2.5vh, 1.5rem);
  color: var(--ink);
}

.home-tagline {
  font-family: var(--font-ui);
  font-size: clamp(1rem, 2vw, 1.35rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.home-blurb {
  margin: clamp(1.25rem, 2.5vh, 1.75rem) 0 0;
  font-family: var(--font-ui);
  font-size: clamp(0.55rem, 1vw, 0.7rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.home-links {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  margin-top: clamp(1rem, 2vh, 1.5rem);
  padding-top: clamp(1rem, 2vh, 1.5rem);
  border-top: var(--frame) solid var(--line-soft);
  width: 100%;
  max-width: 20rem;
}

.home-links a {
  font-family: var(--font-ui);
  font-size: clamp(0.55rem, 1vw, 0.68rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}

.home-links a:hover {
  color: var(--ink-muted);
}

.home-links a + a {
  margin-left: clamp(1rem, 2.5vw, 2rem);
  padding-left: clamp(1rem, 2.5vw, 2rem);
  border-left: var(--frame) solid var(--line-soft);
}

.contact-back {
  display: inline-block;
  margin-top: 2rem;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
}

.contact-back:hover {
  color: var(--ink);
}

.tree-hub {
  position: relative;
  width: min(92vw, 720px);
  aspect-ratio: 4 / 5;
  max-height: calc(100dvh - var(--header-h) - 6rem);
}

.tree-hub svg.tree {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.tree-hub .tree-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
}

.medallion {
  position: absolute;
  width: clamp(5.5rem, 14vw, 7.5rem);
  height: clamp(5.5rem, 14vw, 7.5rem);
  transform: translate(-50%, -50%);
  text-decoration: none;
  color: var(--ink);
}

.medallion-ring {
  position: absolute;
  inset: 0;
  animation: ring-spin 24s linear infinite;
}

.medallion:hover .medallion-ring {
  animation-duration: 8s;
}

@keyframes ring-spin {
  to {
    transform: rotate(360deg);
  }
}

.medallion-core {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  border: var(--frame) solid var(--line-strong);
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s;
}

.medallion:hover .medallion-core {
  transform: scale(1.08);
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 40%, transparent);
}

.medallion-core svg {
  width: 55%;
  height: 55%;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.2;
}

.medallion-label {
  position: absolute;
  bottom: -1.25rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-ui);
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
}

.medallion:hover .medallion-label {
  opacity: 1;
}

/* Medallion positions */
.medallion--owl {
  left: 50%;
  top: 8%;
}
.medallion--fox {
  left: 18%;
  top: 38%;
}
.medallion--dog {
  left: 82%;
  top: 38%;
}
.medallion--horse {
  left: 22%;
  top: 72%;
}
.medallion--dragon {
  left: 78%;
  top: 72%;
}
.medallion--center {
  left: 50%;
  top: 88%;
  width: clamp(4rem, 10vw, 5.5rem);
  height: clamp(4rem, 10vw, 5.5rem);
}

.navigate-tagline {
  text-align: center;
  margin-top: 1rem;
  font-family: var(--font-ui);
  font-size: clamp(0.6rem, 1.2vw, 0.75rem);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ——— About ——— */
.about-layout {
  display: grid;
  grid-template-columns: minmax(4rem, 8vw) 1fr minmax(4rem, 8vw);
  min-height: inherit;
  margin: 0 var(--frame-pad);
  border: var(--frame) solid var(--line);
}

.about-panel {
  border-right: var(--frame) solid var(--line);
  overflow: hidden;
  position: relative;
}

.about-panel:last-child {
  border-right: none;
  border-left: var(--frame) solid var(--line);
}

.about-panel svg {
  width: 100%;
  height: 100%;
  min-height: 60vh;
  opacity: 0.85;
}

.about-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 6vw, 4rem);
  text-align: center;
}

.about-eyebrow {
  font-family: var(--font-ui);
  font-size: clamp(0.55rem, 1vw, 0.7rem);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 2rem;
}

.about-title {
  margin: 0;
  line-height: 0.95;
}

.about-title .line {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 10vw, 8vw);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.9;
  text-transform: uppercase;
}

.about-title .the {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.75rem 0;
  font-family: var(--font-ui);
  font-size: clamp(0.65rem, 1.5vw, 0.85rem);
  letter-spacing: 0.4em;
  color: var(--ink-muted);
}

.about-title .the::before,
.about-title .the::after {
  content: "";
  flex: 1;
  height: var(--frame);
  background: var(--line);
  max-width: 8rem;
}

.about-roman {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
}

.about-roman::before,
.about-roman::after {
  content: "";
  width: 3rem;
  height: var(--frame);
  background: var(--line);
}

.about-body {
  max-width: 36rem;
  margin: 3rem auto 0;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--ink-muted);
  text-align: left;
}

.about-body p {
  margin: 0 0 1.25rem;
}

.about-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  margin-top: 2rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ——— portfolio / Book directory ——— */
.view-portfolio {
  padding: 0 var(--frame-pad) var(--frame-pad);
}

.book-directory {
  display: flex;
  height: calc(100dvh - var(--chrome-top) - var(--frame-pad));
  border: var(--frame) solid var(--line);
  overflow: hidden;
}

.book-spine {
  flex: 1;
  min-width: 0;
  position: relative;
  border-right: var(--frame) solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1.5rem, 3vh, 2.5rem) 0.75rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  background: var(--bg);
  transition:
    flex 0.75s var(--ease-book),
    background 0.5s var(--ease-out);
  overflow: hidden;
}

.book-spine:last-child {
  border-right: none;
}

.book-directory:hover .book-spine {
  flex: 0.65;
}

.book-directory .book-spine:hover,
.book-directory .book-spine.is-expanded {
  flex: 2.8;
  background: var(--bg-elevated);
  z-index: 2;
}

.book-spine__title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 1.8vw, 1.6vw);
  letter-spacing: 0;
  text-transform: uppercase;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
  transition: opacity 0.4s;
}

.book-spine__roman {
  font-size: 0.75em;
  color: var(--ink-muted);
  margin-bottom: 0.5em;
}

.book-spine__cta {
  font-family: var(--font-display);
  font-size: clamp(0.5rem, 0.9vw, 0.65rem);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.book-spine:hover .book-spine__cta {
  opacity: 1;
}

.book-spine__detail {
  position: absolute;
  inset: 0;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateX(12px);
  transition:
    opacity 0.5s var(--ease-out) 0.15s,
    transform 0.5s var(--ease-out) 0.15s;
}

.book-spine:hover .book-spine__detail,
.book-spine.is-expanded .book-spine__detail {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.book-spine:hover .book-spine__title,
.book-spine.is-expanded .book-spine__title {
  opacity: 0;
}

.book-spine__detail h3 {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.5rem);
  letter-spacing: 0.15em;
  font-weight: 400;
  margin: 0 0 0.5rem;
}

.book-spine__detail .meta {
  font-size: 0.85rem;
  color: var(--ink-muted);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.book-spine__detail p {
  max-width: 28rem;
  margin: 0 0 1rem;
  font-size: 1.05rem;
  color: var(--ink-muted);
}

.book-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.book-tags span {
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  padding: 0.35em 0.75em;
  border: var(--frame) solid var(--line);
}

.book-spine--soon {
  cursor: default;
}

.book-spine--soon:hover {
  flex: 1;
}

/* Book open animation on click */
.book-spine.is-opening {
  animation: book-open 0.9s var(--ease-book) forwards;
}

@keyframes book-open {
  0% {
    flex: 2.8;
  }
  50% {
    flex: 4;
    background: var(--bg-elevated);
  }
  100% {
    flex: 2.8;
  }
}

/* ——— Process / Roadmap ——— */
.process-layout {
  display: grid;
  grid-template-columns: 2fr 3fr;
  min-height: calc(100dvh - var(--chrome-top) - var(--frame-pad));
  margin: -1px var(--frame-pad) var(--frame-pad);
  border: var(--frame) solid var(--line);
  background: var(--bg);
}

.overview-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr);
}

.overview-layout .process-hero {
  padding: clamp(1.5rem, 3.5vw, 2.75rem);
  min-width: 0;
  overflow: hidden;
}

.overview-layout .process-hero .display {
  font-size: clamp(1.5rem, 3.2vw, 3.25rem);
  line-height: 0.9;
  overflow-wrap: normal;
  word-break: normal;
  max-width: 100%;
}

.overview-layout .process-hero .overview-intro {
  max-width: 100%;
}

.process-hero {
  padding: clamp(2rem, 5vw, 4rem);
  border-right: var(--frame) solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: sticky;
  top: var(--chrome-top);
  align-self: start;
  height: calc(100dvh - var(--chrome-top) - var(--frame-pad));
}

.process-hero .small {
  font-family: var(--font-display);
  font-size: clamp(0.7rem, 1.2vw, 0.85rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 1rem;
}

.process-hero .display {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 10vw);
  line-height: 0.85;
  letter-spacing: 0;
  text-transform: uppercase;
  margin: 0;
  font-weight: 400;
}

.process-scroll {
  overflow-y: auto;
  max-height: calc(100dvh - var(--chrome-top) - var(--frame-pad));
  scroll-snap-type: y proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--line-soft) transparent;
}

.process-scroll::-webkit-scrollbar {
  width: 6px;
}

.process-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.process-scroll::-webkit-scrollbar-thumb {
  background: var(--line-soft);
  border-radius: 0;
}

.process-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--ink-muted);
}

.process-phase {
  scroll-snap-align: start;
  border-bottom: var(--frame) solid var(--line);
}

.process-phase:last-child {
  border-bottom: none;
}

.process-phase:not(.is-expanded) .process-list {
  display: none;
}

/* Overview pages (categories & portfolio) — all sections open */
.overview-scroll .process-phase .phase-body {
  display: block;
}

.overview-scroll .phase-header--static {
  cursor: default;
}

.overview-scroll .phase-header--static .phase-toggle {
  display: none;
}

.process-hero .overview-intro {
  margin: 1.25rem 0 0;
  max-width: 22rem;
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  color: var(--ink-muted);
  line-height: 1.55;
}

.overview-back {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.3s var(--ease-out);
}

.overview-back:hover {
  color: var(--ink);
}

.phase-body {
  border-top: var(--frame) solid var(--line);
}

.content-block {
  padding: 1rem clamp(1.5rem, 3vw, 2.5rem) 1.25rem;
  border-bottom: var(--frame) solid var(--line-soft);
  font-size: clamp(1rem, 1.3vw, 1.1rem);
  color: var(--ink-muted);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.content-block.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.content-block:last-child {
  border-bottom: none;
}

.content-block p {
  margin: 0;
  max-width: 40rem;
}

.content-block--bullets ul {
  margin: 0;
  padding-left: 1.25rem;
  max-width: 40rem;
}

.content-block--bullets li {
  margin-bottom: 0.5rem;
}

.content-block--bullets li:last-child {
  margin-bottom: 0;
}

.content-block--media {
  padding-bottom: 1.5rem;
}

.content-block--media img,
.content-block--media video {
  display: block;
  width: 100%;
  max-width: 36rem;
  border: var(--frame) solid var(--line);
}

.overview-scroll .content-block--media img,
.overview-scroll .content-block--media .youtube-embed {
  max-width: 100%;
}

body.is-project-detail .content-media-grid {
  display: grid;
  gap: 0.5rem 0.625rem;
  padding: 0.75rem clamp(1.5rem, 3vw, 2.5rem) 1rem;
  border-bottom: var(--frame) solid var(--line-soft);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

body.is-project-detail .content-media-grid.is-visible {
  opacity: 1;
  transform: translateY(0);
}

body.is-project-detail .content-media-grid--1 {
  grid-template-columns: repeat(1, minmax(0, 7.5rem));
}

body.is-project-detail .content-media-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 18rem;
}

body.is-project-detail .content-media-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 27rem;
}

body.is-project-detail .content-media-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 36rem;
}

body.is-project-detail .content-media-grid__item {
  margin: 0;
  min-width: 0;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: var(--frame) solid var(--line);
  background: var(--bg-elevated);
  transition: border-color 0.25s var(--ease-out);
}

body.is-project-detail .content-media-grid__item:has(.content-media-enlarge:hover),
body.is-project-detail .content-media-grid__item:has(.content-media-enlarge:focus-visible) {
  border-color: var(--ink-muted);
}

body.is-project-detail .content-media-enlarge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
}

body.is-project-detail .content-media-grid__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}

@media (max-width: 600px) {
  body.is-project-detail .content-media-grid--3,
  body.is-project-detail .content-media-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 18rem;
  }
}

.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
}

.media-lightbox[hidden] {
  display: none;
}

.media-lightbox__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(8, 8, 8, 0.92);
  cursor: zoom-out;
}

.media-lightbox__figure {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: min(92vw, 42rem);
  max-height: 88vh;
}

.media-lightbox__img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(92vw, 42rem);
  max-height: 88vh;
  object-fit: contain;
  border: var(--frame) solid var(--line);
  background: var(--bg-elevated);
}

.media-lightbox__close {
  position: absolute;
  top: clamp(0.75rem, 2vw, 1.25rem);
  right: clamp(0.75rem, 2vw, 1.25rem);
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0;
  border: var(--frame) solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}

.media-lightbox__close:hover,
.media-lightbox__close:focus-visible {
  color: var(--ink-muted);
  border-color: var(--ink-muted);
}

body.lightbox-open {
  overflow: hidden;
}

.youtube-embed {
  position: relative;
  width: 100%;
  max-width: 40rem;
  aspect-ratio: 16 / 9;
  border: var(--frame) solid var(--line);
  background: var(--bg-elevated);
}

.youtube-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.content-link {
  font-family: var(--font-display);
  font-size: clamp(0.75rem, 1.2vw, 0.85rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding: 0.75rem 1.25rem;
  border: var(--frame) solid var(--line);
  display: inline-block;
  transition: background 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}

.content-link:hover {
  background: var(--bg-elevated);
  border-color: var(--line-strong);
}

.phase-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  width: 100%;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  align-items: center;
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(4px);
  z-index: 1;
  border: none;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.3s var(--ease-out);
}

.phase-header:hover {
  background: color-mix(in srgb, var(--bg-elevated) 60%, transparent);
}

.phase-heading {
  min-width: 0;
}

.phase-toggle {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: var(--frame) solid var(--line-strong);
  position: relative;
  transition: transform 0.35s var(--ease-out);
}

.phase-toggle::before,
.phase-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.55rem;
  height: var(--frame);
  background: var(--ink);
  transform: translate(-50%, -50%);
  transition: transform 0.35s var(--ease-out), opacity 0.35s var(--ease-out);
}

.phase-toggle::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.process-phase.is-expanded .phase-toggle::after {
  transform: translate(-50%, -50%) rotate(90deg) scaleX(0);
  opacity: 0;
}

.phase-emblem {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: var(--frame) solid var(--line-strong);
  display: grid;
  place-items: center;
}

.phase-emblem svg {
  width: 70%;
  height: 70%;
  stroke: var(--ink);
  fill: none;
}

.phase-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  letter-spacing: 0.12em;
  margin: 0;
  font-weight: 400;
}

.phase-status {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--accent);
  font-style: italic;
  margin: 0.25rem 0 0;
}

.process-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.process-list li {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem clamp(1.5rem, 3vw, 2.5rem);
  border-top: var(--frame) solid var(--line);
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.process-list li.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.process-list .num {
  font-family: var(--font-ui);
  font-style: italic;
  color: var(--ink-muted);
}

.check {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: var(--frame) solid var(--line-strong);
  display: grid;
  place-items: center;
}

.check svg {
  width: 0.65rem;
  height: 0.65rem;
  stroke: var(--ink);
  fill: none;
}

/* ——— Contact ——— */
.view-contact {
  padding: 0 var(--frame-pad) var(--frame-pad);
}

.contact-layout {
  border: var(--frame) solid var(--line);
  min-height: calc(100dvh - var(--chrome-top) - var(--frame-pad));
  margin-top: -1px;
  display: grid;
  place-items: center;
  padding: clamp(2rem, 5vw, 4rem);
}

.contact-inner {
  max-width: 32rem;
  text-align: center;
}

.contact-inner h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 400;
  letter-spacing: 0.12em;
  margin: 0 0 0.5rem;
}

.contact-inner .subtitle {
  color: var(--ink-muted);
  margin-bottom: 2.5rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-links a {
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding: 1rem 1.5rem;
  border: var(--frame) solid var(--line);
  transition: background 0.3s, border-color 0.3s;
}

.contact-links a:hover {
  background: var(--bg-elevated);
  border-color: var(--ink);
}

.contact-note {
  margin-top: 2.5rem;
  font-size: 0.95rem;
  color: var(--ink-muted);
}

/* Reveal on scroll */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 900px) {
  .about-layout {
    grid-template-columns: 1fr;
  }

  .about-panel {
    display: none;
  }

  .home-stage {
    grid-template-columns: 1fr;
  }

  .home-etching {
    display: none;
  }

  body.is-home .site-header,
  body.menu-open .site-header,
  body.nav-header:not(.is-home) .site-header {
    grid-template-columns: auto 1fr auto;
    padding: 0 clamp(1rem, 3vw, 2rem);
  }

  body.is-home .site-header::before,
  body.menu-open .site-header::before {
    display: none;
  }

  body.is-home .header-title.header-title--empty,
  body.menu-open .header-title,
  body.nav-header:not(.is-home) .header-title {
    border-left: none;
    border-right: none;
  }

  body.is-home .logo,
  body.menu-open .logo,
  body.nav-header:not(.is-home) .logo {
    padding: 0;
    grid-column: auto;
  }

  body.is-home .menu-btn,
  body.menu-open .menu-btn,
  body.nav-header:not(.is-home) .menu-btn {
    margin-right: 0;
    grid-column: auto;
  }

  .home-stage {
    margin: 0;
  }

  .home-center {
    border-left: none;
    border-right: none;
  }

  .home-center__frame {
    max-width: 42rem;
    margin: 0 auto;
    width: calc(100% - clamp(1rem, 4vw, 2rem));
  }

  .novels-track {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .novels-track::-webkit-scrollbar {
    display: none;
  }

  .novel {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    min-height: 50vw;
    border-right: none;
    border-bottom: var(--frame) solid var(--line);
  }

  .novel:hover,
  .novel:focus-visible {
    flex-grow: 1;
    border-left: none;
  }

  .novels-track:has(.novel:hover) .novel:not(:hover),
  .novels-track:has(.novel:focus-visible) .novel:not(:focus-visible) {
    flex-grow: 1;
    opacity: 1;
  }

  .novel__title {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: clamp(1.4rem, 5.5vw, 2rem);
  }

  .novel__spine {
    gap: 0.5rem;
    width: 100%;
    padding-top: 0.5rem;
  }

  .novel__roman {
    font-size: clamp(1rem, 3vw, 1.15rem);
  }

  .process-layout {
    grid-template-columns: 1fr;
    margin-top: 0;
    border-top: var(--frame) solid var(--line);
  }

  .process-hero {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: var(--frame) solid var(--line);
  }

  .process-scroll {
    max-height: none;
  }

  .book-directory {
    flex-direction: column;
    height: auto;
    min-height: 70vh;
  }

  .book-spine {
    flex: none !important;
    min-height: 4.5rem;
    border-right: none;
    border-bottom: var(--frame) solid var(--line);
    flex-direction: row;
    padding: 1rem 1.25rem;
    align-items: center;
  }

  .book-spine__title {
    writing-mode: horizontal-tb;
    transform: none;
  }

  .book-directory:hover .book-spine {
    flex: none;
  }

  .book-spine__detail {
    position: relative;
    padding: 0 0 0 1rem;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    display: none;
  }

  .book-spine.is-expanded .book-spine__detail {
    display: flex;
  }

}

@media (max-width: 600px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .medallion-ring {
    animation: none;
  }
}
