/* ============================================
   Gift Rich - Base Styles
   リセット、ユーティリティ、アニメーション基盤
   ============================================ */

/* ========== Reset & Box Sizing ========== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--color-text-body);
    background-color: var(--color-base-black);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========== Typography ========== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    color: var(--color-text-heading);
    letter-spacing: var(--tracking-wide);
}

h1 {
    font-size: var(--text-5xl);
}

h2 {
    font-size: var(--text-4xl);
}

h3 {
    font-size: var(--text-2xl);
}

h4 {
    font-size: var(--text-xl);
}

h5 {
    font-size: var(--text-lg);
}

h6 {
    font-size: var(--text-base);
}

@media (max-width: 639px) {
    h1 {
        font-size: var(--text-4xl);
    }

    h2 {
        font-size: var(--text-3xl);
    }

    h3 {
        font-size: var(--text-xl);
    }
}

p {
    color: var(--color-text-body);
    line-height: var(--leading-relaxed);
}

a {
    color: var(--color-gold-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-gold-light);
}

strong,
b {
    font-weight: var(--font-semibold);
}

small {
    font-size: var(--text-sm);
}

/* ========== Focus Styles (Accessibility) ========== */
:focus {
    outline: none;
}

:focus-visible {
    outline: var(--focus-ring-width) solid var(--focus-ring-color);
    outline-offset: var(--focus-ring-offset);
}

/* ========== Lists ========== */
ul,
ol {
    list-style: none;
}

/* ========== Images ========== */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ========== Form Elements ========== */
button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: none;
}

button {
    cursor: pointer;
}

input,
textarea {
    background-color: var(--color-surface);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    color: var(--color-text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
textarea:focus {
    border-color: var(--color-gold-primary);
    box-shadow: var(--shadow-gold);
}

input::placeholder,
textarea::placeholder {
    color: var(--color-text-muted);
}

/* ========== Layout Utilities ========== */
.container {
    width: 100%;
    max-width: var(--container-xl);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

@media (max-width: 639px) {
    .container {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }
}

.section {
    padding-top: var(--space-24);
    padding-bottom: var(--space-24);
}

@media (max-width: 639px) {
    .section {
        padding-top: var(--space-16);
        padding-bottom: var(--space-16);
    }
}

/* ========== Text Utilities ========== */
.text-gold {
    color: var(--color-gold-primary);
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--color-text-muted);
}

/* ========== Spacing Utilities ========== */
.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mt-8 {
    margin-top: var(--space-8);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

/* ========== Visibility ========== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========== Scroll Fade Animations ========== */
.fade-section {
    opacity: 0;
    transform: translateY(40px);
    transition:
        opacity 0.8s var(--ease-out-expo),
        transform 0.8s var(--ease-out-expo);
    will-change: opacity, transform;
}

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

/* Staggered children animations */
.fade-section .fade-item {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 0.6s var(--ease-out-expo),
        transform 0.6s var(--ease-out-expo);
}

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

.fade-section.is-visible .fade-item:nth-child(1) {
    transition-delay: 0.1s;
}

.fade-section.is-visible .fade-item:nth-child(2) {
    transition-delay: 0.2s;
}

.fade-section.is-visible .fade-item:nth-child(3) {
    transition-delay: 0.3s;
}

.fade-section.is-visible .fade-item:nth-child(4) {
    transition-delay: 0.4s;
}

.fade-section.is-visible .fade-item:nth-child(5) {
    transition-delay: 0.5s;
}

.fade-section.is-visible .fade-item:nth-child(6) {
    transition-delay: 0.6s;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {

    .fade-section,
    .fade-section .fade-item {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ========== Keyframe Animations ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes scrollIndicator {

    0%,
    100% {
        opacity: 1;
        transform: translateY(0);
    }

    50% {
        opacity: 0.5;
        transform: translateY(8px);
    }
}

/* ========== Selection ========== */
::selection {
    background-color: var(--color-gold-primary);
    color: var(--color-base-black);
}

::-moz-selection {
    background-color: var(--color-gold-primary);
    color: var(--color-base-black);
}

/* ========== Scrollbar (WebKit) ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-base-black);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}