/* ENQTH Formulary — brand stylesheet */
:root {
  --ink: #0F2D4A;
  --ivory: #F8F5EB;
  --stone: #D7D1C6;
  --sage: #64786E;
  --brass: #B08D57;

  --serif: 'Playfair Display', 'Prata', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background-color: var(--ivory);
  /* matte paper grain */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.06 0 0 0 0 0.17 0 0 0 0 0.29 0 0 0 .035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; letter-spacing: .01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--brass); color: var(--ivory); }
:focus-visible { outline: 1px solid var(--brass); outline-offset: 4px; }

.container { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: var(--gutter); }

.meta {
  font-family: var(--sans);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--sage);
}
.meta--light { color: var(--brass); }

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(248, 245, 235, .88);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--stone); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 84px; gap: 2rem; }

.brand { display: inline-flex; align-items: center; gap: .9rem; color: var(--ink); }
.brand__mark { width: 46px; height: 46px; color: var(--ink); transition: color .3s var(--ease), transform .6s var(--ease); }
.brand:hover .brand__mark { color: var(--brass); transform: rotate(-8deg); }
.brand__name { font-family: var(--sans); font-weight: 600; font-size: .78rem; letter-spacing: .32em; }
.brand--small .brand__mark { width: 34px; height: 34px; }
.brand--small .brand__name { font-size: .68rem; }

.nav__links { display: flex; gap: 2.5rem; }
.nav__links a, .mobile-menu a {
  position: relative;
  font-size: .8125rem; font-weight: 500; letter-spacing: .08em;
  color: var(--ink);
  transition: color .25s var(--ease);
}
.nav__links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: var(--brass); transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav__links a:hover { color: var(--brass); }
.nav__links a:hover::after { transform: scaleX(1); }

.nav__actions { display: flex; align-items: center; gap: 1rem; }
.btn-box {
  display: inline-block;
  padding: .6rem 1.4rem;
  border: 1px solid var(--ink);
  font-size: .72rem; font-weight: 600; letter-spacing: .28em;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.btn-box:hover { background: var(--ink); color: var(--ivory); }

.nav__toggle { display: none; width: 40px; height: 40px; background: none; border: 0; cursor: pointer; position: relative; }
.nav__toggle span { position: absolute; left: 10px; right: 10px; height: 1px; background: var(--ink); transition: transform .3s var(--ease), top .3s var(--ease); }
.nav__toggle span:first-child { top: 16px; }
.nav__toggle span:last-child { top: 23px; }
.nav.is-open .nav__toggle span:first-child { top: 20px; transform: rotate(45deg); }
.nav.is-open .nav__toggle span:last-child { top: 20px; transform: rotate(-45deg); }

.mobile-menu { display: none; }

/* ---------- BUTTONS & LINKS ---------- */
.btn-primary {
  display: inline-flex; align-items: center; gap: .9rem;
  padding: 1.15rem 2rem;
  background: var(--ink); color: var(--ivory);
  border-radius: 0;
  font-size: .75rem; font-weight: 600; letter-spacing: .24em;
  transition: background-color .4s var(--ease);
}
.btn-primary span { display: inline-block; transition: transform .4s var(--ease); }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--brass); }
.btn-primary:hover span { transform: translateX(4px); }

.link-quiet {
  font-size: .8125rem; font-weight: 500; letter-spacing: .04em;
  border-bottom: 1px solid var(--stone); padding-bottom: 2px;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.link-quiet:hover { color: var(--brass); border-color: var(--brass); }

.link-light {
  font-size: .75rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ivory); transition: color .25s var(--ease);
}
.link-light:hover { color: var(--brass); }

/* ---------- HERO ---------- */
.hero {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  padding-block: clamp(3.5rem, 9vw, 7.5rem) clamp(4rem, 9vw, 7rem);
}
.hero__copy { display: flex; flex-direction: column; gap: 2rem; }
.hero__title {
  font-size: clamp(2.6rem, 6vw, 5.25rem);
  line-height: 1.04;
  letter-spacing: .015em;
  font-weight: 500;
  max-width: 13ch;
}
.hero__title em { font-style: italic; color: var(--brass); font-weight: 400; }
.hero__lede { max-width: 46ch; font-size: 1.0625rem; font-weight: 300; color: #2c4459; }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1.75rem; padding-top: .5rem; }
.hero__stats {
  display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 2.5rem;
  margin: 1rem 0 0; padding-top: 1.75rem; border-top: 1px solid var(--stone);
}
.hero__stats dt { font-size: .625rem; letter-spacing: .22em; text-transform: uppercase; color: var(--sage); font-weight: 500; }
.hero__stats dd { margin: .3rem 0 0; font-family: var(--serif); font-size: 1.05rem; }

/* Book stage */
.hero__visual { position: relative; }
.stage {
  position: relative;
  aspect-ratio: 4 / 4.4;
  border: 1px solid var(--stone);
  background:
    linear-gradient(var(--stone), var(--stone)) center / 1px 100% no-repeat,
    linear-gradient(var(--stone), var(--stone)) center / 100% 1px no-repeat,
    #F3EFE2;
  overflow: hidden;
}
.stage::before { /* soft inner frame */
  content: ''; position: absolute; inset: 14px; border: 1px solid rgba(215, 209, 198, .7); pointer-events: none;
}
.stage__label { position: absolute; top: 28px; left: 30px; z-index: 3; }
.stage__note {
  position: absolute; bottom: 28px; right: 30px; z-index: 3;
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink);
  background: var(--ivory); border: 1px solid var(--stone); padding: .5rem .85rem;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brass); }
.stage__shadow {
  position: absolute; left: 18%; right: 14%; bottom: 13%; height: 22px;
  background: radial-gradient(ellipse at center, rgba(15, 45, 74, .28), transparent 70%);
  filter: blur(6px); z-index: 0;
}

.book {
  position: absolute; z-index: 1;
  width: 46%; aspect-ratio: 2 / 3;
  display: flex;
  box-shadow: 0 30px 50px -24px rgba(15, 45, 74, .45), 0 2px 6px rgba(15, 45, 74, .12);
  transition: transform .8s var(--ease);
}
.book__spine { width: 7%; flex-shrink: 0; }
.book__cover {
  position: relative; flex: 1;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 16% 10% 10%;
  overflow: hidden;
}
.book__cover::after { /* page-edge sheen */
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.12), transparent 8%, transparent 92%, rgba(255,255,255,.06));
  pointer-events: none;
}
.book__series { font-size: clamp(.5rem, .9vw, .625rem); letter-spacing: .3em; text-transform: uppercase; }
.book__title {
  margin-top: 14%;
  font-size: clamp(1.15rem, 2.4vw, 1.9rem);
  line-height: 1.12; letter-spacing: .03em;
}
.book__rule { width: 28px; height: 1px; margin: 12% 0 8%; }
.book__author { font-size: clamp(.5rem, .9vw, .65rem); letter-spacing: .22em; text-transform: uppercase; }
.book__mark { position: absolute; bottom: 8%; width: 26%; aspect-ratio: 1; height: auto; }

.book--front { left: 16%; top: 19%; transform: rotate(-3deg); z-index: 2; }
.book--front .book__spine { background: #0a2238; }
.book--front .book__cover { background: var(--ink); color: var(--ivory); }
.book--front .book__series, .book--front .book__author { color: var(--stone); }
.book--front .book__rule { background: var(--brass); }
.book--front .book__mark { color: var(--brass); }

.book--back { right: 11%; top: 13%; transform: rotate(5deg); }
.book--back .book__spine { background: #c9c2b4; }
.book--back .book__cover { background: var(--ivory); color: var(--ink); border: 1px solid var(--stone); border-left: 0; }
.book--back .book__series, .book--back .book__author { color: var(--sage); }
.book--back .book__rule { background: var(--ink); }
.book--back .book__mark { color: var(--sage); }

.stage:hover .book--front { transform: rotate(-5deg) translate(-10px, -6px); }
.stage:hover .book--back { transform: rotate(7deg) translate(10px, -10px); }

/* ---------- SECTIONS ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); border-top: 1px solid var(--stone); }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.section__title { font-size: clamp(1.9rem, 3.6vw, 2.9rem); letter-spacing: .02em; line-height: 1.1; order: -1; }

/* Catalogue */
.catalogue { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1.25rem, 3vw, 2.5rem); }
.title-card { display: flex; flex-direction: column; gap: .65rem; cursor: default; }
.title-card__cover {
  aspect-ratio: 3 / 4; margin-bottom: .75rem;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 1.5rem;
  border: 1px solid var(--stone);
  font-family: var(--serif); font-size: 1.25rem; letter-spacing: .04em; line-height: 1.2;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.title-card:hover .title-card__cover { transform: translateY(-6px); box-shadow: 0 24px 40px -24px rgba(15, 45, 74, .4); }
.title-card h3 { font-size: 1.3rem; transition: color .25s var(--ease); }
.title-card:hover h3 { color: var(--brass); }
.title-card p:last-child { font-size: .9rem; color: #3b5266; font-weight: 300; }
.tc--navy { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.tc--ivory { background: #FBF9F2; color: var(--ink); }
.tc--sage { background: var(--sage); color: var(--ivory); border-color: var(--sage); }
.tc--brass { background: #EDE5D4; color: var(--ink); box-shadow: inset 0 0 0 10px #EDE5D4, inset 0 0 0 11px var(--brass); }

/* Subjects */
.subjects { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--stone); }
.subjects li {
  display: grid; grid-template-columns: 4rem 1fr auto; align-items: baseline; gap: 1rem;
  padding: 1.5rem 0; border-bottom: 1px solid var(--stone);
  transition: padding .4s var(--ease), color .3s var(--ease);
}
.subjects li:hover { padding-left: .75rem; color: var(--brass); }
.subjects__no { font-size: .7rem; letter-spacing: .2em; color: var(--sage); }
.subjects__name { font-family: var(--serif); font-size: clamp(1.3rem, 2.6vw, 2rem); letter-spacing: .02em; }
.subjects__count { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--sage); }

/* Editorial grid */
.grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr;
  border: 1px solid var(--stone);
}
.grid > * + * { border-left: 1px solid var(--stone); }
.grid__feature {
  position: relative; overflow: hidden;
  background: var(--ink); color: var(--ivory);
  padding: clamp(2rem, 4vw, 3.25rem);
  min-height: 420px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
}
.grid__backdrop {
  position: absolute; right: -18%; top: 50%; width: 95%; aspect-ratio: 1; height: auto;
  transform: translateY(-50%);
  color: rgba(248, 245, 235, .07);
  transition: color .6s var(--ease), transform 1.2s var(--ease);
  pointer-events: none;
}
.grid__feature:hover .grid__backdrop { color: rgba(176, 141, 87, .16); transform: translateY(-50%) rotate(-6deg); }
.grid__feature-title {
  position: relative;
  font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.12; letter-spacing: .02em; font-style: italic; font-weight: 400;
  max-width: 14ch;
}
.grid__feature .meta, .grid__feature a { position: relative; }
.grid__cell {
  padding: clamp(1.75rem, 3vw, 2.5rem);
  display: flex; flex-direction: column; gap: 1rem;
  transition: background .4s var(--ease);
}
.grid__cell:hover { background: rgba(215, 209, 198, .25); }
.grid__cell h3 { font-size: 1.4rem; line-height: 1.2; margin-top: auto; }
.grid__cell p:not(.meta) { font-size: .9rem; color: #3b5266; font-weight: 300; }
.grid__cell .link-quiet { align-self: flex-start; }

/* ---------- FOOTER ---------- */
.footer { padding-block: clamp(3rem, 7vw, 5rem) 2.5rem; }
.footer__rule { height: 1px; background: var(--stone); }
.footer__quote {
  margin: 0; padding: clamp(2.5rem, 6vw, 4.5rem) 1rem;
  text-align: center;
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(1.5rem, 3.4vw, 2.6rem); line-height: 1.25; letter-spacing: .015em;
  color: var(--ink);
}
.footer__base {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1.25rem;
  padding-top: 2rem;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1080px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .grid__feature { grid-column: 1 / -1; min-height: 340px; }
  .grid > * + * { border-left: 0; border-top: 1px solid var(--stone); }
  .grid__cell:nth-child(n+3) { border-left: 1px solid var(--stone); }
  .grid__cell:last-child { grid-column: 1 / -1; border-left: 0; }
  .catalogue { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__toggle { display: block; }
  .mobile-menu {
    display: grid; overflow: hidden; max-height: 0;
    padding-inline: var(--gutter);
    transition: max-height .45s var(--ease), padding .45s var(--ease);
  }
  .mobile-menu a { padding: 1rem 0; border-top: 1px solid var(--stone); font-family: var(--serif); font-size: 1.4rem; letter-spacing: .02em; }
  .nav.is-open .mobile-menu { max-height: 360px; padding-bottom: 1rem; }
  .nav.is-open { border-bottom-color: var(--stone); }

  .hero { grid-template-columns: 1fr; }
  .hero__title { max-width: 15ch; }
}

@media (max-width: 560px) {
  .nav__inner { height: 72px; }
  .brand__mark { width: 38px; height: 38px; }
  .brand__name { font-size: .66rem; letter-spacing: .24em; }
  .btn-box { padding: .5rem .9rem; letter-spacing: .2em; }
  .hero__stats { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .btn-primary { width: 100%; justify-content: center; }
  .catalogue { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .title-card__cover { font-size: 1rem; padding: 1rem; }
  .grid { grid-template-columns: 1fr; }
  .grid__cell:nth-child(n+3) { border-left: 0; }
  .subjects li { grid-template-columns: 2.5rem 1fr; }
  .subjects__count { display: none; }
  .footer__base { flex-direction: column; text-align: center; }
}

@media (max-width: 380px) {
  .brand { gap: .6rem; }
  .brand__name { font-size: .58rem; letter-spacing: .18em; }
}

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