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

/* =========================================
   Page: Strengths (当社の強み)
   Aesthetic: PRECISION MONOGRAPH

   Clean white base, warm-toned strength cards,
   generous whitespace, gold accent threading.

   Tokens: --td-*
   Fonts: --font-serif (Shippori Mincho), --font-display (DM Sans), --font-sans (Noto Sans JP)
   Animations: scroll-triggered via .is-visible
   ========================================= */

@layer pages {

  /* ── Design Tokens ── */
  .page-strengths {
    --td-bg: #ffffff;
    --td-surface: #f9f7f2;
    --td-surface-warm: #f3f0e8;
    --td-surface-cool: #edeae2;
    --td-dark: #111110;
    --td-dark-mid: #1e1d1b;
    --td-gold: #b38f2d;
    --td-gold-bright: #cba43a;
    --td-gold-pale: rgba(179, 143, 45, 0.06);
    --td-gold-glow: rgba(179, 143, 45, 0.12);
    --td-ink: #1a1714;
    --td-ink-mid: rgba(26, 23, 20, 0.68);
    --td-ink-muted: rgba(26, 23, 20, 0.42);
    --td-rule: rgba(26, 23, 20, 0.08);
    --td-rule-strong: rgba(26, 23, 20, 0.16);
    --td-ease: cubic-bezier(0.22, 0.61, 0.36, 1);

    color: var(--td-ink);
    background: var(--td-bg);
    font-family: var(--font-sans);
  }

  /* ── Page TOC Navigation ── */
  .str-toc {
    background: var(--td-bg);
    border-bottom: 1px solid var(--td-rule-strong);
    position: sticky;
    top: 0;
    z-index: 90;
  }

  .str-toc__inner {
    max-width: 1320px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .str-toc__inner::-webkit-scrollbar {
    display: none;
  }

  .str-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0;
    white-space: nowrap;
  }

  .str-toc__item {
    flex: 0 0 auto;
  }

  .str-toc__link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: clamp(14px, 2vw, 18px) clamp(16px, 2.2vw, 24px);
    font-family: var(--font-sans);
    font-size: clamp(0.74rem, 0.7rem + 0.3vw, 0.84rem);
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--td-ink-mid);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.25s var(--td-ease), border-color 0.25s var(--td-ease);
  }

  .str-toc__link:hover {
    color: var(--td-ink);
    border-bottom-color: var(--td-gold);
  }

  .str-toc__num {
    font-family: var(--font-display);
    font-size: 0.68em;
    font-weight: 700;
    color: var(--td-gold);
    letter-spacing: 0.04em;
  }

  /* ── Body Container ── */
  .str-body {
    padding: clamp(72px, 12vw, 140px) 0 clamp(80px, 13vw, 140px);
  }

  .str-body__inner {
    display: grid;
    gap: clamp(100px, 16vw, 180px);
    max-width: 1320px;
  }

  /* =========================================
     Section Base
     ========================================= */
  .str-section {
    display: grid;
    gap: clamp(40px, 6vw, 64px);
  }

  /* Dark plate inversion */
  .str-section--cream {
    background: var(--td-dark);
    color: #e8e3d8;
    margin-inline: calc(-1 * var(--gutter));
    padding: clamp(80px, 13vw, 120px) var(--gutter);
    position: relative;
  }

  .str-section--cream::before {
    content: "";
    position: absolute;
    top: 0;
    left: var(--gutter);
    right: var(--gutter);
    height: 1px;
    background: linear-gradient(90deg, var(--td-gold) 0%, var(--td-gold) 120px, transparent 120px);
  }

  .str-section--cream .str-section__eyebrow { color: var(--td-gold); }
  .str-section--cream .str-section__title { color: #fff; }
  .str-section--cream .str-section__lead { color: rgba(232, 227, 216, 0.6); }

  /* Section Head */
  .str-section__head {
    display: grid;
    gap: clamp(10px, 1.8vw, 16px);
  }

  .str-section__eyebrow {
    font-family: var(--font-display);
    font-size: clamp(0.68rem, 0.85vw, 0.75rem);
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--td-gold);
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .str-section__eyebrow::before {
    content: "";
    width: 32px;
    height: 1px;
    background: var(--td-gold);
    flex-shrink: 0;
  }

  .str-section__title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 3.4vw, 2.6rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.35;
    color: var(--td-ink);
  }

  .str-section__lead {
    margin: 0;
    font-size: clamp(0.94rem, 1.15vw, 1.02rem);
    line-height: 2;
    color: var(--td-ink-mid);
  }

  /* Section Link */
  .str-section__link {
    margin: 0;
    padding-top: clamp(12px, 2vw, 20px);
  }

  .str-section__link a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: clamp(0.84rem, 1vw, 0.92rem);
    font-weight: 700;
    color: var(--td-gold);
    text-decoration: none;
    letter-spacing: 0.04em;
    padding: 10px 0;
    border-bottom: 2px solid var(--td-gold-pale);
    transition: border-color 0.4s var(--td-ease), gap 0.4s var(--td-ease);
  }

  .str-section__link a::after {
    content: "\2192";
    transition: transform 0.4s var(--td-ease);
  }

  .str-section__link a:hover {
    border-bottom-color: var(--td-gold);
    gap: 16px;
  }

  .str-section__link a:hover::after {
    transform: translateX(4px);
  }

  /* Dark section link */
  .str-section--cream .str-section__link a {
    color: var(--td-gold);
    border-bottom-color: rgba(179, 143, 45, 0.15);
  }

  .str-section--cream .str-section__link a:hover {
    border-bottom-color: var(--td-gold);
  }

  /* =========================================
     History Section
     ========================================= */
  .str-history__text {
    display: grid;
    gap: clamp(12px, 2vw, 18px);
    padding: clamp(28px, 4vw, 48px);
    background: var(--td-surface);
    border-left: 3px solid var(--td-gold);
  }

  .str-history__text p {
    margin: 0;
    font-size: clamp(0.94rem, 1.12vw, 1.04rem);
    line-height: 2.1;
    color: var(--td-ink);
  }

  /* Stat Cards */
  .str-stats {
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(4, 1fr);
    background: rgba(255, 255, 255, 0.04);
  }

  .str-stats__card {
    display: grid;
    gap: 8px;
    padding: clamp(36px, 5.5vw, 52px) clamp(20px, 3vw, 36px);
    background: var(--td-dark);
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
  }

  .str-stats__card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--td-gold);
    opacity: 0.5;
    transition: left 0.5s var(--td-ease), right 0.5s var(--td-ease), opacity 0.5s var(--td-ease);
  }

  .str-stats__card:hover::after {
    left: 0;
    right: 0;
    opacity: 1;
  }

  .str-stats__en {
    font-family: var(--font-display);
    font-size: clamp(0.6rem, 0.72vw, 0.66rem);
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--td-gold);
  }

  .str-stats__value {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 2.6vw, 2.1rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.15;
    letter-spacing: 0.02em;
  }

  .str-stats__label {
    font-size: clamp(0.72rem, 0.85vw, 0.8rem);
    color: rgba(255, 255, 255, 0.38);
    letter-spacing: 0.08em;
  }

  @media (max-width: 767px) {
    .str-stats {
      grid-template-columns: 1fr 1fr;
    }
  }

  @media (max-width: 479px) {
    .str-stats {
      grid-template-columns: 1fr;
    }
  }

  /* =========================================
     Strength Section — Numbered dossier entries
     Elevated cards on clean white background
     ========================================= */
  .str-strength {
    display: grid;
    gap: clamp(44px, 7vw, 64px);
    padding: clamp(52px, 8vw, 80px) clamp(36px, 5.5vw, 64px);
    background: var(--td-surface);
    border-top: 3px solid var(--str-accent, var(--td-gold));
    position: relative;
  }

  .str-strength:nth-of-type(even) {
    background: var(--td-surface-warm);
  }

  /* Header */
  .str-strength__header {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: start;
    gap: clamp(16px, 2.4vw, 24px);
  }

  @media (max-width: 639px) {
    .str-strength__header {
      grid-template-columns: auto 1fr;
    }

    .str-strength__badge {
      grid-column: 1 / -1;
      order: -1;
    }
  }

  .str-strength__num {
    font-family: var(--font-display);
    font-size: clamp(3rem, 5.5vw, 4.5rem);
    font-weight: 800;
    color: var(--str-accent, var(--td-gold));
    line-height: 0.82;
    letter-spacing: -0.04em;
    opacity: 0.18;
    user-select: none;
  }

  .str-strength__badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 18px;
    font-family: var(--font-display);
    font-size: clamp(0.65rem, 0.78vw, 0.72rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--str-accent, var(--td-gold));
    border: 1.5px solid var(--str-accent, var(--td-gold));
    align-self: center;
    white-space: nowrap;
  }

  .str-strength__title-group {
    display: grid;
    gap: 6px;
    min-width: 0;
  }

  .str-strength__en {
    font-family: var(--font-display);
    font-size: clamp(0.6rem, 0.72vw, 0.66rem);
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--td-ink-muted);
  }

  .str-strength__title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(1.45rem, 2.6vw, 2rem);
    font-weight: 700;
    color: var(--td-ink);
    letter-spacing: 0.03em;
    line-height: 1.4;
  }

  /* Body */
  .str-strength__body {
    display: grid;
    gap: clamp(36px, 5.5vw, 56px);
  }

  .str-strength__heading {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(0.74rem, 0.9vw, 0.82rem);
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--td-ink-muted);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--td-rule-strong);
    margin-bottom: 4px;
  }

  /* Challenge — Inset card */
  .str-strength__challenge {
    display: grid;
    gap: clamp(12px, 1.8vw, 16px);
    padding: clamp(28px, 4vw, 48px);
    background: var(--td-bg);
    border-left: 3px solid var(--td-rule-strong);
  }

  .str-strength__challenge p {
    margin: 0;
    font-size: clamp(0.94rem, 1.12vw, 1.04rem);
    line-height: 2;
    color: var(--td-ink-mid);
  }

  /* Solution — Gold confidence */
  .str-strength__solution {
    display: grid;
    gap: clamp(12px, 1.8vw, 16px);
    padding: clamp(28px, 4vw, 48px);
    background: var(--td-gold-pale);
    border-left: 3px solid var(--td-gold);
  }

  .str-strength__solution p {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(0.96rem, 1.15vw, 1.06rem);
    line-height: 2;
    color: var(--td-ink);
    font-weight: 500;
    letter-spacing: 0.02em;
  }

  /* Detail blocks */
  .str-strength__detail {
    display: grid;
    gap: clamp(14px, 2vw, 20px);
  }

  .str-strength__detail ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 2px;
  }

  .str-strength__detail li {
    font-size: clamp(0.9rem, 1.08vw, 0.98rem);
    line-height: 1.85;
    color: var(--td-ink-mid);
    padding: clamp(14px, 2vw, 18px) clamp(18px, 2.5vw, 28px);
    padding-left: clamp(36px, 4vw, 48px);
    position: relative;
    background: var(--td-bg);
    border-left: 2px solid var(--td-rule);
    transition: background 0.2s var(--td-ease), border-color 0.2s var(--td-ease);
  }

  .str-strength__detail li:hover {
    background: var(--td-surface-cool);
    border-left-color: var(--td-gold);
  }

  .str-strength__detail li::before {
    content: "";
    position: absolute;
    left: clamp(14px, 2vw, 20px);
    top: calc(clamp(14px, 2vw, 18px) + 0.65em);
    width: 8px;
    height: 1px;
    background: var(--td-gold);
  }

  .str-strength__table-note {
    margin: 0;
    font-size: clamp(0.8rem, 0.92vw, 0.86rem);
    color: var(--td-ink-muted);
    font-style: italic;
    padding-top: 4px;
  }

  .str-strength__note {
    padding: clamp(28px, 4vw, 44px);
    background: var(--td-gold-pale);
    border-left: 3px solid var(--td-gold);
  }

  .str-strength__note p {
    margin: 0;
    font-size: clamp(0.94rem, 1.1vw, 1.02rem);
    line-height: 1.95;
    color: var(--td-ink);
  }

  /* Applications Grid */
  .str-applications {
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(2, 1fr);
    background: var(--td-rule);
  }

  @media (min-width: 768px) {
    .str-applications {
      grid-template-columns: repeat(4, 1fr);
    }
  }

  .str-applications__item {
    display: grid;
    gap: 8px;
    padding: clamp(24px, 3.5vw, 36px);
    background: var(--td-bg);
    transition: background 0.3s var(--td-ease);
  }

  .str-applications__item:hover {
    background: var(--td-surface-cool);
  }

  .str-applications__item strong {
    font-family: var(--font-display);
    font-size: clamp(0.84rem, 1vw, 0.92rem);
    font-weight: 700;
    color: var(--td-ink);
    letter-spacing: 0.03em;
  }

  .str-applications__item span {
    font-size: clamp(0.82rem, 0.96vw, 0.88rem);
    color: var(--td-ink-mid);
    line-height: 1.7;
  }

  /* Examples — Card rows */
  .str-examples {
    display: grid;
    gap: 2px;
  }

  .str-examples__item {
    display: grid;
    grid-template-columns: clamp(140px, 18vw, 220px) 1fr;
    gap: 0;
    background: var(--td-bg);
    align-items: stretch;
    transition: background 0.3s var(--td-ease);
  }

  .str-examples__item:hover {
    background: var(--td-surface-cool);
  }

  .str-examples__item strong {
    font-family: var(--font-display);
    font-size: clamp(0.86rem, 1.02vw, 0.94rem);
    font-weight: 700;
    color: var(--td-ink);
    white-space: nowrap;
    padding: clamp(18px, 2.6vw, 28px);
    background: var(--td-surface-warm);
    display: flex;
    align-items: center;
    border-right: 2px solid var(--td-gold);
  }

  .str-examples__item span {
    font-size: clamp(0.86rem, 1vw, 0.94rem);
    color: var(--td-ink-mid);
    line-height: 1.7;
    padding: clamp(18px, 2.6vw, 28px);
    display: flex;
    align-items: center;
  }

  @media (max-width: 479px) {
    .str-examples__item {
      grid-template-columns: 1fr;
    }

    .str-examples__item strong {
      border-right: none;
      border-bottom: 2px solid var(--td-gold);
    }
  }

  /* =========================================
     Tables — Spacious data presentation
     ========================================= */
  .str-materials__table,
  .str-certs__table,
  .str-inspection__table,
  .str-capability__table,
  .str-equipment__table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(0.88rem, 1.04vw, 0.96rem);
  }

  .str-materials__table th,
  .str-materials__table td,
  .str-certs__table th,
  .str-certs__table td,
  .str-inspection__table th,
  .str-inspection__table td,
  .str-capability__table th,
  .str-capability__table td,
  .str-equipment__table th,
  .str-equipment__table td {
    padding: clamp(16px, 2.2vw, 24px) clamp(20px, 3vw, 36px);
    text-align: left;
    border-bottom: 1px solid var(--td-rule);
  }

  .str-materials__table thead th,
  .str-certs__table thead th,
  .str-inspection__table thead th,
  .str-capability__table thead th,
  .str-equipment__table thead th {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(0.72rem, 0.88vw, 0.8rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    background: var(--td-dark);
    white-space: nowrap;
  }

  .str-materials__table tbody td,
  .str-certs__table tbody td,
  .str-inspection__table tbody td,
  .str-capability__table tbody td,
  .str-equipment__table tbody td {
    color: var(--td-ink-mid);
    line-height: 1.7;
  }

  .str-materials__table tbody tr,
  .str-certs__table tbody tr,
  .str-inspection__table tbody tr,
  .str-capability__table tbody tr,
  .str-equipment__table tbody tr {
    transition: background 0.2s var(--td-ease);
  }

  .str-materials__table tbody tr:hover,
  .str-certs__table tbody tr:hover,
  .str-inspection__table tbody tr:hover,
  .str-capability__table tbody tr:hover,
  .str-equipment__table tbody tr:hover {
    background: var(--td-surface-cool);
  }

  .str-materials__table tbody tr:last-child td,
  .str-certs__table tbody tr:last-child td,
  .str-inspection__table tbody tr:last-child td,
  .str-capability__table tbody tr:last-child td,
  .str-equipment__table tbody tr:last-child td {
    border-bottom: none;
  }

  /* Tech table (3-col, in dark section) */
  .str-tech__table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .str-tech__table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(0.88rem, 1.04vw, 0.96rem);
  }

  .str-tech__table th,
  .str-tech__table td {
    padding: clamp(18px, 2.5vw, 28px) clamp(20px, 3vw, 36px);
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .str-tech__table thead th {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(0.72rem, 0.88vw, 0.8rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--td-gold);
    background: rgba(179, 143, 45, 0.08);
    white-space: nowrap;
  }

  .str-tech__table tbody td {
    color: rgba(232, 227, 216, 0.72);
    line-height: 1.8;
  }

  .str-tech__table tbody tr {
    transition: background 0.2s var(--td-ease);
  }

  .str-tech__table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.03);
  }

  .str-tech__table tbody tr:last-child td {
    border-bottom: none;
  }

  /* Process Controls List — Card-style items */
  .str-process-controls {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 2px;
  }

  .str-process-controls li {
    font-size: clamp(0.9rem, 1.08vw, 0.98rem);
    line-height: 1.85;
    color: var(--td-ink-mid);
    padding: clamp(14px, 2vw, 18px) clamp(18px, 2.5vw, 28px);
    padding-left: clamp(36px, 4vw, 48px);
    position: relative;
    background: var(--td-bg);
    border-left: 2px solid var(--td-rule);
    transition: background 0.2s var(--td-ease), border-color 0.2s var(--td-ease);
  }

  .str-process-controls li:hover {
    background: var(--td-surface-cool);
    border-left-color: var(--td-gold);
  }

  .str-process-controls li::before {
    content: "";
    position: absolute;
    left: clamp(14px, 2vw, 20px);
    top: calc(clamp(14px, 2vw, 18px) + 0.65em);
    width: 8px;
    height: 1px;
    background: var(--td-gold);
  }

  /* =========================================
     Flow Steps — Numbered timeline
     ========================================= */
  .str-flow {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .str-flow__step {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: clamp(16px, 2.5vw, 28px);
    align-items: center;
    padding: clamp(24px, 3.2vw, 34px) clamp(18px, 2.4vw, 28px);
    border-bottom: 1px solid var(--td-rule);
    background: var(--td-bg);
    transition: background 0.3s var(--td-ease);
  }

  .str-flow__step:first-child {
    border-top: 1px solid var(--td-rule);
  }

  .str-flow__step:hover {
    background: var(--td-surface-cool);
  }

  .str-flow__index {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 2.2vw, 1.8rem);
    font-weight: 800;
    color: var(--td-gold);
    line-height: 1;
    text-align: center;
    opacity: 0.35;
  }

  .str-flow__content {
    display: grid;
    gap: 4px;
  }

  .str-flow__title {
    font-family: var(--font-display);
    font-size: clamp(0.92rem, 1.1vw, 1.02rem);
    font-weight: 700;
    color: var(--td-ink);
    letter-spacing: 0.02em;
  }

  .str-flow__text {
    font-size: clamp(0.86rem, 1.02vw, 0.94rem);
    color: var(--td-ink-mid);
    line-height: 1.7;
  }

  /* =========================================
     Entrance Animations
     ========================================= */
  @media (prefers-reduced-motion: no-preference) {
    .str-stats__card,
    .str-strength,
    .str-flow__step {
      opacity: 0;
      transform: translateY(24px);
      transition: opacity 0.7s var(--td-ease), transform 0.7s var(--td-ease);
    }

    .str-stats__card.is-visible,
    .str-strength.is-visible,
    .str-flow__step.is-visible {
      opacity: 1;
      transform: translateY(0);
    }

    .str-stats__card:nth-child(2) { transition-delay: 0.08s; }
    .str-stats__card:nth-child(3) { transition-delay: 0.16s; }
    .str-stats__card:nth-child(4) { transition-delay: 0.24s; }

    .str-flow__step:nth-child(2) { transition-delay: 0.06s; }
    .str-flow__step:nth-child(3) { transition-delay: 0.12s; }
    .str-flow__step:nth-child(4) { transition-delay: 0.18s; }
    .str-flow__step:nth-child(5) { transition-delay: 0.24s; }
  }

  @media (prefers-reduced-motion: reduce) {
    .str-stats__card,
    .str-strength,
    .str-flow__step {
      opacity: 1;
      transform: none;
    }
  }

}
