:root {
  --bg: #ffffff;
  --ink: #0b0b0b;
  --muted: #6e6e6e;
  --line: #e7e7e7;
  --ph: #ededed;
  --ph-2: #e3e3e3;
  --ph-ink: #9a9a9a;
  --maxw: 1280px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

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

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px);
}

.update-bar {
  display: block;
  background: #0b0b0b;
  color: #fff;
  transition: background 0.15s;
}

.update-bar:hover {
  background: #1d1d1d;
}

.ub-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px clamp(20px, 4vw, 56px);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  flex-wrap: wrap;
}

.ub-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  position: relative;
  flex: 0 0 auto;
}

.ub-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #fff;
  animation: ping 1.8s ease-out infinite;
}

.ub-label {
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-size: 11px;
}

.ub-sep {
  color: rgba(255, 255, 255, 0.4);
}

.ub-date {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.ub-text {
  color: rgba(255, 255, 255, 0.88);
}

.ub-text b {
  color: #fff;
  font-weight: 600;
}

.ub-arrow {
  width: 16px;
  height: 16px;
  stroke: #fff;
  margin-left: auto;
  flex: 0 0 auto;
  transition: transform 0.15s;
}

.update-bar:hover .ub-arrow {
  transform: translateX(3px);
}

header.site {
  padding: clamp(24px, 3.5vw, 38px) 0 0;
  position: relative;
  z-index: 40;
}

.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}

.nav-left {
  display: flex;
  gap: clamp(18px, 2vw, 30px);
  align-items: center;
}

.nav-left > a {
  color: var(--ink);
  font-size: clamp(16px, 1.6vw, 19px);
  font-weight: 400;
  padding-bottom: 3px;
  transition: opacity 0.15s;
}

.nav-left > a.active {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1.5px;
}

.nav-left > a:not(.active):hover {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
  opacity: 0.85;
}

.nav-dd {
  position: relative;
  display: inline-flex;
}

.nav-dd-toggle {
  border: 0;
  margin: 0;
  padding: 0 0 3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  background: none;
  font-size: clamp(16px, 1.6vw, 19px);
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.15s;
}

.nav-dd-toggle:hover {
  opacity: 0.85;
}

.nav-dd .caret {
  width: 11px;
  height: 7px;
  display: block;
  transition: transform 0.2s;
}

.nav-dd.open .caret {
  transform: rotate(180deg);
}

.nav-dd-menu {
  position: absolute;
  top: calc(100% + 9px);
  left: 50%;
  z-index: 60;
  min-width: 188px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  visibility: hidden;
  opacity: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.09);
  transform: translateX(-50%) translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.nav-dd.open .nav-dd-menu {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.nav-dd-menu a {
  padding: 9px 13px;
  border-radius: 7px;
  color: var(--ink);
  font-size: 15px;
  white-space: nowrap;
  transition: background 0.14s;
}

.nav-dd-menu a:hover {
  background: var(--ph);
}

.brand-block {
  justify-self: center;
  text-align: center;
  line-height: 1.05;
}

.brand {
  display: inline-block;
  font-size: clamp(22px, 2.4vw, 29px);
  font-weight: 500;
  letter-spacing: 0.005em;
  white-space: nowrap;
}

.brand-quote {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  font-style: italic;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand-quote span {
  color: var(--ph-ink);
  font-style: normal;
}

.nav-right {
  justify-self: end;
  display: flex;
  gap: clamp(16px, 1.7vw, 24px);
  align-items: center;
}

.nav-right a {
  display: flex;
  color: var(--ink);
  transition: opacity 0.15s;
}

.nav-right a:hover {
  opacity: 0.55;
}

.nav-right svg {
  width: 22px;
  height: 22px;
  display: block;
}

.page-main {
  padding: clamp(72px, 9vw, 118px) 0 clamp(80px, 10vw, 132px);
}

.page-heading {
  max-width: 720px;
  margin-bottom: clamp(38px, 5vw, 64px);
}

.eyebrow {
  display: block;
  margin-bottom: 11px;
  color: var(--ph-ink);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-heading h1,
.reader-title h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 4vw, 50px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.page-heading p,
.reader-title p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.65;
}

.resource-list {
  display: grid;
  gap: clamp(24px, 3vw, 36px);
}

.resource-card {
  max-width: 980px;
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: border-color 0.16s, transform 0.16s;
}

.resource-card:hover {
  border-color: #c8c8c8;
  transform: translateY(-2px);
}

.resource-cover {
  min-height: 420px;
  padding: clamp(22px, 3vw, 34px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f3;
  border-right: 1px solid var(--line);
}

.resource-cover img {
  width: min(100%, 270px);
  height: auto;
  border-radius: 2px;
  box-shadow: 0 16px 40px rgba(11, 11, 11, 0.14);
}

.resource-content {
  padding: clamp(30px, 5vw, 58px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.resource-subject {
  margin-bottom: 14px;
  color: var(--ph-ink);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.resource-content h2 {
  margin: 0 0 14px;
  font-size: clamp(25px, 3vw, 36px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.018em;
}

.resource-description {
  max-width: 52ch;
  margin: 0 0 30px;
  color: var(--muted);
  font-size: clamp(15.5px, 1.45vw, 18px);
  line-height: 1.65;
}

.primary-link {
  min-height: 46px;
  padding: 10px 19px;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.primary-link:hover {
  color: var(--ink);
  background: #fff;
}

.primary-link:focus-visible,
.control-button:focus-visible,
.page-input:focus-visible,
.retry-button:focus-visible,
.back-link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.primary-link svg,
.back-link svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.reader-main {
  padding: clamp(54px, 6vw, 82px) 0 clamp(58px, 7vw, 92px);
}

.reader-head {
  margin-bottom: clamp(26px, 4vw, 42px);
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.reader-title {
  max-width: 760px;
}

.reader-title h1 {
  font-size: clamp(28px, 3.6vw, 44px);
}

.back-link {
  margin-bottom: 7px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  transition: color 0.15s;
}

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

.reader-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f3f3f1;
}

.reader-toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 68px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 9px;
}

.control-button {
  min-width: 42px;
  min-height: 42px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.control-button:hover:not(:disabled) {
  border-color: var(--ink);
  background: #fafafa;
}

.control-button:disabled {
  color: #b9b9b9;
  cursor: not-allowed;
}

.control-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.page-indicator {
  min-height: 42px;
  padding: 6px 13px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  border: 1px solid transparent;
  font-size: 13px;
  white-space: nowrap;
}

.page-input {
  width: 48px;
  height: 30px;
  padding: 3px 5px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-align: center;
  -moz-appearance: textfield;
}

.page-input::-webkit-inner-spin-button,
.page-input::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.zoom-label {
  min-width: 52px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.reader-stage {
  position: relative;
  min-height: min(74vh, 920px);
  padding: clamp(18px, 3vw, 38px);
  overflow: auto;
  overscroll-behavior: contain;
  text-align: center;
  touch-action: pan-x pan-y;
}

#pdfCanvas {
  flex: 0 0 auto;
  margin: 0 auto;
  display: block;
  background: #fff;
  box-shadow: 0 10px 34px rgba(11, 11, 11, 0.15);
}

#pdfCanvas[hidden] {
  display: none;
}

.reader-state {
  position: absolute;
  inset: 0;
  z-index: 5;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f3f1;
  text-align: center;
}

.reader-state[hidden] {
  display: none;
}

.state-inner {
  max-width: 420px;
}

.spinner {
  width: 30px;
  height: 30px;
  margin: 0 auto 17px;
  border: 2px solid #d5d5d2;
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.state-title {
  margin: 0 0 7px;
  font-size: 18px;
  font-weight: 500;
}

.state-message {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.retry-button {
  margin-top: 18px;
  padding: 9px 17px;
  color: #fff;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.reader-hint {
  margin: 14px 2px 0;
  color: var(--ph-ink);
  font-size: 12.5px;
  text-align: center;
}

.noscript-message {
  margin: 30px;
  padding: 22px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
}

footer.site {
  padding: 46px 0 60px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.footer-inner {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

@keyframes ping {
  0% {
    transform: scale(1);
    opacity: 0.45;
  }
  70% {
    transform: scale(2.6);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

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

@media (max-width: 860px) {
  .nav {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 16px;
    text-align: center;
  }

  .nav-left {
    order: 2;
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: center;
  }

  .brand-block {
    order: 1;
  }

  .brand-quote {
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    white-space: normal;
  }

  .nav-right {
    order: 3;
    justify-self: center;
  }
}

@media (max-width: 720px) {
  .resource-card {
    grid-template-columns: 1fr;
  }

  .resource-cover {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .resource-cover img {
    width: min(72vw, 280px);
  }

  .reader-head {
    align-items: flex-start;
    flex-direction: column-reverse;
    gap: 15px;
  }

  .reader-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-group {
    justify-content: center;
  }

  .toolbar-group:first-child {
    justify-content: space-between;
  }

  .reader-stage {
    min-height: 68vh;
    padding: 14px;
  }
}

@media (max-width: 440px) {
  .ub-inner {
    gap: 7px 9px;
  }

  .ub-text {
    width: 100%;
    min-width: 0;
    padding-left: 17px;
    overflow-wrap: anywhere;
  }

  .ub-arrow {
    display: none;
  }

  .control-label {
    display: none;
  }

  .reader-toolbar {
    padding: 9px;
  }

  .page-indicator {
    padding-left: 5px;
    padding-right: 5px;
  }

  .resource-content {
    padding: 26px 22px 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
