@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root{
  --ink:#000000;
  --paper:#ffffff;
  --grey:#6b6b6b;
  --line:rgba(0,0,0,.12);
  --rail:264px;
  --bar:44px;
  --sans:'IBM Plex Sans',system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif;
  --mono:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}

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

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

body{
  margin:0;
  font-family:var(--sans);
  font-size:17px;
  line-height:1.75;
  color:var(--ink);
  background-color:#f4f4f4;
  background-image:
    repeating-linear-gradient(0deg,var(--line) 0 1px,transparent 1px 40px),
    repeating-linear-gradient(90deg,var(--line) 0 1px,transparent 1px 40px);
  padding-left:var(--rail);
  padding-top:var(--bar);
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}

a{color:inherit}
a:focus-visible,
button:focus-visible{outline:2px solid currentColor;outline-offset:3px}

/* ---------- fixed left rail (aside) ---------- */
.rail{
  position:fixed;
  inset:0 auto 0 0;
  width:var(--rail);
  display:flex;
  flex-direction:column;
  background:var(--paper);
  border-right:1px solid var(--ink);
  padding-bottom:20px;
  z-index:40;
}

.brand-mark{
  display:flex;
  align-items:center;
  justify-content:center;
  width:56px;
  height:56px;
  margin:14px 0 18px 18px;
  border:1px solid var(--ink);
  border-radius:14px;
  font-family:var(--mono);
  font-size:20px;
  font-weight:700;
  line-height:1;
  text-decoration:none;
  transition:background .22s ease,color .22s ease;
}
.brand-mark:hover,
.brand-mark:focus-visible{background:var(--ink);color:var(--paper)}

.rail-head{padding:0 18px 14px}
.rail-head small{
  display:block;
  font-family:var(--mono);
  font-size:11px;
  letter-spacing:.2em;
  color:var(--grey);
  margin-bottom:4px;
}
.rail-head h2{
  margin:0;
  font-size:20px;
  font-weight:600;
  letter-spacing:-.01em;
  line-height:1.3;
}

.rail-nav ol{list-style:none;margin:0;padding:0}
.rail-nav a{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:44px;
  padding:10px 18px;
  font-size:16px;
  text-decoration:none;
  border-top:1px solid var(--line);
  transition:background .22s ease,color .22s ease;
}
.rail-nav li:last-child a{border-bottom:1px solid var(--line)}
.rail-nav a:hover,
.rail-nav a:focus-visible{background:var(--ink);color:var(--paper)}

.dot{
  flex:0 0 auto;
  width:6px;
  height:6px;
  background:currentColor;
}

/* ---------- thin top bar ---------- */
.topbar{
  position:fixed;
  top:0;
  left:var(--rail);
  right:0;
  height:var(--bar);
  display:flex;
  align-items:center;
  padding:0 clamp(16px,4vw,40px);
  background:var(--paper);
  border-bottom:1px solid var(--ink);
  z-index:35;
}
.ticker{
  position:relative;
  flex:1;
  height:18px;
  margin:0;
  overflow:hidden;
  font-family:var(--mono);
  font-size:12px;
  letter-spacing:.16em;
}
.ticker span{
  position:absolute;
  inset:0;
  opacity:0;
  line-height:18px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  transition:opacity .5s ease;
}
.ticker span.on{opacity:1}

/* ---------- page frame ---------- */
.main{display:block}

.sheet{
  max-width:1120px;
  margin:0 auto;
  padding:0 clamp(20px,4vw,56px);
}

.hero{
  min-height:70vh;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  padding:10vh 0 7vh;
  border-bottom:1px solid var(--ink);
}
.hero h1{
  margin:0;
  text-align:right;
  font-size:clamp(2.3rem,8.5vw,6.5rem);
  font-weight:600;
  line-height:1.02;
  letter-spacing:-.045em;
  overflow-wrap:break-word;
}

/* ---------- prose / content ---------- */
.prose{
  max-width:70ch;
  padding:clamp(32px,5vw,56px) 0 88px;
}

.prose div{
  position:relative;
  margin-bottom:26px;
  padding:clamp(22px,3vw,38px);
  background:rgba(255,255,255,.6);
  -webkit-backdrop-filter:blur(18px) saturate(130%);
  backdrop-filter:blur(18px) saturate(130%);
  border:1px solid rgba(0,0,0,.55);
  border-radius:18px;
  scroll-margin-top:calc(var(--bar) + 28px);
}

.prose div > small{
  display:block;
  margin-bottom:10px;
  font-family:var(--mono);
  font-size:12px;
  letter-spacing:.2em;
  color:var(--grey);
}

.prose h2{
  margin:0 0 .7em;
  font-size:clamp(1.45rem,2.6vw,2rem);
  font-weight:600;
  line-height:1.2;
  letter-spacing:-.02em;
}
.prose h3{
  margin:1.6em 0 .6em;
  font-size:1.15rem;
  font-weight:600;
  letter-spacing:-.01em;
}
.prose p{margin:0 0 1.05em}
.prose p:last-child{margin-bottom:0}
.prose ul,
.prose ol{margin:0 0 1.05em;padding-left:1.35em}
.prose li{margin-bottom:.45em}
.prose a{text-underline-offset:3px}
.prose strong{font-weight:600}
.prose blockquote{
  margin:1.4em 0;
  padding:2px 0 2px 18px;
  border-left:2px solid var(--ink);
}
.prose code{
  font-family:var(--mono);
  font-size:.92em;
  background:rgba(0,0,0,.06);
  padding:.1em .35em;
  border-radius:4px;
}
.prose img{
  display:block;
  max-width:100%;
  height:auto;
  margin:1.2em 0;
  border-radius:12px;
}
.prose table{width:100%;border-collapse:collapse;font-size:.95em}
.prose th,
.prose td{
  padding:.6em .5em;
  text-align:left;
  border-bottom:1px solid var(--line);
}
.prose hr{border:0;border-top:1px solid var(--line);margin:2em 0}
.prose time{font-family:var(--mono);font-size:.9em;letter-spacing:.04em}

/* ---------- footer ---------- */
.foot{
  background:var(--ink);
  color:var(--paper);
  padding:clamp(40px,6vw,72px) clamp(20px,4vw,56px) 24px;
}
.foot-brand{
  margin:0;
  font-size:clamp(2.6rem,11vw,8rem);
  font-weight:600;
  line-height:.92;
  letter-spacing:-.05em;
}
.foot-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:clamp(16px,3vw,40px);
  margin-top:clamp(28px,5vw,48px);
  padding-top:22px;
  border-top:1px solid rgba(255,255,255,.35);
}
.foot-grid dt{
  margin-bottom:8px;
  font-family:var(--mono);
  font-size:11px;
  letter-spacing:.2em;
  color:rgba(255,255,255,.62);
}
.foot-grid dd{
  margin:0;
  display:flex;
  flex-wrap:wrap;
  gap:6px 14px;
  font-size:16px;
}
.foot-grid a{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  text-decoration:none;
  border-bottom:1px solid transparent;
  transition:border-color .22s ease;
}
.foot-grid a:hover,
.foot-grid a:focus-visible{border-color:var(--paper)}

.foot-base{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-top:26px;
  padding-top:16px;
  border-top:1px solid rgba(255,255,255,.35);
  font-family:var(--mono);
  font-size:13px;
  letter-spacing:.1em;
}
.foot-base a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  text-decoration:none;
  border-bottom:1px solid rgba(255,255,255,.5);
}

/* ---------- motion ---------- */
.reveal{
  opacity:0;
  transform:translateY(16px);
  transition:opacity .55s ease,transform .55s ease;
}
.reveal.in{
  opacity:1;
  transform:none;
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .reveal{opacity:1;transform:none;transition:none}
  .ticker span{transition:none}
  *{animation-duration:.001ms !important;transition-duration:.001ms !important}
}

/* ---------- narrow screens ---------- */
@media (max-width:900px){
  body{
    padding-left:0;
    padding-top:0;
    background-image:repeating-linear-gradient(0deg,var(--line) 0 1px,transparent 1px 32px);
  }
  .rail{
    position:static;
    width:auto;
    flex-direction:row;
    align-items:center;
    border-right:0;
    border-bottom:1px solid var(--ink);
    padding-bottom:0;
  }
  .brand-mark{
    width:44px;
    height:44px;
    margin:0 8px 0 14px;
    font-size:17px;
    border-radius:12px;
  }
  .rail-head{display:none}
  .rail-nav{flex:1;min-width:0}
  .rail-nav ol{
    display:flex;
    overflow-x:auto;
    scrollbar-width:none;
  }
  .rail-nav ol::-webkit-scrollbar{display:none}
  .rail-nav a{
    padding:0 14px;
    border-top:0;
    border-left:1px solid var(--line);
    white-space:nowrap;
  }
  .rail-nav li:last-child a{border-bottom:0}
  .dot{display:none}

  .topbar{
    position:static;
    left:auto;
    height:40px;
    padding:0 16px;
  }
  .sheet{padding:0 18px}
  .hero{min-height:60vh;padding:8vh 0 5vh}
  .hero h1{font-size:clamp(2rem,10.5vw,3.6rem)}
  .prose{padding:32px 0 64px}
  .prose div{padding:22px 18px;scroll-margin-top:20px}
  .foot-grid{grid-template-columns:1fr}
}

button[aria-expanded]{min-width:44px;min-height:44px}
