/* ═══════════════════════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════════════════════ */
:root {
    --bg-primary: #fafaf9;
    --bg-secondary: #f0efed;
    --bg-card: #fff;
    --text-primary: #1a1a18;
    --text-secondary: #6b6b65;
    --text-tertiary: #9c9c95;
    --accent: #2d5a3d;
    --accent-light: #e8f0eb;
    --accent-hover: #1e3d29;
    --border: #e5e4e1;
    --border-light: #ededeb;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 4%);
    --shadow-md: 0 4px 16px rgb(0 0 0 / 6%);
    --shadow-lg: 0 12px 40px rgb(0 0 0 / 8%);
    --tag-bg: #f0efed;
    --tag-text: #4a4a45;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

[data-theme="dark"] {
    --bg-primary: #111110;
    --bg-secondary: #1a1a18;
    --bg-card: #1e1e1c;
    --text-primary: #f0efed;
    --text-secondary: #9c9c95;
    --text-tertiary: #6b6b65;
    --accent: #5ba878;
    --accent-light: #1a2e22;
    --accent-hover: #7dc49a;
    --border: #2a2a27;
    --border-light: #222220;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 20%);
    --shadow-md: 0 4px 16px rgb(0 0 0 / 30%);
    --shadow-lg: 0 12px 40px rgb(0 0 0 / 40%);
    --tag-bg: #2a2a27;
    --tag-text: #b0b0a8;
}

/* ═══════════════════════════════════════════════════════════
   RESET
   ═══════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 16px;
    transition: background 0.3s ease, color 0.3s ease;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* ═══════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════ */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 100px 0;
}

.section--alt {
    background: var(--bg-secondary);
}

.section--border-top {
    border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
    .section {
        padding: 64px 0;
    }
}

/* ═══════════════════════════════════════════════════════════
   SECTION HEADERS
   ═══════════════════════════════════════════════════════════ */
.section-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 16px;
}

.section-title {
    font-family: "DM Serif Display", serif;
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 16px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 560px;
    line-height: 1.75;
}

/* ═══════════════════════════════════════════════════════════
   NAV
   ═══════════════════════════════════════════════════════════ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--bg-primary) 85%, transparent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    transition: background 0.3s ease;
}

.nav__inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav__logo {
    font-family: "DM Serif Display", serif;
    font-size: 1.25rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.nav__links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav__links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

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

.nav__links--open {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 24px;
    gap: 20px;
}

.nav__mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .nav__links {
        display: none;
    }

    .nav__mobile-toggle {
        display: flex;
    }
}

/* ═══════════════════════════════════════════════════════════
   THEME TOGGLE
   ═══════════════════════════════════════════════════════════ */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

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

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn--primary {
    background: var(--accent);
    color: #fff;
}

.btn--primary:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn--secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn--secondary:hover {
    border-color: var(--text-tertiary);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.btn__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════ */
.hero {
    padding-top: 160px;
    padding-bottom: 100px;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 100px;
    margin-bottom: 32px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.hero__badge::before {
    content: "";
    width: 7px;
    height: 7px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.hero__title {
    font-family: "DM Serif Display", serif;
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    max-width: 700px;
}

.hero__title em {
    font-style: italic;
    color: var(--accent);
}

.hero__subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 540px;
    line-height: 1.75;
    margin-bottom: 40px;
}

.hero__ctas {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════
   PILLARS
   ═══════════════════════════════════════════════════════════ */
.pillars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 56px;
}

.pillar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 36px 28px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pillar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pillar:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.pillar:hover::before {
    opacity: 1;
}

.pillar__icon {
    width: 44px;
    height: 44px;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--accent);
}

.pillar__icon svg {
    width: 22px;
    height: 22px;
}

.pillar__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.pillar__desc {
    color: var(--text-secondary);
    font-size: 0.925rem;
    line-height: 1.7;
}

@media (max-width: 768px) {
    .pillars {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════
   PROCESS
   ═══════════════════════════════════════════════════════════ */
.process {
    margin-top: 56px;
    display: flex;
    flex-direction: column;
}

.process__step {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 24px;
    align-items: start;
    padding: 32px 0;
    border-bottom: 1px solid var(--border-light);
}

.process__step:last-child {
    border-bottom: none;
}

.process__number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "DM Serif Display", serif;
    font-size: 1.1rem;
    color: var(--accent);
    flex-shrink: 0;
}

.process__title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.process__desc {
    color: var(--text-secondary);
    font-size: 0.925rem;
    line-height: 1.7;
}

@media (max-width: 768px) {
    .process__step {
        grid-template-columns: 48px 1fr;
        gap: 16px;
    }
}

/* ═══════════════════════════════════════════════════════════
   CASES
   ═══════════════════════════════════════════════════════════ */
.cases {
    margin-top: 56px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.case {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 32px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.case:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: inherit;
}

.case--cta {
    border-style: dashed;
    cursor: default;
}

.case--cta:hover {
    transform: none;
    box-shadow: none;
}

.case__tag {
    display: inline-block;
    background: var(--tag-bg);
    color: var(--tag-text);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.case__tag--accent {
    background: var(--accent-light);
    color: var(--accent);
}

.case__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.case__desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.65;
}

.case__arrow {
    color: var(--text-tertiary);
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.case:hover .case__arrow {
    color: var(--accent);
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .case {
        grid-template-columns: 1fr;
    }

    .case__arrow {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════
   STACK
   ═══════════════════════════════════════════════════════════ */
.stack {
    margin-top: 56px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stack__tag {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.stack__tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.stack__tag--highlight {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   ABOUT
   ═══════════════════════════════════════════════════════════ */
.about {
    margin-top: 56px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.about__text p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.about__text p:last-child {
    margin-bottom: 0;
}

.about__facts {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.fact {
    display: flex;
    gap: 16px;
    align-items: baseline;
}

.fact__value {
    font-family: "DM Serif Display", serif;
    font-size: 2rem;
    color: var(--accent);
    letter-spacing: -0.02em;
    min-width: 72px;
}

.fact__label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .about {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* ═══════════════════════════════════════════════════════════
   CONTACT
   ═══════════════════════════════════════════════════════════ */
.contact {
    text-align: center;
    max-width: 520px;
    margin: 0 auto;
}

.contact .section-desc {
    margin: 0 auto 40px;
}

.contact__links {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */
.footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════════════════
   CASE STUDY PAGE
   ═══════════════════════════════════════════════════════════ */
.case-hero {
    padding-top: 140px;
    padding-bottom: 64px;
}

.case-hero__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 24px;
    transition: color 0.2s ease;
}

.case-hero__back:hover {
    color: var(--accent);
}

.case-hero__title {
    font-family: "DM Serif Display", serif;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-top: 16px;
    margin-bottom: 20px;
    max-width: 720px;
}

.case-hero__subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.75;
}

.case-body p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
    max-width: 640px;
}

.case-problems {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border-light);
}

.case-problems__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.case-problems__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.case-problems__list li {
    position: relative;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 0.925rem;
    line-height: 1.6;
}

.case-problems__list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.6;
}

.case-blocks {
    margin-top: 48px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.case-block {
    padding-left: 24px;
    border-left: 3px solid var(--accent);
}

.case-block__title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.case-block__desc {
    color: var(--text-secondary);
    font-size: 0.925rem;
    line-height: 1.75;
    max-width: 640px;
}

.case-results {
    margin-top: 48px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.case-results .fact {
    flex-direction: column;
    gap: 8px;
}

.case-results .fact__value {
    min-width: unset;
}

@media (max-width: 768px) {
    .case-results {
        grid-template-columns: repeat(2, 1fr);
    }
}

.case-quote {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 40px;
    max-width: 640px;
}

.case-quote__text {
    font-size: 1rem;
    font-style: italic;
    line-height: 1.8;
    color: var(--text-secondary);
    border-left: 3px solid var(--accent);
    padding-left: 20px;
    margin: 0;
}

.case-quote__author {
    margin-top: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════
   CONTACT FORM
   ═══════════════════════════════════════════════════════════ */
.form {
    max-width: 560px;
}

.form__group {
    margin-bottom: 24px;
}

.form__label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form__optional {
    font-weight: 400;
    color: var(--text-tertiary);
}

.form__input,
.form__textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form__input:focus,
.form__textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

.form__input::placeholder,
.form__textarea::placeholder {
    color: var(--text-tertiary);
}

.form__textarea {
    min-height: 140px;
    resize: vertical;
}

.form__input--valid {
    border-color: #28a745;
}

.form__input--invalid,
.form__textarea.form__input--invalid {
    border-color: #dc3545;
}

.form__error {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #dc3545;
    min-height: 0;
}

.form__submit {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
}

.form__hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.form__notification {
    margin-top: 24px;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
    border: 1px solid transparent;
}

.form__notification--visible {
    display: block;
}

.form__notification--success {
    color: #28a745;
    background: rgba(40, 167, 69, 0.08);
    border-color: rgba(40, 167, 69, 0.3);
}

.form__notification--error {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.08);
    border-color: rgba(220, 53, 69, 0.3);
}

/* ═══════════════════════════════════════════════════════════
   SCROLL REVEAL ANIMATION
   ═══════════════════════════════════════════════════════════ */
[data-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}
