/* ==========================================================================
   Qualiteg Design System
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Base Typography
   -------------------------------------------------------------------------- */

:root {
    /* Font Family */
    --font-primary: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Font Sizes */
    --fs-hero: clamp(28px, 5vw, 56px);
    --fs-section-title: clamp(24px, 4vw, 40px);
    --fs-card-title: clamp(18px, 2.5vw, 24px);
    --fs-body: 16px;
    --fs-small: 14px;
    --fs-caption: 13px;

    /* Font Weights */
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;

    /* Line Heights */
    --lh-heading: 1.35;
    --lh-body: 1.9;
    --lh-catchcopy: 1.55;

    /* Letter Spacing */
    --ls-heading-jp: 0.06em;
    --ls-body-jp: 0.03em;
    --ls-heading-en: 0.01em;

    /* Colors */
    --color-text-primary: #1a1a1a;
    --color-text-secondary: #666666;
    --color-text-muted: #888888;
    --color-bg-white: #ffffff;
    --color-bg-light: #f8f9fa;
    --color-bg-lighter: #fafafa;

    /* Spacing (8px grid) */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 48px;
    --space-2xl: 64px;
    --space-3xl: 80px;
    --space-4xl: 120px;

    /* Container */
    --container-max: 1200px;
    --container-padding: 40px;
    --container-padding-mobile: 20px;
}

/* Base Styles */
body {
    font-family: var(--font-primary);
    font-size: var(--fs-body);
    font-weight: var(--fw-regular);
    line-height: var(--lh-body);
    color: var(--color-text-primary);
    letter-spacing: var(--ls-body-jp);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   2. Typography Classes
   -------------------------------------------------------------------------- */

/* Headings */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-primary);
    font-weight: var(--fw-bold);
    line-height: var(--lh-heading);
    letter-spacing: var(--ls-heading-jp);
    color: var(--color-text-primary);
}

/* Section Titles */
.section-title h2,
.section-heading {
    font-size: var(--fs-section-title);
    font-weight: var(--fw-bold);
    line-height: var(--lh-heading);
    letter-spacing: var(--ls-heading-jp);
    margin-bottom: var(--space-xl);
}

.section-title p {
    font-size: var(--fs-body);
    color: var(--color-text-secondary);
    line-height: var(--lh-body);
}

/* Card Titles */
.card-title,
.service-title {
    font-size: var(--fs-card-title);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-heading);
}

/* Body Text */
p {
    line-height: var(--lh-body);
    margin-bottom: var(--space-md);
}

/* Small Text */
small, .small, .text-small {
    font-size: var(--fs-small);
}

/* Caption */
.caption, .text-caption {
    font-size: var(--fs-caption);
    color: var(--color-text-secondary);
}

/* English Text */
.text-en {
    letter-spacing: var(--ls-heading-en);
}

/* --------------------------------------------------------------------------
   3. Section Spacing
   -------------------------------------------------------------------------- */

/* Sections */
section {
    padding: var(--space-3xl) 0;
}

@media (min-width: 992px) {
    section {
        padding: var(--space-4xl) 0;
    }
}

/* Section Title Bottom Margin */
.section-title {
    margin-bottom: var(--space-xl);
}

@media (min-width: 992px) {
    .section-title {
        margin-bottom: var(--space-2xl);
    }
}

/* --------------------------------------------------------------------------
   4. Container
   -------------------------------------------------------------------------- */

.container {
    max-width: var(--container-max);
    padding-left: var(--container-padding-mobile);
    padding-right: var(--container-padding-mobile);
}

@media (min-width: 992px) {
    .container {
        padding-left: var(--container-padding);
        padding-right: var(--container-padding);
    }
}

/* --------------------------------------------------------------------------
   5. Utility Classes
   -------------------------------------------------------------------------- */

/* Text Colors */
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }

/* Background Colors */
.bg-white { background-color: var(--color-bg-white); }
.bg-light { background-color: var(--color-bg-light); }
.bg-lighter { background-color: var(--color-bg-lighter); }

/* Font Weights */
.fw-regular { font-weight: var(--fw-regular); }
.fw-medium { font-weight: var(--fw-medium); }
.fw-semibold { font-weight: var(--fw-semibold); }
.fw-bold { font-weight: var(--fw-bold); }

/* Line Heights */
.lh-heading { line-height: var(--lh-heading); }
.lh-body { line-height: var(--lh-body); }

/* --------------------------------------------------------------------------
   6. Component Overrides
   -------------------------------------------------------------------------- */

/* Cards */
.card {
    border-radius: 12px;
}

.card-body {
    padding: var(--space-lg);
}

@media (min-width: 992px) {
    .card-body {
        padding: var(--space-xl);
    }
}

/* Buttons */
.btn {
    font-family: var(--font-primary);
    font-weight: var(--fw-medium);
    letter-spacing: 0.02em;
}

/* Links */
a {
    transition: color 0.2s ease;
}

/* --------------------------------------------------------------------------
   8. Dark Section Support (CTA, Hero, etc.)
   -------------------------------------------------------------------------- */

/* Dark Background CTA Section - Use .contact-cta-dark class for dark backgrounds */
.contact-cta-dark h1,
.contact-cta-dark h2,
.contact-cta-dark h3,
.contact-cta-dark h4,
.contact-cta-dark h5,
.contact-cta-dark h6,
.contact-cta-dark .cta-heading-en,
.contact-cta-dark .cta-heading-jp {
    color: #ffffff !important;
}

.contact-cta-dark p,
.contact-cta-dark .cta-description {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Generic dark section class */
.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4,
.section-dark h5,
.section-dark h6 {
    color: #ffffff;
}

.section-dark p {
    color: rgba(255, 255, 255, 0.85);
}

/* --------------------------------------------------------------------------
   7. Responsive Typography
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    :root {
        --fs-body: 15px;
        --fs-small: 13px;
    }

    .section-title h2,
    .section-heading {
        margin-bottom: var(--space-lg);
    }
}
