@font-face {
  font-family: "JPEX Inter";
  src: url("../fonts/inter-latin-variable.woff2") format("woff2-variations");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: "JPEX Inter", "Noto Sans JP", "Noto Sans SC", "Hiragino Sans", "Yu Gothic UI", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  --bg: #f8f7f3;
  --surface: #fffefa;
  --surface-soft: #f3f1eb;
  --surface-hover: #fbf1ed;
  --ink: #24231f;
  --ink-soft: #69665f;
  --ink-faint: #949087;
  --line: #ddd9d0;
  --line-strong: #c9c4b9;
  --accent: #d96f4f;
  --accent-strong: #bd5438;
  --focus: #246b76;
  --content: 1256px;
  --header-height: 78px;
  background: var(--bg);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

[hidden] {
  display: none !important;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

::selection {
  background: #f4c7b8;
  color: var(--ink);
}

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

.skip-link:focus {
  position: fixed;
  z-index: 100000;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  clip: auto;
  margin: 0;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--ink);
}

.jpex-icon {
  display: block;
  width: 24px;
  height: 24px;
}

.site-shell {
  min-height: 100vh;
  overflow: clip;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--header-height);
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(250px, 1fr);
  align-items: center;
  gap: 32px;
  padding: 0 max(28px, calc((100vw - var(--content)) / 2));
  background: rgba(248, 247, 243, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.admin-bar .site-header {
  top: 32px;
}

.wordmark {
  width: fit-content;
  font-size: 1.25rem;
  font-weight: 690;
  letter-spacing: -0.045em;
  line-height: 1;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 42px;
  font-size: 0.78rem;
  font-weight: 560;
}

.site-nav a,
.site-footer > a {
  position: relative;
}

.site-nav a::after,
.site-footer > a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -7px;
  height: 1px;
  background: var(--accent);
  transition: right 180ms ease;
}

.site-nav a:hover::after,
.site-footer > a:hover::after {
  right: 0;
}

.language-switcher {
  justify-self: end;
  display: grid;
  grid-template-columns: repeat(3, minmax(54px, 1fr));
  align-items: stretch;
  min-width: 208px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.language-switcher a {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 580;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}

.language-switcher a:first-child {
  border-left: 0;
}

.language-switcher a:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.language-switcher a.is-active {
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: #fffaf7;
}

.hero {
  min-height: 830px;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  border-bottom: 1px solid var(--line);
}

.hero-copy,
.hero-tools {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(72px, 9vw, 144px) max(52px, calc((100vw - var(--content)) / 2));
}

.hero-copy {
  align-items: flex-start;
  border-right: 1px solid var(--line);
}

.hero-tools {
  padding-inline: clamp(52px, 5.2vw, 76px);
  background-color: var(--bg);
  background-image: url("../images/jpex-dot-matrix.png");
  background-size: 570px 570px;
  background-position: center;
}

.eyebrow {
  margin: 0 0 46px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 560;
  letter-spacing: 0.015em;
}

.hero h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(2.85rem, 4.15vw, 5.05rem);
  line-height: 1.27;
  letter-spacing: -0.06em;
  font-weight: 620;
}

.hero h1 span {
  display: block;
}

.hero-body {
  max-width: 610px;
  margin: 46px 0 0;
  color: #3f3d38;
  font-size: clamp(0.93rem, 1.05vw, 1.05rem);
  line-height: 2;
}

.text-action {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  margin-top: 62px;
  padding: 0 4px 12px 0;
  border-bottom: 1px solid var(--line-strong);
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 180ms ease, border-color 180ms ease;
}

.text-action .jpex-icon,
.project-link .jpex-icon,
.panel-action .jpex-icon {
  color: var(--accent);
  filter: invert(45%) sepia(38%) saturate(1147%) hue-rotate(327deg) brightness(102%) contrast(88%);
  transition: transform 180ms ease;
}

.text-action:hover,
.panel-action:hover {
  color: var(--accent-strong);
  border-color: var(--accent);
}

.text-action:hover .jpex-icon,
.project-link:hover .jpex-icon,
.panel-action:hover .jpex-icon {
  transform: translateX(4px);
}

.project-palette {
  width: min(100%, 570px);
  margin: auto;
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: rgba(255, 254, 250, 0.95);
  box-shadow: 0 18px 50px rgba(43, 39, 31, 0.055);
}

.palette-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.palette-heading p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.mono-label,
.palette-status,
.status-badge,
.detail-panel-title h2,
.footer-mode {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 0.055em;
}

.palette-heading .mono-label {
  margin: 0;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

kbd {
  min-width: 28px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.68rem;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(36, 35, 31, 0.08);
}

.search-field {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  margin-top: 28px;
  padding: 0 12px;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-soft);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-field:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(36, 107, 118, 0.12);
}

.search-field input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.88rem;
}

.search-field input::placeholder {
  color: var(--ink-faint);
}

.palette-status {
  margin: 24px 2px 10px;
  color: var(--ink-faint);
  font-size: 0.66rem;
}

.palette-results {
  border-top: 1px solid var(--line);
}

.palette-option {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.palette-option.is-active {
  background: var(--surface-hover);
  color: var(--accent-strong);
  box-shadow: inset 2px 0 0 var(--accent);
}

.palette-option-icon {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #ece8df;
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.8);
  color: var(--ink-soft);
}

.palette-option > span:nth-child(2) {
  font-size: 0.88rem;
  font-weight: 560;
}

.palette-option > .jpex-icon {
  width: 18px;
  height: 18px;
}

.palette-option-icon .jpex-icon {
  width: 18px;
  height: 18px;
}

.palette-empty {
  margin: 0;
  padding: 26px 12px;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.palette-help {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 22px;
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.palette-help span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.projects-section,
.details-grid {
  width: min(calc(100% - 56px), var(--content));
  margin-inline: auto;
}

.projects-section {
  padding: clamp(88px, 9vw, 138px) 0 78px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 42px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.section-heading > span {
  min-width: 25px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink-soft);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.7rem;
}

.project-list {
  border-top: 1px solid var(--line-strong);
}

.project-family {
  border-bottom: 1px solid var(--line-strong);
}

.project-row {
  min-height: 150px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 24px;
  padding: 28px 18px 28px 24px;
  scroll-margin-top: 120px;
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.project-row:target {
  background: #fbf1ed;
  box-shadow: inset 2px 0 0 var(--accent);
}

.project-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid #ece8df;
  border-radius: 10px;
  background: var(--surface-soft);
  color: #4c4942;
}

.project-icon .jpex-icon {
  width: 22px;
  height: 22px;
}

.project-copy {
  display: grid;
  grid-template-columns: minmax(170px, 0.75fr) minmax(300px, 2fr);
  align-items: baseline;
  gap: 40px;
}

.project-name-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.project-row h3,
.project-row p {
  margin: 0;
}

.project-row h3 {
  font-size: clamp(1.05rem, 1.45vw, 1.35rem);
  font-weight: 610;
  letter-spacing: -0.035em;
}

.project-row p {
  max-width: 720px;
  color: var(--ink-soft);
  font-size: 0.89rem;
  line-height: 1.85;
}

.status-badge {
  padding: 3px 7px;
  border: 1px solid #eaa38d;
  border-radius: 5px;
  color: var(--accent-strong);
  background: #fff8f5;
  font-size: 0.58rem;
  font-weight: 700;
}

.project-link {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  justify-self: end;
  border-radius: 8px;
}

.project-link:hover {
  background: var(--surface-hover);
}

.nested-project {
  position: relative;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  padding: 0 18px 28px 24px;
}

.nested-line {
  width: 1px;
  height: calc(100% - 24px);
  justify-self: center;
  margin-top: -24px;
  background: var(--line-strong);
}

.nested-line::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 48px;
  width: 9px;
  height: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
}

.project-row-child {
  min-height: 138px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 254, 250, 0.68);
}

.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 42px 0 86px;
}

.detail-panel {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 254, 250, 0.58);
  overflow: hidden;
}

.detail-panel-title {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 72px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}

.detail-panel-title .jpex-icon {
  width: 34px;
  height: 34px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.detail-panel-title h2 {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
}

.detail-panel dl {
  margin: 0;
}

.detail-panel dl > div {
  min-height: 69px;
  display: grid;
  grid-template-columns: minmax(100px, 0.45fr) 1fr;
  gap: 22px;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}

.detail-panel dt,
.detail-panel dd {
  margin: 0;
}

.detail-panel dt {
  font-size: 0.77rem;
  font-weight: 650;
}

.detail-panel dd {
  white-space: pre-line;
  color: #403e38;
  font-size: 0.83rem;
  line-height: 1.75;
}

.detail-panel dd a {
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
}

.detail-panel dd a:hover {
  color: var(--accent-strong);
  text-decoration-color: var(--accent);
}

.detail-panel .contact-note {
  min-height: 92px;
}

.panel-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  width: fit-content;
  margin: 25px 24px 25px auto;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line-strong);
  font-size: 0.82rem;
  font-weight: 620;
}

.privacy-strip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: start;
  padding: 34px max(28px, calc((100vw - var(--content)) / 2));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 250, 0.35);
}

.privacy-strip h2,
.privacy-strip p {
  margin: 0;
}

.privacy-strip h2 {
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 650;
}

.privacy-strip p {
  max-width: 1060px;
  color: var(--ink-soft);
  font-size: 0.74rem;
  line-height: 1.85;
}

.site-footer {
  min-height: 122px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 40px;
  padding: 26px max(28px, calc((100vw - var(--content)) / 2));
  font-size: 0.72rem;
}

.site-footer > div {
  display: flex;
  align-items: baseline;
  gap: 24px;
}

.site-footer p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.66rem;
}

.footer-mode {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-faint);
  font-size: 0.58rem;
}

.footer-mode .jpex-icon {
  width: 16px;
  height: 16px;
}

.standard-page {
  width: min(calc(100% - 56px), 860px);
  min-height: 65vh;
  margin-inline: auto;
  padding: clamp(88px, 10vw, 150px) 0;
}

.standard-page h1 {
  margin: 0 0 32px;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 1.15;
  letter-spacing: -0.055em;
}

.entry-content {
  color: var(--ink-soft);
}

@media (max-width: 1080px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .hero-tools {
    padding-inline: clamp(28px, 7vw, 74px);
  }

  .hero-copy {
    min-height: 720px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .hero-tools {
    min-height: 670px;
  }

  .project-copy {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 70px;
  }

  .site-header {
    gap: 18px;
    padding-inline: 18px;
  }

  .language-switcher {
    min-width: 172px;
    grid-template-columns: repeat(3, minmax(48px, 1fr));
  }

  .language-switcher a {
    min-height: 38px;
    padding: 0 8px;
    font-size: 0.68rem;
  }

  .hero-copy {
    min-height: 650px;
    padding-block: 82px;
  }

  .hero-tools {
    min-height: 590px;
    padding-block: 58px;
  }

  .eyebrow {
    margin-bottom: 34px;
  }

  .hero h1 {
    font-size: clamp(2.5rem, 11vw, 4.2rem);
  }

  .hero-body {
    margin-top: 34px;
    font-size: 0.91rem;
  }

  .text-action {
    margin-top: 46px;
  }

  .project-palette {
    padding: 20px;
  }

  .palette-help {
    display: none;
  }

  .projects-section,
  .details-grid {
    width: min(calc(100% - 36px), var(--content));
  }

  .projects-section {
    padding-top: 78px;
  }

  .project-row {
    grid-template-columns: 48px minmax(0, 1fr) 38px;
    gap: 14px;
    padding: 24px 8px 24px 10px;
  }

  .project-icon {
    width: 44px;
    height: 44px;
  }

  .project-row p {
    font-size: 0.82rem;
  }

  .nested-project {
    display: block;
    padding: 0 6px 22px 6px;
  }

  .nested-line {
    display: none;
  }

  .project-row-child {
    padding-left: 14px;
  }

  .details-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel dl > div {
    grid-template-columns: minmax(92px, 0.48fr) 1fr;
  }

  .privacy-strip {
    padding-inline: 22px;
  }

  .site-footer {
    grid-template-columns: 1fr auto;
    gap: 18px;
    padding-inline: 22px;
  }

  .site-footer > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .footer-mode {
    display: none;
  }
}

@media (max-width: 430px) {
  .wordmark {
    font-size: 1.05rem;
  }

  .language-switcher {
    min-width: 164px;
  }

  .language-switcher a {
    font-size: 0.65rem;
  }

  .hero-copy,
  .hero-tools {
    padding-inline: 20px;
  }

  .hero-copy {
    min-height: 610px;
  }

  .hero h1 {
    font-size: 2.45rem;
  }

  .project-palette {
    padding: 17px;
  }

  .palette-heading p:not(.mono-label) {
    max-width: 190px;
  }

  .project-row {
    grid-template-columns: 42px minmax(0, 1fr) 34px;
    gap: 11px;
  }

  .project-icon {
    width: 40px;
    height: 40px;
  }

  .project-row h3 {
    font-size: 1rem;
  }

  .project-link {
    width: 34px;
  }

  .detail-panel dl > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

}

@media screen and (max-width: 782px) {
  .admin-bar .site-header {
    top: 46px;
  }
}

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