:root {
  --blue: #165dff;
  --blue-dark: #0a2a78;
  --blue-soft: #eaf0ff;
  --black: #080b11;
  --ink: #121722;
  --muted: #687082;
  --line: #dce2ec;
  --white: #fff;
  --max: 1440px;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}
body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  font-family: "Inter", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.65;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  display: block;
  width: 100%;
  height: auto;
}
button {
  font: inherit;
}

.site-header {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 64px), var(--max));
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  display: flex;
  align-items: baseline;
  gap: 12px;
  letter-spacing: 0.02em;
}
.site-logo strong {
  font-size: 17px;
  letter-spacing: 0.075em;
}
.site-logo span {
  font-size: 11px;
  color: var(--blue);
}
.global-nav {
  display: flex;
  gap: 30px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.global-nav a {
  position: relative;
  padding: 10px 0;
}
.global-nav a:after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 3px;
  width: 0;
  height: 2px;
  background: var(--blue);
  transition: 0.25s;
}
.global-nav a:hover:after {
  width: 100%;
}

.hero {
  position: relative;
  height: 610px;
  display: grid;
  grid-template-columns: minmax(0, 43%) minmax(0, 57%);
  overflow: hidden;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.hero-copy {
  min-width: 0;
  padding: 125px clamp(28px, 4vw, 62px) 72px max(4.5vw, calc((100vw - var(--max)) / 2 + 20px));
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero h1 {
  margin: 0;
  font-size: clamp(34px, 3.85vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.045em;
  white-space: nowrap;
}
.hero h1 small {
  display: block;
  margin-top: 12px;
  font-size: 0.55em;
  line-height: 1.3;
  letter-spacing: -0.025em;
  color: var(--ink);
  white-space: normal;
}
.hero h1 span {
  color: var(--blue);
}
.hero-lead {
  margin: 25px 0 30px;
  max-width: 520px;
  font-size: clamp(12px, 1.05vw, 15px);
  font-weight: 600;
  line-height: 1.8;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  width: max-content;
  min-width: 188px;
  padding: 13px 17px;
  border: 1px solid currentColor;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.button-outline {
  background: #fff;
  color: var(--blue);
  border-color: var(--blue);
}

/* 写真の左端は、上から下まで一直線の斜め。白い突起・切り欠きは作らない */
.hero-visual {
  min-width: 0;
  position: relative;
  height: 100%;
  background: var(--black);
  overflow: hidden;
  clip-path: polygon(15% 0, 100% 0, 100% 100%, 0 100%);
}
.hero-visual::before {
  content: "";
  position: absolute;
  z-index: 3;
  left: 2.6%;
  top: -8%;
  width: 13.5%;
  height: 118%;
  background: linear-gradient(180deg, #347eff 0%, #165dff 52%, #0a2a78 100%);
  transform: skewX(-15deg);
  transform-origin: center;
  opacity: 0.98;
  pointer-events: none;
}
.hero-visual::after {
  content: "";
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  width: 220px;
  height: 150px;
  background-image: radial-gradient(circle, var(--blue) 1.15px, transparent 1.3px);
  background-size: 11px 11px;
  opacity: 0.6;
  pointer-events: none;
}
.hero-visual > img {
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: grayscale(1) contrast(1.08) brightness(0.62);
}
.hero-topics {
  position: absolute;
  z-index: 4;
  right: 6%;
  top: 42%;
  color: #fff;
}
.hero-topics p {
  margin: 0;
  color: #4a83ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.hero-topics ul {
  list-style: none;
  padding: 0;
  margin: 13px 0;
}
.hero-topics li {
  position: relative;
  padding: 5px 0 5px 18px;
  font-size: 14px;
  font-weight: 600;
}
.hero-topics li:before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--blue);
}
.scroll-guide {
  position: absolute;
  z-index: 5;
  left: 18px;
  bottom: 23px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  writing-mode: vertical-rl;
}
.scroll-guide i {
  display: block;
  width: 1px;
  height: 54px;
  background: #10151f;
  position: relative;
}
.scroll-guide i:after {
  content: "";
  position: absolute;
  left: -2px;
  bottom: 0;
  width: 5px;
  height: 5px;
  background: var(--blue);
  border-radius: 50%;
}

.works {
  position: relative;
  padding: 23px max(4.5vw, calc((100vw - var(--max)) / 2 + 22px)) 52px;
}
.works:after {
  content: "";
  position: absolute;
  right: 0;
  top: 118px;
  width: 125px;
  height: 220px;
  background-image: radial-gradient(circle, #8eb0ff 1px, transparent 1.2px);
  background-size: 10px 10px;
  opacity: 0.32;
  pointer-events: none;
}
.section-heading {
  display: block;
  margin: 0 0 14px;
}
.section-heading p {
  margin: 0;
  color: #111;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.section-heading h2 {
  display: none;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 20px;
  width: 100%;
}
.filter-button {
  flex: 1 1 0;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: 0.22s;
}
.filter-button:hover,
.filter-button.is-active {
  background: linear-gradient(135deg, var(--blue), #143da7);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 7px 16px rgba(22, 93, 255, 0.14);
}
.work-group {
  margin: 0 0 38px;
}
.group-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 13px;
}
.group-title h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.group-title p {
  margin: 0;
  padding-left: 10px;
  border-left: 1px solid #aab3c3;
  color: var(--blue);
  font-size: 9px;
  font-weight: 700;
}
.work-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}
.work-card,
.case-card {
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 5px 18px rgba(13, 24, 45, 0.035);
  transition:
    transform 0.25s,
    box-shadow 0.25s,
    opacity 0.2s;
}
.work-card:hover,
.case-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 34px rgba(13, 24, 45, 0.09);
}
.work-card.is-hidden,
.case-card.is-hidden {
  display: none;
}
.work-image {
  display: block;
  overflow: hidden;
  background: #f4f5f8;
  aspect-ratio: 1.55;
}
.work-image img {
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s;
}
.work-card:hover .work-image img {
  transform: scale(1.035);
}
.work-body {
  position: relative;
  padding: 12px 12px 15px;
  min-height: 132px;
}
.work-number {
  font-size: 15px;
  color: var(--blue);
  font-weight: 700;
  letter-spacing: 0.16em;
  margin: 0 0 4px;
}
.work-body h4,
.case-card h4 {
  margin: 0 0 5px;
  font-size: 14px;
  line-height: 1.4;
}
.work-body > p:not(.work-number),
.case-card > p:not(.work-number) {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 11px;
}
.tags span {
  border: 1px solid var(--line);
  padding: 3px 5px;
  font-size: 7px;
  line-height: 1.15;
  background: #fff;
}

.work-grid--case {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.case-card {
  position: relative;
  min-height: 215px;
  padding: 18px 15px 35px;
}
.case-icon {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(22, 93, 255, 0.35);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--blue);
  font-size: 16px;
  margin-bottom: 15px;
  background: var(--blue-soft);
}
.case-card > a {
  position: absolute;
  right: 14px;
  bottom: 10px;
  font-size: 16px;
}

.about {
  display: grid;
  grid-template-columns: 165px minmax(220px, 340px) 1fr;
  gap: 34px;
  padding: 34px max(4.5vw, calc((100vw - var(--max)) / 2 + 22px));
  color: #fff;
  background: linear-gradient(105deg, #05080e 0%, #071327 46%, #0e2e8a 80%, #155dff 100%);
  position: relative;
  overflow: hidden;
}
.about:before {
  content: "";
  position: absolute;
  left: 25%;
  top: -30%;
  width: 75px;
  height: 170%;
  background: linear-gradient(180deg, rgba(22, 93, 255, 0.95), rgba(22, 93, 255, 0.05));
  transform: skewX(-13deg);
  opacity: 0.9;
}
.about:after {
  content: "";
  position: absolute;
  left: 42%;
  top: -30%;
  width: 24px;
  height: 170%;
  background: rgba(75, 128, 255, 0.28);
  transform: skewX(-13deg);
}
.about-photo,
.about-copy,
.toolbox {
  position: relative;
  z-index: 2;
}
.about-photo img {
  aspect-ratio: 4/5;
  object-fit: cover;
  filter: grayscale(1);
}
.section-label {
  margin: 0 0 7px;
  font-size: 9px;
  color: #7ea6ff;
  font-weight: 700;
  letter-spacing: 0.13em;
}
.about-copy h2 {
  font-size: 18px;
  margin: 3px 0 9px;
}
.about-copy p:last-child {
  font-size: 9px;
  color: #d7deea;
  line-height: 1.8;
}
.tool-columns {
  display: grid;
  grid-template-columns: repeat(5, minmax(78px, 1fr));
  gap: 11px;
}
.tool-columns div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 1px solid rgba(255, 255, 255, 0.24);
  padding-left: 10px;
}
.tool-columns strong {
  font-size: 8px;
  color: #fff;
  letter-spacing: 0.08em;
}
.tool-columns span {
  font-size: 8px;
  color: #d5dff5;
}
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px max(4.5vw, calc((100vw - var(--max)) / 2 + 22px));
  background: #030509;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.08em;
}
.site-footer a {
  color: #6e9cff;
}

@media (max-width: 1100px) {
  .hero {
    height: 560px;
    grid-template-columns: minmax(0, 47%) minmax(0, 53%);
  }
  .hero-topics {
    display: none;
  }
  .work-grid,
  .work-grid--case {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .about {
    grid-template-columns: 150px 1fr;
  }
  .toolbox {
    grid-column: 1/-1;
  }
  .tool-columns {
    grid-template-columns: repeat(5, 1fr);
  }
}
@media (max-width: 760px) {
  .site-header {
    position: fixed;
    width: 100%;
    height: 62px;
    padding: 0 17px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .site-logo span {
    display: none;
  }
  .global-nav {
    gap: 17px;
  }
  .hero {
    display: block;
    height: auto;
    padding-top: 62px;
  }
  .hero-copy {
    padding: 60px 23px 54px;
  }
  .hero h1 {
    font-size: clamp(35px, 10vw, 46px);
    white-space: normal;
  }
  .hero-visual {
    height: 340px;
    clip-path: polygon(0 12%, 100% 0, 100% 100%, 0 100%);
  }
  .hero-visual::before {
    left: 9%;
    width: 7%;
  }
  .scroll-guide {
    display: none;
  }
  .works {
    padding: 23px 18px 48px;
  }
  .filters {
    gap: 7px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-left: -18px;
    margin-right: -18px;
    padding: 0 18px 4px;
  }
  .filters::-webkit-scrollbar {
    display: none;
  }
  .filter-button {
    flex: 0 0 auto;
    min-width: 78px;
    padding: 9px 14px;
    font-size: 9px;
  }
  .group-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .group-title p {
    border-left: 0;
    padding-left: 0;
  }
  .work-grid,
  .work-grid--case {
    grid-template-columns: 1fr;
  }
  .about {
    grid-template-columns: 1fr;
    padding: 34px 22px;
  }
  .about-photo {
    max-width: 180px;
  }
  .about:before,
  .about:after {
    display: none;
  }
  .tool-columns {
    grid-template-columns: repeat(2, 1fr);
  }
  .site-footer {
    padding: 13px 18px;
  }
}

/* ===== Mobile layout fix ===== */
@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .site-header {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 100%;
    height: 58px;
    padding: 0 16px;
    background: #fff;
    border-bottom: 1px solid var(--line);
  }
  .site-logo {
    gap: 7px;
    min-width: 0;
  }
  .site-logo strong {
    font-size: 13px;
    letter-spacing: 0.055em;
    white-space: nowrap;
  }
  .site-logo span {
    display: inline;
    font-size: 8px;
    white-space: nowrap;
  }
  .global-nav {
    gap: 15px;
    font-size: 8px;
    flex-shrink: 0;
  }

  .hero {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    padding: 0;
    border-bottom: 0;
  }
  .hero-copy {
    order: 1;
    width: 100%;
    padding: 48px 22px 10px;
    display: block;
  }
  .hero h1 {
    max-width: 100%;
    font-size: clamp(34px, 10.5vw, 45px);
    line-height: 1.08;
    white-space: normal;
  }
  .hero h1 small {
    margin-top: 10px;
    font-size: 0.53em;
  }
  .hero-lead {
    margin: 22px 0 26px;
    max-width: 100%;
    font-size: 12px;
    line-height: 1.8;
  }
  .hero-lead br {
    display: none;
  }
  .button {
    min-width: 176px;
    padding: 12px 15px;
    font-size: 9px;
  }

  .hero-visual {
    order: 2;
    width: 100%;
    height: 270px;
    min-height: 0;
    clip-path: none;
  }
  .hero-visual::before {
    left: -4%;
    top: -8%;
    width: 15%;
    height: 120%;
    transform: skewX(-15deg);
  }
  .hero-visual::after {
    width: 135px;
    height: 105px;
    background-size: 9px 9px;
  }
  .hero-visual > img {
    object-position: center 42%;
  }
  .hero-topics {
    display: block;
    right: 18px;
    top: auto;
    bottom: 17px;
  }
  .hero-topics p {
    font-size: 7px;
  }
  .hero-topics ul {
    margin-top: 7px;
  }
  .hero-topics li {
    padding: 2px 0 2px 13px;
    font-size: 8px;
  }
  .hero-topics li::before {
    top: 8px;
    width: 3px;
    height: 3px;
  }
  .scroll-guide {
    display: none;
  }

  .works {
    padding: 16px 16px 44px;
  }
  .works::after {
    display: none;
  }
  .filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
    margin: 0 -16px 24px;
    padding: 0 16px 7px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .filters::-webkit-scrollbar {
    display: none;
  }
  .filter-button {
    flex: 0 0 auto;
    min-width: 82px;
    padding: 9px 12px;
    font-size: 8px;
  }
  .section-heading {
    margin-bottom: 12px;
  }
  .section-heading p {
    font-size: 15px;
  }
  .work-group {
    margin-bottom: 38px;
  }
  .group-title {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 9px;
    margin-bottom: 13px;
  }
  .group-title h3 {
    font-size: 16px;
  }
  .group-title p {
    padding-left: 9px;
    border-left: 1px solid #aab3c3;
    font-size: 8px;
  }
  .work-grid,
  .work-grid--case {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .work-card,
  .case-card {
    width: 100%;
  }
  .work-image {
    aspect-ratio: 16 / 9;
  }
  .work-body {
    min-height: 128px;
    padding: 14px 14px 16px;
  }
  .work-body h4,
  .case-card h4 {
    font-size: 14px;
  }
  .work-body > p:not(.work-number),
  .case-card > p:not(.work-number) {
    font-size: 10px;
  }
  .tags span {
    font-size: 8px;
  }
  .case-card {
    min-height: 0;
    padding: 18px 16px 42px;
  }

  .about {
    grid-template-columns: 92px 1fr;
    gap: 18px;
    padding: 30px 18px;
  }
  .about-photo {
    max-width: none;
  }
  .about-photo img {
    aspect-ratio: 1 / 1.18;
  }
  .about-copy h2 {
    font-size: 16px;
  }
  .about-copy p:last-child {
    font-size: 9px;
  }
  .toolbox {
    grid-column: 1 / -1;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }
  .tool-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 10px;
  }
  .tool-columns div {
    min-width: 0;
  }
  .tool-columns strong,
  .tool-columns span {
    font-size: 8px;
  }

  .site-footer {
    padding: 12px 16px;
  }
}

@media (max-width: 390px) {
  .site-logo strong {
    font-size: 12px;
  }
  .site-logo span {
    font-size: 7px;
  }
  .global-nav {
    gap: 11px;
    font-size: 7px;
  }
  .hero-copy {
    padding-left: 18px;
    padding-right: 18px;
  }
  .hero h1 {
    font-size: 34px;
  }
  .about {
    grid-template-columns: 78px 1fr;
    gap: 14px;
  }
}

.site-logo img {
  display: block;
  width: 330px;
  height: auto;
}

@media screen and (max-width: 768px) {
  .site-logo img {
    width: 220px;
  }
}
@media (max-width: 760px) {
  .filters {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 8px;
    overflow: visible;
    margin-bottom: 36px;
  }

  .filter-button {
    flex: 0 0 auto;
    min-width: 0;
    padding: 10px 12px;
    font-size: 10px;
    white-space: nowrap;
  }
}

/* ===== Work modal ===== */
.work-card,
.case-card {
  cursor: pointer;
}
.work-card:focus-visible,
.case-card:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.work-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  transition:
    opacity 0.22s ease,
    visibility 0.22s ease;
}
.work-modal.is-open {
  visibility: visible;
  opacity: 1;
}
.work-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 9, 0.72);
  backdrop-filter: blur(5px);
}
.work-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  overflow-y: auto;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}
.work-modal__close {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(8, 11, 17, 0.88);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.work-modal__image-wrap {
  display: block;
  aspect-ratio: 16/8.5;
  overflow: hidden;
  background: #eef1f6;
}
.work-modal__image-wrap.is-hidden {
  display: none;
}
.work-modal__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.work-modal__content {
  padding: 30px 34px 34px;
}
.work-modal__type {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.work-modal__title {
  margin: 0 0 17px;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.25;
}
.work-modal__detail {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}
.work-modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 22px;
}
.work-modal__tags span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 9px;
}
.work-modal__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 27px;
}
.work-modal__link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-width: 160px;
  padding: 12px 15px;
  border: 1px solid var(--blue);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
}
.work-modal__link:hover {
  background: var(--blue);
  color: #fff;
}
body.modal-open {
  overflow: hidden;
}
@media (max-width: 760px) {
  .work-modal {
    align-items: end;
    padding: 0;
  }
  .work-modal__dialog {
    width: 100%;
    max-height: 88vh;
    border-radius: 18px 18px 0 0;
  }
  .work-modal__image-wrap {
    aspect-ratio: 16/10;
  }
  .work-modal__content {
    padding: 24px 20px 28px;
  }
  .work-modal__title {
    font-size: 24px;
  }
  .work-modal__links {
    flex-direction: column;
  }
  .work-modal__link {
    width: 100%;
  }
}

/* =========================
   モーダル内ギャラリー
========================= */

.modal-gallery {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.modal-gallery-item {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid #dddddd;
  border-radius: 10px;
  background: transparent;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    opacity 0.2s ease;
}

.modal-gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.modal-gallery-item:hover {
  transform: translateY(-2px);
}

.modal-gallery-item.is-active {
  border-color: #222222;
}

.modal-gallery-item:focus-visible {
  outline: 2px solid #222222;
  outline-offset: 3px;
}

/* モーダルのメイン画像 */
#work-modal-image-wrap img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 65vh;
  object-fit: contain;
}

/* タブレット */
@media screen and (max-width: 768px) {
  .modal-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 20px;
  }
}

/* スマホ */
@media screen and (max-width: 480px) {
  .modal-gallery {
    grid-template-columns: 1fr;
  }
}

/* スマホ版：WORKSを タイトル → 写真 → 説明 の順にする */
@media (max-width: 760px) {
  .work-card {
    display: grid;
    grid-template-columns: 1fr;
  }

  /* work-bodyの中身を個別に並べ替えられるようにする */
  .work-card .work-body {
    display: contents;
  }

  .work-card .work-number {
    order: 1;
    margin: 14px 14px 3px;
  }

  .work-card .work-body h4 {
    order: 2;
    margin: 0 14px 12px;
    font-size: 14px;
    line-height: 1.5;
  }

  .work-card .work-image {
    order: 3;
  }

  .work-card .work-body > p:not(.work-number) {
    order: 4;
    margin: 14px 14px 0;
    font-size: 10px;
  }

  .work-card .tags {
    order: 5;
    margin: 11px 14px 16px;
  }
}

@media (max-width: 760px) {
  .work-modal__dialog {
    border-radius: 0;
  }
}
