:root {
  --paper: #ffffff;
  --ink: #173d2c;
  --line: #173d2c;
}

.interrobang-theme {
  --ink: #c6531f;
  --line: #c6531f;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, sans-serif;
  font-size: 12px;
  line-height: 1.68;
}

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

/* ---------- loader ---------- */

body.is-loading { overflow: hidden; }

.site-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 22px;
  background: var(--paper);
  transition: opacity 420ms ease, visibility 420ms ease;
}

.site-loader.is-hidden { opacity: 0; visibility: hidden; }
.site-loader.is-skipped { display: none; }

.site-loader .circuit { width: min(72vw, 520px); height: auto; }

.loader-word {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  opacity: 0;
  animation: c-fade 600ms ease 1200ms forwards;
}

/* ---------- circuit ---------- */

.circuit { color: var(--ink); }

.circuit .c-path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.circuit .c-dot { fill: currentColor; }

.circuit .c-label {
  fill: currentColor;
  font-family: inherit;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.circuit .c-year { font-weight: 400; opacity: 0.65; }

.circuit-animate .c-path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: c-draw 1400ms cubic-bezier(0.65, 0, 0.35, 1) 150ms forwards;
}

.circuit-animate .c-dot,
.circuit-animate .c-label {
  opacity: 0;
  animation: c-fade 380ms ease forwards;
  animation-delay: calc(220ms + var(--i) * 150ms);
}

@keyframes c-draw { to { stroke-dashoffset: 0; } }
@keyframes c-fade { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .site-loader { display: none; }
  .circuit-animate .c-path { animation: none; stroke-dashoffset: 0; }
  .circuit-animate .c-dot, .circuit-animate .c-label { animation: none; opacity: 1; }
}

.circuit-section {
  padding: clamp(28px, 5vw, 52px) 36px clamp(34px, 6vw, 64px);
  border-bottom: 1px solid var(--line);
}

.circuit-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(200px, 0.6fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: end;
  margin-top: 8px;
}

.circuit-wrap .circuit { width: 100%; height: auto; }

.circuit-caption {
  margin: 0;
  max-width: 320px;
  font-size: 12px;
  line-height: 1.85;
}

.site-header {
  position: sticky;
  z-index: 15;
  top: 0;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) max-content;
  gap: 24px;
  align-items: center;
  min-height: 56px;
  padding: 14px 36px;
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
}

.menu-toggle { display: none; }

.nav {
  display: flex;
  justify-content: flex-end;
  gap: clamp(14px, 2.5vw, 42px);
  font-size: 12px;
  line-height: 1.1;
}

.nav a,
.text-link,
.footer a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.nav a[aria-current="page"] { text-decoration-thickness: 2px; }

main { border-bottom: 1px solid var(--line); }

.home,
.page-head {
  padding: clamp(28px, 5vw, 56px) 36px clamp(28px, 5vw, 56px);
  border-bottom: 1px solid var(--line);
}

.page-label {
  margin: 0 0 18px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.home-name {
  margin: 0 0 22px;
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.home-name span {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.home-copy { max-width: 660px; }

.home-copy p {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.78;
}

.home-copy .en { opacity: 0.92; }

.home-links {
  display: flex;
  gap: 20px;
  margin-top: clamp(18px, 4vw, 30px);
}

.section-label,
.project-meta,
.kicker,
.footer {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  text-transform: uppercase;
}

.selected {
  padding-left: 36px;
  padding-right: 36px;
  border-bottom: 1px solid var(--line);
}

.section-label {
  display: grid;
  grid-template-columns: minmax(180px, 0.28fr) minmax(0, 1fr);
  gap: 24px;
  min-height: 48px;
  align-items: center;
}

.section-label p, .section-label span { margin: 0; }
.section-label span { text-align: right; justify-self: end; }

.project-list {
  display: grid;
  margin-left: -36px;
  margin-right: -36px;
  border-top: 1px solid var(--line);
}

.project-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) 110px;
  gap: 24px;
  align-items: baseline;
  min-height: 46px;
  padding: 13px 36px;
  border-bottom: 1px solid var(--line);
  transition: opacity 160ms ease;
}

.project-row:last-child { border-bottom: 0; }
.project-row.is-dimmed { opacity: 0.22; }

.project-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.project-name-ja {
  display: block;
  font-weight: 400;
  opacity: 0.75;
}

/* ---------- work detail ---------- */

.work-head {
  padding: clamp(34px, 6vw, 70px) 36px clamp(26px, 4vw, 46px);
  border-bottom: 1px solid var(--line);
}

.work-kicker {
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.work-title {
  margin: 0;
  font-size: clamp(20px, 3.4vw, 30px);
  font-weight: 600;
  line-height: 1.25;
}

.work-title-ja {
  margin: 8px 0 0;
  font-size: 13px;
}

.work-detail {
  display: grid;
  grid-template-columns: minmax(170px, 0.26fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: clamp(30px, 6vw, 70px) 36px;
  border-bottom: 1px solid var(--line);
}

.work-meta {
  display: grid;
  gap: 10px;
  margin: 0;
  font-size: 12px;
}

.work-meta div { display: grid; gap: 2px; }
.work-meta dt { font-weight: 600; text-transform: uppercase; }
.work-meta dd { margin: 0; }

.work-body { max-width: 680px; }

.work-body p {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.9;
}

.work-image { margin: 0 0 24px; }
.work-image img { display: block; width: 100%; }

.work-pager {
  display: grid;
  grid-template-columns: 1fr max-content 1fr;
  gap: 18px;
  padding: 18px 36px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.work-pager a { text-decoration: underline; text-underline-offset: 3px; }
.work-pager .pager-next { justify-self: end; text-align: right; }
.work-pager a:nth-child(2) { justify-self: center; }

.project-role {
  font-size: 12px;
  line-height: 1.4;
}

.project-meta {
  justify-self: end;
  text-align: right;
}

.filters {
  display: grid;
  gap: 5px;
  margin: 0 -36px;
  padding: 14px 36px;
  border-bottom: 1px solid var(--line);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.filter-group span { min-width: 84px; }

.filter-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.filter-button.is-active { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.about {
  display: block;
  padding: clamp(34px, 7vw, 82px) 36px;
  border-bottom: 1px solid var(--line);
}

.bio-section { max-width: 860px; }
.bio-section + .bio-section { margin-top: clamp(38px, 7vw, 70px); }

.bio-title { margin: 0 0 4px; font-size: 14px; font-weight: 700; }
.bio-role { margin: 0 0 18px; font-size: 12px; font-weight: 500; text-transform: uppercase; }

.bio-section p {
  max-width: 760px;
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.85;
}

.text-page {
  padding: 0 36px;
  border-bottom: 1px solid var(--line);
}

.text-block {
  padding: clamp(24px, 4vw, 44px) 0;
  border-bottom: 1px solid var(--line);
}

.text-block:last-child { border-bottom: 0; }

.text-block > p {
  max-width: 850px;
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.85;
}

.text-block .kicker {
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.chronology { display: grid; gap: 12px; }

.chronology p {
  display: grid;
  grid-template-columns: minmax(94px, 0.16fr) minmax(0, 1fr);
  gap: 18px;
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
}

.chronology span { font-weight: 600; }

.keyword-list,
.company-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.keyword-list div,
.company-list div {
  display: grid;
  grid-template-columns: minmax(140px, 0.24fr) minmax(0, 1fr);
  gap: 18px;
}

.keyword-list dt,
.company-list dt {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.keyword-list dd,
.company-list dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
}

.member-list { display: grid; gap: 24px; }
.member-list h2 { margin: 0 0 10px; font-size: 12px; font-weight: 600; }
.member-list p { max-width: 820px; margin: 0 0 10px; font-size: 12px; line-height: 1.82; }

.contact {
  display: grid;
  grid-template-columns: minmax(180px, 0.28fr) minmax(0, 1fr);
  gap: 24px;
  padding: clamp(44px, 8vw, 100px) 36px;
  border-bottom: 1px solid var(--line);
}

.kicker { margin: 0; }

.contact-body p { margin: 0 0 10px; font-size: 12px; line-height: 1.8; }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 36px;
}

.footer-links { display: flex; gap: 18px; }

@media (max-width: 720px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) 30px;
    gap: 16px;
    padding: 16px 22px;
  }

  .menu-toggle {
    display: grid;
    justify-self: end;
    align-content: center;
    gap: 5px;
    width: 30px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
  }

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

  .menu-line {
    display: block;
    width: 30px;
    height: 1px;
    background: currentColor;
    transition: transform 160ms ease;
  }

  .menu-toggle[aria-expanded="true"] .menu-line:first-of-type { transform: translateY(3px) rotate(22deg); }
  .menu-toggle[aria-expanded="true"] .menu-line:last-of-type { transform: translateY(-3px) rotate(-22deg); }

  .site-header .nav {
    grid-column: 1 / -1;
    display: none;
    justify-items: end;
    gap: 16px;
    width: 100%;
    padding: 22px 0 2px;
    border-top: 1px solid var(--line);
  }

  .menu-toggle[aria-expanded="true"] + .nav { display: grid; }
  .nav a { font-size: 15px; }

  .home, .page-head, .about, .footer { padding-left: 22px; padding-right: 22px; }
  .selected, .text-page { padding-left: 22px; padding-right: 22px; }
  .contact { grid-template-columns: 1fr; gap: 18px; padding-left: 22px; padding-right: 22px; }

  .project-list { margin-left: -22px; margin-right: -22px; }
  .filters { margin-left: -22px; margin-right: -22px; padding-left: 22px; padding-right: 22px; }

  .project-row {
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 4px 16px;
    padding-left: 22px;
    padding-right: 22px;
  }

  .project-role { grid-column: 1 / -1; opacity: 0.85; }

  .chronology p,
  .keyword-list div,
  .company-list div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .circuit-section { padding-left: 22px; padding-right: 22px; }
  .circuit-wrap { grid-template-columns: 1fr; align-items: start; }
  .work-head, .work-detail, .work-pager { padding-left: 22px; padding-right: 22px; }
  .work-detail { grid-template-columns: 1fr; gap: 20px; }
  .work-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
