/* Unified styles for works and static pages */
:root {
  --key: #34b6e4;
  --ink: #101f46;
  --muted: #314b67;
  --line: #cfdbe7;
  --paper: #f8fcff;
  --white: #ffffff;
  --content-width: 1280px;
  --column-heading-width: 280px;
  --column-gap: 60px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(16, 31, 70, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(16, 31, 70, 0.05) 1px, transparent 1px),
    linear-gradient(
      to bottom,
      rgba(52, 182, 228, 0.12),
      rgba(52, 182, 228, 0) 420px
    ),
    var(--paper);
  background-size:
    26px 26px,
    26px 26px,
    100% 100%,
    auto;
  font-family:
    "Helvetica", "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", "メイリオ",
    Meiryo, sans-serif;
  line-height: 1.65;
}

.archive-wrap {
  width: min(var(--content-width), calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 64px;
}

.archive-header {
  margin-bottom: 34px;
  padding: 16px 0 24px;
  border-top: 10px solid var(--key);
}

.brand-anchor {
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  letter-spacing: 0.24em;
  font-weight: 700;
}

.archive-header-grid {
  display: grid;
  grid-template-columns: minmax(220px, var(--column-heading-width)) minmax(0, 1fr);
  gap: var(--column-gap);
  margin-top: 10px;
}

.archive-header-left {
  padding-right: 0;
  border-right: 1px solid var(--line);
}

.archive-header-grid.archive-header-grid-single {
  grid-template-columns: 1fr;
  gap: 0;
}

.archive-header-grid.archive-header-grid-single .archive-header-left {
  border-right: 0;
}

.header-label {
  margin: 0;
  color: var(--key);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
}

.archive-header h1 {
  margin: 8px 0 0;
  font-size: clamp(36px, 6vw, 74px);
  line-height: 0.94;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.header-copy {
  margin: 0;
  max-width: 780px;
  font-size: 15px;
  color: var(--muted);
}

.archive-language-switch {
  margin: 0 0 14px;
}

.archive-language-label {
  margin: 0 0 6px;
  color: var(--key);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}

.archive-language-controls {
  display: inline-flex;
  border: 1px solid var(--line);
  background: #ffffffcc;
}

.archive-language-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  min-width: 54px;
  padding: 7px 10px;
  cursor: pointer;
}

.archive-language-button + .archive-language-button {
  border-left: 1px solid var(--line);
}

.archive-language-button.is-active {
  background: var(--key);
  color: var(--white);
}

.header-stats {
  margin: 20px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.header-stats div {
  min-width: 110px;
  border-top: 2px solid var(--key);
  padding-top: 8px;
}

.header-stats dt {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.header-stats dd {
  margin: 4px 0 0;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.archive-main {
  border-top: 2px solid var(--ink);
}

.archive-footer {
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
}

.archive-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.project-item {
  background: rgba(255, 255, 255, 0.84);
  border-bottom: 1px solid var(--line);
}

.project-toggle {
  width: 100%;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  text-align: left;
  padding: 22px 12px;
  display: grid;
  grid-template-columns: minmax(220px, var(--column-heading-width)) minmax(0, 1fr);
  gap: var(--column-gap);
}

.project-toggle.is-disabled {
  cursor: default;
}

.project-toggle.is-disabled .project-action {
  color: #91a2b5;
}

.project-lead {
  padding-right: 0;
  border-right: 1px solid var(--line);
}

.project-logo {
  width: min(240px, 100%);
  height: 68px;
  display: block;
  object-fit: contain;
  object-position: left center;
  margin: 0 0 8px;
}

.project-lead-label {
  margin: 0;
  color: var(--key);
  font-size: 11px;
  letter-spacing: 0.2em;
  font-weight: 700;
  text-transform: uppercase;
}

.project-name {
  margin: 8px 0 0;
  font-size: clamp(24px, 3vw, 42px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.project-chevron {
  color: var(--key);
  margin-left: 8px;
  display: inline-block;
  transition: transform 0.32s ease;
}

.project-item.is-open .project-chevron {
  transform: rotate(45deg);
}

.project-body {
  min-width: 0;
  padding-top: 8px;
  padding-inline: 10px 8px;
}

.project-summary {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.98;
  color: var(--muted);
  max-width: 860px;
  white-space: pre-line;
}

.project-meta-row {
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.project-count {
  margin: 0;
  color: var(--key);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}

.project-action {
  margin: 0;
  color: #6b7f95;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.48s cubic-bezier(0.2, 0.84, 0.24, 1);
}

.panel-inner {
  padding: 0 12px 28px;
}

.panel-layout {
  display: grid;
  grid-template-columns: minmax(220px, var(--column-heading-width)) minmax(0, 1fr);
  gap: var(--column-gap);
}

.panel-side {
  padding-right: 0;
  border-right: 1px solid var(--line);
}

.panel-side-label {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
}

.panel-side-count {
  margin: 4px 0 0;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 700;
}

.panel-content {
  min-width: 0;
  padding-inline: 10px 8px;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.case-card {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  padding: 10px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.case-card:hover,
.case-card:focus-visible {
  border-color: #b8cede;
}

.case-card.is-active {
  border-color: #90bad0;
}

.case-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  background: #e7f1f7;
  margin-bottom: 8px;
}

.case-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.36;
  font-weight: 700;
}

.case-date {
  margin: auto 0 0;
  color: var(--muted);
  font-size: 12px;
}

.case-detail {
  grid-column: 1 / -1;
  margin: 2px 0;
  border-top: 0;
  background: var(--white);
  padding: 0 14px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.42s ease,
    opacity 0.25s ease,
    padding 0.24s ease;
}

.case-detail.is-open {
  border-top: 3px solid var(--key);
  padding: 14px;
  max-height: 18000px;
  opacity: 1;
}

.case-detail-grid {
  display: block;
}

.case-detail-head {
  margin: 0 0 14px;
}

.case-detail-content {
  display: grid;
  gap: 12px;
}

.case-detail-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e7f1f7;
}

.case-detail-label {
  margin: 0;
  color: var(--key);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.case-detail h3 {
  margin: 8px 0 0;
  font-size: clamp(20px, 2.5vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.case-detail-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-detail-copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.9;
  color: #21355a;
  white-space: pre-line;
}

.case-legacy-block {
  min-width: 0;
}

.case-legacy-block .description-widget-item {
  margin: 0;
  font-size: 14px;
  line-height: 1.9;
  color: #21355a;
}

.case-legacy-block a {
  color: var(--key);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.case-legacy-block img {
  width: 100%;
  height: auto;
  display: block;
  background: #e7f1f7;
}

.case-legacy-image {
  margin: 0;
}

.case-legacy-image img {
  width: 100%;
  height: auto;
  display: block;
  background: #e7f1f7;
}

.case-detail-subtitle {
  margin: 16px 0 8px;
  color: var(--key);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.case-detail-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
}

.case-detail-gallery-link {
  border: 1px solid var(--line);
  display: block;
  background: #f5fbff;
}

.case-detail-gallery-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.case-detail-comments {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.case-detail-comment {
  border: 1px solid var(--line);
  background: #f8fcff;
  padding: 8px 10px;
}

.case-detail-comment-meta {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.case-detail-comment-body {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: #1e3257;
}

.project-empty {
  margin: 0;
  border: 1px dashed var(--line);
  background: #fcfeff;
  padding: 16px;
  color: var(--muted);
  font-size: 14px;
}

.no-script {
  margin: 24px auto;
  width: min(var(--content-width), calc(100% - 40px));
  padding: 0;
  color: #6a7f93;
}

@media (max-width: 1280px) {
  .archive-header-grid,
  .project-toggle,
  .panel-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .archive-header-left,
  .project-lead,
  .panel-side {
    border-right: 0;
    padding-right: 0;
  }

  .project-body,
  .panel-content {
    padding-inline: 0;
  }

  .project-logo {
    width: min(170px, 82%);
    height: 46px;
  }

  .panel-side {
    padding-top: 4px;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px 16px;
  }

  .panel-side-count {
    font-size: 28px;
  }

  .case-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-detail-grid {
    display: block;
  }

  .policy-document-body .content-item,
  .policy-document-body .tos_text {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .policy-document-body .content-item > :not(h2) {
    grid-column: auto;
  }

  .policy-document-body .tos_text_left {
    border-right: 0;
  }
}

@media (max-width: 620px) {
  .archive-wrap {
    width: auto;
    margin: 0;
    padding: 14px 12px 40px;
  }

  .archive-header {
    padding-top: 12px;
  }

  .case-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-toggle {
    padding: 18px 8px;
  }

  .panel-inner {
    padding-bottom: 20px;
  }

  .no-script {
    width: auto;
    padding: 0 12px;
  }
}

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

/* Policy extensions */
.policy-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.policy-header {
  margin-bottom: 34px;
}

.policy-header .archive-language-controls .archive-language-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-decoration: none;
}

.policy-header .archive-language-controls .archive-language-button:visited {
  color: var(--muted);
}

.policy-header
  .archive-language-controls
  .archive-language-button.is-active:visited {
  color: var(--white);
}

.policy-main {
  border-top: 2px solid var(--ink);
  flex: 1;
}

.policy-shell {
  padding-top: 0;
}

.policy-document {
  background: rgba(255, 255, 255, 0.84);
  border-bottom: 1px solid var(--line);
}

.policy-document-head {
  padding: 22px 12px 18px;
  border-bottom: 1px solid var(--line);
}

.policy-document-title {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
}

.policy-document-lead {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.75;
  color: var(--muted);
  max-width: none;
}

.policy-document-body {
  padding: 22px 12px 28px;
}

.policy-document-body .content-item,
.policy-document-body .tos_text {
  padding: 0 0 20px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 20px;
  background: transparent;
}

.policy-document-body .content-item {
  display: grid;
  grid-template-columns: minmax(220px, var(--column-heading-width)) minmax(0, 1fr);
  gap: var(--column-gap);
  align-items: start;
}

.policy-document-body .content-item:last-child,
.policy-document-body .tos_text:last-of-type {
  margin-bottom: 0;
  border-bottom: 0;
  padding-bottom: 0;
}

.policy-document-body .content-item h2,
.policy-document-body .tos_text_right h2 {
  margin: 0 0 12px;
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.policy-document-body .content-item > h2 {
  grid-column: 1;
  margin-bottom: 0;
}

.policy-document-body .content-item > :not(h2) {
  grid-column: 2;
}

.policy-document-body p,
.policy-document-body li {
  font-size: 15px;
  line-height: 1.75;
}

.policy-document-body ul,
.policy-document-body ol {
  margin: 10px 0 0 1.25rem;
  padding: 0;
}

.policy-document-body li {
  margin: 0 0 8px;
}

.policy-document-body .content-item > :last-child,
.policy-document-body .tos_text_right > :last-child {
  margin-bottom: 0;
}

.policy-document-body .tos_text_right > ul:last-child,
.policy-document-body .tos_text_right > ol:last-child,
.policy-document-body .tos_text_right > p:last-child {
  margin-bottom: 0;
}

.policy-document-body .box-white,
.policy-document-body .contents-full,
.policy-document-body .left,
.policy-document-body .tos_text_left,
.policy-document-body .tos_text_right {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
}

.policy-document-body .box-white {
  box-shadow: none;
  background: transparent;
  border: 0;
  padding: 0;
}

.policy-document-body .tos_text {
  display: grid;
  grid-template-columns: minmax(220px, var(--column-heading-width)) minmax(0, 1fr);
  gap: var(--column-gap);
}

.policy-document-body .tos_text_left {
  margin: 0 !important;
  padding-right: 0;
  border-right: 1px solid var(--line);
}

.policy-document-body .tos_text_left .small {
  margin: 0;
  color: var(--ink);
  font-size: clamp(18px, 2vw, 28px);
  letter-spacing: -0.02em;
  font-weight: 700;
  line-height: 1.2;
}

.policy-document-body a {
  color: #0b6ea2;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.policy-footer {
  margin-top: 48px;
}

.policy-footer-links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.policy-footer-links a {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 620px) {
  .policy-document-head,
  .policy-document-body {
    padding-left: 12px;
    padding-right: 12px;
  }

  .policy-document-body .content-item,
  .policy-document-body .tos_text {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .policy-document-body .tos_text_left {
    border-right: 0;
  }

  .policy-footer-links {
    flex-direction: column;
    gap: 8px;
  }
}
