/* ============================================================
   EQXX — Colour Portal
   Paper-and-bronze editorial system, derived from the brand's
   own palette (#F6F0E6 / #17130F / #8B642F / #A56849 / #75877D).
   ============================================================ */

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

html {
  background: #f6f0e6;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Jost", "Noto Serif SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
p {
  margin: 0;
  text-wrap: pretty;
}

/* ---------- root shell: the paper that gets dyed ---------- */

.portal {
  --paper: #f6f0e6;
  --ink: #17130f;
  --bronze: #8b642f;
  --fg: var(--ink);
  --fg-soft: rgba(23, 19, 15, 0.6);
  --fg-faint: rgba(23, 19, 15, 0.38);
  --line: rgba(23, 19, 15, 0.16);
  --line-strong: rgba(23, 19, 15, 0.3);

  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--paper);
  color: var(--fg);
  transition: background-color 760ms cubic-bezier(0.22, 0.61, 0.36, 1),
    color 760ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.portal[data-wash="library"] {
  background-color: #3c463b;
  --fg: #f2ecdf;
  --fg-soft: rgba(242, 236, 223, 0.7);
  --fg-faint: rgba(242, 236, 223, 0.42);
  --line: rgba(242, 236, 223, 0.22);
  --line-strong: rgba(242, 236, 223, 0.4);
  --bronze: #cdb98f;
}

.portal[data-wash="journal"] {
  background-color: #2b1e2d;
  --fg: #f4ece6;
  --fg-soft: rgba(244, 236, 230, 0.7);
  --fg-faint: rgba(244, 236, 230, 0.42);
  --line: rgba(244, 236, 230, 0.22);
  --line-strong: rgba(244, 236, 230, 0.4);
  --bronze: #d3b79b;
}

.portal[data-wash="identity"] {
  background-color: #6b2320;
  --fg: #f8eee3;
  --fg-soft: rgba(248, 238, 227, 0.72);
  --fg-faint: rgba(248, 238, 227, 0.44);
  --line: rgba(248, 238, 227, 0.24);
  --line-strong: rgba(248, 238, 227, 0.42);
  --bronze: #e0bd97;
}

/* printed frame, kept 22px inside the viewport */
.print-frame {
  position: fixed;
  inset: 22px;
  border: 1px solid var(--line);
  pointer-events: none;
  z-index: 40;
  transition: border-color 760ms ease;
}

/* ---------- shared type ---------- */

.eyebrow {
  font-family: "Jost", sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--fg-faint);
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--bronze);
  display: block;
  flex: none;
}

.serif-latin {
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
  font-weight: 300;
}

/* ---------- masthead ---------- */

.masthead {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px clamp(28px, 4.4vw, 60px) 22px;
  border-bottom: 1px solid var(--line);
  transition: border-color 760ms ease;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.wordmark__name {
  font-family: "Jost", sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.4em;
  color: var(--fg);
  transition: color 760ms ease;
}

.wordmark__mark {
  font-family: "Cormorant Garamond", serif;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--bronze);
}

.masthead__meta {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 40px);
  font-family: "Jost", sans-serif;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-faint);
  transition: color 760ms ease;
}

.masthead__meta span {
  white-space: nowrap;
}

.masthead__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--bronze);
  flex: none;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(36px, 5vw, 90px);
  align-items: center;
  padding: clamp(44px, 5.6vw, 84px) clamp(28px, 4.4vw, 60px) clamp(48px, 5vw, 76px);
  min-height: calc(100vh - 76px);
}

.hero__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(20px, 2.4vw, 30px);
  max-width: 620px;
}

.hero__title {
  font-family: "Noto Serif SC", "Cormorant Garamond", serif;
  font-weight: 300;
  font-size: clamp(38px, 4.4vw, 66px);
  line-height: 1.24;
  letter-spacing: 0.01em;
  color: var(--fg);
  transition: color 760ms ease;
}

.hero__title em {
  font-style: normal;
  color: var(--bronze);
  transition: color 760ms ease;
}

.hero__latin {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(20px, 2vw, 29px);
  letter-spacing: 0.01em;
  color: var(--fg-soft);
  transition: color 760ms ease;
}

.hero__lede {
  max-width: 36ch;
  font-family: "Noto Serif SC", serif;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.95;
  letter-spacing: 0.02em;
  color: var(--fg-soft);
  transition: color 760ms ease;
}

.hero__cue {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: clamp(8px, 1.6vw, 20px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
  width: min(100%, 360px);
  font-family: "Jost", sans-serif;
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg-faint);
  transition: color 760ms ease, border-color 760ms ease;
}

.hero__cue svg {
  color: var(--bronze);
}

/* hero plate */

.hero__plate {
  position: relative;
  justify-self: end;
  width: min(100%, 460px);
}

.hero__frame {
  position: relative;
  aspect-ratio: 3 / 3.85;
  overflow: hidden;
  background: rgba(23, 19, 15, 0.08);
}

.hero__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 32%;
  filter: saturate(0.94) contrast(1.02);
  transition: transform 1400ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.hero__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(23, 19, 15, 0.05), rgba(23, 19, 15, 0.16));
  pointer-events: none;
}

.hero__plate-rule {
  position: absolute;
  top: -12px;
  right: -12px;
  bottom: 12px;
  left: 12px;
  border: 1px solid var(--line-strong);
  pointer-events: none;
  transition: border-color 760ms ease;
}

.hero__caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  font-family: "Jost", sans-serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-faint);
  transition: color 760ms ease;
}

/* ---------- doors ---------- */

.doors {
  position: relative;
  padding: clamp(40px, 5vw, 68px) clamp(28px, 4.4vw, 60px) clamp(52px, 6vw, 92px);
  border-top: 1px solid var(--line);
  transition: border-color 760ms ease;
}

.doors__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: clamp(24px, 2.6vw, 36px);
}

.doors__title {
  font-family: "Noto Serif SC", serif;
  font-weight: 300;
  font-size: clamp(22px, 2vw, 28px);
  letter-spacing: 0.04em;
  color: var(--fg);
  margin-top: 14px;
  transition: color 760ms ease;
}

.doors__note {
  font-family: "Noto Serif SC", serif;
  font-weight: 300;
  font-size: 13px;
  letter-spacing: 0.03em;
  color: var(--fg-faint);
  padding-bottom: 4px;
  transition: color 760ms ease;
}

.doors__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.4vw, 20px);
}

/* one door = one colour domain */

.door {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: clamp(430px, 40vw, 545px);
  padding: 22px 24px 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f7f1e6;
  isolation: isolate;
  transition: transform 620ms cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 520ms ease, border-color 520ms ease;
}

.portal[data-density="紧凑"] .door {
  min-height: clamp(360px, 33vw, 430px);
}

.door__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: #2a2419;
}

.door__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.03) brightness(0.94);
  transform: scale(1.005);
  transition: transform 1500ms cubic-bezier(0.22, 0.61, 0.36, 1),
    filter 900ms ease;
}

.door__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(14, 11, 8, 0.52) 0%,
    rgba(14, 11, 8, 0.12) 34%,
    rgba(14, 11, 8, 0.34) 62%,
    rgba(14, 11, 8, 0.8) 100%
  );
  transition: background 620ms ease;
}

.door__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.door__index {
  font-family: "Cormorant Garamond", serif;
  font-size: 17px;
  letter-spacing: 0.16em;
  color: rgba(247, 241, 230, 0.92);
  transition: color 500ms ease;
}

.door__domain {
  font-family: "Jost", sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  color: rgba(247, 241, 230, 0.58);
  transition: color 500ms ease;
}

.door__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.door__en {
  font-family: "Jost", sans-serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(231, 200, 158, 0.95);
}

.door__cn {
  font-family: "Noto Serif SC", serif;
  font-weight: 300;
  font-size: clamp(24px, 2.1vw, 31px);
  line-height: 1.3;
  letter-spacing: 0.05em;
  color: #fbf6ec;
}

.door__desc {
  max-width: 30ch;
  font-family: "Noto Serif SC", serif;
  font-weight: 300;
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: 0.015em;
  color: rgba(247, 241, 230, 0.74);
}

.door__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.door__tags li {
  font-family: "Jost", "Noto Serif SC", sans-serif;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: rgba(247, 241, 230, 0.86);
  padding: 5px 9px;
  border: 1px solid rgba(247, 241, 230, 0.26);
}

.door__cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid rgba(247, 241, 230, 0.26);
  font-family: "Jost", "Noto Serif SC", sans-serif;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(251, 246, 236, 0.9);
  transition: border-color 500ms ease, color 500ms ease;
}

.door__cta svg {
  transition: transform 500ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* hover / focus: the door opens */

.door:hover .door__media img,
.door:focus-visible .door__media img {
  transform: scale(1.055);
  filter: saturate(1.02) contrast(1.04) brightness(1.02);
}

.door:hover .door__veil,
.door:focus-visible .door__veil {
  background: linear-gradient(
    180deg,
    rgba(14, 11, 8, 0.38) 0%,
    rgba(14, 11, 8, 0.06) 34%,
    rgba(14, 11, 8, 0.3) 62%,
    rgba(14, 11, 8, 0.78) 100%
  );
}

.door:hover .door__cta svg,
.door:focus-visible .door__cta svg {
  transform: translateX(6px);
}

.door:hover .door__cta,
.door:focus-visible .door__cta {
  border-color: rgba(247, 241, 230, 0.55);
  color: #fffaf0;
}

.door:focus-visible {
  outline: 1px solid #f2e3c8;
  outline-offset: 3px;
}

/* siblings recede while one door is chosen */

.doors__grid[data-active] .door {
  opacity: 0.44;
  transform: scale(0.988);
}

.doors__grid[data-active] .door.is-active {
  opacity: 1;
  transform: scale(1);
  border-color: rgba(247, 241, 230, 0.42);
}

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

.footer {
  padding: clamp(28px, 3vw, 40px) clamp(28px, 4.4vw, 60px) clamp(30px, 3.4vw, 44px);
  border-top: 1px solid var(--line);
  transition: border-color 760ms ease;
}

.footer__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.footer__sign {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__line {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 20px;
  letter-spacing: 0.01em;
  color: var(--fg);
  transition: color 760ms ease;
}

.footer__place {
  font-family: "Jost", sans-serif;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg-faint);
  transition: color 760ms ease;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: flex-end;
}

.footer__links a {
  font-family: "Noto Serif SC", serif;
  font-weight: 300;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--fg-soft);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 400ms ease, border-color 400ms ease;
}

.footer__links a:hover {
  color: var(--fg);
  border-bottom-color: var(--bronze);
}

.footer__links span {
  font-family: "Jost", sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--fg-faint);
}

.footer__base {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: clamp(26px, 3vw, 36px);
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: "Jost", sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
  transition: color 760ms ease, border-color 760ms ease;
}

/* ---------- entrance choreography ---------- */

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

.reveal {
  animation: riseIn 900ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.portal[data-motion="克制"] .reveal {
  animation: none;
}

.portal[data-motion="克制"] .door,
.portal[data-motion="克制"] .door__media img,
.portal[data-motion="克制"] .hero__frame img,
.portal[data-motion="克制"] .doors__grid .door {
  transition: none;
}

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    gap: 40px;
  }

  .hero__plate {
    justify-self: start;
    width: min(100%, 420px);
  }

  .doors__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .door:last-child {
    grid-column: span 2;
    min-height: 340px;
  }
}

@media (max-width: 720px) {
  .print-frame {
    inset: 10px;
  }

  .masthead {
    padding: 20px 24px 18px;
    gap: 12px;
  }

  .masthead__meta span:not(:first-child),
  .masthead__dot {
    display: none;
  }

  .hero,
  .doors,
  .footer {
    padding-left: 24px;
    padding-right: 24px;
  }

  .hero__title {
    font-size: clamp(32px, 9vw, 40px);
  }

  .doors__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .door,
  .portal[data-density="紧凑"] .door,
  .door:last-child {
    grid-column: auto;
    min-height: 400px;
  }

  .footer__links {
    align-items: flex-start;
  }
}

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