* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #fafafa;
    --bg-secondary: #f5f5f5;
    --bg-elevated: #ffffff;
    --text-primary: #171717;
    --text-secondary: #525252;
    --text-tertiary: #a3a3a3;
    --accent: #171717;
    --accent-soft: rgba(23, 23, 23, 0.06);
    --border: #e5e5e5;
    --border-strong: #d4d4d4;
    --highlight: #0066ff;
    --highlight-soft: rgba(0, 102, 255, 0.08);
}

[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-elevated: #1c1c1c;
    --text-primary: #ededed;
    --text-secondary: #a3a3a3;
    --text-tertiary: #666666;
    --accent: #ededed;
    --accent-soft: rgba(237, 237, 237, 0.06);
    --border: #262626;
    --border-strong: #404040;
    --highlight: #3b82f6;
    --highlight-soft: rgba(59, 130, 246, 0.12);
}

body {
    font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, .logo, .metric-value {
    font-family: 'Plus Jakarta Sans', 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, sans-serif;
}

::selection {
    background: var(--highlight);
    color: white;
}

:focus-visible {
    outline: 2px solid var(--highlight);
    outline-offset: 2px;
}

/* Accessibility */
.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;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--accent);
    color: var(--bg-primary);
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 9999;
}

.skip-link:focus {
    top: 0;
}

/* ===================== */
/* Navigation            */
/* ===================== */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

@supports (backdrop-filter: blur(12px)) {
    nav {
        backdrop-filter: blur(12px) saturate(180%);
        background: color-mix(in srgb, var(--bg-primary) 80%, transparent);
    }
}

.nav-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0.875rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
}

.logo-icon {
    width: 28px;
    height: 28px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-tertiary);
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.15s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem;
    display: flex;
    align-items: center;
    color: var(--text-tertiary);
    transition: color 0.15s ease;
}

.theme-toggle:hover {
    color: var(--text-primary);
}

.theme-toggle svg {
    width: 16px;
    height: 16px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem;
    color: var(--text-primary);
}

.mobile-menu-toggle svg {
    width: 22px;
    height: 22px;
}

.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
}

.mobile-nav.active {
    display: block;
}

.mobile-nav ul {
    list-style: none;
    padding: 0.5rem 0;
}

.mobile-nav li {
    padding: 0.625rem 2rem;
}

.mobile-nav a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9375rem;
}

/* ===================== */
/* Layout                */
/* ===================== */
main {
    margin-top: 56px;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 5rem 0;
}

h2 {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: 3rem;
}

/* ===================== */
/* Hero                  */
/* ===================== */
.hero {
    padding: 8rem 0 6rem;
    border-bottom: 1px solid var(--border);
}

.hero-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: 0.02em;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.15;
    margin-bottom: 1.25rem;
}

.hero-sub {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 540px;
    margin-bottom: 2.5rem;
}

.hero-cta {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-decoration: none;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-strong);
    transition: color 0.15s ease, border-color 0.15s ease;
}

.hero-cta:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

/* ===================== */
/* Approach              */
/* ===================== */
#approach {
    border-bottom: 1px solid var(--border);
}

.approach-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.approach-item h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.625rem;
    letter-spacing: -0.01em;
}

.approach-item p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===================== */
/* Case Studies          */
/* ===================== */
#work {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.case {
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--border);
}

.case:first-of-type {
    padding-top: 0;
}

.case:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.case-header {
    margin-bottom: 1rem;
}

.case-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--highlight);
    letter-spacing: 0.03em;
    margin-bottom: 0.375rem;
}

.case-header h3 {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.3;
}

.case-body {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    max-width: 640px;
}

.case-metrics {
    display: flex;
    gap: 2.5rem;
    margin-bottom: 1.25rem;
}

.metric {
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.2;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.125rem;
}

.case-tags {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.case-tags span {
    padding: 0.1875rem 0.5rem;
    background: var(--accent-soft);
    border-radius: 3px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===================== */
/* Products              */
/* ===================== */
#products {
    border-bottom: 1px solid var(--border);
}

.products-intro {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-top: -2rem;
    margin-bottom: 2.5rem;
}

.product-item {
    display: flex;
    align-items: baseline;
    gap: 1.25rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: opacity 0.15s ease;
}

.product-item:last-child {
    padding-bottom: 0;
}

.product-item:hover {
    opacity: 0.6;
}

.product-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    position: relative;
    top: 4px;
}

.product-icon--rounded {
    border-radius: 6px;
}

.product-body {
    flex: 1;
    min-width: 0;
}

.product-body h3 {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.25rem;
}

.product-body p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.product-url {
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* ===================== */
/* Contact               */
/* ===================== */
#contact h2 {
    margin-bottom: 1rem;
}

.contact-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 420px;
}

.contact-cta {
    display: inline-block;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -0.01em;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid var(--text-primary);
    transition: opacity 0.15s ease;
}

.contact-cta:hover {
    opacity: 0.6;
}

.contact-location {
    margin-top: 1.5rem;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

/* ===================== */
/* Footer                */
/* ===================== */
footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
}

.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.15s ease;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-copyright {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ===================== */
/* Animations            */
/* ===================== */
.js-loaded .case,
.js-loaded .approach-item,
.js-loaded .product-item {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.js-loaded .approach-item:nth-child(1) { transition-delay: 0s; }
.js-loaded .approach-item:nth-child(2) { transition-delay: 0.1s; }
.js-loaded .approach-item:nth-child(3) { transition-delay: 0.2s; }

.js-loaded .product-item:nth-child(2) { transition-delay: 0s; }
.js-loaded .product-item:nth-child(3) { transition-delay: 0.1s; }
.js-loaded .product-item:nth-child(4) { transition-delay: 0.2s; }

.js-loaded .case.visible,
.js-loaded .approach-item.visible,
.js-loaded .product-item.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===================== */
/* Tablet                */
/* ===================== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .hero {
        padding: 5rem 0 4rem;
    }

    section {
        padding: 3.5rem 0;
    }

    .approach-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .case-metrics {
        flex-wrap: wrap;
        gap: 1.5rem;
    }

    .metric {
        min-width: 100px;
    }

    h2 {
        margin-bottom: 2rem;
    }

    .product-item {
        flex-wrap: wrap;
    }

    .product-url {
        width: 100%;
        padding-left: calc(32px + 1.25rem);
        margin-top: 0.25rem;
    }

    .footer-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
