:root {
  --lime: #C8D400;
  --black: #1a1a1a;
  --white: #f8f8f4;
  --gray: #888;
  --light: #f0f0e8;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--white);
  color: var(--black);
  overflow-x: hidden;
  cursor: none;
}

/* Custom Cursor */
.cursor {
  width: 12px; height: 12px;
  background: var(--lime);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 100000;
  transition: transform 0.15s ease, width 0.2s, height 0.2s;
  transform: translate(-50%, -50%);
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1.5px solid var(--black);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  transition: transform 0.35s cubic-bezier(.23,1,.32,1), width 0.3s, height 0.3s, border-color 0.3s;
  transform: translate(-50%, -50%);
}
body.modal-open .cursor {
  background: #ffffff !important;
  box-shadow: 0 0 10px rgba(255, 255, 255, 1), 0 0 20px rgba(255, 255, 255, 0.6);
}
body.modal-open .cursor-ring {
  border-color: #ffffff !important;
  border-width: 2px !important;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.8), 0 0 30px rgba(255, 255, 255, 0.4);
}

/* Global Nav (Left Sidebar) */
nav {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 220px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 60px 0 60px 48px;
  gap: 80px;
  pointer-events: none;
}
nav > * {
  pointer-events: auto;
}

.nav-logo img {
  width: 100%;
  max-width: 180px;
  height: auto;
  display: block;
  transition: filter 0.4s ease;
}
/* This class is toggled by JS when over dark sections */
.nav-logo.invert-logo img {
  filter: invert(1) brightness(2);
}
.nav-logo {
  text-decoration: none;
  transition: transform 0.2s;
  display: flex;
}
.nav-logo:hover { transform: scale(1.05) translateX(4px); }

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 24px;
  list-style: none;
  align-items: flex-start;
}
.nav-links a {
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--black);
  font-weight: 700;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.4s ease;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  height: 2px; width: 0;
  background: currentColor;
  transition: width 0.25s ease;
}
.nav-links a:hover::after { width: 100%; }

/* JS adds this class to nav-links when on dark background */
.nav-links.invert-links a {
  color: #fff;
}

/* Layout Centering System */
.promise, .services, .works, .about, .contact {
  padding-top: 140px;
  padding-bottom: 140px;
}
.section-inner {
  width: 100%;
  max-width: 1040px;
  /* Centered around 50vw. If 50vw - halftwidth is less than 260px (nav area), stick to 260px. */
  margin-left: max(260px, calc(50vw - 520px));
  padding-right: 64px;
  box-sizing: content-box; /* preserves the full 1040px area without squeezing */
}

/* Hero */
.hero {
  min-height: 100vh;
  background: var(--lime);
  position: relative;
  overflow: hidden;
}
.hero-bg-anim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero-bg-anim::before, .hero-bg-anim::after {
  content: '';
  position: absolute;
  width: 80vw;
  height: 80vw;
  max-width: 800px;
  max-height: 800px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.6;
  animation: bgAurora 18s ease-in-out infinite alternate;
}
.hero-bg-anim::before {
  background: rgba(255, 255, 255, 0.4);
  top: -200px; left: -200px;
}
.hero-bg-anim::after {
  background: rgba(180, 200, 0, 0.8);
  bottom: -200px; right: -200px;
  animation-delay: -6s;
  animation-duration: 22s;
}

@keyframes bgAurora {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30%, 20%) scale(1.3); }
}

.hero-logo-base {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 40vw;
  max-width: 320px;
  opacity: 0;
  animation: fadeIn 1s ease 0.2s forwards;
  pointer-events: none;
  z-index: 2;
}
.hero-logo-spin {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  z-index: 1;
}
.spin-1 {
  top: -20%; left: -30%;
  width: 250vw; max-width: 1400px;
  animation: fadeIn 1.5s ease 0.6s forwards, spinHero 60s linear infinite 3s;
}
.spin-2 {
  bottom: -40%; right: -20%;
  width: 180vw; max-width: 1200px;
  animation: fadeIn 1.5s ease 0.8s forwards, spinHeroReverse 45s linear infinite 3s;
}
.spin-3 {
  top: 40%; right: -50%;
  width: 200vw; max-width: 1800px;
  animation: fadeIn 1.5s ease 1s forwards, spinHero 80s linear infinite 3s;
  opacity: 0.5;
}

@keyframes spinHero {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes spinHeroReverse {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}

.hero-scroll {
  position: absolute;
  bottom: 40px; right: 80px;
  writing-mode: vertical-rl;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--black);
  font-weight: 700;
  opacity: 0.5;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeIn 1s ease 1.4s forwards;
  z-index: 3;
}
.hero-scroll::after {
  content: '';
  width: 1px;
  height: 48px;
  position: relative;
  overflow: hidden;
  background: transparent;
}
.hero-scroll::before {
  content: '';
  position: absolute;
  bottom: -48px;
  left: 5px;
  width: 1px;
  height: 48px;
  background: var(--black);
  animation: scrollLine 2s infinite ease-in-out;
}
@keyframes scrollLine {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(200%); }
}

/* Promise Section */
.promise-inner {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 80px;
  align-items: center;
}
.section-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 11px;
  letter-spacing: 0.35em;
  color: var(--gray);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.section-label::before {
  content: '';
  width: 32px; height: 1px;
  background: var(--lime);
}

.promise-text {
  font-size: 15px;
  line-height: 2.4;
  color: #444;
  font-weight: 300;
  letter-spacing: 0.05em;
}
.promise-text p + p { margin-top: 24px; }

/* Services */
.services {
  background: var(--black);
}
.services-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 80px;
}
.services-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(48px, 7vw, 100px);
  color: var(--white);
  letter-spacing: 0.05em;
}
.services-title span { color: var(--lime); }
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
.service-card {
  background: #111;
  padding: 48px 56px;
  transition: background 0.3s, transform 0.3s;
  cursor: none;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 48px;
}
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--lime);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s cubic-bezier(.23,1,.32,1);
}
.service-card:hover::before { transform: scaleY(1); }
.service-card:hover { background: #1e1e1e; transform: translateX(8px); }
.service-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 64px;
  color: var(--lime);
  line-height: 1;
  opacity: 0.4;
  width: 80px;
}
.service-info {
  flex: 1;
}
.service-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  color: var(--white);
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.service-name span { font-size: 18px; font-family: 'Noto Sans JP', sans-serif; display: inline-block; margin-left: 16px; font-weight: 700;}
.service-desc {
  font-size: 14px;
  color: #888;
  line-height: 2;
  font-weight: 300;
  letter-spacing: 0.04em;
}

/* Works */
.works-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 64px;
}
.works-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(64px, 9vw, 120px);
  line-height: 1;
  letter-spacing: 0.04em;
}
.works-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 48px;
}
.tab-btn {
  padding: 10px 24px;
  border: 1.5px solid #ccc;
  background: none;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  letter-spacing: 0.15em;
  cursor: none;
  transition: all 0.2s;
  border-radius: 100px;
  color: var(--black);
}
.tab-btn.active, .tab-btn:hover {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}
.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.work-item {
  aspect-ratio: 4/3;
  background: var(--light);
  position: relative;
  overflow: hidden;
  cursor: none;
  border-radius: 8px;
}
.work-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(.23,1,.32,1);
}
.work-item:hover .work-thumb {
  transform: scale(1.05);
}
.work-item-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 32px;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.35s;
}
.work-item:hover .work-item-inner { opacity: 1; }
.work-title {
  color: var(--white);
  text-align: right;
  line-height: 1.6;
}
.work-client {
  font-size: 11px;
  letter-spacing: 0.1em;
  opacity: 0.8;
}
.work-project {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: inline-block;
}

/* About / Company */
.about {
  background: var(--black);
  color: var(--white);
}
.about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
}
.about-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(80px, 12vw, 160px);
  line-height: 0.9;
  letter-spacing: -0.01em;
  color: var(--white);
}
.about-name span { color: var(--lime); }
.about-info {
  padding-top: 20px;
}
.info-block + .info-block { margin-top: 40px; }
.info-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--lime);
  margin-bottom: 20px;
}
.info-value {
  font-size: 15px;
  color: #ddd;
  line-height: 2.2;
  font-weight: 300;
  letter-spacing: 0.05em;
}

/* Contact */
.contact {
  text-align: center;
  position: relative;
  overflow: hidden;
}
.contact-bg {
  position: absolute;
  inset: 0;
  background: var(--lime);
  clip-path: polygon(0 30%, 100% 0%, 100% 100%, 0 100%);
  z-index: 0;
}
.contact-inner {
  position: relative; 
  z-index: 1; 
  /* Center structurally differently just for contact form constraints */
  max-width: 600px;
  margin-left: max(260px, calc(50vw - 300px));
}
.contact-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(60px, 10vw, 140px);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--black);
}
.contact-sub {
  font-size: 16px;
  line-height: 2;
  color: #333;
  margin: 24px auto 56px;
  font-weight: 300;
  letter-spacing: 0.06em;
}

/* Contact Form */
.contact-form {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 16px 20px;
  background: var(--white);
  border: none;
  border-radius: 12px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 15px;
  color: var(--black);
  transition: all 0.3s;
  cursor: none;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--black);
}

.submit-btn {
  background: var(--black);
  color: var(--lime);
  border: none;
  padding: 16px 48px;
  font-weight: 700;
  font-size: 15px;
  border-radius: 100px;
  cursor: none;
  align-self: center;
  margin-top: 16px;
  transition: all 0.3s;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.1em;
}
.submit-btn:hover {
  background: #333;
  color: var(--white);
}
.submit-btn:disabled {
  background: #888;
  color: #ccc;
  cursor: not-allowed;
  opacity: 0.7;
}

.form-error {
  display: none;
  font-family: 'Noto Sans JP', sans-serif;
  color: #ff3b30;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  margin-top: 8px;
  background: rgba(255, 59, 48, 0.08);
  padding: 12px;
  border-radius: 8px;
}

.contact-form {
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.contact-form.fade-out {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.contact-success {
  display: none;
  opacity: 0;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 32px;
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
  margin-top: 32px;
  transition: opacity 0.5s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.5s cubic-bezier(0.215, 0.61, 0.355, 1);
  transform: translateY(20px);
}
.contact-success.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: scale(0);
}
.contact-success.active .success-icon {
  animation: successPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s forwards;
}

.success-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  letter-spacing: 0.1em;
  color: var(--black);
  margin-bottom: 12px;
}
.success-text {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  line-height: 1.8;
  color: #555;
  font-weight: 400;
}

@keyframes successPop {
  0% { transform: scale(0) rotate(-15deg); }
  70% { transform: scale(1.1) rotate(10deg); }
  85% { transform: scale(0.95) rotate(-3deg); }
  100% { transform: scale(1) rotate(0); }
}

/* Footer */
footer {
  background: var(--black);
  padding: 24px 0;
  text-align: center;
  border-top: 1px solid #333;
}
.footer-copy {
  font-size: 11px;
  color: #555;
  letter-spacing: 0.1em;
}

/* Portfolio Modal */
.works-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; justify-content: center; align-items: flex-start;
  opacity: 0; pointer-events: none; transition: opacity 0.4s;
  overflow-y: auto; overflow-x: hidden;
  padding: 80px 20px;
}
.works-modal.active { opacity: 1; pointer-events: auto; }
.works-modal-overlay {
  position: fixed; inset: 0; background: rgba(10,10,10,0.95); z-index: 0; cursor: none;
}
.works-modal-close {
  position: fixed; top: 40px; right: 40px; z-index: 2;
  background: none; border: none; color: #fff; font-size: 64px;
  cursor: none; line-height: 1; transition: transform 0.2s;
  font-family: 'Noto Sans JP', sans-serif; font-weight: 300;
}
.works-modal-close:hover { transform: scale(1.1); }
.works-modal-content {
  position: relative; z-index: 1;
  width: 100%; max-width: 1000px;
  display: flex; flex-direction: column; gap: 40px;
  transform: translateY(40px); transition: transform 0.4s;
  padding-bottom: 80px;
}
.works-modal.active .works-modal-content { transform: translateY(0); }
.works-modal-content img {
  width: 100%; height: auto; display: block; border-radius: 4px;
}

.modal-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 16px auto 0;
  padding: 20px 48px;
  background: var(--lime);
  color: var(--black);
  text-decoration: none;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.1em;
  border-radius: 100px;
  transition: transform 0.3s, background 0.3s;
  cursor: none;
}
.modal-action-btn:hover {
  background: #fff;
  transform: scale(1.05);
}
/* Animations */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(.23,1,.32,1), transform 0.8s cubic-bezier(.23,1,.32,1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.works-cta {
  margin-top: 180px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.works-cta-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 24px;
  font-family: 'Noto Sans JP', sans-serif;
  letter-spacing: 0.05em;
}
.works-cta-desc {
  font-size: 15px;
  line-height: 2.4;
  color: #444;
  margin-bottom: 48px;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 300;
  letter-spacing: 0.05em;
}
.works-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 18px 56px;
  background: var(--black);
  color: var(--white);
  text-decoration: none;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.1em;
  border-radius: 100px;
  transition: all 0.3s ease;
  cursor: none;
}
.works-cta-btn:hover {
  background: #333;
  color: var(--lime);
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 900px) {
  /* Disable custom cursor on mobile */
  body, a, button, input, textarea, .contact-link, .work-item, .submit-btn, .tab-btn, .nav-links a, .nav-logo, .works-modal-close, .modal-action-btn, .works-modal-overlay {
    cursor: auto !important;
  }
  a, button, .tab-btn, .submit-btn, .modal-action-btn, .works-modal-close {
    cursor: pointer !important;
  }
  .cursor, .cursor-ring {
    display: none !important;
  }

  /* Global Nav - Hidden until Promise section on SP */
  nav { 
    top: 0; left: 0; right: 0; bottom: auto; width: 100%; height: 80px; 
    flex-direction: row; pointer-events: auto; background: rgba(255,255,255,0.9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    justify-content: space-between;
    padding: 16px 24px;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, visibility 0.4s ease;
    opacity: 0;
    visibility: hidden;
  }
  nav.nav-visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-logo { align-items: center; }
  .nav-logo img { max-width: 140px; }
  
  /* Reset logic on mobile so it doesn't try to invert on scroll */
  .nav-logo.invert-logo img { filter: none !important; }
  
  .nav-links { display: none; }
  
  .promise, .services, .works, .about, .contact { padding: 80px 32px; }
  .section-inner { margin-left: 0 !important; width: 100% !important; max-width: 100% !important; padding: 0 !important; }
  
  .spin-1 { top: -10%; left: -50%; width: 300vw; }
  .spin-2 { bottom: -20%; right: -50%; width: 250vw; }
  .spin-3 { display: none; } /* hide one on mobile to save performance */
  
  .promise-inner { grid-template-columns: 1fr; gap: 48px; }
  
  /* Our Services Card Layout on SP: Number on top, text bottom */
  .service-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 32px 24px;
  }
  .service-num {
    width: auto;
    font-size: 48px;
    margin-bottom: 0;
  }
  .service-info {
    width: 100%;
  }

  .works-grid { grid-template-columns: 1fr; }
  .about-inner { display: flex; flex-direction: column; }
  .contact-inner { margin-left: 0; width: 100%; }
  
  /* SP View More hiding */
  .work-item.sp-hidden {
    display: none !important;
  }

  .works-cta {
    margin-top: 100px;
    padding-top: 0;
  }
  .works-cta-title {
    font-size: 18px;
    margin-bottom: 20px;
  }
  .works-cta-desc {
    font-size: 14px;
    line-height: 2.2;
    margin-bottom: 36px;
  }
  .pc-br {
    display: none;
  }
}

/* View More Button for SP */
.works-more-btn-container {
  display: flex;
  justify-content: center;
  margin-top: 48px;
  width: 100%;
}
.works-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 48px;
  background: none;
  border: 1.5px solid var(--black);
  color: var(--black);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 15px;
  letter-spacing: 0.15em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 100px;
}
.works-more-btn:hover {
  background: var(--black);
  color: var(--white);
  transform: translateY(-2px);
}
@media (min-width: 901px) {
  .works-more-btn-container {
    display: none !important;
  }
}
