/* ================================================
   GRATCRAFT — Stylesheet
   ================================================ */

:root {
  --bg:         #030303;
  --text:       #e8e8e8;
  --text-muted: #585858;
  --border:     rgba(255, 255, 255, 0.09);
  --t:          0.3s ease;
  --font-en:    'Montserrat', sans-serif;
  --font-jp:    'Noto Sans JP', sans-serif;
  --max-w:      1100px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-jp);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 48px;
}


/* ================================================
   Diagonal decoration lines
   ================================================ */
.deco-lines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.deco-line {
  position: absolute;
  width: 1px;
  height: 300vh;
  top: -100vh;
  transform-origin: center center;
}
.deco-line-1 {
  left: 54%;
  background: rgba(255, 255, 255, 0.055);
  transform: rotate(25deg);
}
.deco-line-2 {
  left: calc(54% + 20px);
  background: rgba(255, 255, 255, 0.033);
  transform: rotate(25deg);
}
.deco-line-3 {
  left: calc(54% + 40px);
  background: rgba(255, 255, 255, 0.018);
  transform: rotate(25deg);
}


/* ================================================
   Navigation
   ================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 28px 0;
  transition: background var(--t), padding var(--t);
}
.nav.scrolled {
  background: rgba(3, 3, 3, 0.93);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 18px 0;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 48px;
}
.nav-logo {
  display: block;
  line-height: 0;
  position: relative;
  z-index: 1001;
}
.nav-logo img {
  height: 40px;
  width: auto;
  opacity: 0.9;
  transition: opacity var(--t);
}
.nav-logo img:hover { opacity: 1; }
.nav.scrolled .nav-logo img { height: 32px; }
.nav-menu {
  display: flex;
  align-items: center;
  gap: 40px;
}
.nav-menu a {
  font-family: var(--font-en);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.45;
  transition: opacity var(--t);
}
.nav-menu a:hover,
.nav-menu a.active { opacity: 1; }
.nav-cta {
  opacity: 1 !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  padding: 8px 20px !important;
  transition: background var(--t), color var(--t) !important;
}
.nav-cta:hover {
  background: #fff !important;
  color: #000 !important;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 32px; height: 32px;
  background: none; border: none;
  cursor: pointer;
  z-index: 1001;
  position: relative;
}
.nav-toggle span {
  display: block;
  width: 100%; height: 1px;
  background: var(--text);
  transition: var(--t);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ================================================
   Buttons
   ================================================ */
.btn {
  display: inline-block;
  font-family: var(--font-en);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 14px 36px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--text);
  transition: var(--t);
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover {
  background: #fff;
  border-color: #fff;
  color: #000;
}
.btn-primary {
  background: #fff;
  border-color: #fff;
  color: #000;
}
.btn-primary:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.85);
}
.btn-lg { padding: 18px 52px; font-size: 0.75rem; }


/* ================================================
   Section band (white bar)
   ================================================ */
.section-band {
  background: #fff;
  color: #000;
  text-align: center;
  padding: 20px 48px;
  position: relative;
  z-index: 1;
}
.section-band-title {
  font-family: var(--font-en);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.55em;
  text-transform: uppercase;
}

/* Page top spacer (inner pages — below fixed nav) */
.page-top {
  height: 110px;
  position: relative;
  z-index: 1;
}


/* ================================================
   Section with background image (JS付与クラス)
   ================================================ */
.has-bg-image {
  position: relative;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}
.has-bg-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 3, 0.52);
  z-index: 0;
  pointer-events: none;
}
.has-bg-image > * {
  position: relative;
  z-index: 1;
}

/* 背景画像セクション内の文字を白く */
.has-bg-image .service-name,
.has-bg-image .service-section-title,
.has-bg-image .contact-title,
.has-bg-image .contact-title-jp,
.has-bg-image .work-title,
.has-bg-image .work-card-title,
.has-bg-image .about-message-text,
.has-bg-image .company-table td,
.has-bg-image .company-table th,
.has-bg-image h2, .has-bg-image h3 {
  color: #ffffff;
}
.has-bg-image .service-desc,
.has-bg-image .service-section-desc,
.has-bg-image .service-list li,
.has-bg-image .contact-desc,
.has-bg-image .work-cat,
.has-bg-image .work-card-cat,
.has-bg-image .about-message-text,
.has-bg-image .about-message-label,
.has-bg-image .about-profile-label {
  color: rgba(255, 255, 255, 0.75);
}
.has-bg-image .service-num {
  color: rgba(255, 255, 255, 0.08);
}
.has-bg-image .btn {
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
}
.has-bg-image .btn-primary {
  background: #fff;
  color: #000;
}
.has-bg-image .company-table tr {
  border-bottom-color: rgba(255, 255, 255, 0.15);
}
.has-bg-image .company-table td a {
  color: rgba(255, 255, 255, 0.7);
}


/* ================================================
   Section commons
   ================================================ */
.section {
  padding: 80px 0;
  position: relative;
  z-index: 1;
}
.section-cta {
  text-align: center;
  margin-top: 56px;
}


/* ================================================
   Hero (index)
   ================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  z-index: 1;
  padding: 0 24px;
  /* 背景画像は main.js でランダム設定 */
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero-company {
  font-family: var(--font-en);
  font-weight: 100;
  font-size: clamp(3.5rem, 11vw, 10rem);
  letter-spacing: 0.22em;
  line-height: 1;
}
.hero-sub {
  font-family: var(--font-en);
  font-size: 0.58rem;
  letter-spacing: 0.42em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 32px;
}
.hero-scroll {
  position: absolute;
  bottom: 48px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.hero-scroll-text {
  font-family: var(--font-en);
  font-size: 0.55rem;
  letter-spacing: 0.42em;
  color: var(--text-muted);
}
.hero-scroll-chevron {
  width: 9px; height: 9px;
  border-right: 1px solid var(--text-muted);
  border-bottom: 1px solid var(--text-muted);
  transform: rotate(45deg);
  animation: chevronDrop 2s ease-in-out infinite;
}
@keyframes chevronDrop {
  0%, 100% { opacity: 0.5; transform: rotate(45deg) translate(0, 0); }
  50%       { opacity: 1;   transform: rotate(45deg) translate(3px, 3px); }
}


/* ================================================
   Services grid (index)
   ================================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
}
.service-card {
  background: var(--bg);
  padding: 48px 36px;
  transition: background var(--t);
}
.service-card:hover { background: #0c0c0c; }
.service-num {
  font-family: var(--font-en);
  font-size: 3.5rem;
  font-weight: 100;
  color: rgba(255, 255, 255, 0.05);
  line-height: 1;
  margin-bottom: 24px;
  user-select: none;
}
.service-name {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 14px;
}
.service-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.9;
  margin-bottom: 24px;
}
.service-link {
  font-family: var(--font-en);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.38);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color var(--t), gap var(--t);
}
.service-link:hover { color: var(--text); gap: 10px; }


/* ================================================
   Works preview (index)
   ================================================ */
.works-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
}
.work-preview-item { display: block; overflow: hidden; }
.work-thumb {
  aspect-ratio: 16 / 9;
  transition: transform 0.65s ease;
}
.work-preview-item:hover .work-thumb { transform: scale(1.04); }
.work-info { padding: 16px 0; }
.work-cat {
  font-family: var(--font-en);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.work-title {
  font-size: 0.88rem;
  font-weight: 300;
  margin-top: 5px;
}


/* ================================================
   Works page
   ================================================ */
.works-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.filter-btn {
  font-family: var(--font-en);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  padding: 8px 20px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--t);
  text-transform: uppercase;
}
.filter-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text);
}
.filter-btn.active {
  border-color: #fff;
  color: #fff;
}
.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 20px;
}
.work-card { display: block; cursor: pointer; }
.work-card-thumb { aspect-ratio: 4 / 3; overflow: hidden; }
.work-card-thumb-inner {
  width: 100%; height: 100%;
  transition: transform 0.65s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.work-card:hover .work-card-thumb-inner { transform: scale(1.04); }
.now-printing {
  font-family: var(--font-en);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  color: rgba(255, 255, 255, 0.35);
  text-transform: lowercase;
  user-select: none;
}
.work-card-body { padding: 14px 0; }
.work-card-cat {
  font-family: var(--font-en);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.work-card-title {
  font-size: 0.88rem;
  font-weight: 300;
  margin-top: 5px;
}
.work-card-hidden { display: none !important; }


/* ================================================
   Services page (detail)
   ================================================ */
.service-section {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}
.service-section:last-child { border-bottom: none; }
.service-section-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.service-section-inner.reverse { direction: rtl; }
.service-section-inner.reverse > * { direction: ltr; }
.service-section-num {
  font-family: var(--font-en);
  font-size: 6rem;
  font-weight: 100;
  color: rgba(255, 255, 255, 0.04);
  line-height: 1;
  margin-bottom: -10px;
  user-select: none;
}
.service-section-label {
  font-family: var(--font-en);
  font-size: 0.62rem;
  letter-spacing: 0.45em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.service-section-title {
  font-family: var(--font-en);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 100;
  letter-spacing: 0.18em;
  line-height: 1;
  margin-bottom: 24px;
}
.service-section-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.95;
  margin-bottom: 28px;
}
.service-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.service-list li {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding-left: 18px;
  position: relative;
}
.service-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 7px; height: 1px;
  background: rgba(255, 255, 255, 0.25);
}
.service-image-placeholder {
  aspect-ratio: 4 / 3;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.service-image-placeholder span {
  font-family: var(--font-en);
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  color: var(--text-muted);
  opacity: 0.3;
}


/* ================================================
   Contact
   ================================================ */
.contact { text-align: center; }
.contact-inner { max-width: 560px; margin: 0 auto; }
.contact-title {
  font-family: var(--font-en);
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 100;
  letter-spacing: 0.04em;
  line-height: 1.25;
  margin-bottom: 20px;
}
.contact-title-jp {
  font-family: var(--font-jp);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 300;
  line-height: 1.4;
  margin-bottom: 20px;
}
.contact-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.95;
  margin-bottom: 40px;
}


/* ================================================
   About page
   ================================================ */
.about-message {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}
.about-message-inner {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 80px;
  align-items: start;
}
.about-message-label {
  font-family: var(--font-en);
  font-size: 0.62rem;
  letter-spacing: 0.45em;
  color: var(--text-muted);
  padding-top: 6px;
}
.about-message-text {
  font-size: 0.95rem;
  line-height: 2.15;
  color: var(--text-muted);
}
.about-message-text strong {
  color: var(--text);
  font-weight: 500;
  font-size: 1.05rem;
}
.about-profile {
  padding: 80px 0;
  position: relative;
  z-index: 1;
}
.about-profile-label {
  font-family: var(--font-en);
  font-size: 0.62rem;
  letter-spacing: 0.45em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 48px;
}
.company-table {
  width: 100%;
  border-collapse: collapse;
}
.company-table tr { border-bottom: 1px solid var(--border); }
.company-table th,
.company-table td {
  padding: 22px 0;
  text-align: left;
  vertical-align: top;
}
.company-table th {
  width: 180px;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-muted);
  padding-right: 32px;
  white-space: nowrap;
}
.company-table td {
  font-size: 0.92rem;
  font-weight: 300;
  line-height: 1.7;
}
.company-table td a {
  color: rgba(255, 255, 255, 0.55);
  transition: color var(--t);
}
.company-table td a:hover { color: var(--text); }


/* ================================================
   Footer
   ================================================ */
.footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 24px;
}
.footer-logo {
  font-family: var(--font-en);
  font-weight: 200;
  font-size: 1rem;
  letter-spacing: 0.22em;
}
.footer-company {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.footer-nav {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.footer-nav a {
  font-family: var(--font-en);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  transition: color var(--t);
}
.footer-nav a:hover { color: var(--text); }
.footer-copy {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.38;
}


/* ================================================
   Scroll animations
   ================================================ */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ================================================
   Responsive
   ================================================ */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: 1fr; }
  .service-section-inner,
  .service-section-inner.reverse {
    grid-template-columns: 1fr;
    gap: 40px;
    direction: ltr;
  }
  .about-message-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .container { padding: 0 24px; }
  .nav-inner { padding: 0 24px; }
  .section { padding: 60px 0; }
  .about-message { padding: 60px 0; }
  .about-profile { padding: 60px 0; }
  .service-section { padding: 60px 0; }
  .section-band { padding: 18px 24px; }

  /* Mobile nav */
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed;
    inset: 0;
    background: rgba(3, 3, 3, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    gap: 32px;
    padding: 80px 40px;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.76, 0, 0.24, 1);
    pointer-events: none;
  }
  .nav-menu.open {
    transform: translateX(0);
    pointer-events: all;
  }
  .nav-menu a { font-size: 1.1rem; opacity: 0.5; }
  .nav-menu a:hover, .nav-menu a.active { opacity: 1; }
  .nav-cta { padding: 12px 24px !important; }

  .works-preview-grid { grid-template-columns: 1fr; }
  .works-grid { grid-template-columns: 1fr; }
  .works-grid .work-card { display: block !important; }

  .footer-inner { flex-direction: column; }
  .footer-nav { flex-wrap: wrap; gap: 16px; }

  .company-table th { width: 110px; font-size: 0.78rem; padding-right: 16px; }
}

@media (max-width: 480px) {
  .btn { padding: 12px 24px; }
  .btn-lg { padding: 14px 32px; }
  .works-filter { gap: 6px; }
  .filter-btn { padding: 7px 14px; font-size: 0.6rem; }
}
