/* ===================================
   CSS Variables
   =================================== */
:root {
  /* Colors */
  --color-primary: #014189;
  --color-accent: #00a3e7;
  --color-sub: #009ba6;
  --color-base: #ffffff;
  --color-base-sub: #f8f9fa;
  --color-text: #4a4a4a;
  --color-text-light: #6c757d;
  --color-border: #e0e0e0;

  /* Typography */
  --font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-label: 14px;
  --font-size-heading: 32px;
  --font-size-subheading: 20px;
  --font-size-body: 16px;
  --font-size-small: 14px;

  /* Spacing */
  --section-padding: 120px;
  --container-width: 1200px;
  --container-narrow: 800px;

  /* Header */
  --header-height: 80px;

  /* Transitions */
  --transition: all 0.3s ease;
}

/* ===================================
   Base Styles
   =================================== */
html {
  scroll-behavior: smooth;
}

/* Page load animation */
body {
  font-family: var(--font-family);
  font-size: var(--font-size-body);
  line-height: 1.8;
  color: var(--color-text);
  background-color: var(--color-base);
  opacity: 0;
  transition: opacity 0.6s ease-out;
}

body.is-loaded {
  opacity: 1;
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ===================================
   Common Components
   =================================== */
.section__label {
  font-size: var(--font-size-label);
  letter-spacing: 0.3em;
  color: var(--color-accent);
  text-align: center;
  margin-bottom: 8px;
}

.section__title {
  font-size: var(--font-size-heading);
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: 60px;
  letter-spacing: 0.05em;
}

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

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

/* ===================================
   Header
   =================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: var(--transition);
}

.header.is-scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.header__logo {
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.header__logo-img {
  height: 48px;
  width: auto;
}

.header__nav-list {
  display: flex;
  gap: 40px;
}

.header__nav-link {
  font-size: var(--font-size-small);
  font-weight: 700;
  color: var(--color-primary);
  transition: var(--transition);
  position: relative;
}

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

.header__nav-link:hover {
  color: var(--color-sub);
}

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

/* Hamburger */
.header__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 30px;
  height: 30px;
}

.header__hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
  transition: var(--transition);
}

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

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

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

/* ===================================
   Hero
   =================================== */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  background-image: url('../images/hero-pc.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero__content {
  padding-left: 10%;
}

.hero__catch-sub {
  font-size: var(--font-size-body);
  letter-spacing: 0.3em;
  color: var(--color-primary);
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.hero__catch-main {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-primary);
  letter-spacing: 0.05em;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.hero__scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--color-primary);
  opacity: 0;
  transition: opacity 0.6s ease-out;
}

/* Hero entrance animation */
body.is-loaded .hero__catch-sub {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.3s;
}

body.is-loaded .hero__catch-main {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.6s;
}

body.is-loaded .hero__scroll {
  opacity: 1;
  transition-delay: 1.2s;
}

.hero__scroll-text {
  font-size: 12px;
  letter-spacing: 0.1em;
}

.hero__scroll-icon {
  width: 24px;
  height: 24px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

/* ===================================
   Philosophy
   =================================== */
.philosophy {
  padding: var(--section-padding) 24px;
  background-color: var(--color-base);
}

.philosophy__inner {
  max-width: var(--container-narrow);
  margin: 0 auto;
}

.philosophy__content {
  text-align: center;
}

.philosophy__text {
  font-family: 'Noto Serif JP', serif;
  font-size: 24px;
  font-weight: 500;
  line-height: 2.2;
  color: var(--color-primary);
  letter-spacing: 0.05em;
}

.philosophy__text--second {
  margin-top: 24px;
}

/* Line by line animation */
.philosophy__line {
  display: block;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* 1st paragraph lines */
.philosophy__content.is-visible .philosophy__text:nth-child(1) .philosophy__line:nth-child(1) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0s;
}

.philosophy__content.is-visible .philosophy__text:nth-child(1) .philosophy__line:nth-child(2) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.2s;
}

.philosophy__content.is-visible .philosophy__text:nth-child(1) .philosophy__line:nth-child(3) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.4s;
}

/* 2nd paragraph lines */
.philosophy__content.is-visible .philosophy__text:nth-child(2) .philosophy__line:nth-child(1) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.8s;
}

.philosophy__content.is-visible .philosophy__text:nth-child(2) .philosophy__line:nth-child(2) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 1.0s;
}

.philosophy__content.is-visible .philosophy__text:nth-child(2) .philosophy__line:nth-child(3) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 1.2s;
}

/* Marker highlight animation */
.philosophy__text-highlight {
  background: linear-gradient(transparent 60%, rgba(0, 163, 231, 0.25) 60%);
  background-size: 0% 100%;
  background-repeat: no-repeat;
  transition: background-size 0.6s ease-out;
}

.philosophy__content.is-visible .philosophy__text:nth-child(1) .philosophy__text-highlight {
  background-size: 100% 100%;
  transition-delay: 0.8s;
}

.philosophy__content.is-visible .philosophy__text:nth-child(2) .philosophy__text-highlight {
  background-size: 100% 100%;
  transition-delay: 1.4s;
}


/* ===================================
   Values
   =================================== */
.values {
  padding: var(--section-padding) 24px;
  background-color: var(--color-base-sub);
}

.values__inner {
  max-width: var(--container-width);
  margin: 0 auto;
}

.values__cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px;
}

.values__card {
  flex: 0 1 calc((100% - 40px) / 2);
  max-width: calc((100% - 40px) / 2);
}

.values__card {
  position: relative;
  overflow: hidden;
  background-color: var(--color-base);
  padding: 40px 30px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: var(--transition);
}

/* Background number */
.values__card::before {
  content: attr(data-number);
  position: absolute;
  top: -10px;
  right: -5px;
  font-size: 120px;
  font-weight: 700;
  line-height: 1;
  color: rgba(0, 163, 231, 0.08);
  pointer-events: none;
  z-index: 0;
}

.values__card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.values__card-icon {
  position: relative;
  z-index: 1;
  margin-bottom: 16px;
  color: var(--color-primary);
}

.values__card-icon svg {
  width: 48px;
  height: 48px;
}

.values__card-title {
  position: relative;
  z-index: 1;
  font-size: var(--font-size-subheading);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 16px;
}

.values__card-text {
  position: relative;
  z-index: 1;
  font-size: var(--font-size-small);
  line-height: 1.8;
  color: var(--color-text);
}

/* ===================================
   Company
   =================================== */
.company {
  padding: var(--section-padding) 24px;
  background-color: var(--color-base);
}

.company__inner {
  max-width: 900px;
  margin: 0 auto;
}

.company__table-wrapper {
  margin-bottom: 60px;
}

.company__table {
  width: 100%;
  border-collapse: collapse;
}

.company__table th,
.company__table td {
  padding: 20px;
  border: 1px solid var(--color-border);
  text-align: left;
}

.company__table th {
  width: 150px;
  background-color: var(--color-base-sub);
  font-weight: 700;
  color: var(--color-primary);
}

.company__table td {
  background-color: var(--color-base);
}

.company__image img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 8px;
}

/* ===================================
   Footer
   =================================== */
.footer {
  background-color: var(--color-primary);
  color: var(--color-base);
  padding: 60px 24px 40px;
}

.footer__inner {
  max-width: var(--container-width);
  margin: 0 auto;
}

.footer__info {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 40px;
}

.footer__logo {
  flex-shrink: 0;
}

.footer__logo-img {
  height: 56px;
  width: auto;
  filter: brightness(0) invert(1);
}

.footer__address {
  font-size: var(--font-size-small);
  line-height: 1.8;
  opacity: 0.8;
}

.footer__nav {
  margin-bottom: 24px;
}

.footer__nav-list {
  display: flex;
  justify-content: center;
  gap: 32px;
}

.footer__nav-link {
  font-size: var(--font-size-small);
  color: var(--color-base);
  opacity: 0.8;
  transition: var(--transition);
}

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

.footer__copyright {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
}

.footer__copyright small {
  font-size: 12px;
  opacity: 0.8;
}

/* ===================================
   Subpage
   =================================== */
.subpage-hero {
  position: relative;
  padding-top: calc(var(--header-height) + 60px);
  padding-bottom: 60px;
  background-image: url('../images/hero-pc.png');
  background-size: cover;
  background-position: center;
  text-align: center;
}

.subpage-hero__title {
  font-size: var(--font-size-heading);
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.05em;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.9),
    0 0 16px rgba(255, 255, 255, 0.6);
}

.subpage-hero__label {
  font-size: var(--font-size-label);
  letter-spacing: 0.3em;
  color: var(--color-accent);
  margin-bottom: 8px;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.9),
    0 0 16px rgba(255, 255, 255, 0.6);
}

.subpage-content {
  padding: 80px 24px;
  background-color: var(--color-base);
}

.subpage-content__inner {
  max-width: var(--container-narrow);
  margin: 0 auto;
}

.subpage-content h2 {
  font-size: var(--font-size-subheading);
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-accent);
}

.subpage-content h2:first-child {
  margin-top: 0;
}

.subpage-content p {
  margin-bottom: 16px;
  line-height: 2.0;
}

.subpage-content ul,
.subpage-content ol {
  margin-bottom: 16px;
  padding-left: 1.5em;
  line-height: 2.0;
}

.subpage-content li {
  margin-bottom: 4px;
}

.subpage-content .indent {
  padding-left: 1.5em;
}

.subpage-content .company-sign {
  margin-top: 48px;
  text-align: right;
}

.subpage-content .contact-box {
  margin-top: 32px;
  padding: 24px;
  background-color: var(--color-base-sub);
  border-radius: 8px;
  line-height: 2.0;
}

.subpage-content .contact-box dt {
  font-weight: 700;
  color: var(--color-primary);
}

/* ===================================
   Page Top Button
   =================================== */
.page-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: var(--color-base);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 900;
}

.page-top.is-visible {
  opacity: 1;
  visibility: visible;
}

.page-top:hover {
  background-color: var(--color-accent);
}

.page-top svg {
  width: 20px;
  height: 20px;
}

/* ===================================
   Responsive - Tablet
   =================================== */
@media (max-width: 1279px) {
  :root {
    --section-padding: 100px;
    --font-size-heading: 28px;
  }

  .hero,
  .subpage-hero {
    background-image: url('../images/hero-tablet.png');
  }

  .hero__content {
    padding-left: 0;
    text-align: center;
    width: 100%;
    padding: 0 24px;
  }

  .hero__catch-main {
    font-size: 40px;
  }

  .philosophy__text {
    font-size: 20px;
  }
}

/* ===================================
   Responsive - Smartphone
   =================================== */
@media (max-width: 767px) {
  :root {
    --header-height: 60px;
    --section-padding: 80px;
    --font-size-label: 12px;
    --font-size-heading: 24px;
    --font-size-subheading: 18px;
    --font-size-body: 14px;
  }

  .header__nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background-color: var(--color-base);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
  }

  .header__nav.is-open {
    opacity: 1;
    visibility: visible;
  }

  .header__nav-list {
    flex-direction: column;
    align-items: center;
    gap: 32px;
  }

  .header__nav-link {
    font-size: 18px;
  }

  .header__logo-img {
    height: 36px;
  }

  .header__hamburger {
    display: flex;
  }

  .footer__logo-img {
    height: 44px;
  }

  .hero,
  .subpage-hero {
    background-image: url('../images/hero-sp.png');
  }

  .hero__catch-sub {
    font-size: 12px;
    letter-spacing: 0.2em;
  }

  .hero__catch-main {
    font-size: 28px;
  }

  .section__title {
    margin-bottom: 40px;
  }

  .philosophy__text {
    font-size: 16px;
    line-height: 2.0;
  }

  .values__cards {
    gap: 24px;
  }

  .values__card {
    flex: 0 1 100%;
    max-width: 100%;
  }

  .values__card {
    padding: 32px 24px;
  }

  .company__table th,
  .company__table td {
    display: block;
    width: 100%;
  }

  .company__table th {
    border-bottom: none;
  }

  .company__table td {
    border-top: none;
  }

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

  .footer__nav-list {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
}
