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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --ash: #6b6b6b;
  --hair: #d8d8d8;
  --r: 10px;
  --sh: 0 18px 40px -30px rgba(0, 0, 0, 0.9);
  --sh-hi: 0 30px 54px -32px rgba(0, 0, 0, 0.95);
  --gut: clamp(1rem, 4vw, 3.25rem);
  --mono: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Exo', system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

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

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

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  letter-spacing: 0.004em;
  font-weight: 400;
}

body.menu-open { overflow: hidden; }

h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}

a { color: var(--ink); }

img { max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 300;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.1rem;
  font-family: var(--mono);
  text-decoration: none;
}

.skip:focus { left: 0; }

/* ---------- top bar ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.top-in {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.5rem var(--gut);
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  transition: background 0.2s ease, color 0.2s ease;
}

.brand-mark:hover,
.brand-mark:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.mark-img { display: block; width: 30px; height: 30px; object-fit: contain; }
.mark-svg { display: block; }

.top-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.85rem;
  font-family: var(--mono);
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  transition: background 0.2s ease, color 0.2s ease;
}

.contact:hover,
.contact:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.burger {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0 0.85rem;
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 8px;
  cursor: pointer;
}

.burger:hover { background: #1c1c1c; }

.burger-t { line-height: 1; }

.bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 18px;
  height: 12px;
}

.bars i {
  display: block;
  height: 2px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

body.menu-open .bars i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
body.menu-open .bars i:nth-child(2) { opacity: 0; }
body.menu-open .bars i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* ---------- fullscreen menu ---------- */

.menu {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  color: #fff;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

body.menu-open .menu { opacity: 1; visibility: visible; }

.menu-in {
  max-width: 1240px;
  margin: 0 auto;
  min-height: 100%;
  padding: clamp(1rem, 4vw, 2.5rem) var(--gut) clamp(2rem, 6vw, 4rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 6vw, 3.5rem);
}

.menu-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #3a3a3a;
  padding-bottom: 0.9rem;
}

.menu-brand {
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.14em;
  color: #bdbdbd;
}

.menu-close {
  min-height: 44px;
  padding: 0 0.9rem;
  font-family: var(--mono);
  font-size: 1rem;
  color: #fff;
  background: transparent;
  border: 1px solid #6b6b6b;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.menu-close:hover,
.menu-close:focus-visible {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.menu-nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}

.menu-nav li {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  transition-delay: calc(var(--i, 0) * 45ms);
}

body.menu-open .menu-nav li { opacity: 1; transform: none; }

.menu-nav a {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 3vw, 1.6rem);
  min-height: 52px;
  padding: 0.45rem 0;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid #2b2b2b;
}

.menu-nav .idx {
  font-family: var(--mono);
  font-size: 1rem;
  color: #8a8a8a;
}

.menu-nav .lbl {
  font-size: clamp(1.35rem, 4.4vw, 2.35rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  transition: transform 0.25s ease;
}

.menu-nav a:hover .lbl,
.menu-nav a:focus-visible .lbl { transform: translateX(0.5rem); }

.menu-nav a:hover .idx { color: #fff; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 70vh;
  background: #000;
  color: #fff;
  overflow: hidden;
  border-bottom: 1px solid var(--ink);
}

.hero-figure {
  margin: 0;
  position: absolute;
  inset: 0;
}

.hero-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.06);
}

.hero-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.6) 55%, rgba(0, 0, 0, 0.94) 100%);
}

.hero-copy {
  position: relative;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(4rem, 12vh, 8rem) var(--gut) clamp(1.5rem, 5vh, 3rem);
}

.hero-badge {
  display: inline-block;
  margin-bottom: 1.1rem;
  padding: 0.3rem 0.7rem;
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.12em;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  color: #fff;
}

.hero h1 {
  max-width: 24ch;
  font-size: clamp(2.15rem, 7vw, 4.5rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero-lede {
  margin: 1.15rem 0 0;
  max-width: 54ch;
  font-size: 1.0625rem;
  color: rgba(255, 255, 255, 0.86);
}

/* ---------- split layout ---------- */

.split {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(1.75rem, 4vw, 3.5rem) var(--gut) clamp(2.5rem, 6vw, 5rem);
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) 17rem;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
}

.split-figure {
  position: sticky;
  top: 6rem;
  margin: 0;
  height: 58vh;
  border-left: 1px solid var(--ink);
  background-image: repeating-linear-gradient(to bottom, var(--ink) 0 1px, transparent 1px 16px);
  background-size: 12px 100%;
  background-repeat: no-repeat;
  background-position: left top;
}

.split-figure .tick {
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.split-body { min-width: 0; }

.split-body > section {
  position: relative;
  margin: 0 0 clamp(1.5rem, 3.5vw, 2.75rem);
  padding: clamp(1.25rem, 3vw, 2.35rem);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--r);
  box-shadow: var(--sh);
  scroll-margin-top: 6.5rem;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.split-body > section::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.4rem;
  bottom: 1.4rem;
  width: 4px;
  background: var(--ink);
  border-radius: 4px;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.split-body > section:hover { box-shadow: var(--sh-hi); }
.split-body > section:hover::before { transform: scaleY(1); }

.split-body h2 {
  font-size: clamp(1.45rem, 3.2vw, 2.05rem);
  letter-spacing: -0.025em;
}

.split-body h2 + hr {
  width: 58px;
  height: 0;
  margin: 0.75rem 0 1.15rem;
  border: 0;
  border-top: 3px solid var(--ink);
}

.split-body h3 {
  margin: 1.7rem 0 0.5rem;
  font-size: 1.2rem;
}

.split-body p { margin: 0 0 1rem; max-width: 68ch; }
.split-body p:last-child { margin-bottom: 0; }

.split-body ul,
.split-body ol {
  margin: 0 0 1.1rem;
  padding-left: 1.35rem;
  max-width: 66ch;
}

.split-body li { margin: 0.3rem 0; }

.split-body a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.split-body a:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

.split-body blockquote {
  margin: 1.2rem 0;
  padding: 0.35rem 0 0.35rem 1.1rem;
  border-left: 3px solid var(--ink);
  color: #2a2a2a;
}

.split-body strong { font-weight: 600; }

.split-body code,
.split-body pre {
  font-family: var(--mono);
  font-size: 0.95em;
}

.split-body pre {
  overflow-x: auto;
  padding: 0.9rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: #f6f6f6;
}

.split-body table {
  width: 100%;
  margin: 1.1rem 0;
  border-collapse: collapse;
  font-size: 0.98rem;
}

.split-body th,
.split-body td {
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--hair);
  text-align: left;
  vertical-align: top;
}

.split-body th {
  font-family: var(--mono);
  font-weight: 500;
  border-bottom: 1px solid var(--ink);
}

.split-body figure { margin: 1.2rem 0; }

.split-body img {
  display: block;
  height: auto;
  border: 1px solid var(--ink);
  border-radius: 8px;
}

.split-body figcaption {
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--ash);
}

.split-body time {
  font-family: var(--mono);
  font-size: 0.98rem;
}

/* ---------- aside ---------- */

.split-aside {
  position: sticky;
  top: 6rem;
  padding-left: 1.15rem;
  border-left: 1px solid var(--ink);
}

.aside-h {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.16em;
}

.split-aside hr {
  width: 40px;
  height: 0;
  margin: 0.55rem 0 0.9rem;
  border: 0;
  border-top: 2px solid var(--ink);
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.35rem 0;
  font-size: 1rem;
  text-decoration: none;
  border-bottom: 1px solid var(--hair);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.toc .idx {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--ash);
}

.toc a:hover,
.toc a.on {
  transform: translateX(4px);
  border-bottom-color: var(--ink);
}

.toc a.on .idx { color: var(--ink); }

/* ---------- footer ---------- */

.foot {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.5rem var(--gut) 2.25rem;
  border-top: 1px solid var(--ink);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.75rem;
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.foot-name {
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.1em;
}

.foot-nav { min-width: 0; }

.foot-nav dl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.1rem;
  margin: 0;
}

.foot-nav dt {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--ash);
}

.foot-nav dd { margin: 0; }

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.1rem;
  font-size: 1rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.foot-nav a:hover,
.foot-nav a:focus-visible { border-bottom-color: var(--ink); }

.foot-copy p {
  margin: 0;
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--ash);
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .split-body > section {
    animation: rise 0.65s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .split-body > section:nth-child(1) { animation-delay: 0.04s; }
  .split-body > section:nth-child(2) { animation-delay: 0.1s; }
  .split-body > section:nth-child(3) { animation-delay: 0.16s; }
  .split-body > section:nth-child(4) { animation-delay: 0.22s; }
  .split-body > section:nth-child(5) { animation-delay: 0.28s; }
  .split-body > section:nth-child(6) { animation-delay: 0.34s; }
  .split-body > section:nth-child(7) { animation-delay: 0.4s; }
  .split-body > section:nth-child(n + 8) { animation-delay: 0.46s; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

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

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
  .split { grid-template-columns: 3rem minmax(0, 1fr) 14rem; }
}

@media (max-width: 860px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
  }

  .split-figure { display: none; }

  .split-aside {
    position: static;
    order: 2;
    padding-left: 0;
    padding-top: 1.25rem;
    border-left: 0;
    border-top: 1px solid var(--ink);
  }

  .foot { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  body { font-size: 1rem; }

  .hero { min-height: 68vh; }

  .hero-badge { font-size: 0.95rem; }

  .burger-t { display: none; }

  .burger { padding: 0 0.75rem; }

  .contact { padding: 0 0.7rem; }

  .split-body > section::before { display: none; }

  .foot-nav dl { gap: 0 0.9rem; }
}

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