:root {
  --paper: #f7f7f2;
  --ink: #1c2e2a;
  --muted: #63746b;
  --accent: #2f6d5a;
  --line: #d6ded7;
  --hardware: #ecefeb;
  --font: 'Yu Gothic', 'Hiragino Kaku Gothic ProN', Meiryo, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); line-height: 1.7; }
a, button { outline-offset: 4px; }
button { font: inherit; }
.skip-link { position: absolute; top: -4rem; left: 1rem; z-index: 20; padding: .5rem 1rem; background: #fff; }
.skip-link:focus { top: 1rem; }
.page-shell { width: min(100% - 2.5rem, 1360px); margin-inline: auto; }
.review-bar { padding: .4rem 1rem; background: #deeadf; color: #30553f; text-align: center; font-size: .7rem; font-weight: 700; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 2rem; min-height: 86px; padding: 1rem max(calc((100vw - 1360px) / 2), 1.25rem); background: #fff; border-bottom: 1px solid var(--line); }
.brand { color: var(--ink); font-size: 1.27rem; font-weight: 800; letter-spacing: .14em; line-height: 1.15; text-decoration: none; white-space: nowrap; }
.brand span { display: block; margin-top: .28rem; color: var(--muted); font-size: .63rem; font-weight: 500; letter-spacing: .08em; }
.site-header nav { display: flex; gap: clamp(1rem, 2.3vw, 2.2rem); }
.site-header nav a { color: var(--muted); font-size: .78rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.site-header nav a:hover { color: var(--accent); }
.hero { padding-block: clamp(3.8rem, 7vw, 6rem) clamp(3rem, 5vw, 4.5rem); }
.eyebrow { margin: 0 0 .8rem; color: var(--accent); font-size: .74rem; font-weight: 800; letter-spacing: .2em; }
.hero h1 { margin: 0; font-size: clamp(2.6rem, 5.5vw, 4.9rem); line-height: 1.24; letter-spacing: -.07em; }
.hero > p:last-child { margin: 1.3rem 0 0; color: var(--muted); font-size: .94rem; }
.portfolio-section { padding-bottom: clamp(3.8rem, 6vw, 6rem); scroll-margin-top: 1rem; }
.section-head { display: flex; align-items: baseline; gap: 1.3rem; margin-bottom: 1.7rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.section-number { flex: none; color: var(--accent); font-size: 2rem; font-weight: 800; }
.section-head h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.45rem); line-height: 1.4; letter-spacing: -.05em; }
.section-head p { margin: .25rem 0 0; color: var(--muted); font-size: .77rem; }
.project-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.3rem; }
.project-cell { display: flex; min-width: 0; flex-direction: column; }
.project-card { position: relative; display: flex; flex-direction: column; width: 100%; min-width: 0; height: 100%; overflow: hidden; border: 1px solid #e3e8e2; border-radius: 10px; background: #fff; color: var(--ink); box-shadow: 0 4px 12px #1c2e2a0c; transition: transform .22s ease, box-shadow .22s ease; }
.project-card:hover { transform: translateY(-4px); box-shadow: 0 15px 32px #1c2e2a1b; }
.project-card-main { position: relative; display: flex; flex: 1; flex-direction: column; width: 100%; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; }
.project-card-main:focus-visible { z-index: 1; outline: 3px solid var(--accent); outline-offset: -3px; }
.visual-placeholder { position: relative; display: block; width: 100%; aspect-ratio: 1.9; overflow: hidden; background: #ddeae4; }
#systems .visual-placeholder { background: #e2eae6; }
#ec .visual-placeholder { background: #eae8de; }
#hardware .visual-placeholder { background: #dce4df; }
.visual-placeholder img { display: block; width: 100%; height: 100%; object-fit: cover; }
.visual-image-contain { background: #e9edf2; }
.visual-image-contain img { object-fit: contain; }
.visual-status { position: absolute; top: .65rem; left: .65rem; padding: .3rem .55rem; border-radius: 4px; background: #fff; color: #315c45; font-size: .65rem; font-weight: 800; box-shadow: 0 2px 8px #1c2e2a1a; }
.visual-symbol { position: absolute; top: 23%; left: 31%; width: 38%; height: 49%; border-radius: 7px; background: #ffffffad; }
.visual-symbol::before { content: ''; position: absolute; top: 17%; right: 16%; width: 15%; aspect-ratio: 1; border-radius: 50%; background: #92aea0; }
.visual-symbol::after { content: ''; position: absolute; left: 15%; bottom: 20%; width: 62%; height: 35%; border-left: 5px solid #92aea0; border-bottom: 5px solid #92aea0; transform: skew(-22deg); opacity: .8; }
.visual-label { position: absolute; bottom: .65rem; left: 50%; color: #5c7669; font-size: .68rem; font-weight: 700; transform: translateX(-50%); white-space: nowrap; }
.card-content { display: flex; flex: 1; flex-direction: column; gap: .32rem; min-height: 104px; padding: 1rem 1rem .9rem; }
.card-tag { color: var(--accent); font-size: .68rem; font-weight: 800; letter-spacing: .06em; }
.card-title { padding-right: .9rem; font-size: 1rem; line-height: 1.42; }
.card-summary { color: var(--muted); font-size: .73rem; line-height: 1.55; }
.card-zoom-button { position: absolute; top: .7rem; right: .7rem; z-index: 2; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.35); color: #273640; box-shadow: 0 2px 8px rgba(15,23,42,.1); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); cursor: pointer; transition: background-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.card-zoom-button:hover { transform: translateY(-1px); background: rgba(255,255,255,.58); box-shadow: 0 4px 11px rgba(15,23,42,.15); }
.card-zoom-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-zoom-button svg { display: block; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.35; }
.card-public-link { display: flex; align-items: center; gap: .35rem; min-height: 2.3rem; margin-top: auto; padding: .45rem 1rem; border-top: 1px solid #e9eee9; background: #f8faf8; color: var(--accent); font-size: .72rem; font-weight: 700; text-decoration: none; }
.card-public-link:hover { background: #edf4ee; }
.public-link-host { overflow: hidden; color: inherit; text-overflow: ellipsis; white-space: nowrap; }
.public-link-icon { flex: none; width: .85rem; height: .85rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.4; }
.hardware-section { padding-block: 3.5rem 5rem; background: var(--hardware); scroll-margin-top: 1rem; }
.hardware-section .section-head { border-color: #cbd6ce; }
.site-footer { display: flex; justify-content: space-between; gap: 1rem; padding-block: 2rem; color: var(--muted); font-size: .72rem; }

.project-dialog { position: fixed; inset: 0; width: min(1040px, calc(100vw - 2rem)); max-width: none; max-height: min(88vh, 850px); margin: auto; padding: 0; overflow: auto; border: 0; border-radius: 12px; background: #fff; color: var(--ink); box-shadow: 0 25px 80px #10231c55; }
.project-dialog::backdrop { background: #132a20b5; }
.project-dialog[open] { animation: show-dialog .23s ease both; }
.project-dialog[open]::backdrop { animation: show-backdrop .23s ease both; }
.dialog-close { position: sticky; top: 1rem; left: calc(100% - 3.7rem); z-index: 2; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; margin: 1rem 1rem -3.6rem auto; border: 0; border-radius: 50%; background: #fff; color: var(--ink); box-shadow: 0 3px 15px #1c2e2a30; cursor: pointer; font-size: 1.5rem; }
.dialog-close:hover { background: #edf4ee; }
.detail-layout { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 570px; }
.visual-large { min-height: 570px; aspect-ratio: auto; }
.visual-large.visual-image-contain { display: grid; place-items: center; }
.visual-large.visual-image-contain img { height: auto; max-height: 100%; object-fit: contain; }
.visual-large .visual-symbol { top: 31%; left: 26%; width: 48%; height: 34%; }
.visual-large .visual-label { bottom: 18%; font-size: .9rem; }
.detail-copy { padding: clamp(2.3rem, 5vw, 4.8rem) clamp(1.6rem, 4vw, 4rem); }
.detail-tag { margin: 0; color: var(--accent); font-size: .75rem; font-weight: 800; letter-spacing: .07em; }
.detail-copy h2 { margin: .7rem 0 1rem; font-size: clamp(1.7rem, 2.8vw, 2.8rem); line-height: 1.35; letter-spacing: -.05em; }
.detail-lead { margin: 0 0 2rem; font-size: .95rem; }
.detail-description { margin: -1rem 0 1.5rem; color: var(--ink); font-size: .86rem; line-height: 1.8; }
.detail-section { margin-top: 1.35rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.detail-section h3 { margin: 0 0 .55rem; color: var(--accent); font-size: .82rem; }
.detail-list { display: grid; gap: .35rem; margin: 0; padding-left: 1.2rem; font-size: .8rem; line-height: 1.75; }
.detail-section > p { margin: 0; font-size: .8rem; line-height: 1.8; }
.detail-use-case { padding-left: .9rem; border-left: 2px solid var(--accent); border-top: 0; }
.detail-notice { margin: 1.7rem 0 0; padding: .85rem 1rem; border-radius: 6px; background: #eef3ec; color: #315c45; font-size: .82rem; font-weight: 700; }
.public-link { display: inline-flex; align-items: center; gap: .35rem; margin-top: 1.2rem; padding: .75rem .9rem; border: 1px solid #dce7dc; border-radius: 6px; background: #f7faf7; color: var(--accent); font-size: .83rem; font-weight: 800; text-decoration: none; }
.public-link:hover { border-color: var(--accent); background: #eef5ef; }
@keyframes show-dialog { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes show-backdrop { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 1160px) {
  .project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-header { display: block; }
  .site-header nav { margin-top: 1rem; overflow-x: auto; padding-bottom: .2rem; }
}
@media (max-width: 810px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-layout { grid-template-columns: 1fr; }
  .visual-large { min-height: 0; height: 310px; }
}
@media (max-width: 520px) {
  .page-shell { width: min(100% - 2rem, 1360px); }
  .hero { padding-block: 3rem; }
  .project-grid { grid-template-columns: 1fr; }
  .card-content { min-height: 0; }
  .hardware-section { padding-block: 2.8rem 3.5rem; }
  .visual-large { height: 240px; }
  .detail-description { margin-top: -1rem; }
  .site-footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .project-card, .card-zoom-button, .project-dialog[open], .project-dialog[open]::backdrop { animation: none; transition: none; }
}
