@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=Space+Mono:ital,wght@0,400;0,700;1,400&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600&display=swap');

:root {
  --rail: 88px;
  --ink: #0b0d10;
  --ink-soft: #1a1f26;
  --paper: #f2f0ea;
  --paper-2: #e8e4db;
  --lime: #c8f050;
  --lime-dim: #a3c93a;
  --coral: #ff6b4a;
  --muted: #6b7280;
  --line: rgba(11, 13, 16, 0.1);
  --display: 'Syne', sans-serif;
  --mono: 'Space Mono', monospace;
  --body: 'DM Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

/* ── Ticker ── */
.ticker-wrap {
  background: var(--ink);
  color: var(--lime);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  overflow: hidden;
  white-space: nowrap;
  padding: 10px 0;
  margin-left: var(--rail);
}

.ticker {
  display: inline-block;
  animation: ticker 40s linear infinite;
}

.ticker span { padding: 0 40px; opacity: 0.85; }
.ticker span::before { content: '◆ '; color: var(--coral); }

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Rail nav ── */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail);
  background: var(--ink);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  gap: 8px;
}

.rail-logo {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--lime);
  margin-bottom: 24px;
  text-transform: uppercase;
}

.rail a {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: rgba(255,255,255,0.4);
  font-family: var(--mono);
  font-size: 10px;
  transition: background 0.2s, color 0.2s;
  position: relative;
}

.rail a:hover,
.rail a.active {
  background: rgba(200, 240, 80, 0.12);
  color: var(--lime);
}

.rail a .tip {
  position: absolute;
  left: calc(100% + 12px);
  background: var(--ink-soft);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.rail a:hover .tip { opacity: 1; }

.rail-bottom { margin-top: auto; }

/* ── Main shell ── */
.shell {
  margin-left: var(--rail);
  min-height: 100vh;
}

/* ── Bento homepage ── */
.bento-hero {
  padding: 48px 40px 24px;
  display: grid;
  grid-template-columns: 1.6fr 0.5fr 0.9fr;
  grid-template-rows: auto auto auto;
  gap: 14px;
  grid-template-areas:
    "feature feature stat"
    "feature feature pulse"
    "wide wide wide";
}

.cell {
  background: var(--ink);
  color: #fff;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  min-height: 0;
}

.cell-light {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.cell-feature {
  grid-area: feature;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 36px;
}

.cell-feature .bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.45;
}

.cell-feature .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(11,13,16,0.95) 0%, transparent 60%);
}

.cell-feature .content { position: relative; z-index: 2; }

.cell-feature .tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 12px;
}

.cell-feature h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.05;
  margin: 0 0 16px;
  max-width: 520px;
}

.cell-feature p {
  color: rgba(255,255,255,0.65);
  max-width: 440px;
  margin: 0 0 24px;
  font-size: 15px;
}

.btn-lime {
  display: inline-block;
  background: var(--lime);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 24px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.btn-lime:hover { background: var(--lime-dim); transform: translateY(-2px); }

.cell-stat {
  grid-area: stat;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--lime);
  color: var(--ink);
}

.cell-stat .num {
  font-family: var(--display);
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1;
}

.cell-stat .lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 8px;
}

.cell-pulse {
  grid-area: pulse;
  padding: 24px;
  background: var(--coral);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cell-pulse p {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
  color: rgba(0,0,0,0.75);
}

.cell-wide {
  grid-area: wide;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: transparent;
  border: none;
}

.cell-wide span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

/* ── Bento cards row ── */
.bento-cards {
  padding: 14px 40px 40px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.card-tile {
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-tile:hover { transform: translateY(-6px) rotate(-0.5deg); }

.card-tile.span-5 { grid-column: span 5; }
.card-tile.span-4 { grid-column: span 4; }
.card-tile.span-3 { grid-column: span 3; }
.card-tile.span-7 { grid-column: span 7; }

.card-tile .bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s;
}

.card-tile:hover .bg { transform: scale(1.06); }

.card-tile .shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(11,13,16,0.88) 0%, rgba(11,13,16,0.2) 100%);
}

.card-tile .meta {
  position: relative;
  z-index: 2;
}

.card-tile .idx {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--lime);
  margin-bottom: 8px;
}

.card-tile h3 {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: #fff;
  line-height: 1.25;
}

.card-tile.dark-flat {
  background: var(--ink-soft);
  justify-content: center;
}

.card-tile.dark-flat .shade,
.card-tile.dark-flat .bg { display: none; }

.card-tile.dark-flat h3 { font-size: 1.5rem; }
.card-tile.dark-flat p {
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  margin: 10px 0 0;
}

/* ── Horizontal scroll strip ── */
.scroll-strip {
  padding: 0 0 60px;
  overflow: hidden;
}

.scroll-strip-head {
  padding: 0 40px 20px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.scroll-strip-head h2 {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0;
}

.scroll-track {
  display: flex;
  gap: 16px;
  padding: 0 40px 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.scroll-track::-webkit-scrollbar { display: none; }

.scroll-item {
  flex: 0 0 280px;
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.scroll-item:hover {
  border-color: var(--ink);
  box-shadow: 8px 8px 0 var(--lime);
}

.scroll-item .num {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--paper-2);
  line-height: 1;
  margin-bottom: 12px;
}

.scroll-item h4 {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.scroll-item p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* ── Diagonal band ── */
.diag-band {
  background: var(--ink);
  color: #fff;
  padding: 70px 40px;
  transform: skewY(-2deg);
  margin: 40px 0 60px;
}

.diag-band-inner {
  transform: skewY(2deg);
  max-width: 680px;
}

.diag-band blockquote {
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  border: none;
  padding: 0;
}

.diag-band cite {
  display: block;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--lime);
  font-style: normal;
  letter-spacing: 0.1em;
}

/* ── Article split layout ── */
.article-shell {
  display: grid;
  grid-template-columns: 200px 1fr 220px;
  gap: 0;
  min-height: calc(100vh - 40px);
}

.article-rail {
  padding: 48px 24px 48px 40px;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.article-rail .back {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-bottom: 32px;
}

.article-rail .back:hover { color: var(--ink); }

.article-rail nav a {
  display: block;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0;
  border-left: 2px solid transparent;
  padding-left: 12px;
  margin-left: -12px;
  transition: color 0.2s, border-color 0.2s;
}

.article-rail nav a:hover,
.article-rail nav a.active {
  color: var(--ink);
  border-left-color: var(--coral);
}

.article-main {
  padding: 48px 48px 80px;
  max-width: 720px;
}

.article-main .eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 12px;
}

.article-main h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 20px;
}

.article-main .lead {
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 32px;
  line-height: 1.7;
}

.article-main .hero-img {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 36px;
  aspect-ratio: 16/9;
}

.article-main .hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-main h2 {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 36px 0 14px;
}

.article-main p {
  font-size: 16px;
  line-height: 1.85;
  color: #374151;
  margin-bottom: 18px;
}

.article-main ul {
  margin-bottom: 18px;
  padding-left: 20px;
  color: #374151;
}

.article-main li { margin-bottom: 8px; }

.article-aside {
  padding: 48px 32px 48px 24px;
  border-left: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
}

.note-box {
  background: var(--ink);
  color: #fff;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  font-size: 12px;
  line-height: 1.6;
}

.note-box strong {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 8px;
}

.note-box.light {
  background: var(--paper-2);
  color: var(--ink);
}

.note-box.light strong { color: var(--coral); }

/* ── Topics mosaic page ── */
.mosaic {
  padding: 48px 40px 80px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 140px;
  gap: 12px;
}

.mosaic-item {
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s;
}

.mosaic-item:hover { transform: scale(1.02); }

.mosaic-item.tall { grid-row: span 2; }
.mosaic-item.wide { grid-column: span 2; }
.mosaic-item.big { grid-column: span 2; grid-row: span 2; }

.mosaic-item h3 {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  position: relative;
  z-index: 2;
  color: #fff;
}

.mosaic-item .bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.mosaic-item .veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.8), transparent);
}

.mosaic-item.solid-lime { background: var(--lime); }
.mosaic-item.solid-lime h3 { color: var(--ink); }
.mosaic-item.solid-coral { background: var(--coral); }
.mosaic-item.solid-coral h3 { color: var(--ink); }

/* ── Contact / About ── */
.page-block {
  padding: 60px 40px 100px;
  max-width: 900px;
}

.page-block h1 {
  font-family: var(--display);
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 32px;
}

.form-grid .full { grid-column: span 2; }

.form-grid input,
.form-grid textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-family: var(--body);
  font-size: 14px;
  background: #fff;
}

.form-grid input:focus,
.form-grid textarea:focus {
  outline: none;
  box-shadow: 4px 4px 0 var(--lime);
}

.form-msg {
  display: none;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12px;
}

.form-msg.show { display: block; }

/* ── Footer strip ── */
.foot-strip {
  margin-left: var(--rail);
  background: var(--ink);
  color: rgba(255,255,255,0.45);
  padding: 20px 40px;
  font-family: var(--mono);
  font-size: 10px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.foot-strip a { color: rgba(255,255,255,0.6); }
.foot-strip a:hover { color: var(--lime); }

/* ── Cookie ── */
#cookiePop {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 340px;
  background: var(--ink);
  color: rgba(255,255,255,0.8);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(200,240,80,0.2);
  z-index: 9999;
  display: none;
  font-size: 12px;
}

#cookiePop.show { display: block; }
#cookiePop button {
  margin-top: 12px;
  background: var(--lime);
  border: none;
  padding: 10px 18px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
}

/* ── Mobile rail ── */
.mobile-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--ink);
  z-index: 1001;
  padding: 10px 16px;
  justify-content: space-around;
}

.mobile-bar a {
  color: rgba(255,255,255,0.5);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
}

.mobile-bar a.active { color: var(--lime); }

@media (max-width: 1024px) {
  .bento-hero {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "feature feature"
      "stat pulse"
      "wide wide";
  }

  .article-shell {
    grid-template-columns: 1fr;
  }

  .article-rail,
  .article-aside {
    position: static;
    height: auto;
    border: none;
    padding: 24px 24px 0;
  }

  .article-main { padding: 24px 24px 60px; }

  .bento-cards .card-tile { grid-column: span 6 !important; }

  .mosaic { grid-template-columns: repeat(2, 1fr); }
  .mosaic-item.wide,
  .mosaic-item.big { grid-column: span 2; }
}

@media (max-width: 768px) {
  :root { --rail: 0px; }

  .rail { display: none; }
  .mobile-bar { display: flex; }
  .ticker-wrap { margin-left: 0; }
  .shell { margin-bottom: 56px; }
  .foot-strip { margin-left: 0; }
  .bento-hero { grid-template-columns: 1fr; grid-template-areas: "feature" "stat" "pulse" "wide"; padding: 24px 20px; }
  .bento-cards { padding: 14px 20px 40px; }
  .scroll-strip-head,
  .scroll-track { padding-left: 20px; padding-right: 20px; }
  .diag-band { padding: 50px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: span 1; }
}
