/* Shared frame dimensions for the fixed logo rail, menu button, and project grid. */
:root {
  --rail-width: 100px;
  --project-side-space: 100px;
  --project-grid-gap-x: 15px;
  --project-grid-gap-y: 54px;
  --project-image-ratio: 3 / 2;
}

html {
  overflow-y: scroll;
}

body {
  overflow-x: hidden;
}

.brand-rail {
  top: 0;
  left: 0;
  width: var(--rail-width);
  height: 100vh;
  padding-top: 42px;
  justify-content: center;
  background: #ffffff;
}

.brand-logo {
  width: auto;
  height: 336px;
}

.brand-logo-picture {
  display: block;
}

.menu-button {
  top: 42px;
  right: 38px;
  width: 32px;
  height: 18px;
}

.hero {
  margin-left: var(--rail-width);
}

.page-title,
.section-title {
  letter-spacing: 0.005em;
}

.about .section-text,
.contact-cta .section-text,
.about-copy,
.service-list,
.process-list {
  font-size: 12pt;
  letter-spacing: 0.1em;
}

.page-message {
  font-size: 12pt;
  letter-spacing: 0.07em;
}

.works {
  width: calc(100% - (var(--project-side-space) * 2));
}

.works-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--project-grid-gap-x);
  row-gap: var(--project-grid-gap-y);
}

.work-image {
  aspect-ratio: var(--project-image-ratio);
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "nav actions"
    "copyright copyright";
  align-items: center;
  min-height: 178px;
  padding: 34px var(--project-side-space) 30px;
  row-gap: 52px;
  column-gap: 32px;
}

.site-footer::before {
  left: 50%;
  width: calc(100% - (var(--project-side-space) * 2));
  transform: translateX(-50%);
}

.footer-nav {
  grid-area: nav;
  display: flex;
  align-items: center;
  gap: 36px;
  font-family: var(--font-display, "FOT-TsukuGo Pro", "TsukuGo Pro", "Noto Sans JP", sans-serif);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.footer-nav a {
  position: relative;
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  color: rgba(62, 58, 57, 0.62);
  transition: color 300ms ease;
}

.footer-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1.5px;
  background: currentColor;
  opacity: 0;
  transition: opacity 300ms ease;
}

.footer-nav a:hover,
.footer-nav a[aria-current="page"] {
  color: var(--color-text, #3e3a39);
}

.footer-nav a:hover::after,
.footer-nav a[aria-current="page"]::after {
  opacity: 1;
}

.footer-actions {
  grid-area: actions;
  justify-self: end;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 24px;
  row-gap: 10px;
}

.site-footer .social {
  grid-column: 1;
  justify-self: auto;
}

.footer-privacy-link {
  position: absolute;
  right: var(--project-side-space);
  bottom: 65px;
  color: rgba(62, 58, 57, 0.62);
  font-family: var(--font-display, "FOT-TsukuGo Pro", "TsukuGo Pro", "Noto Sans JP", sans-serif);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.04em;
  transition: color 300ms ease;
}

.footer-privacy-link:hover,
.footer-privacy-link[aria-current="page"] {
  color: var(--color-text, #3e3a39);
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  color: var(--color-text, #3e3a39);
  font-family: var(--font-display, "FOT-TsukuGo Pro", "TsukuGo Pro", "Noto Sans JP", sans-serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  transition: transform 260ms ease, opacity 260ms ease;
}

.back-to-top:hover {
  transform: translateY(-7px);
}

.site-footer .copyright {
  grid-area: copyright;
  grid-column: auto;
  position: absolute;
  left: 50%;
  bottom: 30px;
  justify-self: center;
  margin: 0;
  text-align: center;
  transform: translateX(-50%);
}

@media (max-width: 900px) {
  :root {
    --rail-width: 72px;
  }

  .brand-logo {
    height: 300px;
  }

  .works {
    width: min(100% - 56px, 1080px);
  }

  .works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .site-footer {
    grid-template-columns: 1fr;
    grid-template-areas:
      "nav"
      "actions"
      "copyright";
    justify-items: center;
    padding-right: 28px;
    padding-left: 28px;
    row-gap: 28px;
  }

  .site-footer::before {
    width: calc(100% - 56px);
  }

  .footer-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px 26px;
    font-size: 13px;
  }

  .footer-actions {
    justify-self: center;
    justify-items: center;
  }

  .footer-privacy-link {
    position: static;
    grid-column: 1 / -1;
    justify-self: center;
  }
}

@media (max-width: 600px) {
  :root {
    --rail-width: 0px;
  }

  .brand-rail {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 70px !important;
    box-sizing: border-box !important;
    padding: 0 22px !important;
    background: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    overflow: visible !important;
  }

  .brand-rail a,
  .brand-logo-picture {
    display: block !important;
    width: min(280px, 72vw) !important;
    height: auto !important;
    line-height: 0 !important;
  }

  .brand-logo {
    display: block !important;
    width: min(280px, 72vw) !important;
    max-width: min(280px, 72vw) !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
  }

  .menu-button {
    position: fixed !important;
    top: 26px !important;
    right: 24px !important;
    width: 30px !important;
    height: 18px !important;
    z-index: 60 !important;
  }

  .menu-line {
    width: 30px !important;
    height: 2px !important;
  }

  .menu-line:nth-child(1) {
    top: 0;
  }

  .menu-line:nth-child(2) {
    top: 8px;
  }

  .menu-line:nth-child(3) {
    top: 16px;
  }

  body.is-menu-open .menu-line:nth-child(1) {
    transform: translateY(8px) rotate(38deg) !important;
  }

  body.is-menu-open .menu-line:nth-child(2) {
    opacity: 0 !important;
  }

  body.is-menu-open .menu-line:nth-child(3) {
    transform: translateY(-8px) rotate(-38deg) !important;
  }

  body:not(.is-menu-open) .menu-button:hover .menu-line:nth-child(1) {
    transform: none !important;
  }

  body:not(.is-menu-open) .menu-button:hover .menu-line:nth-child(2) {
    opacity: 1 !important;
  }

  body:not(.is-menu-open) .menu-button:hover .menu-line:nth-child(3) {
    transform: none !important;
  }

  body.is-menu-open:not(.is-menu-transitioning) .menu-button:hover .menu-line:nth-child(1) {
    transform: translateY(8px) rotate(38deg) !important;
  }

  body.is-menu-open:not(.is-menu-transitioning) .menu-button:hover .menu-line:nth-child(3) {
    transform: translateY(-8px) rotate(-38deg) !important;
  }

  .hero {
    margin-left: 0 !important;
  }

  .page {
    margin-left: 0 !important;
    padding-top: 80px !important;
  }

  .page-title {
    max-width: calc(100% - 40px);
    margin-right: auto;
    margin-left: auto;
    overflow: visible;
  }

  .works {
    width: min(100% - 40px, 1080px);
  }

  .works-grid {
    grid-template-columns: 1fr;
    row-gap: 42px;
    column-gap: 0;
  }

  .site-footer::before {
    width: calc(100% - 40px);
  }

  .footer-nav {
    justify-content: center;
    gap: 14px 20px;
    font-size: 12px;
  }

  .site-footer {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "nav"
      "privacy"
      "copyright";
    justify-items: center;
    min-height: 0;
    padding: 34px 20px 38px;
    row-gap: 18px;
    column-gap: 0;
    text-align: center;
  }

  .footer-actions {
    display: none !important;
  }

  .site-footer .copyright {
    position: static;
    grid-area: copyright;
    grid-column: auto;
    left: auto;
    bottom: auto;
    transform: none;
    font-family: "Helvetica Neue", Arial, sans-serif !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    letter-spacing: 0.06em !important;
  }

  .footer-privacy-link {
    position: static;
    grid-area: privacy;
    grid-column: auto;
    justify-self: center;
  }
}

@media (hover: none) and (pointer: coarse) and (max-width: 600px) {
  :root {
    --rail-width: 0px;
  }

  .brand-rail {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 70px !important;
    box-sizing: border-box !important;
    padding: 0 22px !important;
    background: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    overflow: visible !important;
  }

  .brand-rail a,
  .brand-logo-picture,
  .brand-logo {
    display: block !important;
    width: min(280px, 72vw) !important;
    max-width: min(280px, 72vw) !important;
    height: auto !important;
    max-height: none !important;
    line-height: 0 !important;
    object-fit: contain !important;
  }

  .menu-button {
    position: fixed !important;
    top: 26px !important;
    right: 24px !important;
    width: 30px !important;
    height: 18px !important;
    z-index: 60 !important;
  }

  .menu-line {
    width: 30px !important;
    height: 2px !important;
  }

  .menu-line:nth-child(1) {
    top: 0;
  }

  .menu-line:nth-child(2) {
    top: 8px;
  }

  .menu-line:nth-child(3) {
    top: 16px;
  }

  body.is-menu-open .menu-line:nth-child(1),
  body.is-menu-open:not(.is-menu-transitioning) .menu-button:hover .menu-line:nth-child(1) {
    transform: translateY(8px) rotate(38deg) !important;
  }

  body.is-menu-open .menu-line:nth-child(2),
  body.is-menu-open .menu-button:hover .menu-line:nth-child(2) {
    opacity: 0 !important;
  }

  body.is-menu-open .menu-line:nth-child(3),
  body.is-menu-open:not(.is-menu-transitioning) .menu-button:hover .menu-line:nth-child(3) {
    transform: translateY(-8px) rotate(-38deg) !important;
  }

  body:not(.is-menu-open) .menu-line:nth-child(1),
  body:not(.is-menu-open) .menu-button:hover .menu-line:nth-child(1),
  body:not(.is-menu-open) .menu-line:nth-child(3),
  body:not(.is-menu-open) .menu-button:hover .menu-line:nth-child(3) {
    transform: none !important;
  }

  body:not(.is-menu-open) .menu-line:nth-child(2),
  body:not(.is-menu-open) .menu-button:hover .menu-line:nth-child(2) {
    opacity: 1 !important;
  }

  .hero {
    margin-left: 0 !important;
  }

  .page {
    margin-left: 0 !important;
  }
}
