@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;700&family=Noto+Sans+JP:wght@300;400;500;700;900&family=Noto+Serif+JP:wght@900&display=swap');

/* Performance: off-screen rendering */
.section,
.footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 500px;
}

:root {
  --color-black: #000000;
  --color-white: #ffffff;

  --font-base: 'Noto Sans JP', sans-serif;
  --font-heading: 'Noto Sans JP', sans-serif;
  --font-en: 'Montserrat', sans-serif;

  --spacing-base: 8px;
  --section-padding: clamp(80px, 10vw, 160px);
  --container-width: 1200px;
  --header-height: 80px;

  --transition-smooth: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

:focus-visible {
  outline: 2px solid var(--color-black);
  outline-offset: 4px;
}

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

body {
  background-color: var(--color-white);
  color: var(--color-black);
  font-family: var(--font-base);
  line-height: 1.8;
  letter-spacing: 0.05em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-top: var(--header-height);

  /* Japanese Typography enhancements */
  line-break: strict;
  word-break: auto-phrase;
  /* Supported natively in latest Chrome/Safari */
}

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

a:hover {
  opacity: 0.5;
}

ul,
ol {
  list-style: none;
}

img,
svg {
  max-width: 100%;
  display: block;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.1em;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 48px);
}

.section {
  padding: var(--section-padding) 0;
  position: relative;
}

/* Base Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 20px 48px;
  background-color: var(--color-black);
  color: var(--color-white);
  border: 1px solid var(--color-black);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all var(--transition-smooth);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-white);
  transform: translateY(100%);
  transition: transform var(--transition-smooth);
  z-index: 1;
}

.btn:hover::before {
  transform: translateY(0);
}

.btn span {
  position: relative;
  z-index: 2;
  transition: color var(--transition-smooth);
}

.btn:hover span {
  color: var(--color-black);
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: flex;
  align-items: center;
  transition: transform var(--transition-smooth);
}

.header.is-hidden {
  transform: translateY(-100%);
}

.header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.header__logo {
  font-family: var(--font-en);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.global-nav {
  display: flex;
  gap: 32px;
}

.global-nav__link {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: relative;
}

.global-nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-black);
  transition: width var(--transition-smooth);
}

.global-nav__link:hover::after {
  width: 100%;
}

/* Footer */
.footer {
  background-color: var(--color-black);
  color: var(--color-white);
  padding: 80px 0 40px;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.footer__top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 48px;
}

.footer__logo {
  font-family: var(--font-en);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  margin-bottom: 16px;
}

.footer__tagline {
  font-size: 0.9rem;
  opacity: 0.7;
}

.footer__nav,
.footer__social {
  display: flex;
  gap: 48px;
}

.footer__nav-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer__nav-link {
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.footer__nav-link:hover {
  opacity: 1;
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 32px;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* Animations */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Call To Action Global Spacing */
.cta {
  text-align: center;
}

.cta__title {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 500;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

.cta__lead {
  font-size: 1rem;
  line-height: 2;
  margin-bottom: 48px;
  opacity: 0.7;
  font-weight: 400;
}

.svg-reveal {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}

/* Golf Strategy SVG Utilities */
.svg-strategy {
  width: 100%;
  height: auto;
  overflow: visible;
}

.svg-strategy path,
.svg-strategy circle,
.svg-strategy line,
.svg-strategy polygon,
.svg-strategy rect {
  fill: none;
  stroke: var(--color-black);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.svg-strategy .fill-black {
  fill: var(--color-black);
}

.svg-strategy .stroke-dashed {
  stroke-dasharray: 4, 4;
}

.svg-strategy .stroke-dotted {
  stroke-dasharray: 1, 4;
  stroke-linecap: round;
}

.svg-strategy .stroke-thick {
  stroke-width: 2.5;
}

.svg-strategy .stroke-thin {
  stroke-width: 0.75;
}

/* Specific icon containers for headings */
.heading-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin-right: 12px;
  margin-top: 0.1em;
  /* Align visually with text center of the first line */
}

.list-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  margin-right: 16px;
  margin-top: -0.1em;
  /* Align visually with text center of the first line */
}

/* Base style for elements containing icons */
:is(h1, h2, h3, h4, h5, h6, .s-detail__label):has(.heading-icon, .list-icon) {
  display: flex;
  align-items: flex-start;
}

/* Micro Interactions & Advanced SVGs */
.hover-target {
  position: relative;
  display: inline-block;
}

.hover-target .hover-svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1.2);
  width: calc(100% + 40px);
  height: calc(100% + 40px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.hover-target:hover .hover-svg {
  opacity: 1;
}

.hover-target .hover-svg path,
.hover-target .hover-svg rect {
  fill: none;
  stroke: var(--color-black);
  stroke-width: 1;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-target:hover .hover-svg path,
.hover-target:hover .hover-svg rect {
  stroke-dashoffset: 0;
}

/* Page Transitions */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--color-black);
  z-index: 9999;
  transform-origin: top;
  pointer-events: none;
}

/* Preloader */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--color-black);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.preloader.is-hidden {
  display: none;
}

.preloader__svg {
  width: min(90vw, 800px);
  height: auto;
  display: block;
}

@keyframes preloader-line {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* Work Card Component */
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 4px;
  margin-bottom: 120px;
}

.work-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--color-black);
  background-color: var(--color-white);
  transition: transform var(--transition-smooth);
  border: 1px solid rgba(0, 0, 0, 0.05);
  height: auto;
}

.work-card:hover {
  transform: translateY(-8px);
}

.work-card__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-color: #f5f5f5;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  overflow: hidden;
  position: relative;
}

.work-card__image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
}

.work-card:hover .work-card__image::after {
  background: rgba(0, 0, 0, 0.05);
}

.work-card__content {
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.work-card__sub {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  opacity: 0.7;
  text-transform: uppercase;
}

.work-card__title {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-family: var(--font-ja);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.05em;
  margin: 0;
}

/* Responsive */
/* =========================================================================
   Responsive Design (Mobile / Tablet)
   ========================================================================= */
@media (max-width: 768px) {
  :root {
    --section-padding: clamp(48px, 10vw, 80px);
    --header-height: 64px;
  }

  /* Page Header Mobile Override */
  .page-header {
    padding-top: 60px;
    padding-bottom: 48px;
    text-align: left;
  }

  .page-header__title {
    font-size: clamp(1.6rem, 6vw, 2rem) !important;
    margin-bottom: 16px;
  }

  .page-header__lead {
    font-size: 0.85rem !important;
    line-height: 2;
    margin: 0 !important;
  }

  /* Prevent forced line breaks in lead text on smartphone for natural BudouX flow */
  .page-header__lead br,
  .hero__lead br,
  .cta__lead br,
  .s-detail__lead br,
  .manifesto-quote br {
    display: none;
  }

  /* Typography Adjustments */
  .fade-up {
    transform: translateY(20px);
  }

  /* Responsive Icons */
  .heading-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    margin-top: 0.15em;
  }

  .list-icon {
    width: 32px;
    height: 32px;
    margin-right: 12px;
  }

  /* Header & Navigation */
  .header__inner {
    padding: 0 16px;
  }

  .header__logo {
    font-size: 1.2rem;
  }

  /* Global Nav Desktop Hide, Mobile Overlay Adjustments */
  .global-nav {
    display: none;
    /* Handled via JS injected overlay now */
  }

  /* JS Injected Mobile Menu Styles */
  .mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    position: relative;
  }

  .mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 1.5px;
    background-color: var(--color-black);
    transition: all 0.3s ease;
    margin: 3px 0;
  }

  .mobile-menu-btn.is-active span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
  }

  .mobile-menu-btn.is-active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-btn.is-active span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
  }

  .mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--color-white);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s ease;
  }

  .mobile-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translateY(0);
  }

  .mobile-overlay .global-nav__link {
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: var(--color-black);
  }

  /* Buttons */
  .btn {
    padding: 16px 32px;
    font-size: 0.9rem;
    width: 100%;
    max-width: 300px;
  }

  /* Footer */
  .footer {
    padding: 60px 0 30px;
  }

  .footer__top {
    flex-direction: column;
    gap: 40px;
  }

  .footer__nav,
  .footer__social {
    flex-direction: column;
    gap: 24px;
  }

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .footer__links {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .footer__nav-link {
    margin-right: 0 !important;
    margin-bottom: 8px;
  }

  .works-grid {
    grid-template-columns: 1fr;
    margin-bottom: 80px;
  }

  .work-card {
    height: 280px;
    padding: 0;
  }

  .work-card__content {
    padding: 24px;
  }

  /* CTA Mobile Adjustments */
  .cta__title {
    font-size: clamp(1.3rem, 5vw, 1.6rem);
    margin-bottom: 16px;
  }

  .cta__lead {
    font-size: 0.9rem;
    margin-bottom: 36px;
  }
}