/* ============================================================
   THE BROADSHEET · shared foundation
   newsprint #F6F1E7 · ink #1A1611 · oxblood #7A1F1F · rule #C9BFA8
   ============================================================ */

:root {
  --paper: #F6F1E7;
  --paper-2: #F0E9D8;
  --paper-3: #EAE1CC;
  --ink: #1A1611;
  --ink-2: #4A4136;
  --ink-3: #6E6352;
  --ox: #7A1F1F;
  --ox-deep: #5E1717;
  --rule: #C9BFA8;
  --rule-2: #DCD5C2;

  --serif: 'Spectral', Georgia, 'Times New Roman', serif;
  --disp: 'Playfair Display', 'Georgia', serif;
  --mono: 'IBM Plex Mono', 'Consolas', monospace;

  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --ease-draw: cubic-bezier(.66, 0, .22, 1);
  --ease-press: cubic-bezier(.3, 1.45, .55, 1);

  --wrap: 1240px;
  --gut: clamp(18px, 4vw, 48px);
}

/* ------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  /* smooth scrolling is applied per-click in JS so programmatic jumps stay instant */
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.68 var(--serif);
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* paper grain, printed over everything, never interactive */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='table' tableValues='0 0.05'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='260' height='260' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--ox); color: var(--paper); }

body {
  scrollbar-width: thin;
  scrollbar-color: var(--ink) var(--paper-2);
}
body::-webkit-scrollbar { width: 12px; }
body::-webkit-scrollbar-track { background: var(--paper-2); border-left: 1px solid var(--rule); }
body::-webkit-scrollbar-thumb { background: var(--ink); border: 3px solid var(--paper-2); }

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

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

:focus-visible {
  outline: 2px dashed var(--ox);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .8em 1.2em;
  background: var(--ink);
  color: var(--paper);
  font: 600 11px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  transition: top .25s var(--ease-out);
}
.skip:focus { top: 12px; }

/* ------------------------------------------------ layout */
.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gut);
}

/* continuous sheet-edge rails */
.rails { position: relative; }
.rails::before, .rails::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--rule);
}
.rails::before { left: 0; }
.rails::after { right: 0; }
@media (max-width: 720px) {
  .rails::before, .rails::after { display: none; }
}

/* ------------------------------------------------ rules (the printed kind) */
.r-hair { height: 1px; background: var(--rule); border: 0; }
.r-ink { height: 1px; background: var(--ink); border: 0; }
.r-oxford {
  height: 7px; border: 0;
  background: linear-gradient(to bottom,
    var(--ink) 0, var(--ink) 3px,
    transparent 3px, transparent 6px,
    var(--ink) 6px, var(--ink) 7px);
}
.r-oxford-flip {
  height: 7px; border: 0;
  background: linear-gradient(to bottom,
    var(--ink) 0, var(--ink) 1px,
    transparent 1px, transparent 4px,
    var(--ink) 4px, var(--ink) 7px);
}
.r-double { height: 5px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); background: transparent; }

/* ------------------------------------------------ type utilities */
.k {
  font: 600 11px/1.5 var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
}
.k-ox { color: var(--ox); }
.k-soft { color: var(--ink-3); }
.cap {
  font: 500 10.5px/1.6 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ink-spread underline for inline links */
.lnk {
  background-image: linear-gradient(to top, var(--ox) 0, var(--ox) 100%);
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: 0 96%;
  transition: background-size .3s var(--ease-out), color .3s var(--ease-out);
  padding-bottom: 2px;
}
.lnk:hover { background-size: 100% 3px; color: var(--ox); }

/* ------------------------------------------------ buttons: letterpress */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .7em;
  min-height: 46px;
  padding: .95em 1.7em;
  border: 1px solid var(--ink);
  background: var(--ox);
  color: var(--paper);
  font: 600 11.5px/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .16s var(--ease-out), box-shadow .16s var(--ease-out), background .16s var(--ease-out), color .16s var(--ease-out);
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); background: var(--ox-deep); }
.btn:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); }
.btn svg { width: 15px; height: 15px; flex: none; }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--rule);
}
.btn--ghost:hover { background: var(--ink); color: var(--paper); box-shadow: 6px 6px 0 var(--rule); }

.btn--inv {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
  box-shadow: 4px 4px 0 var(--ox);
}
.btn--inv:hover { background: var(--paper-2); box-shadow: 6px 6px 0 var(--ox); transform: translate(-2px,-2px); }

/* ------------------------------------------------ edition ticker */
.ticker {
  position: relative;
  z-index: 20;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker-run 46s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-set {
  display: flex;
  align-items: center;
  white-space: nowrap;
  padding: 7px 0;
  font: 500 10.5px/1 var(--mono);
  letter-spacing: .19em;
}
.ticker-set > span { display: inline-block; padding: 0 1.35em; }
.ticker-set > span > b { font-weight: 600; color: var(--rule); }
.ticker-set > .tick-dot { padding: 0; color: var(--ox); font-weight: 700; }
@keyframes ticker-run { to { transform: translateX(-50%); } }

/* ------------------------------------------------ masthead */
.masthead { position: relative; }

.dateline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 1rem;
  padding: 10px 0 9px;
  border-bottom: 1px solid var(--ink);
  font: 500 10.5px/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
}
.dateline > :nth-child(2) { text-align: center; }
.dateline > :nth-child(3) { text-align: right; }

.m-plate {
  position: relative;
  text-align: center;
  padding: clamp(22px, 3.4vw, 44px) 0 clamp(14px, 2vw, 24px);
}
.m-title {
  font-family: var(--disp);
  font-weight: 900;
  font-size: clamp(2.55rem, 7.4vw, 6.6rem);
  line-height: .96;
  letter-spacing: -.02em;
  color: var(--ink);
}
.m-title .thin { font-weight: 500; font-style: italic; margin-right: .12em; }

.m-motto {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.2rem;
  padding: 8px 0;
  font: 600 10.5px/1.5 var(--mono);
  letter-spacing: .2em;
  text-transform: uppercase;
}
.m-motto > :first-child { text-align: left; color: var(--ink-3); }
.m-motto > :nth-child(2) { text-align: center; color: var(--ox); }
.m-motto > :last-child { text-align: right; color: var(--ink-3); }

/* the ears */
.ear {
  position: absolute;
  top: clamp(20px, 3vw, 40px);
  width: clamp(118px, 11vw, 150px);
  border: 1px solid var(--rule);
  padding: 10px 12px;
  text-align: left;
  font: 500 10px/1.65 var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--paper);
}
.ear b { display: block; color: var(--ox); font-weight: 600; letter-spacing: .16em; margin-bottom: 3px; }
.ear--l { left: 0; }
.ear--r { right: 0; }
@media (max-width: 1080px) { .ear { display: none; } }

/* est. stamp */
.stamp-est {
  position: absolute;
  right: clamp(4px, 11vw, 158px);
  top: -6px;
  width: clamp(70px, 7vw, 96px);
  height: auto;
  color: var(--ox);
  opacity: .92;
  transform: rotate(8deg);
  mix-blend-mode: multiply;
  transition: transform .5s var(--ease-press);
}
.masthead:hover .stamp-est { transform: rotate(2deg) scale(1.04); }
@media (max-width: 1080px) { .stamp-est { display: none; } }

/* ------------------------------------------------ department nav */
.deptnav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(.4rem, 2vw, 1.6rem);
  flex-wrap: wrap;
  padding: 11px 0;
}
.navlink {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 2px;
  font: 600 11px/1 var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink);
}
.navlink::after {
  content: "";
  position: absolute;
  left: 50%; right: 50%;
  bottom: 0;
  height: 2px;
  background: var(--ox);
  transition: left .28s var(--ease-out), right .28s var(--ease-out);
}
.navlink:hover::after, .navlink[aria-current]::after { left: 0; right: 0; }
.navlink:hover { color: var(--ox); }
.nav-dot { color: var(--rule); font-size: 12px; user-select: none; }

/* sticky compact bar */
.stickybar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 80;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  box-shadow: 0 1px 0 var(--paper), 0 4px 0 -3px var(--ink), 0 10px 24px -18px rgba(26, 22, 17, .55);
  transform: translateY(-104%);
  transition: transform .4s var(--ease-out);
}
.stickybar.on { transform: none; }
.stickybar .progress {
  position: absolute;
  left: 0; bottom: -1px;
  height: 2px;
  width: 100%;
  background: var(--ox);
  transform: scaleX(0);
  transform-origin: left center;
}
.stickybar-in {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding-block: 9px;
}
.stickybar .brand {
  font-family: var(--disp);
  font-weight: 900;
  font-size: 1.28rem;
  letter-spacing: -.01em;
  margin-right: auto;
  white-space: nowrap;
}
.stickybar .brand:hover { color: var(--ox); }
.stickybar .navlink { min-height: 44px; }
.stickybar .btn { min-height: 38px; padding: .7em 1.2em; box-shadow: 3px 3px 0 var(--ink); }
@media (max-width: 900px) {
  .stickybar .navlink { display: none; }
}

/* ------------------------------------------------ section headers */
.dept-head { text-align: center; }
.dept-head .dept-folio {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0 22px;
}
.dept-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
}
.dept-title-row svg { width: 26px; height: 12px; color: var(--ox); flex: none; }
.dept-title {
  font: 600 clamp(12px, 1.4vw, 14px)/1.4 var(--mono);
  letter-spacing: .34em;
  text-indent: .34em;
  text-transform: uppercase;
  color: var(--ink);
}
.dept-sub {
  margin-top: 10px;
  font-family: var(--disp);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  color: var(--ink-2);
}

/* ------------------------------------------------ figures: halftone that sharpens */
.fig { position: relative; }
.fig svg { width: 100%; height: auto; }
.fig .g-tone { opacity: .3; transition: opacity .8s var(--ease-out); }
.fig .g-line { opacity: 0; transition: opacity .8s var(--ease-out) .15s; }
.fig.in .g-tone { opacity: .62; }
.fig.in .g-line { opacity: .78; }
.fig.in:hover .g-tone { opacity: .3; }
.fig.in:hover .g-line { opacity: 1; }

/* ------------------------------------------------ reveal choreography */
.js [data-rv] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .75s var(--ease-out), transform .75s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.js [data-rv].in { opacity: 1; transform: none; }

.js [data-rv="rule"] {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .9s var(--ease-draw);
}
.js [data-rv="rule"].in { transform: scaleX(1); }

.js [data-rv="rule-c"] {
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .9s var(--ease-draw);
}
.js [data-rv="rule-c"].in { transform: scaleX(1); }

/* ------------------------------------------------ footer */
.footer { border-top: 3px solid var(--ink); background: var(--paper); }
.footer-in { padding-block: clamp(40px, 6vw, 72px) 0; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.6fr;
  gap: clamp(1.6rem, 4vw, 4rem);
  padding-bottom: clamp(36px, 5vw, 56px);
}
.footer h3 {
  font: 600 11px/1 var(--mono);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ox);
  margin-bottom: 1.1em;
}
.footer ul { list-style: none; }
.footer li { margin: 0; }
.footer li a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  font: 400 .95rem/1.5 var(--serif);
  background-image: linear-gradient(to top, var(--ox) 0, var(--ox) 100%);
  background-repeat: no-repeat;
  background-size: 0% 1px;
  background-position: 0 88%;
  transition: background-size .28s var(--ease-out), color .28s var(--ease-out);
}
.footer li a:hover { background-size: 100% 1px; color: var(--ox); }
.footer .brandline {
  font-family: var(--disp);
  font-weight: 900;
  font-size: 1.7rem;
  margin-bottom: .5em;
}
.footer .colophon {
  font-size: .92rem;
  line-height: 1.7;
  color: var(--ink-2);
  font-style: italic;
}
.footer-base {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--rule);
  padding-block: 18px;
  font: 500 10px/1.7 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.footer-base a { color: var(--ink); }
.footer-base a:hover { color: var(--ox); }
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; }
}

/* ------------------------------------------------ touch: every target clears 44px */
@media (max-width: 900px) {
  .navlink { min-height: 44px; }
  .footer li a { min-height: 44px; }
  .stickybar .brand { display: inline-flex; align-items: center; min-height: 44px; }
  .footer-base a { display: inline-flex; align-items: center; min-height: 44px; }
  .skip { padding: 1.05em 1.3em; }
}

/* ------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .js [data-rv],
  .js [data-rv="rule"],
  .js [data-rv="rule-c"] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .fig .g-tone, .fig .g-line { transition: none; }
  .fig .g-line { opacity: .78; }
  .fig .g-tone { opacity: .62; }
  .btn, .btn:hover, .btn:active { transform: none; }
  .stamp-est, .masthead:hover .stamp-est { transform: rotate(8deg); transition: none; }
  .stickybar { transition: none; }
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; }
}
