@layer base, layout, components, utilities, pages;

/* =========================================
   Page: Company - 2025 Modern Design
   =========================================
   Features:
   - Bilingual typography (Japanese + English)
   - Grain texture overlays
   - Bold section headers
   - Card-based layout with hover effects
   - Staggered animations
   ========================================= */

@layer pages {

  /* Design Tokens */
  .page-company {
    --cp-gold: #b38f2d;
    --cp-gold-light: #d8b768;
    --cp-gold-pale: #f5dfa6;
    --cp-dark: #0a0908;
    --cp-dark-warm: #141210;
    --cp-cream: #fffcf5;
    --cp-cream-dark: #f8f4eb;
    --cp-text: #1a1612;
    --cp-text-muted: rgba(26, 22, 18, 0.65);
    --cp-border: rgba(179, 143, 45, 0.15);
    --cp-border-strong: rgba(179, 143, 45, 0.35);
    --cp-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --cp-ease-out: cubic-bezier(0.0, 0, 0.2, 1);

    background: var(--cp-cream);
    color: var(--cp-text);
  }

  /* =========================================
     Hero Section
     ========================================= */
  .cp-hero {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    min-height: clamp(320px, 45vh, 420px);
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--cp-dark);
  }

  .cp-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
  }

  .cp-hero__bg-overlay {
    position: absolute;
    inset: 0;
    background: var(--cp-dark);
  }

  .cp-hero__bg-grain {
    position: absolute;
    inset: 0;
    opacity: 0.35;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    mix-blend-mode: overlay;
  }

  .cp-hero__decor {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
  }

  .cp-hero__decor-line {
    position: absolute;
    background: var(--cp-gold);
    opacity: 0.25;
  }

  .cp-hero__decor-line--left {
    left: clamp(20px, 5vw, 60px);
    top: 20%;
    bottom: 20%;
    width: 1px;
  }

  .cp-hero__decor-line--right {
    right: clamp(20px, 5vw, 60px);
    top: 20%;
    bottom: 20%;
    width: 1px;
  }

  .cp-hero__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 900px;
    padding: clamp(80px, 12vh, 120px) clamp(24px, 5vw, 48px);
  }

  .cp-hero__content {
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 3vw, 24px);
  }

  .cp-hero__eyebrow {
    margin: 0;
    font-family: "DM Sans", var(--font-sans);
    font-size: clamp(0.7rem, 1vw, 0.8rem);
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--cp-gold);
  }

  .cp-hero__title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.2;
    color: #fff;
  }

  .cp-hero__lead {
    margin: 0;
    max-width: 600px;
    font-size: clamp(0.9rem, 1.3vw, 1rem);
    line-height: 1.9;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.7);
  }

  @media (max-width: 640px) {
    .cp-hero__decor-line {
      display: none;
    }
  }

  /* =========================================
     Body / Main Content
     ========================================= */
  .cp-body {
    padding: clamp(56px, 10vw, 96px) 0 clamp(72px, 12vw, 120px);
  }

  .cp-body__inner {
    display: grid;
    gap: clamp(64px, 10vw, 100px);
    max-width: 1100px;
  }

  /* =========================================
     Section Base
     ========================================= */
  .cp-section {
    display: grid;
    gap: clamp(32px, 5vw, 48px);
  }

  .cp-section__head {
    display: grid;
    gap: clamp(8px, 1.5vw, 12px);
    max-width: 700px;
  }

  .cp-section__eyebrow {
    font-family: "DM Sans", var(--font-sans);
    font-size: clamp(0.65rem, 0.9vw, 0.75rem);
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--cp-gold);
  }

  .cp-section__title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.3;
    color: var(--cp-text);
  }

  .cp-section__lead {
    margin: 0;
    font-size: clamp(0.9rem, 1.2vw, 0.98rem);
    line-height: 1.8;
    color: var(--cp-text-muted);
  }

  /* =========================================
     Overview Section
     ========================================= */
  .cp-overview {
    display: grid;
    gap: clamp(12px, 2vw, 16px);
    margin: 0;
  }

  .cp-overview__row {
    display: grid;
    gap: clamp(8px, 1.5vw, 12px);
    padding: clamp(20px, 3vw, 28px);
    background: #fff;
    border: 1px solid var(--cp-border);
    transition: all 0.3s var(--cp-ease);
  }

  .cp-overview__row:hover {
    border-color: var(--cp-border-strong);
    box-shadow: 0 8px 32px rgba(43, 32, 16, 0.08);
  }

  .cp-overview__term {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .cp-overview__term-en {
    font-family: "DM Sans", var(--font-sans);
    font-size: clamp(0.6rem, 0.8vw, 0.68rem);
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--cp-gold);
  }

  .cp-overview__term-ja {
    font-size: clamp(0.9rem, 1.2vw, 1rem);
    font-weight: 700;
    color: var(--cp-text);
  }

  .cp-overview__desc {
    margin: 0;
    font-size: clamp(0.9rem, 1.1vw, 0.98rem);
    line-height: 1.7;
    color: var(--cp-text-muted);
  }

  @media (min-width: 768px) {
    .cp-overview__row {
      grid-template-columns: 200px 1fr;
      align-items: start;
      gap: clamp(20px, 3vw, 32px);
    }
  }

  /* =========================================
     Philosophy Section
     ========================================= */
  .cp-philosophy {
    display: grid;
    gap: clamp(16px, 2.5vw, 24px);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .cp-philosophy__item {
    display: grid;
    gap: clamp(10px, 1.5vw, 14px);
    padding: clamp(24px, 4vw, 36px);
    background: #fff;
    border: 1px solid var(--cp-border);
    border-left: 4px solid var(--cp-gold);
    transition: all 0.3s var(--cp-ease);
  }

  .cp-philosophy__item:hover {
    border-left-color: var(--cp-gold-light);
    box-shadow: 0 8px 32px rgba(43, 32, 16, 0.08);
    transform: translateX(4px);
  }

  .cp-philosophy__en {
    font-family: "DM Sans", var(--font-sans);
    font-size: clamp(0.68rem, 1vw, 0.78rem);
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--cp-gold);
  }

  .cp-philosophy__text {
    margin: 0;
    font-size: clamp(0.95rem, 1.2vw, 1.05rem);
    line-height: 1.9;
    color: var(--cp-text);
  }

  /* =========================================
     Certifications Section
     ========================================= */
  .cp-certs {
    display: grid;
    gap: clamp(16px, 2.5vw, 24px);
  }

  @media (min-width: 640px) {
    .cp-certs {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  .cp-certs__card {
    display: grid;
    gap: clamp(10px, 1.5vw, 14px);
    padding: clamp(24px, 4vw, 32px);
    background: var(--cp-dark);
    color: #fff;
    transition: all 0.3s var(--cp-ease);
  }

  .cp-certs__card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(43, 32, 16, 0.2);
  }

  .cp-certs__en {
    font-family: "DM Sans", var(--font-sans);
    font-size: clamp(0.6rem, 0.8vw, 0.68rem);
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--cp-gold);
  }

  .cp-certs__title {
    margin: 0;
    font-family: "DM Sans", var(--font-sans);
    font-size: clamp(1.3rem, 2vw, 1.6rem);
    font-weight: 700;
    letter-spacing: 0.02em;
  }

  .cp-certs__meta {
    display: grid;
    gap: 4px;
  }

  .cp-certs__meta p {
    margin: 0;
    font-size: clamp(0.8rem, 1vw, 0.88rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
  }

  .cp-certs__details {
    display: grid;
    gap: clamp(12px, 2vw, 16px);
    margin: 0;
  }

  .cp-certs__detail {
    display: grid;
    gap: clamp(6px, 1vw, 10px);
    padding: clamp(16px, 2.5vw, 22px);
    background: #fff;
    border: 1px solid var(--cp-border);
  }

  .cp-certs__detail dt {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .cp-certs__detail-en {
    font-family: "DM Sans", var(--font-sans);
    font-size: clamp(0.58rem, 0.75vw, 0.65rem);
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--cp-gold);
  }

  .cp-certs__detail-ja {
    font-size: clamp(0.85rem, 1.1vw, 0.92rem);
    font-weight: 700;
    color: var(--cp-text);
  }

  .cp-certs__detail dd {
    margin: 0;
    font-size: clamp(0.88rem, 1.1vw, 0.95rem);
    line-height: 1.7;
    color: var(--cp-text-muted);
  }

  .cp-award {
    display: grid;
    gap: clamp(8px, 1.2vw, 12px);
    padding: clamp(20px, 3vw, 28px);
    background: rgba(179, 143, 45, 0.08);
    border: 1px solid var(--cp-border-strong);
    border-left: 4px solid var(--cp-gold);
  }

  .cp-award__en {
    font-family: "DM Sans", var(--font-sans);
    font-size: clamp(0.6rem, 0.8vw, 0.68rem);
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--cp-gold);
  }

  .cp-award__text {
    margin: 0;
    font-size: clamp(0.9rem, 1.1vw, 0.98rem);
    line-height: 1.7;
    color: var(--cp-text);
  }

  /* =========================================
     Access Section
     ========================================= */
  .cp-locations {
    display: grid;
    gap: clamp(16px, 2.5vw, 24px);
  }

  @media (min-width: 768px) {
    .cp-locations {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  .cp-location {
    display: grid;
    gap: clamp(14px, 2vw, 20px);
    padding: clamp(24px, 4vw, 32px);
    background: #fff;
    border: 1px solid var(--cp-border);
    border-top: 4px solid var(--cp-gold);
    transition: all 0.3s var(--cp-ease);
  }

  .cp-location:hover {
    border-top-color: var(--cp-gold-light);
    box-shadow: 0 12px 40px rgba(43, 32, 16, 0.1);
    transform: translateY(-4px);
  }

  .cp-location__header {
    display: grid;
    gap: 4px;
  }

  .cp-location__en {
    font-family: "DM Sans", var(--font-sans);
    font-size: clamp(0.6rem, 0.8vw, 0.68rem);
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--cp-gold);
  }

  .cp-location__title {
    margin: 0;
    font-size: clamp(1.2rem, 1.8vw, 1.4rem);
    font-weight: 700;
    color: var(--cp-text);
  }

  .cp-location__address {
    font-style: normal;
    font-size: clamp(0.9rem, 1.1vw, 0.98rem);
    line-height: 1.6;
    color: var(--cp-text);
  }

  .cp-location__info {
    display: grid;
    gap: clamp(8px, 1.2vw, 12px);
    margin: 0;
  }

  .cp-location__info-row {
    display: grid;
    gap: 4px;
  }

  .cp-location__info-row dt {
    font-size: clamp(0.7rem, 0.9vw, 0.78rem);
    font-weight: 700;
    color: var(--cp-text-muted);
  }

  .cp-location__info-row dd {
    margin: 0;
    font-size: clamp(0.85rem, 1vw, 0.92rem);
    line-height: 1.6;
    color: var(--cp-text);
  }

  .cp-location__note {
    margin: 0;
    padding: clamp(10px, 1.5vw, 14px);
    background: rgba(179, 143, 45, 0.08);
    font-size: clamp(0.8rem, 0.95vw, 0.88rem);
    color: var(--cp-gold);
    border-left: 3px solid var(--cp-gold);
  }

  .cp-map {
    overflow: hidden;
    border: 1px solid var(--cp-border);
    box-shadow: 0 8px 32px rgba(43, 32, 16, 0.08);
  }

  .cp-map iframe {
    display: block;
    width: 100%;
    height: clamp(300px, 40vw, 400px);
    border: 0;
  }

  /* =========================================
     Animations
     ========================================= */
  @media (prefers-reduced-motion: no-preference) {
    .cp-overview__row,
    .cp-philosophy__item,
    .cp-certs__card,
    .cp-certs__detail,
    .cp-location {
      opacity: 0;
      transform: translateY(20px);
      animation: cpFadeUp 0.6s var(--cp-ease) forwards;
    }

    .cp-overview__row:nth-child(1) { animation-delay: 0.05s; }
    .cp-overview__row:nth-child(2) { animation-delay: 0.08s; }
    .cp-overview__row:nth-child(3) { animation-delay: 0.11s; }
    .cp-overview__row:nth-child(4) { animation-delay: 0.14s; }
    .cp-overview__row:nth-child(5) { animation-delay: 0.17s; }
    .cp-overview__row:nth-child(6) { animation-delay: 0.20s; }
    .cp-overview__row:nth-child(7) { animation-delay: 0.23s; }
    .cp-overview__row:nth-child(8) { animation-delay: 0.26s; }
    .cp-overview__row:nth-child(9) { animation-delay: 0.29s; }
    .cp-overview__row:nth-child(10) { animation-delay: 0.32s; }

    .cp-philosophy__item:nth-child(1) { animation-delay: 0.1s; }
    .cp-philosophy__item:nth-child(2) { animation-delay: 0.18s; }

    .cp-certs__card:nth-child(1) { animation-delay: 0.1s; }
    .cp-certs__card:nth-child(2) { animation-delay: 0.18s; }

    .cp-certs__detail:nth-child(1) { animation-delay: 0.22s; }
    .cp-certs__detail:nth-child(2) { animation-delay: 0.28s; }

    .cp-location:nth-child(1) { animation-delay: 0.1s; }
    .cp-location:nth-child(2) { animation-delay: 0.18s; }

    @keyframes cpFadeUp {
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
  }

  /* Reduced Motion */
  @media (prefers-reduced-motion: reduce) {
    .cp-overview__row,
    .cp-philosophy__item,
    .cp-certs__card,
    .cp-certs__detail,
    .cp-location {
      animation: none;
      opacity: 1;
      transform: none;
    }
  }

}
