/* Concept: a weekly magazine's nameplate and its shelf. Newsprint white, deep emerald ink, a brass rule;
   covers treated as real printed paper, and a full map of the Torah's 54 portions as the archive's index. */
@font-face { font-family: 'Modern Times'; src: url('/fonts/modern-times-cn.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Modern Times Wide'; src: url('/fonts/modern-times-wide.woff2') format('woff2'); font-display: swap; }
:root {
  --paper: #f4f2ec; --paper-2: #ebe7dd; --card: #fffefb; --line: #d9d3c6; --ink: #121519; --ink-2: #39404a; --muted: #6f747c;
  --emerald: #1d4f43; --emerald-2: #2b6b5a; --deep: #0f2a24; --brass: #b98d3e; --brass-2: #e0c48e; --on-deep: #f2efe6; --on-deep-mut: #a9bab3;
  --wide: 'Modern Times Wide', 'Modern Times', system-ui, sans-serif; --thin: 'Modern Times', system-ui, sans-serif;
  --serif: 'Newsreader', Georgia, serif; --ui: 'Hanken Grotesk', system-ui, sans-serif; --ease: cubic-bezier(.2, .7, .1, 1);
  --grain: 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='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --paper: #10140f; --paper-2: #161c17; --card: #1a211c; --line: #2c372f; --ink: #eeebe2; --ink-2: #c7ccc4; --muted: #929a92; --emerald: #8fc7b3; --emerald-2: #a8d6c4; color-scheme: dark; } }
:root[data-theme="dark"] { --paper: #10140f; --paper-2: #161c17; --card: #1a211c; --line: #2c372f; --ink: #eeebe2; --ink-2: #c7ccc4; --muted: #929a92; --emerald: #8fc7b3; --emerald-2: #a8d6c4; color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.7 var(--ui); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body::after { content: ""; position: fixed; inset: 0; background: var(--grain); opacity: .08; pointer-events: none; z-index: 100; mix-blend-mode: multiply; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 4px; }
.w { width: min(1220px, 100% - 48px); margin-inline: auto; }
h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.05; text-wrap: balance; }
p { margin: 0; }
em { font-family: var(--serif); font-style: italic; }
.kicker { font: 600 .7rem/1 var(--ui); letter-spacing: .26em; text-transform: uppercase; color: var(--brass); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.fade { opacity: 0; animation: fade .9s var(--ease) forwards; animation-delay: var(--d, .1s); }
@keyframes fade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 999px; font: 600 .92rem/1 var(--ui); transition: transform .3s var(--ease), background .3s, border-color .3s; white-space: nowrap; }
.btn:hover { transform: translateY(-2px); }
.btn svg { width: 17px; height: 17px; }
.btn-em { background: var(--emerald); color: #fbfaf5; }
.btn-brass { background: var(--brass); color: #1d1406; }
.btn-line { border: 1px solid var(--line); }
.btn-line:hover { border-color: var(--ink); }
.btn-ghost { border: 1px solid rgba(255,255,255,.25); color: var(--on-deep); }
.link { font-weight: 600; border-bottom: 1px solid currentColor; padding-bottom: 2px; display: inline-flex; gap: 8px; align-items: center; }

/* nameplate */
.bar { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 40; }
.bar .w { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { font: 400 1.1rem/1 var(--wide); letter-spacing: .14em; margin-right: auto; }
.logo i { font-style: normal; color: var(--brass); }
.nav { display: flex; gap: 4px; }
.nav a { padding: 7px 13px; border-radius: 999px; font-size: .92rem; font-weight: 500; color: var(--ink-2); }
.nav a:hover, .nav a.on { background: var(--paper-2); color: var(--ink); }
.masthead { padding: 56px 0 0; text-align: center; }
.masthead .rule { display: flex; align-items: center; gap: 18px; justify-content: center; font: 600 .7rem/1 var(--ui); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.masthead .rule::before, .masthead .rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.nameplate { font: 400 clamp(2.8rem, 12vw, 10.5rem)/.9 var(--wide); letter-spacing: .06em; margin: 22px 0 18px; }
.masthead .tag { font: italic 400 clamp(1.1rem, 2vw, 1.4rem)/1.4 var(--serif); color: var(--ink-2); }
.masthead .meta { margin-top: 26px; padding: 12px 0; border-block: 3px double var(--line); display: flex; justify-content: center; gap: 10px 34px; flex-wrap: wrap; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

/* this week */
.week { padding: 70px 0 90px; display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(36px, 7vw, 100px); align-items: center; }
.paper { position: relative; display: block; aspect-ratio: 3/4; background: var(--card); border-radius: 3px; overflow: hidden; box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 34px 60px -30px rgba(15, 30, 26, .55); transition: transform .7s var(--ease), box-shadow .7s var(--ease); }
.paper img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.paper::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(255,255,255,.18), transparent 22%, transparent 80%, rgba(0,0,0,.08)); pointer-events: none; }
.stack { position: relative; justify-self: center; width: min(420px, 100%); }
.stack .paper { transform: rotate(-3deg); z-index: 2; }
.stack::before, .stack::after { content: ""; position: absolute; inset: 0; border-radius: 3px; background: var(--paper-2); border: 1px solid var(--line); }
.stack::before { transform: rotate(4deg) translate(14px, 6px); }
.stack::after { transform: rotate(1deg) translate(6px, 2px); background: var(--card); }
.stack:hover .paper { transform: rotate(0) translateY(-8px); }
.week h2 { font: 400 clamp(2.6rem, 6vw, 5rem)/1 var(--thin); margin: 18px 0 8px; }
.week .lede { font: italic 400 1.3rem/1.4 var(--serif); color: var(--ink-2); max-width: 36ch; }
.week .acts { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 34px; }
.nocover { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding: 24px; color: var(--on-deep); background: linear-gradient(165deg, var(--deep), var(--emerald) 70%, #6c7f45 160%); }
.nocover small { font: 600 .62rem/1 var(--ui); letter-spacing: .3em; color: var(--brass-2); }
.nocover b { font: 400 1.5rem/1.05 var(--thin); }

/* sections */
.sec { padding: 90px 0; }
.head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; padding-bottom: 18px; border-bottom: 1px solid var(--ink); }
.head h2 { font: 400 clamp(2rem, 4vw, 3.2rem)/1 var(--thin); margin-top: 12px; }
.shelf { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 40px 22px; }
.issue { display: grid; gap: 10px; min-width: 0; }
.issue:hover .paper { transform: translateY(-6px) rotate(-1deg); box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 40px 70px -30px rgba(15, 30, 26, .6); }
.issue b { font: 400 1.08rem/1.25 var(--serif); }
.issue span { font-size: .78rem; color: var(--muted); letter-spacing: .04em; }

/* the Torah map */
.map { background: var(--deep); color: var(--on-deep); position: relative; overflow: hidden; isolation: isolate; }
.map::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--grain); opacity: .18; mix-blend-mode: overlay; }
.map .head { border-color: rgba(255,255,255,.2); }
.map .head p { color: var(--on-deep-mut); max-width: 42ch; }
.books { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; border-top: 1px solid rgba(255,255,255,.12); }
.book { padding: 22px 18px 26px; border-right: 1px solid rgba(255,255,255,.12); min-width: 0; }
.book:last-child { border-right: 0; }
.book h3 { font: italic 400 1.5rem var(--serif); color: var(--brass-2); margin-bottom: 14px; }
.book ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.book li a, .book li span { display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; margin: 0 -8px; border-radius: 6px; font-size: .92rem; }
.book li a:hover { background: rgba(255,255,255,.08); }
.book li a i { font-style: normal; font-size: .72rem; color: var(--brass-2); }
.book li span { color: rgba(242, 239, 230, .32); }

/* about strip */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 6vw, 80px); align-items: center; }
.about h2 { font: 400 clamp(2rem, 4vw, 3.2rem)/1.05 var(--thin); margin: 14px 0 20px; }
.about p { color: var(--ink-2); font-size: 1.08rem; max-width: 58ch; }
.about .by { display: flex; gap: 18px; align-items: center; margin-top: 28px; }
.about .by img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--paper-2); }
.about .by b { font: italic 400 1.2rem var(--serif); display: block; }
.quote { font: italic 400 clamp(1.8rem, 3.4vw, 2.8rem)/1.2 var(--serif); padding-left: 28px; border-left: 2px solid var(--brass); }

/* ask */
.ask { border-top: 1px solid var(--line); }
.ask .w { display: grid; grid-template-columns: .9fr 1.1fr; gap: 40px; align-items: start; }
.ask h2 { font: 400 clamp(2rem, 3.6vw, 2.8rem)/1.05 var(--thin); margin-top: 12px; }
.ask form { display: grid; gap: 16px; position: relative; }
.ask .two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ask label { display: grid; gap: 4px; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.ask input, .ask textarea { padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; font-size: 1.02rem; text-transform: none; letter-spacing: 0; font-weight: 400; border-radius: 0; font-family: var(--ui); color: var(--ink); }
.ask textarea { min-height: 110px; resize: vertical; }
.ask input:focus, .ask textarea:focus { outline: none; border-bottom-color: var(--emerald); }
.ask .msg { min-height: 1.4em; color: var(--emerald); font-size: .92rem; }
.ask .hp { position: absolute; left: -9999px; }

/* subscribe */
.sub { background: var(--emerald); color: #f6f4ec; }
.sub .w { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.sub h2 { font: 400 clamp(2rem, 4vw, 3rem)/1.05 var(--thin); margin-top: 12px; }
.sub .kicker { color: var(--brass-2); }
.sub p { color: #d5e3dc; margin-top: 12px; }
.sub form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; position: relative; }
.sub label { display: grid; gap: 4px; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: #cfe0d8; }
.sub input { padding: 12px 0; border: 0; border-bottom: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; font-size: 1.02rem; text-transform: none; letter-spacing: 0; border-radius: 0; }
.sub input:focus { outline: none; border-bottom-color: var(--brass-2); }
.sub .msg { grid-column: 1 / -1; min-height: 1.4em; color: var(--brass-2); font-size: .92rem; }
.sub .hp { position: absolute; left: -9999px; }

/* archive page */
.ph { padding: 70px 0 40px; border-bottom: 1px solid var(--line); }
.ph h1 { font: 400 clamp(2.6rem, 7vw, 5.4rem)/1 var(--thin); margin: 14px 0 12px; }
.ph p { color: var(--ink-2); max-width: 56ch; font-size: 1.1rem; }
.tools { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }
.search { flex: 1 1 300px; display: flex; gap: 10px; align-items: center; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.search input { flex: 1; border: 0; background: none; outline: none; padding: 13px 0; min-width: 0; }
.chip { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); font-size: .86rem; font-weight: 500; white-space: nowrap; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.year { margin-top: 56px; }
.year h3 { font: italic 400 1.6rem var(--serif); margin-bottom: 22px; display: flex; align-items: center; gap: 16px; }
.year h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.empty { padding: 60px 0; text-align: center; color: var(--muted); }

/* reader */
.reader { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 44px; padding: 48px 0 90px; align-items: start; }
.reader aside { position: sticky; top: 90px; display: grid; gap: 18px; }
.reader h1 { font: 400 clamp(2rem, 3.4vw, 2.8rem)/1.05 var(--thin); }
.reader .acts { display: grid; gap: 10px; }
.reader .acts .btn { justify-content: center; }
.viewer { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--paper-2); height: min(88vh, 1100px); }
.viewer iframe { width: 100%; height: 100%; border: 0; display: block; }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pn a { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font-size: .86rem; }
.pn a:hover { border-color: var(--ink); }
.pn small { display: block; color: var(--brass); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: .66rem; }
.side-list { display: grid; gap: 8px; }
.side-list a { display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: center; font-size: .9rem; }
.side-list a .paper { aspect-ratio: 3/4; }

footer { background: var(--deep); color: var(--on-deep-mut); padding: 70px 0 30px; }
footer .w { display: grid; gap: 40px; }
.ft { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 30px; }
.ft b { display: block; color: var(--on-deep); font: 600 .7rem/1 var(--ui); letter-spacing: .22em; text-transform: uppercase; margin-bottom: 14px; }
.ft a { display: block; padding: 3px 0; }
.ft a:hover { color: var(--on-deep); }
.ft .logo { font-size: 2rem; color: var(--on-deep); display: block; margin-bottom: 14px; }
.ft p { font: italic 400 1.1rem/1.5 var(--serif); color: var(--on-deep); max-width: 36ch; }
.credit { border-top: 1px solid rgba(255,255,255,.1); padding-top: 22px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .84rem; }
.loading { min-height: 50vh; display: grid; place-content: center; color: var(--muted); }

::view-transition-old(root) { animation: vt-out .25s ease both; }
::view-transition-new(root) { animation: vt-in .5s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 1100px) {
  .shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .books { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .book:nth-child(3n) { border-right: 0; }
  .book:nth-child(n+4) { border-top: 1px solid rgba(255,255,255,.12); }
}
@media (max-width: 860px) {
  .nav { display: none; }
  .week, .about, .sub .w, .reader, .ask .w { grid-template-columns: 1fr; }
  .ask .two { grid-template-columns: 1fr; }
  .stack { width: min(320px, 80%); }
  .reader aside { position: static; }
  .viewer { height: 70vh; }
  .shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sub form { grid-template-columns: 1fr; }
  .ft { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .w { width: calc(100% - 32px); }
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .books { grid-template-columns: 1fr 1fr; }
  .book { border-right: 0 !important; border-top: 1px solid rgba(255,255,255,.12); }
  .masthead .meta { gap: 6px 18px; }
  .ft { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .fade { opacity: 1; } }
