/* ========================================
   CSS Variables
   ======================================== */
:root {
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-text: #1a1a2e;
  --color-text-secondary: #555570;
  --color-text-muted: #8888a0;
  --color-primary: #2d5be3;
  --color-primary-dark: #1e3fba;
  --color-primary-light: #e8eefb;
  --color-accent: #00c9a7;
  --color-border: #e4e4ec;
  --color-border-light: #f0f0f5;

  --font-ja: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  --font-en: 'Inter', 'Helvetica Neue', Arial, sans-serif;

  --container-max: 1120px;
  --header-height: 72px;
  --section-padding: 120px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);

  --transition: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ========================================
   Reset & Base
   ======================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-ja);
  font-size: 16px;
  line-height: 1.8;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========================================
   Utility
   ======================================== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.sp-only {
  display: none;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-ja);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 28px;
  border: 2px solid transparent;
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-sm {
  padding: 8px 20px;
  font-size: 14px;
}

.btn-lg {
  padding: 16px 40px;
  font-size: 16px;
}

.btn-full {
  width: 100%;
}

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

.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 91, 227, 0.3);
}

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

.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
}

/* ========================================
   Header
   ======================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
  transition: all var(--transition);
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--color-text);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-list a {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
}

.nav-list a:hover {
  color: var(--color-primary);
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
  transition: all var(--transition);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* ========================================
   Hero
   ======================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(45, 91, 227, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 20% 80%, rgba(0, 201, 167, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, #fff 0%, var(--color-bg) 100%);
  z-index: -1;
}

.hero-inner {
  padding: 160px 24px 120px;
}

.hero-label {
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  color: var(--color-text);
}

.hero-description {
  font-size: 18px;
  color: var(--color-text-secondary);
  line-height: 1.9;
  margin-bottom: 40px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero-scroll span {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: var(--color-border);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 60%;
  background: var(--color-primary);
  animation: scrollDown 2s ease-in-out infinite;
}

@keyframes scrollDown {
  0% { top: -60%; }
  100% { top: 120%; }
}

/* ========================================
   Section Common
   ======================================== */
.section {
  padding: var(--section-padding) 0;
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-label {
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

/* ========================================
   About
   ======================================== */
.about {
  background: var(--color-surface);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.about-lead {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
  line-height: 1.6;
  color: var(--color-text);
}

.about-text p {
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.stat-item {
  text-align: center;
  padding: 32px 16px;
  background: var(--color-bg);
  border-radius: var(--radius-md);
}

.stat-number {
  display: block;
  font-family: var(--font-en);
  font-size: 36px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ========================================
   Services
   ======================================== */
.services {
  background: var(--color-bg);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--color-surface);
  padding: 48px 36px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  transition: all var(--transition);
}

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

.service-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.service-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.service-description {
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.8;
}

/* ========================================
   Works
   ======================================== */
.works {
  background: var(--color-surface);
}

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

.work-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border-light);
  background: var(--color-surface);
  transition: all var(--transition);
}

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

.work-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--color-primary-light) 0%, #f0e6ff 100%);
}

.work-body {
  padding: 24px;
}

.work-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 4px 12px;
  border-radius: 50px;
  margin-bottom: 12px;
}

.work-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.work-description {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* ========================================
   CTA
   ======================================== */
.cta {
  background: linear-gradient(135deg, var(--color-text) 0%, #2a2a50 100%);
  text-align: center;
}

.cta-inner {
  max-width: 640px;
}

.cta-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: #fff;
  margin-bottom: 20px;
  line-height: 1.4;
}

.cta-description {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 40px;
  line-height: 1.8;
}

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

.cta .btn-primary:hover {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 24px rgba(255, 255, 255, 0.2);
}

/* ========================================
   Contact
   ======================================== */
.contact {
  background: var(--color-bg);
}

.contact-content {
  max-width: 640px;
  margin: 0 auto;
}

.contact-form {
  background: var(--color-surface);
  padding: 48px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text);
}

.required {
  color: #e74c3c;
  font-size: 12px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-ja);
  font-size: 15px;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(45, 91, 227, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* ========================================
   Form Success
   ======================================== */
.form-success {
  text-align: center;
  padding: 64px 32px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
}

.success-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e6f9f4;
  color: var(--color-accent);
  font-size: 28px;
  font-weight: 700;
  border-radius: 50%;
  margin: 0 auto 24px;
}

.form-success h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

.form-success p {
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.8;
}

/* ========================================
   Footer
   ======================================== */
.footer {
  background: var(--color-text);
  color: rgba(255, 255, 255, 0.7);
  padding: 64px 0 32px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.footer-brand .logo {
  color: #fff;
  margin-bottom: 12px;
  display: inline-block;
}

.footer-description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
}

.footer-links ul {
  display: flex;
  gap: 32px;
}

.footer-links a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
}

/* ========================================
   Animations
   ======================================== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* stagger animation for service cards */
.service-card.fade-in:nth-child(2) { transition-delay: 0.1s; }
.service-card.fade-in:nth-child(3) { transition-delay: 0.2s; }
.service-card.fade-in:nth-child(4) { transition-delay: 0.3s; }

.work-card.fade-in:nth-child(2) { transition-delay: 0.1s; }
.work-card.fade-in:nth-child(3) { transition-delay: 0.2s; }

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  :root {
    --section-padding: 80px;
    --header-height: 64px;
  }

  .sp-only {
    display: inline;
  }

  /* Navigation */
  .hamburger {
    display: flex;
  }

  .nav-list {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform var(--transition);
    padding: 40px;
  }

  .nav-list.open {
    transform: translateX(0);
  }

  .nav-list a {
    font-size: 16px;
  }

  /* Hero */
  .hero-inner {
    padding: 120px 24px 80px;
  }

  .hero-description {
    font-size: 16px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-scroll {
    display: none;
  }

  /* About */
  .about-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-lead {
    font-size: 19px;
  }

  /* Services */
  .services-grid {
    grid-template-columns: 1fr;
  }

  .service-card {
    padding: 36px 28px;
  }

  /* Works */
  .works-grid {
    grid-template-columns: 1fr;
  }

  /* Contact */
  .contact-form {
    padding: 32px 24px;
  }

  /* Footer */
  .footer-links ul {
    flex-direction: column;
    gap: 16px;
  }
}
