/* jayschrader.com — financial broadsheet
   The channel documents trading disasters; the banner already reads like a
   masthead. So the page is built as the front page of a newspaper that only
   covers people losing money. */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Newsreader:ital,opsz,wght@0,6..72,300..700;1,6..72,300..600&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --paper:      #faf8f4;
  --paper-deep: #f2eee5;
  --ink:        #16150f;
  --ink-soft:   #3d3a30;
  --muted:      #6b675c;
  --rule:       #d8d2c4;
  --rule-soft:  #e8e3d7;
  --loss:       #b3161d;
  --gain:       #1d6b3f;

  --display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --body:    'Newsreader', Georgia, 'Times New Roman', serif;
  --mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --gut: clamp(1.25rem, 4vw, 3rem);
  --max: 1180px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Newsprint grain. Fixed so it reads as paper stock, not a moving texture. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .038;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; }

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

:focus-visible {
  outline: 2px solid var(--loss);
  outline-offset: 3px;
}

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

.kicker {
  font-family: var(--mono);
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Masthead ─────────────────────────────────────────────── */

.masthead { padding-top: clamp(1.5rem, 4vw, 2.75rem); }

.edition {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--ink);
  flex-wrap: wrap;
}
.edition span { white-space: nowrap; }
.edition .mid { flex: 1; text-align: center; }

.wordmark {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(3.1rem, 13vw, 9.5rem);
  line-height: .92;
  letter-spacing: -.025em;
  text-align: center;
  margin: clamp(1.1rem, 3vw, 2rem) 0 .2rem;
}

.tagline {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1rem, 2.6vw, 1.6rem);
  text-align: center;
  color: var(--ink-soft);
  margin: 0 0 clamp(1.1rem, 3vw, 1.9rem);
}

.rule-double {
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  height: 4px;
}

/* ── Ticker ───────────────────────────────────────────────── */

.ticker {
  border-bottom: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  padding: .55rem 0;
  display: flex;
  user-select: none;
}

.ticker__track {
  display: flex;
  flex-shrink: 0;
  gap: 2.5rem;
  padding-right: 2.5rem;
  min-width: 100%;
  animation: slide 90s linear infinite;
}

.ticker__item {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--paper);
}
.ticker__item::before {
  content: '▼';
  color: #ff6b70;
  margin-right: .6rem;
  font-size: .58rem;
}

@keyframes slide {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* ── Lede + signup ────────────────────────────────────────── */

.lede {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(1.75rem, 5vw, 4rem);
  padding: clamp(2rem, 5vw, 3.5rem) 0;
  align-items: start;
}

.lede__head {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.9rem, 5.2vw, 3.6rem);
  line-height: 1.03;
  letter-spacing: -.02em;
  margin: .5rem 0 1.1rem;
  text-wrap: balance;
}
.lede__head em {
  font-style: italic;
  color: var(--loss);
}

.lede__body { font-size: 1.05rem; color: var(--ink-soft); margin: 0; }

/* Drop cap — the one flourish that signals "newspaper" instantly. */
.lede__body::first-letter {
  float: left;
  font-family: var(--display);
  font-size: 3.5em;
  line-height: .78;
  font-weight: 600;
  padding: .08em .1em 0 0;
  color: var(--ink);
}

/* Subscription box, styled as a newspaper coupon. */
.signup {
  border: 1px solid var(--ink);
  background: var(--paper-deep);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  position: relative;
}
.signup::after {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid var(--rule);
  pointer-events: none;
}

.signup__title {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.15;
  margin: .55rem 0 .4rem;
}

.signup__sub {
  font-size: .95rem;
  color: var(--muted);
  margin: 0 0 1.1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.field input[type=email] {
  font-family: var(--body);
  font-size: 1rem;
  padding: .8rem .85rem;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  border-radius: 0;
  width: 100%;
  min-height: 46px;
}
.field input[type=email]::placeholder { color: #a8a294; }

.btn {
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  padding: .85rem 1.2rem;
  min-height: 46px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.btn:hover:not(:disabled) { background: var(--loss); border-color: var(--loss); }
.btn:disabled { opacity: .55; cursor: progress; }

/* Visually hidden but read aloud — for real labels. */
.sr-only,
/* Bot honeypot — hidden from people, visible to naive scrapers. Kept as a
   separate selector so restyling one never silently changes the other. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.fineprint {
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .07em;
  color: var(--muted);
  margin: .85rem 0 0;
  line-height: 1.7;
}

.msg {
  margin-top: .85rem;
  font-size: .95rem;
  padding: .7rem .85rem;
  border-left: 3px solid var(--gain);
  background: rgba(29,107,63,.07);
  color: var(--gain);
}
.msg[data-kind=error] {
  border-color: var(--loss);
  background: rgba(179,22,29,.07);
  color: var(--loss);
}

/* ── Video grid ───────────────────────────────────────────── */

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: .55rem 0;
  margin-bottom: clamp(1.5rem, 4vw, 2.25rem);
}
.section-head h2 {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -.01em;
}
.section-head .kicker { margin-left: auto; }

.stories { padding-bottom: clamp(2.5rem, 6vw, 4.5rem); }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.25rem, 3vw, 2.25rem);
}

.story {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule-soft);
}

/* Lead story spans the full width and sets its own two-column rhythm. */
.story--lead {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(1.25rem, 3.5vw, 2.5rem);
  align-items: center;
  border-top: none;
  padding-top: 0;
  padding-bottom: clamp(1.5rem, 4vw, 2.25rem);
  border-bottom: 1px solid var(--ink);
  margin-bottom: .5rem;
}

.story__shot {
  position: relative;
  overflow: hidden;
  background: var(--paper-deep);
  aspect-ratio: 16 / 9;
  border: 1px solid var(--rule);
}
.story__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Print-plate tint at rest; full colour on hover. */
  filter: grayscale(.55) contrast(1.06);
  transition: transform .5s cubic-bezier(.2,.7,.3,1), filter .35s ease;
}
.story:hover .story__shot img,
.story:focus-visible .story__shot img {
  transform: scale(1.045);
  filter: grayscale(0) contrast(1);
}

.story__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.12rem;
  line-height: 1.2;
  letter-spacing: -.01em;
  margin: 0;
  text-wrap: balance;
}
.story--lead .story__title {
  font-size: clamp(1.6rem, 4vw, 2.9rem);
  line-height: 1.04;
}

.story__meta {
  display: flex;
  gap: .7rem;
  align-items: center;
}

.story__no { color: var(--loss); }

.story:hover .story__title { text-decoration: underline; text-underline-offset: 3px; }

.empty {
  font-style: italic;
  color: var(--muted);
  padding: 2rem 0;
  text-align: center;
}

/* ── Footer ───────────────────────────────────────────────── */

.foot {
  border-top: 3px solid var(--ink);
  padding: 1.5rem 0 3rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: baseline;
}
.foot a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.foot a:hover { border-color: var(--loss); color: var(--loss); }

/* ── Standalone pages (confirm / unsubscribe) ─────────────── */

.slab {
  min-height: 82vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 0;
}
.slab__inner { max-width: 34rem; }
.slab h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 600;
  line-height: 1.05;
  margin: .8rem 0 .8rem;
  letter-spacing: -.02em;
}
.slab p { color: var(--ink-soft); margin: 0 0 1.6rem; }
.slab .btn { display: inline-block; text-decoration: none; }

/* ── Page-load reveal ─────────────────────────────────────── */

.reveal {
  animation: rise .85s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.d1 { animation-delay: .06s; }
.d2 { animation-delay: .14s; }
.d3 { animation-delay: .22s; }
.d4 { animation-delay: .30s; }

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 900px) {
  .lede { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .story--lead { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .grid { grid-template-columns: 1fr; }
  .edition .mid { display: none; }
  .foot { flex-direction: column; gap: .5rem; }
}

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