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

:root {
  --paper: #ffffff;
  --mist: #f5f5f5;
  --ink: #1f1f1f;
  --mute: #5d5d5d;
  --line: #e3e3e3;
  --shadow: 0 3px 0 #e8e8e8, 0 12px 26px rgba(0, 0, 0, 0.07);
  --mono: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gap: 20px;
}

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

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

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

body.locked {
  overflow: hidden;
}

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

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

p {
  margin: 0 0 1em;
}

p:last-child {
  margin-bottom: 0;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.6em;
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 700;
  word-break: break-word;
}

ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.15em;
}

li {
  margin-bottom: 0.4em;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

/* header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}

.brandline {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px clamp(14px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.1rem;
}

.mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--ink);
  color: var(--paper);
  font-size: 1rem;
  letter-spacing: 0;
}

.mark-img {
  width: 34px;
  height: 34px;
  object-fit: cover;
}

.wordmark {
  white-space: nowrap;
}

.contact {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--ink);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  transition: background 0.18s ease, color 0.18s ease;
}

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

.burger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.burger-bars {
  position: relative;
  width: 16px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
}

.rail {
  padding: 0 clamp(14px, 4vw, 40px);
  overflow-x: auto;
  scrollbar-width: none;
}

.rail::-webkit-scrollbar {
  display: none;
}

.rail > p {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 5px 0;
  white-space: nowrap;
}

.rail a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 11px;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  color: var(--mute);
  border-bottom: 2px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.rail a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* layout shell */

.shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 40px) clamp(14px, 4vw, 40px) 64px;
  align-items: start;
}

.side {
  position: sticky;
  top: 118px;
  background: var(--paper);
  border-top: 4px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 22px 20px;
}

.side-title {
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--mute);
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--line);
}

.side-label,
.foot-label {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--mute);
  margin: 0 0 8px;
}

.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: navc;
}

.side-list li {
  margin: 0;
  counter-increment: navc;
  border-bottom: 1px solid var(--line);
}

.side-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 4px 0;
  font-size: 0.85rem;
}

.side-list a::before {
  content: counter(navc, decimal-leading-zero);
  color: var(--mute);
  font-size: 0.7rem;
}

.side-list a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* section */

.doc {
  min-width: 0;
}

.hero {
  position: relative;
  overflow: hidden;
  margin: 0 0 var(--gap);
  min-height: 58vh;
  display: grid;
  place-items: center;
  padding: 48px 26px 76px;
  background-color: var(--ink);
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 18px 18px;
  color: var(--paper);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 52px));
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.06);
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(31, 31, 31, 0.55), rgba(31, 31, 31, 0.78));
  pointer-events: none;
}

.hero:not(:has(.hero-img))::after {
  background: none;
}

.hero-in {
  position: relative;
  z-index: 2;
  max-width: 22ch;
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.9rem, 5.6vw, 3.4rem);
  line-height: 1.16;
  letter-spacing: -0.035em;
}

.doc .body {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
}

.doc .body > div {
  grid-column: span 7;
  scroll-margin-top: 118px;
  background: var(--paper);
  border-top: 3px solid var(--ink);
  box-shadow: var(--shadow);
  padding: clamp(20px, 3vw, 30px);
  word-break: break-word;
}

.doc .body > div:nth-child(even) {
  grid-column: span 5;
  background: var(--paper);
  border-top-color: var(--mute);
}

.doc .body > div:nth-child(3n) {
  background: #fafafa;
}

.doc .body h2 {
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  margin-bottom: 12px;
}

.doc .body h2 + p {
  font-size: 0.9rem;
  color: var(--mute);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.doc .body h3 {
  font-size: 1rem;
  margin-top: 1.4em;
}

.doc .body p {
  line-height: 1.78;
}

.doc .body ul,
.doc .body ol {
  padding-left: 1.1em;
}

.doc .body a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.doc .body blockquote {
  margin: 1.2em 0;
  padding: 12px 16px;
  border-left: 3px solid var(--ink);
  background: var(--mist);
  font-size: 0.92rem;
}

.doc .body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.doc .body th,
.doc .body td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
}

/* footer */

.site-footer {
  background: var(--ink);
  color: var(--paper);
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr;
  gap: 28px clamp(18px, 3vw, 44px);
  padding: clamp(30px, 5vw, 56px) clamp(14px, 4vw, 40px) clamp(20px, 3vw, 32px);
}

.site-footer > div {
  min-width: 0;
}

.site-footer a {
  color: var(--paper);
}

.foot-wordmark {
  font-size: clamp(2.1rem, 7vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  font-weight: 700;
  margin: 0;
  word-break: break-all;
}

.foot-label {
  color: #9c9c9c;
}

.foot-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 0.85rem;
  border-bottom: 1px solid #3a3a3a;
}

.foot-links a:hover {
  color: #c9c9c9;
}

.foot-legal {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #3a3a3a;
  padding-top: 18px;
}

.copy {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: #b5b5b5;
}

.to-top {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #4a4a4a;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.to-top:hover {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

/* overlay menu */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  grid-template-rows: auto 1fr;
  padding: clamp(16px, 4vw, 36px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

.overlay.open {
  opacity: 1;
  visibility: visible;
}

.overlay-close {
  justify-self: end;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #4a4a4a;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

.overlay-links {
  align-self: center;
  display: flex;
  flex-direction: column;
  margin: 0;
}

.overlay-links a {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 4px 0;
  font-size: clamp(1.1rem, 4vw, 1.5rem);
  border-bottom: 1px solid #3a3a3a;
  letter-spacing: -0.02em;
}

.overlay-links a:hover {
  color: #c9c9c9;
}

/* reveal */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .overlay {
    transition: none;
  }
}

/* responsive */

@media (max-width: 1080px) {
  .shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .doc .body > div,
  .doc .body > div:nth-child(even) {
    grid-column: span 12;
  }
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .doc {
    order: 1;
  }
  .side {
    order: 2;
    position: static;
  }
  .hero {
    min-height: 52vh;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 36px));
    padding-bottom: 58px;
  }
  .site-footer {
    grid-template-columns: 1fr 1fr;
  }
  .foot-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .contact {
    padding: 0 10px;
  }
  .rail a {
    font-size: 0.76rem;
    padding: 0 9px;
  }
  .hero h1 {
    font-size: 1.75rem;
  }
  .site-footer {
    grid-template-columns: 1fr;
  }
  .foot-legal {
    flex-direction: column;
    align-items: flex-start;
  }
}

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