/* ============================================
   TempMachi Corporate Website — Design System
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&family=Noto+Sans+JP:wght@400;500;700;900&family=Yomogi&family=Dancing+Script:wght@400..700&display=swap');

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Colors — B-Corsairs Style */
  --color-primary: #000436;
  /* B-Corsairs Deep Blue */
  --color-secondary: #b2955d;
  /* B-Corsairs Gold */
  --color-accent: #bf0016;
  /* B-Corsairs Red */
  --color-gradient: linear-gradient(135deg, #000436, #b2955d);
  --color-gradient-hover: linear-gradient(135deg, #b2955d, #000436);
  --color-bg-light: #F4F4F4;
  --color-bg-dark: #020202;
  /* Frontale Black/Dark Grey */
  --color-bg-dark-alt: #111111;
  --color-text-primary: #333333;
  --color-text-secondary: #444444;
  --color-text-on-dark: #FFFFFF;
  --color-text-on-dark-sub: rgba(255, 255, 255, 0.7);
  --color-border: rgba(0, 0, 0, 0.08);
  --color-border-light: rgba(255, 255, 255, 0.1);

  /* Typography — B-Corsairs Style */
  --font-heading: 'Roboto', "Noto Sans Japanese", 'Noto Sans JP', "ヒラギノ角ゴ ProN W6", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, sans-serif;
  --font-body: "Noto Sans Japanese", 'Noto Sans JP', YakuHanJP, "ヒラギノ角ゴ ProN W3", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, "メイリオ", Meiryo, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --text-hero: clamp(3rem, 6vw, 5.5rem);
  --text-h1: clamp(2rem, 4vw, 3.2rem);
  --text-h2: clamp(1.5rem, 3vw, 2.5rem);
  --text-h3: clamp(1.2rem, 2vw, 1.5rem);
  --text-body: 1rem;
  --text-body-lg: 1.125rem;
  --text-small: 0.875rem;
  --text-xs: 0.75rem;
  --line-height-heading: 1.1;
  --line-height-body: 1.75;
  --letter-spacing-heading: 0.04em;
  --letter-spacing-body: 0.01em;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --space-section: clamp(80px, 10vw, 120px);

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 800px;
  --header-height: 80px;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;
  --border-radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
  --shadow-glow: 0 0 30px rgba(96, 165, 250, 0.4);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--line-height-body);
  letter-spacing: var(--letter-spacing-body);
  color: var(--color-text-primary);
  background-color: #FFFFFF;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

ul,
ol {
  list-style: none;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  line-height: var(--line-height-heading);
  letter-spacing: var(--letter-spacing-heading);
  font-weight: 700;
}

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

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

.section--dark {
  background-color: var(--color-bg-dark);
  color: var(--color-text-on-dark);
}

.section--dark-alt {
  background-color: var(--color-bg-dark-alt);
  color: var(--color-text-on-dark);
}

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

/* --- Section Header --- */
.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-label {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--text-small);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin-bottom: var(--space-sm);
}

.section-title {
  font-size: var(--text-h1);
  font-weight: 800;
  margin-bottom: var(--space-md);
}

.section-subtitle {
  font-size: var(--text-body-lg);
  color: var(--color-text-secondary);
  max-width: 640px;
  margin: 0 auto;
}

.section--dark .section-subtitle {
  color: var(--color-text-on-dark-sub);
}

/* --- Header / Navigation --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  display: flex;
  align-items: center;
  transition: background-color var(--transition-base), box-shadow var(--transition-base);
}

.header--scrolled {
  background-color: rgba(1, 61, 149, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

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

.header__logo {
  display: flex;
  align-items: center;
  z-index: 1001;
}

.header__logo-img {
  height: 24px;
  width: auto;
  display: block;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.header__nav-link {
  font-family: var(--font-heading);
  font-size: var(--text-small);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-on-dark);
  position: relative;
  padding: var(--space-xs) 0;
}

.header__nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-secondary);
  transition: width var(--transition-base);
}

.header__nav-link:hover::after,
.header__nav-link--active::after {
  width: 100%;
}

.header__nav-link--cta {
  background: var(--color-secondary);
  color: var(--color-text-on-dark);
  padding: 10px 24px;
  border-radius: var(--border-radius-full);
  font-weight: 700;
}

.header__nav-link--cta::after {
  display: none;
}

.header__nav-link--cta:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

/* Dropdown Menu (PC) */
.nav-item--has-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--color-bg-light);
  min-width: 260px;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  pointer-events: none;
  z-index: 1002;
  border: 1px solid var(--color-border);
  padding: var(--space-xs) 0;
}

.nav-item--has-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Invisible bridge so hover doesn't break */
.nav-item--has-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 20px;
}

.dropdown-menu__link {
  display: block;
  padding: 12px var(--space-md);
  color: var(--color-text-primary);
  font-size: var(--text-small);
  font-weight: 600;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.dropdown-menu__link:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--color-secondary);
}

/* Hamburger */
.header__hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 1001;
  padding: 8px;
}

.header__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-text-on-dark);
  transition: var(--transition-base);
  transform-origin: center;
}

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

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

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

/* Mobile Navigation Overlay */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(1, 61, 149, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.mobile-nav--active {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.mobile-nav__link {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-on-dark);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.mobile-nav--active .mobile-nav__link {
  opacity: 1;
  transform: translateY(0);
}

.mobile-nav--active .mobile-nav__link:nth-child(1) {
  transition-delay: 0.1s;
}

.mobile-nav--active .mobile-nav__link:nth-child(2) {
  transition-delay: 0.15s;
}

.mobile-nav--active .mobile-nav__link:nth-child(3) {
  transition-delay: 0.2s;
}

.mobile-nav--active .mobile-nav__link:nth-child(4) {
  transition-delay: 0.25s;
}

.mobile-nav--active .mobile-nav__link:nth-child(5) {
  transition-delay: 0.3s;
}

/* Dropdown Menu (Mobile) */
.mobile-nav__item-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.mobile-nav__sublist {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: 80%;
}

.mobile-nav__sublink {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-on-dark-sub);
  transition: color var(--transition-fast);
  padding: 8px 0;
}

.mobile-nav__sublink:hover {
  color: var(--color-secondary);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-body);
  padding: 14px 36px;
  border-radius: var(--border-radius-full);
  transition: all var(--transition-base);
  cursor: pointer;
  white-space: nowrap;
}

.btn--primary {
  background: var(--color-secondary);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(178, 149, 93, 0.3);
}

.btn--primary:hover {
  box-shadow: 0 6px 25px rgba(178, 149, 93, 0.4);
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn--outline {
  border: 2px solid var(--color-text-on-dark);
  color: var(--color-text-on-dark);
  background: transparent;
}

.btn--outline:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.btn--outline-dark {
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  background: transparent;
}

.btn--outline-dark:hover {
  background: var(--color-primary);
  color: var(--color-text-on-dark);
  transform: translateY(-2px);
}

.btn--secondary {
  background-color: var(--color-primary);
  color: var(--color-text-on-dark);
}

.btn--secondary:hover {
  background-color: #082C5A;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn--black {
  background-color: #000000;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn--black:hover {
  background-color: #333333;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.btn--sm {
  padding: 10px 24px;
  font-size: var(--text-small);
}

.btn--lg {
  padding: 18px 48px;
  font-size: var(--text-body-lg);
}

.btn__icon {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-fast);
}

.btn:hover .btn__icon {
  transform: translateX(4px);
}

/* --- Cards --- */
.card {
  background: #FFFFFF;
  border-radius: var(--border-radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  border: 1px solid var(--color-border);
}

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

.card--dark {
  background: var(--color-bg-dark-alt);
  border-color: var(--color-border-light);
}

.card--dark:hover {
  border-color: var(--color-secondary);
  box-shadow: 0 8px 32px rgba(96, 165, 250, 0.15);
}

.card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--border-radius-md);
  background: var(--color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  transition: transform var(--transition-spring);
}

.card:hover .card__icon {
  transform: scale(1.1);
}

.card__icon svg {
  width: 28px;
  height: 28px;
  color: var(--color-primary);
}

.card__title {
  font-size: var(--text-h3);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.card__text {
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.card--dark .card__text {
  color: var(--color-text-on-dark-sub);
}

/* --- Footer --- */
.footer {
  background-color: rgba(1, 61, 149, 1);
  color: var(--color-text-on-dark);
  padding: var(--space-3xl) 0 var(--space-lg);
}

.footer__inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-3xl);
}

.footer__brand-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.footer__brand-desc {
  color: var(--color-text-on-dark-sub);
  font-size: var(--text-small);
  line-height: 1.7;
}

.footer__col-title {
  font-family: var(--font-heading);
  font-size: var(--text-small);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
  color: var(--color-secondary);
}

.footer__link {
  display: block;
  color: var(--color-text-on-dark-sub);
  font-size: var(--text-small);
  padding: var(--space-xs) 0;
  transition: color var(--transition-fast);
}

.footer__link:hover {
  color: var(--color-text-on-dark);
}

.footer__bottom {
  border-top: 1px solid var(--color-border-light);
  padding-top: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.footer__copyright {
  font-size: var(--text-xs);
  color: var(--color-text-on-dark-sub);
}

/* --- Page Hero (Sub-pages) --- */
.page-hero {
  background-color: var(--color-bg-dark);
  padding-top: calc(var(--header-height) + var(--space-3xl));
  padding-bottom: var(--space-3xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.page-hero__label {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin-bottom: var(--space-sm);
}

.page-hero__title {
  font-size: var(--text-hero);
  font-weight: 900;
  color: var(--color-text-on-dark);
  margin-bottom: var(--space-md);
}

.page-hero__subtitle {
  font-size: var(--text-body-lg);
  color: var(--color-text-on-dark-sub);
  max-width: 640px;
  margin: 0 auto;
}

/* --- Fade-in Animation --- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* --- Footer Social Links --- */
.footer__social {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: var(--color-text-on-dark);
  transition: all var(--transition-base);
}

.footer__social-link:hover {
  background: var(--color-secondary);
  transform: translateY(-3px);
  color: var(--color-text-on-dark);
}

.footer__social-icon {
  width: 18px;
  height: 18px;
}

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

  .container {
    padding: 0 var(--space-md);
  }

  .header__nav {
    display: none;
  }

  .header__hamburger {
    display: flex;
  }

  .footer__inner {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

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

  .section-header {
    margin-bottom: var(--space-2xl);
  }

  .btn--lg {
    padding: 14px 36px;
    font-size: var(--text-body);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-sm);
  }
}

/* ============================================
   Descente-style Alternating Layout
   ============================================ */
.descente-section {
  position: relative;
  padding: var(--space-3xl) 0;
  overflow: hidden;
  background-color: var(--color-bg);
  /* Default, override in HTML if needed */
}

.descente-section--light {
  background-color: #f8f9fa;
}

/* Watermark Text */
.descente-watermark {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) rotate(350deg);
  font-size: 10vw;
  /* Responsive huge size */
  font-weight: 900;
  color: rgba(0, 0, 0, 0.03);
  /* Very light gray */
  font-family: "Segoe Script", "SegoeScript", "Dancing Script", cursive !important;
  white-space: nowrap;
  letter-spacing: 0.1em;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

.descente-section--dark .descente-watermark {
  color: rgba(255, 255, 255, 0.03);
  /* Light outline for dark background */
}

/* Container */
.descente-container {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  position: relative;
  z-index: 1;
  gap: var(--space-2xl);
}

/* Alternating Reverse */
.descente-container--reverse {
  flex-direction: row-reverse;
}

/* Vertical Heading Wrapper */
.descente-heading-wrapper {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
  padding-top: var(--space-xl);
}

.descente-container--reverse .descente-heading-wrapper {
  align-items: flex-end;
}

/* Accent Line */
.descente-accent-line {
  width: 80px;
  height: 12px;
  background-color: #111;
  border-radius: 0 0 12px 0;
  display: block;
}

.descente-container--reverse .descente-accent-line {
  border-radius: 0 0 0 12px;
}

/* Vertical Heading Text */
.descente-heading-vertical {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-heading);
  font-size: 4rem;
  /* Large size */
  font-weight: 900;
  color: var(--color-text-primary);
  letter-spacing: 0.1em;
  line-height: 1;
  margin: 0;
}

.descente-section--light .descente-heading-vertical {
  color: var(--color-text-primary);
}

/* Content Area */
.descente-content {
  flex: 1;
  min-width: 0;
  /* Prevent flex overflow */
}

/* Responsive (Mobile/Tablet Stack) */
@media (max-width: 992px) {

  .descente-container {
    flex-direction: row;
    gap: var(--space-md);
  }

  .descente-container--reverse {
    flex-direction: row-reverse;
    gap: var(--space-md);
  }

  .descente-heading-wrapper {
    padding-top: var(--space-sm);
    gap: var(--space-sm);
  }

  .descente-heading-vertical {
    font-size: 1.96rem;
    /* 70% of 2.8rem */
  }

  .descente-accent-line {
    width: 42px;
    /* 70% of 60px */
    height: 8px;
    border-radius: 0 0 8px 0;
  }

  .descente-container--reverse .descente-accent-line {
    border-radius: 0 0 0 8px;
  }

  .descente-watermark {
    font-size: 20vw;
  }
}