/* The Portal Journal: only what is Journal-specific. Tokens, type, buttons,
   the bar, the menu, the footer and the paper texture all come from the main
   site's /assets/portal.css, so the two are one brand by construction. */

/* ---------- index: the hero ---------- */
.j-hero { min-height: 82svh; }
.j-hero .move { max-width: 12ch; }
.j-kicker { display: inline-flex; align-items: center; gap: 10px; color: var(--peri); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 18px; }
.j-kicker svg { width: 14px; height: 14px; fill: var(--cream); filter: drop-shadow(0 0 8px rgba(194, 204, 229, .8)); }
.j-pane { max-width: 600px; }

/* ---------- the sign-up form (hero, article end) ---------- */
.j-signup { display: grid; gap: 10px; }
.j-signup-label { font: 500 15px/1.3 var(--sans); color: var(--cream); }
.j-signup-row { display: flex; gap: 8px; flex-wrap: wrap; }
.j-signup input[type="email"] {
  flex: 1 1 220px; min-width: 0; height: 48px; padding: 0 18px; border-radius: 999px;
  font: 400 16px/1 var(--sans); color: var(--cream); background: rgba(251, 246, 234, .06);
  border: 1px solid rgba(251, 246, 234, .18); outline: none; transition: border-color .25s, box-shadow .25s, background .25s;
}
.j-signup input[type="email"]::placeholder { color: rgba(251, 246, 234, .42); }
.j-signup input[type="email"]:focus { border-color: rgba(194, 204, 229, .75); box-shadow: 0 0 0 4px rgba(194, 204, 229, .14); background: rgba(251, 246, 234, .09); }
.j-signup .btn { height: 48px; }
.j-signup-note { font: 400 13px/1.5 var(--sans); color: rgba(251, 246, 234, .6); margin: 0; }
.j-signup-note a { color: inherit; }
.j-signup[data-state="sending"] .btn { opacity: .6; pointer-events: none; }
.j-signup[data-state="done"] .j-signup-row { display: none; }
.j-signup[data-state="done"] .j-signup-note { color: var(--cream); font-size: 15px; }
.j-signup[data-state="error"] .j-signup-note { color: var(--rose); }
.j-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- index: the list ---------- */
.j-list { padding: clamp(64px, 10vw, 130px) 0; }
.j-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: clamp(28px, 4vw, 48px); }
.j-rss { color: var(--ink-muted); }
.j-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: clamp(14px, 2vw, 22px); }
.j-card {
  position: relative; display: grid; align-content: start; gap: 12px; padding: clamp(22px, 2.6vw, 32px); border-radius: 22px;
  color: var(--ink); text-decoration: none; background: rgba(255, 255, 255, .42); border: 1px solid var(--ink-line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 18px 40px -28px rgba(15, 15, 15, .35);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), background .5s var(--ease);
}
.j-card:hover { transform: translateY(-4px); background: rgba(255, 255, 255, .62); box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 28px 60px -30px rgba(15, 15, 15, .45); }
.j-card h3 { font: 400 clamp(24px, 2.2vw, 30px)/1.15 var(--serif); letter-spacing: -.015em; margin: 0; text-wrap: balance; }
.j-card p { font: 400 16px/1.55 var(--sans); color: var(--ink-muted); margin: 0; }
.j-card--lead { grid-column: 1 / -1; padding: clamp(28px, 4vw, 54px); }
.j-card--lead h3 { font-size: clamp(32px, 4.4vw, 58px); max-width: 20ch; }
.j-card--lead p { font-size: 18px; max-width: 60ch; }
.j-read { font: 400 13px/1 var(--mono); color: var(--ink); margin-top: 4px; }
.j-read { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; transition: text-decoration-color .4s var(--ease); }
.j-card:hover .j-read { text-decoration-color: currentColor; }
.j-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font: 400 12.5px/1.4 var(--mono); color: var(--ink-muted); margin: 0; }
.j-tag { padding: 4px 10px; border-radius: 999px; border: 1px solid currentColor; text-transform: lowercase; }
.j-draft { justify-self: start; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--blood); border: 1px dashed currentColor; padding: 5px 9px; border-radius: 6px; }
.j-draft--head { display: table; color: var(--rose); margin: 0 0 18px; }
.j-empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: clamp(40px, 7vw, 90px) 16px; border: 1px dashed var(--ink-line); border-radius: 24px; }
.j-empty h3 { font: 400 clamp(26px, 3vw, 38px)/1.15 var(--serif); margin: 6px 0 0; }
.j-empty p { color: var(--ink-muted); margin: 0; }
.j-empty-star svg { width: 34px; height: 34px; fill: var(--ink); animation: j-breathe 5s ease-in-out infinite; }
@keyframes j-breathe { 0%, 100% { transform: scale(1) rotate(-6deg); opacity: .8; } 50% { transform: scale(1.12) rotate(6deg); opacity: 1; } }

/* ---------- article: the head (night, a still wash of liquid light) ---------- */
.j-head { position: relative; isolation: isolate; overflow: hidden; background: var(--night); padding: calc(var(--bar-h) + clamp(60px, 9vw, 120px)) 0 clamp(52px, 7vw, 90px); }
.j-head-light { position: absolute; inset: -20% -10% auto; height: 140%; z-index: -1; pointer-events: none;
  background: radial-gradient(55% 45% at 18% 20%, rgba(194, 204, 229, .26), transparent 62%), radial-gradient(45% 40% at 82% 30%, rgba(241, 157, 155, .18), transparent 62%), radial-gradient(40% 35% at 55% 85%, rgba(247, 216, 161, .10), transparent 60%);
  filter: blur(20px); animation: j-drift 22s ease-in-out infinite alternate; }
@keyframes j-drift { to { transform: translate3d(3%, 4%, 0) scale(1.06); } }
.j-head-inner { max-width: 980px; }
.j-back { display: flex; width: max-content; gap: 8px; color: var(--muted); text-decoration: none; margin-bottom: clamp(26px, 4vw, 42px); }
.j-back:hover { color: var(--cream); }
.j-head .j-meta { color: rgba(251, 246, 234, .66); margin-bottom: 20px; }
.j-title { font-size: clamp(40px, 5.6vw, 84px); max-width: 18ch; }
.j-dek { margin-top: clamp(18px, 2.4vw, 28px); max-width: 46ch; }
.j-byline { display: flex; align-items: center; gap: 10px; margin: clamp(22px, 3vw, 34px) 0 0; font: 400 13px/1 var(--mono); color: rgba(251, 246, 234, .7); }
.j-byline svg { width: 14px; height: 14px; fill: var(--cream); }

/* ---------- article: the body on paper ---------- */
.j-body { padding: clamp(56px, 8vw, 110px) 0 clamp(70px, 9vw, 130px); }
.j-layout { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 700px); justify-content: center; gap: clamp(32px, 5vw, 80px); }
.j-toc { position: sticky; top: calc(var(--bar-h) + 32px); align-self: start; }
.j-toc .label { color: var(--ink-muted); margin-bottom: 14px; }
.j-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; border-left: 1px solid var(--ink-line); }
.j-toc a { display: block; padding: 6px 0 6px 16px; margin-left: -1px; border-left: 2px solid transparent; font: 400 14px/1.4 var(--sans); color: var(--ink-muted); text-decoration: none; transition: color .3s, border-color .3s; }
.j-toc a:hover, .j-toc a[aria-current="true"] { color: var(--ink); border-left-color: var(--ink); }
.j-prose { font: 400 clamp(18.5px, 1.35vw, 20.5px)/1.72 var(--serif); color: #1A1714; min-width: 0; }
.j-prose > :first-child { margin-top: 0; }
.j-prose p, .j-prose ul, .j-prose ol { margin: 0 0 1.15em; }
.j-prose > p:first-of-type::first-letter { float: left; font: 400 4.2em/.82 var(--anton); padding: .08em .1em 0 0; color: var(--ink); }
.j-prose h2 { font: 400 clamp(28px, 2.6vw, 38px)/1.15 var(--serif); letter-spacing: -.02em; margin: 1.9em 0 .6em; scroll-margin-top: calc(var(--bar-h) + 24px); text-wrap: balance; }
.j-prose h3 { font: 600 clamp(19px, 1.5vw, 22px)/1.3 var(--sans); letter-spacing: -.01em; margin: 1.6em 0 .5em; scroll-margin-top: calc(var(--bar-h) + 24px); }
.j-prose a { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(214, 58, 30, .55); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.j-prose a:hover { text-decoration-color: var(--blood); }
.j-prose strong { font-weight: 600; }
.j-prose li { margin-bottom: .45em; padding-left: .2em; }
.j-prose li::marker { color: var(--blood); }
.j-prose code { font: 400 .82em/1 var(--mono); background: rgba(15, 15, 15, .06); padding: .15em .4em; border-radius: 6px; }
.j-prose pre { font: 400 14px/1.6 var(--mono); background: var(--night); color: var(--cream); padding: 20px 22px; border-radius: 16px; overflow-x: auto; margin: 0 0 1.4em; }
.j-prose pre code { background: none; padding: 0; font-size: inherit; }
.j-quote { margin: 1.6em 0; padding: 0 0 0 clamp(18px, 2.4vw, 28px); border-left: 2px solid var(--blood); font: italic 300 clamp(24px, 2.2vw, 30px)/1.35 var(--serif); color: var(--ink); }
.j-quote p { margin: 0 0 .4em; }
.j-callout { margin: 1.6em 0; padding: 20px 22px 6px; border-radius: 18px; background: rgba(255, 255, 255, .5); border: 1px solid var(--ink-line); font: 400 17px/1.6 var(--sans); }
.j-callout-label { font: 500 11.5px/1 var(--mono) !important; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); margin: 0 0 10px !important; }
.j-callout--tip { border-color: rgba(194, 204, 229, .9); background: rgba(194, 204, 229, .22); }
.j-callout--warning { border-color: rgba(214, 58, 30, .35); background: rgba(241, 157, 155, .16); }
.j-callout--plain { background: var(--night); color: var(--cream); border-color: transparent; }
.j-callout--plain .j-callout-label { color: var(--peri); }
.j-figure { margin: 1.8em 0; }
.j-figure img { display: block; width: 100%; height: auto; border-radius: 18px; box-shadow: 0 24px 60px -34px rgba(15, 15, 15, .6); }
.j-figure figcaption { font: 400 12.5px/1.5 var(--mono); color: var(--ink-muted); margin-top: 10px; }
.j-rule { display: flex; justify-content: center; margin: 2.2em 0; }
.j-rule svg { width: 18px; height: 18px; fill: var(--ink); opacity: .7; }
.j-table { overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--ink-line); border-radius: 14px; }
.j-table table { width: 100%; border-collapse: collapse; font: 400 15px/1.45 var(--sans); }
.j-table th, .j-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--ink-line); vertical-align: top; }
.j-table th { font-weight: 600; background: rgba(15, 15, 15, .04); }
.j-table tr:last-child td { border-bottom: 0; }

/* ---------- article: the end (night again) ---------- */
.j-end { background: var(--night); padding: clamp(60px, 8vw, 110px) 0; }
.j-end-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: clamp(18px, 3vw, 40px); align-items: center; }
.j-end-card { padding: clamp(24px, 3vw, 36px); border-radius: 24px; background: rgba(251, 246, 234, .04); border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
.j-end-cta .label { color: var(--peri); margin-bottom: 10px; }
.j-end-line { font: 300 clamp(22px, 2vw, 28px)/1.35 var(--serif); color: var(--cream); margin: 0 0 22px; max-width: 30ch; }
.j-more { margin-top: clamp(56px, 7vw, 90px); }
.j-more > .label { margin-bottom: 18px; }
.j-grid--more .j-card { color: var(--cream); background: rgba(251, 246, 234, .035); border-color: var(--line); box-shadow: none; }
.j-grid--more .j-card:hover { background: rgba(251, 246, 234, .07); }
.j-grid--more .j-card p, .j-grid--more .j-meta { color: rgba(251, 246, 234, .62); }
.j-grid--more .j-read { color: var(--cream); }

/* ---------- reading progress: a thin line of liquid light under the bar ---------- */
.j-progress { position: fixed; left: 0; right: 0; top: 0; height: 2px; z-index: 60; pointer-events: none; }
.j-progress i { display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(var(--read, 0));
  background: linear-gradient(90deg, var(--peri), var(--cream) 55%, var(--rose)); box-shadow: 0 0 12px rgba(194, 204, 229, .7); }

/* ---------- phones ---------- */
@media (max-width: 900px) {
  .j-layout { grid-template-columns: minmax(0, 1fr); }
  .j-toc { position: static; }
  .j-toc--none { display: none; }
}
@media (max-width: 560px) {
  .j-signup .btn { flex: 1 1 100%; justify-content: center; }
  .j-card--lead h3 { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .j-head-light, .j-empty-star svg { animation: none; }
  .j-card, .j-read span { transition: none; }
}
