/* ==========================================================
   変数・リセット
   ========================================================== */
:root {
  --color-text: #1f2328;
  --color-sub: #5f6670;
  --color-border: #e3e6ea;
  --color-bg: #ffffff;
  --color-gray: #f5f7f9;
  --color-primary: #1f4fd8;
  --color-primary-dark: #163ba6;
  --color-accent: #00b3a4;
  --color-dark: #14171c;
  --color-error: #d93025;

  --font-base: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
  --font-en: "Helvetica Neue", Arial, sans-serif;

  --header-h: 72px;
  --container: 1120px;
  --radius: 8px;
  --shadow: 0 6px 24px rgba(20, 23, 28, 0.08);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.8;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

body.is-locked {
  overflow: hidden;
}

h1, h2, h3, p, ul, dl, dd {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
}

/* ==========================================================
   共通レイアウト
   ========================================================== */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: 800px;
}

.section {
  padding: 112px 0;
}

.section--gray {
  background: var(--color-gray);
}

.section__head {
  margin-bottom: 56px;
  text-align: center;
}

.section__head--left {
  text-align: left;
  margin-bottom: 32px;
}

.section__en {
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.section__title {
  margin-top: 8px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.section__desc {
  margin-top: 16px;
  color: var(--color-sub);
}

/* ==========================================================
   ボタン
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  padding: 14px 32px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s, transform 0.25s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--color-primary-dark);
}

.btn--outline {
  border-color: var(--color-text);
  background: transparent;
  color: var(--color-text);
}

.btn--outline:hover {
  background: var(--color-text);
  color: #fff;
}

.btn--wide {
  min-width: 280px;
}

/* ==========================================================
   ヘッダー
   ========================================================== */
.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  transition: box-shadow 0.3s;
}

.header.is-scrolled {
  box-shadow: 0 2px 12px rgba(20, 23, 28, 0.08);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

.header__logo {
  font-family: var(--font-en);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.header__logo span {
  margin-left: 4px;
  color: var(--color-primary);
}

.header__logo--light {
  color: #fff;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav__link {
  position: relative;
  font-family: var(--font-en);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.nav__link:not(.nav__link--btn)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease);
}

.nav__link:hover::after,
.nav__link.is-current::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav__link--btn {
  padding: 8px 24px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  transition: background-color 0.25s;
}

.nav__link--btn:hover {
  background: var(--color-primary-dark);
}

.hamburger {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
}

.hamburger span {
  position: absolute;
  left: 10px;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger span:nth-child(1) { top: 14px; }
.hamburger span:nth-child(2) { top: 21px; }
.hamburger span:nth-child(3) { top: 28px; }

.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================
   ヒーロー
   ========================================================== */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: calc(var(--header-h) + 40px) 0 80px;
  overflow: hidden;
  background: linear-gradient(135deg, #f7f9fc 0%, #eef2fb 100%);
}

.hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.hero__test-note {
  display: inline-block;
  margin-bottom: 16px;
  padding: 4px 10px;
  border-radius: 4px;
  background: #fff4d6;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.hero__label {
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--color-primary);
}

.hero__title {
  margin-top: 20px;
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.04em;
}

.hero__text {
  margin-top: 28px;
  color: var(--color-sub);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 44px;
}

.hero__deco {
  position: absolute;
  top: 50%;
  right: -10%;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(0, 179, 164, 0.35), rgba(31, 79, 216, 0.25) 60%, transparent 70%);
  transform: translateY(-50%);
  animation: float 10s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(-50%) scale(1); }
  50% { transform: translateY(-46%) scale(1.05); }
}

/* 初回表示アニメーション */
.hero__label,
.hero__title,
.hero__text,
.hero__actions {
  opacity: 0;
  transform: translateY(20px);
  animation: heroIn 0.9s var(--ease) forwards;
}

.hero__title { animation-delay: 0.15s; }
.hero__text { animation-delay: 0.3s; }
.hero__actions { animation-delay: 0.45s; }

@keyframes heroIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================
   サービス
   ========================================================== */
.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.service-card {
  padding: 40px 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  transition: box-shadow 0.3s, transform 0.3s, border-color 0.3s;
}

.service-card:hover {
  border-color: transparent;
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.service-card__num {
  font-family: var(--font-en);
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  color: var(--color-primary);
  opacity: 0.2;
}

.service-card__title {
  margin-top: 20px;
  font-size: 18px;
  font-weight: 700;
}

.service-card__text {
  margin-top: 12px;
  font-size: 14px;
  color: var(--color-sub);
}

/* ==========================================================
   制作実績
   ========================================================== */
.works-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
}

.works-filter__btn {
  padding: 8px 22px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  color: var(--color-sub);
  transition: all 0.25s;
}

.works-filter__btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.works-filter__btn.is-active {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.work-card {
  overflow: hidden;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 2px 8px rgba(20, 23, 28, 0.04);
  transition: box-shadow 0.3s, transform 0.3s;
}

.work-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.work-card.is-hidden {
  display: none;
}

.work-card__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.work-card__thumb span {
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.9);
  transition: transform 0.4s var(--ease);
}

.work-card:hover .work-card__thumb span {
  transform: scale(1.08);
}

.work-card__thumb--1 { background: linear-gradient(135deg, #1f4fd8, #4f7bff); }
.work-card__thumb--2 { background: linear-gradient(135deg, #00b3a4, #4fd6c9); }
.work-card__thumb--3 { background: linear-gradient(135deg, #2b2f36, #5a6170); }
.work-card__thumb--4 { background: linear-gradient(135deg, #3a5fcd, #7a9cf0); }
.work-card__thumb--5 { background: linear-gradient(135deg, #0f8f84, #3cc1b4); }
.work-card__thumb--6 { background: linear-gradient(135deg, #444b57, #8a919c); }

.work-card__body {
  padding: 20px 24px 24px;
}

.work-card__cat {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
}

.work-card__title {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 700;
}

/* ==========================================================
   会社概要
   ========================================================== */
.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.about__lead {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.6;
}

.about__text {
  margin-top: 24px;
  color: var(--color-sub);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 40px;
}

.stats__item {
  padding: 20px 8px;
  border-top: 2px solid var(--color-primary);
  text-align: center;
}

.stats__num {
  font-family: var(--font-en);
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}

.stats__unit {
  margin-left: 2px;
  font-size: 14px;
  font-weight: 700;
}

.stats__label {
  margin-top: 8px;
  font-size: 13px;
  color: var(--color-sub);
}

.company-table {
  border-top: 1px solid var(--color-border);
}

.company-table__row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
}

.company-table dt {
  font-weight: 700;
}

.company-table dd {
  color: var(--color-sub);
}

/* ==========================================================
   お知らせ
   ========================================================== */
.news-list {
  border-top: 1px solid var(--color-border);
  background: #fff;
}

.news-list__item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid var(--color-border);
}

.news-list__item time {
  flex-shrink: 0;
  font-family: var(--font-en);
  font-size: 14px;
  color: var(--color-sub);
}

.news-list__link {
  transition: color 0.25s;
}

.news-list__link:hover {
  color: var(--color-primary);
}

.tag {
  flex-shrink: 0;
  min-width: 80px;
  padding: 2px 12px;
  border-radius: 4px;
  background: var(--color-gray);
  font-size: 12px;
  text-align: center;
  color: var(--color-sub);
}

.tag--accent {
  background: rgba(0, 179, 164, 0.12);
  color: #00857a;
}

/* ==========================================================
   お問い合わせ
   ========================================================== */
.contact-form {
  padding: 48px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.contact-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.form-row + .form-row {
  margin-top: 24px;
}

.form-row label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 700;
}

.required {
  display: inline-block;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 3px;
  background: var(--color-primary);
  font-size: 11px;
  color: #fff;
  vertical-align: middle;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-gray);
  font: inherit;
  font-size: 15px;
  color: var(--color-text);
  transition: border-color 0.25s, background-color 0.25s, box-shadow 0.25s;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(31, 79, 216, 0.12);
}

.contact-form .is-invalid {
  border-color: var(--color-error);
  background: #fff6f5;
}

.contact-form textarea {
  resize: vertical;
}

.form-error {
  min-height: 1em;
  margin-top: 4px;
  font-size: 13px;
  color: var(--color-error);
}

.form-submit {
  margin-top: 40px;
  text-align: center;
}

.form-note {
  margin-top: 16px;
  font-size: 13px;
  text-align: center;
  color: var(--color-sub);
}

/* ==========================================================
   フッター
   ========================================================== */
.footer {
  padding: 56px 0 24px;
  background: var(--color-dark);
  color: rgba(255, 255, 255, 0.75);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  font-family: var(--font-en);
  font-size: 14px;
}

.footer__nav a:hover {
  color: #fff;
}

.footer__copy {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-en);
  font-size: 12px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}

/* ==========================================================
   トップへ戻る / モーダル
   ========================================================== */
.page-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: var(--shadow);
  font-size: 18px;
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background-color 0.25s;
}

.page-top.is-show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.page-top:hover {
  background: var(--color-primary-dark);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 23, 28, 0.55);
  animation: fadeIn 0.25s ease;
}

.modal[hidden] {
  display: none;
}

.modal__content {
  width: 100%;
  max-width: 420px;
  padding: 40px 32px;
  border-radius: var(--radius);
  background: #fff;
  text-align: center;
}

.modal__title {
  font-size: 20px;
}

.modal__text {
  margin: 16px 0 28px;
  font-size: 14px;
  color: var(--color-sub);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==========================================================
   スクロールアニメーション
   ========================================================== */
.has-scroll-animation .fade-in {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.has-scroll-animation .fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .has-scroll-animation .fade-in,
  .hero__label, .hero__title, .hero__text, .hero__actions {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================
   レスポンシブ
   ========================================================== */
@media (max-width: 1024px) {
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .about {
    grid-template-columns: 1fr;
    gap: 56px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 64px;
  }

  .section {
    padding: 80px 0;
  }

  .section__head {
    margin-bottom: 40px;
  }

  .section__title {
    font-size: 26px;
  }

  .hamburger {
    display: block;
    z-index: 110;
  }

  .nav {
    position: fixed;
    inset: 0;
    z-index: 105;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
  }

  .nav__list {
    flex-direction: column;
    gap: 32px;
  }

  .nav__link {
    font-size: 20px;
  }

  .hero__text br {
    display: none;
  }

  .hero__deco {
    width: 360px;
    height: 360px;
    right: -30%;
    top: 30%;
  }

  .service-grid,
  .works-grid {
    grid-template-columns: 1fr;
  }

  .about__lead {
    font-size: 22px;
  }

  .company-table__row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .news-list__item {
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 20px 16px;
  }

  .news-list__link {
    flex-basis: 100%;
  }

  .contact-form {
    padding: 28px 20px;
  }

  .btn--wide {
    width: 100%;
    min-width: 0;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }

  .footer__nav {
    justify-content: center;
    gap: 20px;
  }
}
