:root {
  --ink: #07090d;
  --panel: #0d1118;
  --paper: #f4f1ea;
  --muted: #9aa1ad;
  --line: rgba(244, 241, 234, 0.13);
  --line-strong: rgba(244, 241, 234, 0.28);
  --ember: #ff6b3d;
  --amber: #f5ae4b;
  --ice: #87d8ee;
  --violet: #8e6cff;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }

html {
  background: var(--ink);
  color-scheme: dark;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 107, 61, 0.09), transparent 30rem),
    radial-gradient(circle at 90% 22%, rgba(135, 216, 238, 0.07), transparent 32rem),
    var(--ink);
  color: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 72px 72px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.journal-header,
.journal-hero,
.journal-feed,
.journal-footer,
.post-shell {
  width: min(100% - 56px, 1420px);
  margin-inline: auto;
}

.journal-header {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.journal-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .17em;
}

.journal-brand img {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 10px;
}

.journal-header nav { display: flex; gap: 34px; }
.journal-header nav a { color: #c9cbd1; font-size: 14px; }
.journal-header nav a:hover,
.journal-header nav a:focus-visible,
.journal-header nav a[aria-current="page"] { color: var(--paper); }

.journal-hero {
  display: grid;
  min-height: 570px;
  grid-template-columns: 1.25fr .75fr;
  align-items: end;
  gap: clamp(50px, 9vw, 150px);
  padding: 94px 0 84px;
}

.journal-kicker,
.feed-heading,
.card-meta,
.post-meta,
.post-aside > span {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.journal-kicker {
  margin: 0 0 30px;
  color: #aeb4bd;
  font-size: 10px;
  font-weight: 650;
}

.journal-hero h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(66px, 8vw, 124px);
  font-weight: 650;
  letter-spacing: -.075em;
  line-height: .88;
}

.journal-intro {
  padding-bottom: 12px;
  border-top: 1px solid var(--line);
}

.journal-intro > p {
  margin: 28px 0 44px;
  color: #b9bec6;
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.55;
}

.journal-signal {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #7e8692;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.journal-signal span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 6px rgba(245,174,75,.1);
}

.journal-feed {
  padding: 34px 0 120px;
  border-top: 1px solid var(--line);
}

.feed-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 34px;
  color: #777f8b;
  font-size: 9px;
}

.feed-heading .journal-kicker { margin: 0; }

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.journal-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
  transition: border-color 240ms ease, transform 320ms var(--ease);
}

.journal-card:hover { border-color: var(--line-strong); transform: translateY(-6px); }
.journal-card-featured { grid-column: 1 / -1; }
.journal-card > a { display: grid; min-height: 520px; grid-template-rows: auto 1fr; }
.journal-card-featured > a { grid-template-columns: 1.08fr .92fr; grid-template-rows: 1fr; }

.card-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  min-height: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 68% 40%, rgba(135,216,238,.22), transparent 26%),
    radial-gradient(circle at 28% 70%, rgba(142,108,255,.2), transparent 29%),
    linear-gradient(135deg, #111722, #090c12);
}

.journal-card-featured .card-visual { align-self: start; min-height: 0; border-right: 1px solid var(--line); border-bottom: 0; }
.card-visual > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 700ms var(--ease);
}
.card-visual.portrait-cover > img {
  padding: clamp(18px, 3vw, 44px);
  object-fit: contain;
  filter: drop-shadow(0 24px 42px rgba(0,0,0,.42));
}
.journal-card:hover .card-visual > img { transform: scale(1.025); }

.card-number {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 50%;
  background: rgba(7,9,13,.58);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  backdrop-filter: blur(12px);
}

.card-signal { position: absolute; inset: 0; }
.card-signal span { position: absolute; border: 1px solid rgba(135,216,238,.2); border-radius: 50%; }
.card-signal span:first-child { width: 330px; height: 330px; top: 10%; left: 16%; }
.card-signal span:nth-child(2) { width: 190px; height: 190px; top: 29%; left: 32%; border-style: dashed; }
.card-signal i { position: absolute; width: 24px; height: 24px; top: 48%; left: 51%; border-radius: 50%; background: var(--ember); box-shadow: 0 0 40px rgba(255,107,61,.75); }

.card-content { display: flex; flex-direction: column; padding: 30px; }
.journal-card-featured .card-content { justify-content: center; padding: clamp(38px, 6vw, 82px); }
.card-meta { display: flex; justify-content: space-between; gap: 20px; color: #777f8b; font-size: 8px; }
.card-content h2 { margin: 28px 0 0; font-size: clamp(30px, 3vw, 50px); font-weight: 630; letter-spacing: -.055em; line-height: 1.02; }
.journal-card-featured .card-content h2 { font-size: clamp(42px, 5vw, 72px); }
.card-content > p { max-width: 620px; margin: 22px 0 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.card-read { align-self: flex-start; margin-top: auto; padding-top: 38px; border-bottom: 1px solid var(--line-strong); font-size: 13px; font-weight: 650; }

.empty-state {
  min-height: 420px;
  padding: 80px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
}
.empty-state span { color: #6d7581; font: 600 9px/1 ui-monospace, monospace; letter-spacing: .16em; }
.empty-state h2 { max-width: 750px; margin: 90px 0 20px; font-size: clamp(40px, 5vw, 72px); letter-spacing: -.06em; line-height: .98; }
.empty-state p { color: var(--muted); }

.post-shell {
  display: grid;
  grid-template-columns: minmax(0, 920px) minmax(220px, 1fr);
  align-items: start;
  gap: clamp(48px, 8vw, 120px);
  padding: 100px 0 130px;
}

.post-header { margin-bottom: 56px; }
.post-header h1 { margin: 0; font-size: clamp(56px, 7vw, 104px); font-weight: 650; letter-spacing: -.072em; line-height: .92; }
.post-deck { max-width: 760px; margin: 32px 0 0; color: #b9bec6; font-size: clamp(19px, 2vw, 25px); line-height: 1.5; }
.post-meta { display: flex; gap: 28px; margin-top: 34px; color: #727b87; font-size: 8px; }
.post-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 70px;
  border: 1px solid var(--line);
  border-radius: 26px;
  object-fit: cover;
  object-position: center;
}
.post-cover.portrait-cover {
  height: clamp(340px, 44vw, 620px);
  aspect-ratio: auto;
  padding: clamp(18px, 3vw, 42px);
  background:
    radial-gradient(circle at 68% 40%, rgba(135,216,238,.16), transparent 28%),
    radial-gradient(circle at 28% 70%, rgba(142,108,255,.16), transparent 31%),
    #090c12;
  object-fit: contain;
  object-position: center;
}

.post-body { color: #d2d3d6; font-family: Georgia, "Times New Roman", serif; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.82; }
.post-body > * { max-width: 760px; margin-right: auto; margin-left: auto; }
.post-body p { margin-top: 0; margin-bottom: 1.45em; }
.post-body h2,
.post-body h3 { color: var(--paper); font-family: Inter, ui-sans-serif, sans-serif; letter-spacing: -.045em; line-height: 1.12; }
.post-body h2 { margin-top: 1.8em; margin-bottom: .65em; font-size: clamp(34px, 4vw, 54px); }
.post-body h3 { margin-top: 1.7em; margin-bottom: .6em; font-size: clamp(26px, 3vw, 36px); }
.post-body blockquote { margin-top: 2em; margin-bottom: 2em; padding: 8px 0 8px 28px; border-left: 3px solid var(--ember); color: var(--paper); font-size: 1.22em; line-height: 1.55; }
.post-body ul,
.post-body ol { margin-top: 0; margin-bottom: 1.6em; padding-left: 1.4em; }
.post-body li { margin: .4em 0; }
.post-body a { color: var(--ice); text-decoration: underline; text-underline-offset: 4px; }
.post-body img { width: min(100%, 980px); max-width: none; margin: 2.4em 50% 2.4em; border-radius: 20px; transform: translateX(-50%); }
.post-body pre { overflow-x: auto; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: #05070a; font: 14px/1.7 ui-monospace, monospace; }
.post-body code { padding: .12em .35em; border-radius: 5px; background: rgba(255,255,255,.07); font-family: ui-monospace, monospace; font-size: .86em; }
.post-body pre code { padding: 0; background: transparent; }

.post-aside { position: sticky; top: 36px; padding-top: 18px; border-top: 1px solid var(--line); }
.post-aside > span { color: #737c88; font-size: 8px; }
.post-aside p { margin: 26px 0 40px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.post-aside a { padding-bottom: 7px; border-bottom: 1px solid var(--line-strong); font-size: 13px; }

.journal-footer {
  display: grid;
  min-height: 120px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-top: 1px solid var(--line);
  color: #7e8691;
  font-size: 12px;
}
.journal-footer > a:first-child { color: var(--paper); font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.journal-footer > a:last-child { justify-self: end; }

.empty-page { width: min(100% - 48px, 900px); margin: 20vh auto; }
.empty-page h1 { margin: 0 0 40px; font-size: clamp(58px, 9vw, 110px); letter-spacing: -.07em; line-height: .9; }
.empty-page a { border-bottom: 1px solid var(--line-strong); }

@media (max-width: 920px) {
  .journal-hero,
  .post-shell { grid-template-columns: 1fr; }
  .journal-hero { min-height: auto; }
  .journal-card-featured > a { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .journal-card-featured .card-visual { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .post-aside { position: static; }
}

@media (max-width: 700px) {
  .journal-header,
  .journal-hero,
  .journal-feed,
  .journal-footer,
  .post-shell { width: min(100% - 32px, 1420px); }
  .journal-header nav { gap: 18px; }
  .journal-header nav a:first-child { display: none; }
  .journal-hero { gap: 50px; padding: 70px 0; }
  .journal-hero h1 { font-size: clamp(58px, 18vw, 82px); }
  .post-grid { grid-template-columns: 1fr; }
  .journal-card-featured { grid-column: auto; }
  .journal-card > a,
  .journal-card-featured > a { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .journal-card-featured .card-visual { min-height: 0; }
  .journal-card-featured .card-content { padding: 30px; }
  .journal-card-featured .card-content h2 { font-size: 38px; }
  .empty-state { padding: 36px 24px; }
  .post-shell { padding-top: 70px; }
  .post-header h1 { font-size: clamp(52px, 16vw, 76px); }
  .post-cover { margin-bottom: 48px; border-radius: 18px; }
  .post-cover.portrait-cover { height: clamp(240px, 78vw, 430px); padding: 16px; }
  .post-body img { width: 100%; max-width: 100%; margin-right: 0; margin-left: 0; transform: none; }
  .journal-footer { grid-template-columns: 1fr auto; }
  .journal-footer p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
