*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --canvas:          #f7f7f4;
    --canvas-soft:     #fafaf7;
    --surface-card:    #ffffff;
    --surface-strong:  #e6e5e0;
    --primary:         #f54e00;
    --primary-active:  #d04200;
    --ink:             #26251e;
    --body:            #5a5852;
    --body-strong:     #26251e;
    --muted:           #807d72;
    --muted-soft:      #a09c92;
    --on-primary:      #ffffff;
    --hairline:        #e6e5e0;
    --hairline-soft:   #efeee8;
    --hairline-strong: #cfcdc4;
    --semantic-success:#1f8a65;
    --semantic-error:  #cf2d56;
    --tl-thinking:     #dfa88f;
    --tl-grep:         #9fc9a2;
    --tl-read:         #9fbbe0;
    --tl-edit:         #c0a8dd;
    --tl-done:         #c08532;

    --r-xs:   4px;
    --r-sm:   6px;
    --r-md:   8px;
    --r-lg:   12px;
    --r-xl:   16px;
    --r-pill: 9999px;

    --sp-xxs: 4px;
    --sp-xs:  8px;
    --sp-sm:  12px;
    --sp-base:16px;
    --sp-md:  20px;
    --sp-lg:  24px;
    --sp-xl:  32px;
    --sp-xxl: 48px;
    --sp-section: 80px;
}

html { scroll-behavior: smooth; }

body {
    background: var(--canvas);
    color: var(--body);
    font-family: 'Inter', system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--ink); }
img { display: block; max-width: 100%; height: auto; }
address { font-style: normal; }
ul { list-style: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--sp-xl);
}

.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--canvas);
    border-bottom: 1px solid var(--hairline);
    height: 64px;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--sp-xl);
    height: 100%;
    display: flex;
    align-items: center;
    gap: var(--sp-xl);
}

.nav-wordmark {
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--sp-lg);
    margin-left: auto;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--body);
    transition: color 0.15s;
}

.nav-link:hover,
.nav-link.active { color: var(--ink); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto;
    padding: var(--sp-xs);
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

.hero-band {
    padding: var(--sp-section) 0 calc(var(--sp-section) * 0.75);
    background: var(--canvas);
}

.hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--sp-xl);
}

.hero-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.88px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: var(--sp-lg);
}

.hero-title {
    font-size: 72px;
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -2.16px;
    color: var(--ink);
    max-width: 820px;
    margin-bottom: var(--sp-lg);
}

.hero-sub {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--body);
    max-width: 560px;
    margin-bottom: var(--sp-xl);
}

.hero-image-wrap {
    margin-top: var(--sp-xxl);
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--hairline);
    background: var(--surface-card);
}

.hero-image-wrap img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
}

.hero-image-caption {
    padding: var(--sp-sm) var(--sp-base);
    font-size: 13px;
    color: var(--muted);
    border-top: 1px solid var(--hairline-soft);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--on-primary);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    padding: 10px 18px;
    height: 40px;
    border-radius: var(--r-md);
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}

.btn-primary:hover { background: var(--primary-active); color: var(--on-primary); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-card);
    color: var(--ink);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    padding: 10px 18px;
    height: 40px;
    border-radius: var(--r-md);
    border: 1px solid var(--hairline-strong);
    cursor: pointer;
    transition: border-color 0.15s;
    text-decoration: none;
}

.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }

.section {
    padding: var(--sp-section) 0;
}

.section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--sp-xl);
}

.section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.88px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: var(--sp-base);
}

.section-title {
    font-size: 36px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.72px;
    color: var(--ink);
    margin-bottom: var(--sp-md);
}

.section-body {
    font-size: 16px;
    line-height: 1.5;
    color: var(--body);
    max-width: 640px;
    margin-bottom: var(--sp-xl);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-base);
}

.card-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-base);
}

.feature-card {
    background: var(--surface-card);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    padding: var(--sp-lg);
    display: flex;
    flex-direction: column;
    gap: var(--sp-sm);
    text-decoration: none;
    transition: border-color 0.15s;
}

.feature-card:hover { border-color: var(--hairline-strong); }

.feature-card-img {
    border-radius: var(--r-sm);
    overflow: hidden;
    margin-bottom: var(--sp-sm);
}

.feature-card-img img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.feature-card-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.88px;
    text-transform: uppercase;
    color: var(--muted);
}

.feature-card-title {
    font-size: 22px;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: -0.11px;
    color: var(--ink);
}

.feature-card-excerpt {
    font-size: 14px;
    line-height: 1.5;
    color: var(--body);
    flex: 1;
}

.feature-card-meta {
    font-size: 13px;
    color: var(--muted-soft);
    margin-top: var(--sp-xs);
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--sp-xxl);
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--sp-section) var(--sp-xl);
}

.article-content { min-width: 0; }

.article-header { margin-bottom: var(--sp-xl); }

.article-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.88px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: var(--sp-base);
}

.article-title {
    font-size: 36px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.72px;
    color: var(--ink);
    margin-bottom: var(--sp-base);
}

.article-meta {
    font-size: 13px;
    color: var(--muted-soft);
    margin-bottom: var(--sp-lg);
    display: flex;
    gap: var(--sp-base);
    flex-wrap: wrap;
}

.article-hero-img {
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--hairline);
    margin-bottom: var(--sp-xxl);
}

.article-hero-img img {
    width: 100%;
    max-height: 440px;
    object-fit: cover;
}

.article-hero-img figcaption {
    padding: var(--sp-sm) var(--sp-base);
    font-size: 13px;
    color: var(--muted);
    border-top: 1px solid var(--hairline-soft);
    background: var(--surface-card);
}

.prose h2 {
    font-size: 26px;
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -0.325px;
    color: var(--ink);
    margin: var(--sp-xxl) 0 var(--sp-base);
}

.prose h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink);
    margin: var(--sp-xl) 0 var(--sp-sm);
}

.prose p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--body);
    margin-bottom: var(--sp-base);
}

.prose ul, .prose ol {
    margin: var(--sp-base) 0 var(--sp-base) var(--sp-lg);
    display: flex;
    flex-direction: column;
    gap: var(--sp-xs);
}

.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }

.prose li {
    font-size: 16px;
    line-height: 1.5;
    color: var(--body);
}

.prose a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose a:hover { color: var(--primary-active); }

.prose strong { color: var(--ink); font-weight: 600; }

.prose code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    background: var(--surface-card);
    border: 1px solid var(--hairline);
    border-radius: var(--r-xs);
    padding: 2px 6px;
    color: var(--ink);
}

.prose blockquote {
    border-left: 3px solid var(--hairline-strong);
    padding: var(--sp-sm) var(--sp-base);
    margin: var(--sp-xl) 0;
    background: var(--canvas-soft);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.prose blockquote p {
    font-size: 16px;
    font-style: italic;
    color: var(--muted);
    margin: 0;
}

.info-box {
    background: var(--surface-card);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    padding: var(--sp-lg);
    margin: var(--sp-xl) 0;
}

.info-box-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.88px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: var(--sp-xs);
}

.info-box p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--body);
    margin: 0;
}

.article-inline-img {
    margin: var(--sp-xl) 0;
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--hairline);
}

.article-inline-img img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
}

.article-inline-img figcaption {
    padding: var(--sp-sm) var(--sp-base);
    font-size: 13px;
    color: var(--muted);
    border-top: 1px solid var(--hairline-soft);
    background: var(--surface-card);
}

.article-sidebar {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: var(--sp-base);
}

.sidebar-card {
    background: var(--surface-card);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    padding: var(--sp-lg);
}

.sidebar-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: var(--sp-sm);
    padding-bottom: var(--sp-sm);
    border-bottom: 1px solid var(--hairline-soft);
}

.sidebar-toc {
    display: flex;
    flex-direction: column;
    gap: var(--sp-xs);
}

.sidebar-toc a {
    font-size: 14px;
    line-height: 1.4;
    color: var(--body);
    padding: var(--sp-xxs) 0;
    border-bottom: 1px solid var(--hairline-soft);
}

.sidebar-toc a:last-child { border-bottom: none; }
.sidebar-toc a:hover { color: var(--ink); }

.sidebar-refs {
    display: flex;
    flex-direction: column;
    gap: var(--sp-xs);
}

.sidebar-refs a {
    font-size: 13px;
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    line-height: 1.4;
}

.sidebar-refs a:hover { color: var(--primary-active); }

.contact-section {
    padding: var(--sp-section) 0;
    background: var(--canvas-soft);
    border-top: 1px solid var(--hairline);
}

.contact-inner {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 var(--sp-xl);
}

.contact-title {
    font-size: 36px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.72px;
    color: var(--ink);
    margin-bottom: var(--sp-md);
}

.contact-desc {
    font-size: 16px;
    line-height: 1.5;
    color: var(--body);
    margin-bottom: var(--sp-xl);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--sp-base);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--sp-xxs);
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
}

.form-input {
    background: var(--surface-card);
    color: var(--ink);
    font-size: 16px;
    font-family: inherit;
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-md);
    padding: 12px 16px;
    height: 44px;
    outline: none;
    transition: border-color 0.15s;
    width: 100%;
}

.form-input:focus { border-color: var(--ink); }

textarea.form-input {
    height: auto;
    min-height: 120px;
    resize: vertical;
}

.form-error {
    font-size: 13px;
    color: var(--semantic-error);
    display: none;
}

.form-error.visible { display: block; }

.form-msg {
    font-size: 14px;
    padding: var(--sp-sm) var(--sp-base);
    border-radius: var(--r-md);
    display: none;
}

.form-msg.success {
    background: #e6f4ef;
    color: var(--semantic-success);
    border: 1px solid #b3dfd1;
    display: block;
}

.form-msg.error-msg {
    background: #fdeaee;
    color: var(--semantic-error);
    border: 1px solid #f5b8c4;
    display: block;
}

.site-footer {
    background: var(--canvas);
    border-top: 1px solid var(--hairline);
    padding: 64px var(--sp-xl) 48px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr repeat(4, 1fr);
    gap: var(--sp-xl);
}

.footer-brand {
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    display: block;
    margin-bottom: var(--sp-sm);
}

.footer-tagline {
    font-size: 14px;
    line-height: 1.5;
    color: var(--body);
}

.footer-heading {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.88px;
    text-transform: uppercase;
    color: var(--muted);
    display: block;
    margin-bottom: var(--sp-sm);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--sp-xs);
}

.footer-link {
    font-size: 14px;
    line-height: 1.5;
    color: var(--body);
    transition: color 0.15s;
}

.footer-link:hover { color: var(--ink); }

.footer-address p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--body);
    margin-bottom: var(--sp-xs);
}

.footer-bottom {
    max-width: 1200px;
    margin: var(--sp-xl) auto 0;
    padding-top: var(--sp-base);
    border-top: 1px solid var(--hairline-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sp-sm);
}

.footer-bottom p {
    font-size: 13px;
    color: var(--muted-soft);
}

.cookie-banner {
    position: fixed;
    bottom: var(--sp-xl);
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    color: var(--canvas);
    padding: var(--sp-base) var(--sp-xl);
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    gap: var(--sp-xl);
    max-width: 640px;
    width: calc(100% - var(--sp-xl) * 2);
    z-index: 200;
    box-shadow: 0 4px 24px rgba(38,37,30,0.18);
    transition: opacity 0.3s, transform 0.3s;
}

.cookie-banner.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(16px);
}

.cookie-banner p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--canvas);
    flex: 1;
}

.cookie-banner a {
    color: var(--tl-read);
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: var(--sp-xs);
    flex-shrink: 0;
}

.cookie-actions .btn-primary {
    height: 36px;
    padding: 8px 16px;
}

.cookie-actions .btn-secondary {
    height: 36px;
    padding: 8px 16px;
    background: transparent;
    color: var(--canvas);
    border-color: rgba(255,255,255,0.3);
}

.cookie-actions .btn-secondary:hover {
    border-color: var(--canvas);
    color: var(--canvas);
}

.badge-pill {
    display: inline-block;
    background: var(--surface-strong);
    color: var(--ink);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.88px;
    text-transform: uppercase;
    border-radius: var(--r-pill);
    padding: 4px 10px;
}

.divider {
    border: none;
    border-top: 1px solid var(--hairline);
    margin: var(--sp-section) 0;
}

.page-header {
    padding: var(--sp-xxl) 0 var(--sp-xl);
    border-bottom: 1px solid var(--hairline);
}

.page-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--sp-xl);
}

.page-title {
    font-size: 36px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.72px;
    color: var(--ink);
    margin-bottom: var(--sp-sm);
}

.page-updated {
    font-size: 13px;
    color: var(--muted-soft);
}

.content-page {
    max-width: 760px;
    margin: 0 auto;
    padding: var(--sp-section) var(--sp-xl);
}

@media (max-width: 1024px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { grid-template-columns: repeat(3, 1fr); }
    .article-layout { grid-template-columns: 1fr; }
    .article-sidebar { position: static; }
}

@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav-menu {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--canvas);
        border-bottom: 1px solid var(--hairline);
        flex-direction: column;
        padding: var(--sp-base) var(--sp-xl);
        gap: var(--sp-sm);
        align-items: flex-start;
    }
    .nav-menu.open { display: flex; }
    .nav-inner { position: relative; }
    .hero-title { font-size: 56px; letter-spacing: -1.5px; }
    .footer-inner { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .hero-title { font-size: 32px; letter-spacing: -0.5px; }
    .card-grid, .card-grid-2 { grid-template-columns: 1fr; }
    .section-title { font-size: 28px; }
    .article-title { font-size: 28px; }
    .footer-inner { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
    .container { padding: 0 var(--sp-base); }
    .section-inner, .hero-inner, .article-layout, .content-page, .contact-inner, .page-header-inner { padding-left: var(--sp-base); padding-right: var(--sp-base); }
    .cookie-banner { flex-direction: column; align-items: flex-start; }
}
