/* CSS Variables */
:root {
  --color-text-primary: #111827;
  --color-text-white: #ffffff;
  --color-bg-hero: #f8f9fb;
  --color-bg-dark: #000000;
  --font-family-base: "Manrope", "Yu Gothic Medium", "Yu Gothic", "Noto Sans JP",
    "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "palt";
  letter-spacing: 0.05em;

  /* Mobile-first variables (used for all screen sizes) */
  --hero-walking-person-size: clamp(10px, 5vh, 100px);
  --hero-walking-person-offset: clamp(8px, 3vw, 12px);
  --hero-circle-top: clamp(48px, 13vh, 120px);
  --hero-circle-size: clamp(220px, 82vw, 320px);
  --hero-overlay-size: clamp(150px, 58vw, 220px);
  --hero-tagline-gap: clamp(16px, 4vh, 48px);
  --hero-overlay-offset-y: calc(var(--hero-circle-size) * 0.12);
  --hero-overlay-translate-y: -25%;
  --hero-slide-distance: clamp(160px, 36vh, 480px);
}

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

body {
  font-family: var(--font-family-base);
  background: var(--color-bg-dark);
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* Desktop: Center content with mobile aspect ratio */
@media (min-width: 601px) {
  body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: calc(
    var(--hero-circle-top) + var(--hero-circle-size) + var(--hero-tagline-gap) +
      320px
  );
  height: auto;
  background: var(--color-bg-hero);
  overflow-y: visible;
  overflow-x: hidden;
  width: 100%;
  outline: none;
  border: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Desktop: Fixed mobile aspect ratio (9:16) */
@media (min-width: 601px) {
  .hero {
    min-height: 100vh;
    height: auto;
    width: calc(100vh * 9 / 16);
    max-width: 100vw;
    margin: 0 auto;
  }
}

.hero__viewport {
  position: relative;
  width: 100%;
  min-height: inherit;
  height: auto;
  overflow-x: hidden;
  overflow-y: visible;
  z-index: 20;
  outline: none;
  border: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.hero__walking-person {
  position: absolute;
  left: 50%;
  top: calc(
    var(--hero-circle-top) - var(--hero-walking-person-size) -
      var(--hero-walking-person-offset)
  );
  width: var(--hero-walking-person-size);
  height: auto;
  z-index: 25;
  pointer-events: none;
  will-change: transform;
  animation: none !important;
}

.hero__circle {
  position: absolute;
  left: 50%;
  top: var(--hero-circle-top);
  width: min(var(--hero-circle-size), 94vw);
  aspect-ratio: 1 / 1;
  z-index: 25;
  pointer-events: none;
  transform-origin: 50% 50%;
  animation: spin-circle 18s linear infinite;
}

@keyframes spin-circle {
  from {
    transform: translateX(-50%) rotate(0deg);
  }
  to {
    transform: translateX(-50%) rotate(360deg);
  }
}

.hero__logo-overlay {
  position: absolute;
  left: 50%;
  text-align: center;
  top: calc(
    var(--hero-circle-top) + (var(--hero-circle-size) / 2) -
      (var(--hero-overlay-offset-y) / 2)
  );
  width: min(
    var(--hero-overlay-size),
    calc(var(--hero-circle-size) * 0.46),
    72vw
  );
  height: auto;
  transform: translate(-50%, var(--hero-overlay-translate-y));
  z-index: 26;
  pointer-events: auto;
  cursor: pointer;
}

.hero__tagline {
  position: absolute;
  left: calc(50% + 1rem);
  top: calc(
    var(--hero-circle-top) + var(--hero-circle-size) + var(--hero-tagline-gap)
  );
  width: clamp(220px, 92vw, 360px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: clamp(1.8rem, 7vw, 3.2rem);
  font-weight: 800;
  color: var(--color-text-white);
  letter-spacing: clamp(0.04em, 1.1vw, 0.08em);
  line-height: 1.25;
  z-index: 24;
  pointer-events: auto;
}

.hero__tagline-sub {
  font-size: clamp(1rem, 4vw, 1.2rem);
  padding-top: 1.5rem;
  padding-right: 1rem;
  font-weight: 400;
  max-width: fit-content;
  white-space: nowrap;
}

.hero__contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(0.6rem, 2vw, 0.8rem);
  margin-top: clamp(2.25rem, 6vw, 3rem);
  padding: 0 1rem;
}

.hero__contact-item {
  font-size: clamp(0.85rem, 3.5vw, 1rem);
  font-weight: 400;
  color: var(--color-text-white);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.3s ease;
  opacity: 0.9;
}

.hero__contact-item:hover {
  opacity: 1;
  transform: translateY(-2px);
  text-shadow: 0 2px 8px rgba(255, 255, 255, 0.3);
}
.hero__tagline > span {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
}

.hero__tagline > span:first-child {
  margin-bottom: 0.12em;
  margin-left: -1em;
}

.hero__tagline-line {
  display: inline-flex;
  align-items: center;
  gap: 0.24ch;
  white-space: nowrap;
}

.hero__tagline-ellipsis {
  display: inline-flex;
  min-width: 3ch;
  justify-content: flex-start;
  font-family: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}

.hero__tagline-ellipsis::before {
  content: "";
  animation: hero-tagline-ellipsis 1.4s steps(1, end) infinite;
}

@keyframes hero-tagline-ellipsis {
  0%,
  20% {
    content: ".";
  }
  40%,
  60% {
    content: "..";
  }
  80%,
  100% {
    content: "...";
  }
}

.hero__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(
    var(--hero-circle-top) + var(--hero-circle-size) + var(--hero-tagline-gap) +
      320px
  );
  min-height: 100vh;
  background: var(--color-bg-dark);
  z-index: 0;
  pointer-events: none;
}

/* Short viewport optimization */
@media (max-height: 700px) {
  .hero__tagline {
    font-size: clamp(1.5rem, 6vw, 2.8rem);
  }
  
  .hero__tagline-sub {
    font-size: clamp(0.85rem, 3.5vw, 1rem);
    padding-top: 1rem;
  }
  
  .hero__contact {
    gap: 0.4rem;
    margin-top: 1rem;
  }
  
  .hero__contact-item {
    font-size: clamp(0.75rem, 3vw, 0.9rem);
  }
}

@media (max-height: 600px) {
  .hero__tagline {
    font-size: clamp(1.3rem, 5.5vw, 2.5rem);
  }
  
  .hero__tagline-sub {
    font-size: clamp(0.75rem, 3vw, 0.9rem);
    padding-top: 0.75rem;
  }
  
  .hero__contact {
    gap: 0.3rem;
    margin-top: 0.75rem;
  }
  
  .hero__contact-item {
    font-size: clamp(0.7rem, 2.8vw, 0.85rem);
  }
}
