/* ══════════════════════════════════════════════
   FONTS — self-hosted PT Sans (SIL OFL 1.1)
══════════════════════════════════════════════ */
@font-face {
    font-family: 'PT Sans';
    src: url('assets/fonts/pt-sans-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'PT Sans';
    src: url('assets/fonts/pt-sans-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ══════════════════════════════════════════════
   DESIGN TOKENS — palette "final-blood-red"
   Contrast (WCAG): text on bg 10.8:1, accent on bg 7.5:1,
   white on brand 9.7:1, text on surface 7.4:1.
   Never use --c-brand as text on the dark background (2.0:1).
══════════════════════════════════════════════ */
:root {
    --c-bg:        #090C08;
    --c-surface:   #1E3231;
    --c-text:      #BFC0C0;
    --c-heading:   #FFFFFF;
    --c-brand:     #881600;
    --c-accent:    #EF8354;
    --c-on-accent: #090C08;
    --c-border:    rgba(191, 192, 192, 0.18);
    --c-header-bg: rgba(9, 12, 8, 0.92);

    --font: 'PT Sans', 'Gill Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;

    --r-sm: 6px;
    --r-md: 12px;
    --r-lg: 18px;

    --header-h: 72px;

    color-scheme: dark;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    /* Sections have their own top padding, so the offset can be smaller than the header. */
    scroll-padding-top: calc(var(--header-h) - 40px);
}

body {
    font-family: var(--font);
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Keep the footer at the bottom on short pages (404). */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1 0 auto; }

h1, h2, h3 { color: var(--c-heading); font-weight: 700; line-height: 1.15; }

img { display: block; max-width: 100%; height: auto; }

a { color: var(--c-accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 3px;
    border-radius: 2px;
}

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

.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 1001;
    padding: 0.5rem 1rem;
    background: var(--c-accent);
    color: var(--c-on-accent);
    font-weight: 700;
    border-radius: var(--r-sm);
}
.skip-link:focus { top: 1rem; }

/* ══════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 26px;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    border-radius: var(--r-sm);
    border: 2px solid transparent;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
    background: var(--c-accent);
    color: var(--c-on-accent);
}
.btn-primary:hover { background: #F39A72; }

.btn-outline {
    color: var(--c-heading);
    border-color: rgba(255, 255, 255, 0.7);
}
.btn-outline:hover { border-color: var(--c-heading); background: rgba(255, 255, 255, 0.08); }

.btn-outline-accent {
    color: var(--c-accent);
    border-color: var(--c-accent);
}
.btn-outline-accent:hover { background: rgba(239, 131, 84, 0.1); }

/* ══════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--c-header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}
.site-header.scrolled { border-bottom-color: var(--c-border); }

.header-content {
    min-height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 24px;
}

.logo { display: block; flex-shrink: 0; }
/* The logo SVGs use currentColor, which is black inside <img>. Invert to white. */
.logo-img { height: 26px; width: auto; filter: invert(1); }

.nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 24px;
    list-style: none;
}
.nav-link {
    font-size: 1rem;
    color: var(--c-text);
    text-decoration: none;
    transition: color 0.15s ease;
}
.nav-link:hover { color: var(--c-accent); }

/* ══════════════════════════════════════════════
   HERO
══════════════════════════════════════════════ */
.hero {
    position: relative;
    overflow: hidden;
    background: var(--c-brand);
    color: var(--c-heading);
    padding: var(--space-xl) 0;
}
/* Large faint mark as decoration. */
.hero::after {
    content: '';
    position: absolute;
    right: -80px;
    top: 50%;
    width: 520px;
    height: 414px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.07);
    -webkit-mask: url('assets/logo/kalatech-mark.svg') no-repeat center / contain;
    mask: url('assets/logo/kalatech-mark.svg') no-repeat center / contain;
    pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 720px; }

.hero-eyebrow {
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: var(--space-sm);
}
.hero-title {
    font-size: clamp(2.5rem, 7vw, 4.25rem);
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}
.hero-lead {
    font-size: 1.25rem;
    color: var(--c-heading);
    max-width: 600px;
    margin-bottom: var(--space-md);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ══════════════════════════════════════════════
   SECTIONS
══════════════════════════════════════════════ */
.section { padding: var(--space-xl) 0; }
.section + .section { border-top: 1px solid var(--c-border); }

.section-header { max-width: 760px; margin-bottom: 3rem; }
.section-eyebrow {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-accent);
    margin-bottom: 0.75rem;
}
.section-title {
    font-size: clamp(1.875rem, 4vw, 2.5rem);
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
}
.section-sub { font-size: 1.125rem; }

/* ══════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.card {
    background: var(--c-surface);
    border-radius: var(--r-md);
    padding: 2rem;
}
.card-title { font-size: 1.375rem; margin-bottom: 0.75rem; }
.card p + p { margin-top: 0.75rem; }

/* Products */
.product-card { display: flex; flex-direction: column; gap: 1rem; }
.product-head { display: flex; align-items: center; gap: 14px; }
.product-icon { width: 48px; height: 48px; border-radius: 10px; }
.product-head .card-title { margin-bottom: 0; }
.product-kind { font-size: 0.9375rem; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.tag {
    font-size: 0.8125rem;
    padding: 3px 10px;
    border: 1px solid var(--c-border);
    border-radius: 999px;
}
.product-link { margin-top: auto; font-weight: 700; }

.card-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: transparent;
    border: 2px dashed var(--c-border);
}

/* Services */
.service-num {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--c-accent);
    margin-bottom: 0.75rem;
}

/* ══════════════════════════════════════════════
   ABOUT
══════════════════════════════════════════════ */
.about {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: var(--space-lg);
    align-items: start;
}
.about-photo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--r-lg);
}
.about-name { font-size: 1.75rem; }
.about-role { color: var(--c-accent); font-weight: 700; margin-bottom: 1.5rem; }
.about-text p + p { margin-top: 1rem; }

.about-facts { margin-top: 1.75rem; border-top: 1px solid var(--c-border); }
.about-facts > div {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--c-border);
}
.about-facts dt {
    padding-top: 3px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-accent);
}
.about-link { display: inline-block; margin-top: 1.5rem; font-weight: 700; }

/* ══════════════════════════════════════════════
   CONTACT
══════════════════════════════════════════════ */
.contact-box {
    background: var(--c-surface);
    border-radius: var(--r-lg);
    padding: var(--space-lg);
}
.contact-box .section-header { margin-bottom: var(--space-md); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ══════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════ */
.site-footer {
    background: var(--c-brand);
    color: var(--c-heading);
    padding: var(--space-lg) 0 var(--space-md);
    font-size: 0.9375rem;
}
.site-footer a { color: var(--c-heading); }

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}
.footer-logo-img { height: 30px; width: auto; filter: invert(1); margin-bottom: 0.75rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; }

.footer-legal {
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    padding-top: var(--space-sm);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 24px;
}
.footer-legal:first-child { border-top: 0; padding-top: 0; }
.legal-list { display: flex; flex-wrap: wrap; gap: 4px 20px; list-style: none; }

/* ══════════════════════════════════════════════
   TEXT PAGES (privacy, 404)
══════════════════════════════════════════════ */
.page { padding: var(--space-xl) 0; }
/* Keep the left edge in line with the header. Limit only the text width. */
.page .container > * { max-width: 760px; }
.page h1 { font-size: clamp(2rem, 5vw, 2.75rem); margin-bottom: 1rem; }
.page h2 { font-size: 1.375rem; margin: 2.5rem 0 0.75rem; }
.page p + p, .page p + ul, .page ul + p { margin-top: 0.75rem; }
.page ul { padding-left: 1.25rem; }
.page li + li { margin-top: 0.25rem; }
.page-meta { font-size: 0.9375rem; }
.page .btn { margin-top: var(--space-md); }

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */
@media (max-width: 900px) {
    .about { grid-template-columns: 220px minmax(0, 1fr); gap: var(--space-md); }
}

@media (max-width: 720px) {
    :root { --header-h: 104px; }
    body { font-size: 1.0625rem; }
    .container { padding: 0 16px; }
    .header-content { padding-top: 14px; padding-bottom: 14px; }
    .section, .hero, .page { padding: var(--space-lg) 0; }
    .hero::after { width: 300px; height: 240px; right: -90px; top: auto; bottom: -40px; transform: none; }
    .card-grid { grid-template-columns: minmax(0, 1fr); }
    .card { padding: 1.5rem; }
    .about { grid-template-columns: minmax(0, 1fr); }
    .about-photo { max-width: 240px; }
    .about-facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .contact-box { padding: var(--space-md) 1.5rem; }
}

@media (max-width: 380px) {
    .nav-list { gap: 4px 16px; }
    .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; }
    .btn:hover { transform: none; }
}
