@charset "utf-8";

:root {
  --ink: #000000;
  --paper: #ffffff;
  --line: rgba(0, 0, 0, 0.16);
  --soft: rgba(0, 0, 0, 0.58);
  --wash: rgba(0, 0, 0, 0.055);
  --u: 8px;
  --pad: clamp(16px, 4vw, 56px);
  --dock: 92px;
  --sans: 'Open Sans', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --head: 'Poppins', 'Open Sans', -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

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

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

body {
  margin: 0;
  padding: 0 0 calc(var(--dock) + 32px);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.68;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

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

img { max-width: 100%; }

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

.sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.hero {
  display: grid;
  gap: calc(var(--u) * 3);
  align-content: center;
  justify-items: center;
  text-align: center;
  min-height: clamp(430px, 70vh, 780px);
  padding: calc(var(--u) * 5) var(--pad) calc(var(--u) * 4);
  border-bottom: 2px solid var(--ink);
}

.badge {
  display: inline-block;
  font-family: var(--head);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.34em;
  padding: 6px 16px 6px 20px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--ink);
  transform: translateY(2px);
}

.hero-h1 {
  font-size: clamp(2rem, 6.4vw, 4.25rem);
  font-weight: 600;
  max-width: 22ch;
  letter-spacing: -0.035em;
}

.hero-media {
  margin: 0;
  width: 100%;
  max-width: min(940px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  border-bottom: 3px solid var(--ink);
}

.hero-img {
  display: block;
  width: 100%;
  height: auto;
  will-change: transform;
}

/* ---------- grid stage ---------- */

.stage {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: calc(var(--u) * 2);
  align-items: start;
  max-width: 1360px;
  margin: 0 auto;
  padding: calc(var(--u) * 5) var(--pad) calc(var(--u) * 6);
}

.doc {
  grid-column: 1 / 9;
  min-width: 0;
  counter-reset: sec;
}

.doc > article {
  position: relative;
  counter-increment: sec;
  padding: calc(var(--u) * 4) 0 calc(var(--u) * 3);
  border-top: 1px solid var(--ink);
  scroll-margin-top: calc(var(--u) * 4);
  scroll-margin-bottom: calc(var(--dock) + 32px);
}

.doc > article::before {
  content: counter(sec, decimal-leading-zero);
  display: block;
  font-family: var(--head);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.26em;
  color: var(--soft);
  margin-bottom: var(--u);
}

.doc > article.hero {
  counter-increment: none;
  border-top: 0;
  padding: 0 0 calc(var(--u) * 4);
}

.doc > article.hero::before { content: none; }

.doc h2 {
  font-size: clamp(1.5rem, 3.4vw, 2.15rem);
  margin: 0 0 calc(var(--u) * 2);
}

.doc h2 > span { display: block; }

.doc h3 {
  font-size: clamp(1.14rem, 2vw, 1.35rem);
  margin: calc(var(--u) * 3) 0 var(--u);
}

.doc h3 > span { display: block; }

.doc p {
  margin: 0 0 calc(var(--u) * 2);
  max-width: 68ch;
}

.doc ul,
.doc ol {
  margin: 0 0 calc(var(--u) * 2);
  padding-left: 1.2em;
  max-width: 66ch;
}

.doc li { margin: 0 0 6px; }

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

.doc a:hover { background: var(--wash); }

.doc strong { font-weight: 700; }

.doc blockquote {
  margin: calc(var(--u) * 3) 0;
  padding: calc(var(--u) * 2) calc(var(--u) * 3);
  background: var(--wash);
  border-left: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  border-radius: 4px;
}

.doc blockquote > :last-child { margin-bottom: 0; }

.doc figure { margin: calc(var(--u) * 3) 0; }

.doc figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  border-bottom: 3px solid var(--ink);
}

.doc figcaption {
  font-size: 14px;
  color: var(--soft);
  padding-top: 6px;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 calc(var(--u) * 2);
  font-size: 16px;
}

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

.doc th {
  font-family: var(--head);
  font-weight: 600;
  background: var(--wash);
}

.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--wash);
  padding: 1px 5px;
  border-radius: 3px;
}

.doc hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: calc(var(--u) * 3) 0;
}

/* ---------- right rail ---------- */

.side {
  grid-column: 10 / 13;
  position: sticky;
  top: calc(var(--u) * 3);
  align-self: start;
  align-self: start;
  padding-left: calc(var(--u) * 2);
  border-left: 1px solid var(--line);
  min-height: 52vh;
}

.search {
  display: grid;
  gap: 6px;
  padding-bottom: calc(var(--u) * 2);
  border-bottom: 3px solid var(--ink);
  border-radius: 0 0 4px 4px;
}

.search-lab {
  font-family: var(--head);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3em;
  padding-bottom: 2px;
}

.search-in,
.sub-in {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 4px;
}

.search-btn,
.sub-btn {
  height: 44px;
  padding: 0 14px;
  font-family: var(--head);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 4px;
  cursor: pointer;
}

.search-btn:hover,
.sub-btn:hover { background: #1c1c1c; }

.search-out,
.sub-out {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--soft);
  min-height: 1.3em;
}

/* ---------- bottom dock ---------- */

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--u);
  padding: 10px max(12px, env(safe-area-inset-left)) calc(10px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 2px solid var(--ink);
}

.dock-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2px;
  min-width: 0;
}

.dock-list--a { justify-content: flex-end; }
.dock-list--b { justify-content: flex-start; }

.dock-list a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px;
  font-family: var(--head);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  border-radius: 4px;
}

.dock-list a:hover,
.dock-list a:focus-visible { background: var(--wash); }

.dock-list .i {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}

.dock-brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  font-family: var(--head);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
  border-left: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
}

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

.foot {
  border-top: 2px solid var(--ink);
  margin-top: calc(var(--u) * 4);
  padding: calc(var(--u) * 5) var(--pad) calc(var(--u) * 3);
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  gap: calc(var(--u) * 3);
  max-width: 1240px;
  margin: 0 auto;
}

.foot-h {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3em;
  margin: 0 0 calc(var(--u) * 2);
  padding-bottom: 6px;
  border-bottom: 3px solid var(--ink);
  border-radius: 0 0 4px 0;
}

.foot-h > span { display: block; }

.foot-addr {
  font-style: normal;
  font-family: var(--head);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

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

.foot-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 16px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

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

.sub {
  display: grid;
  gap: 6px;
}

.foot-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--u);
  max-width: 1240px;
  margin: calc(var(--u) * 5) auto 0;
  padding-top: calc(var(--u) * 2);
  border-top: 1px solid var(--line);
}

.copy {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--soft);
}

.totop {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 4px;
}

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

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

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

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

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

@media (max-width: 1080px) {
  .doc { grid-column: 1 / 9; }
  .side { grid-column: 10 / 13; }
  .dock-list a { padding: 0 8px; font-size: 13px; }
  .dock-list .i { display: none; }
}

@media (max-width: 860px) {
  :root { --dock: 132px; }

  body { font-size: 17px; }

  .stage {
    grid-template-columns: 1fr;
    gap: calc(var(--u) * 3);
    padding-top: calc(var(--u) * 6);
  }

  .doc { grid-column: 1 / -1; }

  .side {
    grid-column: 1 / -1;
    position: static;
    border-left: 0;
    padding-left: 0;
    min-height: 0;
  }

  .search {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 70;
    width: min(62vw, 240px);
    padding: 8px 8px 10px;
    background: var(--paper);
    border: 1px solid var(--ink);
    border-radius: 4px;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.12);
    grid-template-columns: 1fr auto;
  }

  .search-lab { grid-column: 1 / -1; letter-spacing: 0.22em; }
  .search-out { grid-column: 1 / -1; font-size: 13px; }

  .hero { padding-top: 84px; }

  .dock {
    grid-template-columns: 1fr;
    gap: 4px;
    padding-top: 4px;
  }

  .dock-brand {
    order: -1;
    justify-content: center;
    border-left: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    min-height: 38px;
    font-size: 16px;
  }

  .dock-list {
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .dock-list::-webkit-scrollbar { display: none; }
  .dock-list--a,
  .dock-list--b { justify-content: flex-start; }
  .dock-list a { padding: 0 10px; font-size: 14px; min-height: 42px; }

  .foot-grid { grid-template-columns: 1fr 1fr; gap: calc(var(--u) * 3) calc(var(--u) * 2); }
  .foot-col--wide { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .hero-h1 { font-size: clamp(1.75rem, 9vw, 2.4rem); }
  .doc p, .doc ul, .doc ol { max-width: none; }
  .foot-bar { flex-direction: column; align-items: flex-start; }
}

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