/* =========================================================================
   KARAT Tech — stylesheet
   Premium software-house aesthetic: near-black dark theme, single warm
   "karat gold" accent, generous spacing, large type. No frameworks.
   ========================================================================= */

/* ---- Design tokens ---------------------------------------------------- */
:root {
    --bg:            #08080a;
    --bg-elev:       #101014;
    --bg-card:       #0d0d11;
    --bg-card-hover: #141419;

    --border:        rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);

    --text:          #ededf0;
    --text-muted:    #9a9aa5;
    --text-dim:      #6b6b76;

    /* Karat gold accent */
    --accent:        #e8b661;
    --accent-bright: #f4c977;
    --accent-deep:   #c8963f;
    --accent-soft:   rgba(232, 182, 97, 0.12);
    --accent-line:   rgba(232, 182, 97, 0.30);

    --radius:        14px;
    --radius-lg:     20px;

    --maxw:          1140px;
    --gutter:        clamp(20px, 5vw, 40px);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
            Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;

    --shadow-card: 0 1px 0 rgba(255,255,255,0.03) inset,
                   0 20px 40px -24px rgba(0,0,0,0.8);

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* Ambient background glow */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(60% 50% at 50% -8%, rgba(232, 182, 97, 0.10), transparent 70%),
        radial-gradient(40% 40% at 100% 0%, rgba(232, 182, 97, 0.05), transparent 60%);
    pointer-events: none;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul { list-style: none; }

::selection { background: var(--accent-soft); color: var(--accent-bright); }

/* ---- Layout helpers --------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

section { position: relative; }

.section-pad { padding-block: clamp(72px, 12vw, 130px); }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 18px;
}
.eyebrow::before {
    content: "";
    width: 22px; height: 1px;
    background: var(--accent-line);
}

.section-title {
    font-size: clamp(1.9rem, 4.2vw, 2.9rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: 700;
    max-width: 20ch;
}
.section-lead {
    margin-top: 18px;
    color: var(--text-muted);
    font-size: 1.06rem;
    max-width: 56ch;
}

/* =========================================================================
   Header
   ========================================================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(8, 8, 10, 0.6);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.scrolled {
    border-bottom-color: var(--border);
    background: rgba(8, 8, 10, 0.82);
}
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: -0.01em;
    font-size: 1.15rem;
}
.brand .mark {
    width: 28px; height: 28px;
    border-radius: 8px;
    display: grid; place-items: center;
    background: linear-gradient(150deg, var(--accent-bright), var(--accent-deep));
    color: #1a1206;
    font-weight: 800;
    font-size: 0.9rem;
    box-shadow: 0 0 0 1px rgba(232,182,97,0.25), 0 6px 18px -6px rgba(232,182,97,0.5);
}
.brand .brand-sub { color: var(--text-dim); font-weight: 500; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
}
.nav-links a {
    font-size: 0.92rem;
    color: var(--text-muted);
    transition: color 0.2s var(--ease);
}
.nav-links a:hover { color: var(--text); }

.nav-right { display: flex; align-items: center; gap: 18px; }

.lang-switch {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px;
    font-size: 0.78rem;
    font-weight: 600;
}
.lang-switch a {
    padding: 4px 11px;
    border-radius: 999px;
    color: var(--text-dim);
    transition: color 0.2s, background 0.2s;
}
.lang-switch a.active {
    color: #1a1206;
    background: linear-gradient(150deg, var(--accent-bright), var(--accent-deep));
}
.lang-switch a:not(.active):hover { color: var(--text); }

.nav-toggle { display: none; }

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px 22px;
    border-radius: 11px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: linear-gradient(150deg, var(--accent-bright), var(--accent-deep));
    color: #1a1206;
    box-shadow: 0 10px 30px -12px rgba(232,182,97,0.6);
}
.btn-primary:hover {
    box-shadow: 0 14px 38px -12px rgba(232,182,97,0.75);
    transform: translateY(-2px);
}
.btn-ghost {
    background: rgba(255,255,255,0.02);
    border-color: var(--border-strong);
    color: var(--text);
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--accent-line);
    transform: translateY(-2px);
}
.btn svg { width: 17px; height: 17px; }

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
    padding-top: clamp(80px, 12vw, 140px);
    padding-bottom: clamp(60px, 9vw, 110px);
    text-align: center;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 7px 15px 7px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255,255,255,0.02);
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}
.hero-badge .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent-bright);
    box-shadow: 0 0 0 4px var(--accent-soft);
}
.hero h1 {
    font-size: clamp(2.5rem, 7vw, 4.6rem);
    line-height: 1.04;
    letter-spacing: -0.035em;
    font-weight: 700;
    max-width: 15ch;
    margin-inline: auto;
}
.hero h1 .grad {
    background: linear-gradient(120deg, var(--accent-bright), var(--accent) 55%, var(--accent-deep));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-sub {
    margin: 26px auto 0;
    max-width: 60ch;
    font-size: clamp(1.05rem, 2.2vw, 1.25rem);
    color: var(--text-muted);
}
.hero-cta {
    margin-top: 38px;
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* =========================================================================
   Stats bar
   ========================================================================= */
.stats {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255,255,255,0.015), transparent);
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
}
.stat {
    background: var(--bg);
    padding: 34px 26px;
    text-align: center;
}
.stat .num {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(120deg, var(--accent-bright), var(--accent-deep));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.stat .label {
    margin-top: 6px;
    font-size: 0.86rem;
    color: var(--text-muted);
}

/* =========================================================================
   What we do — capability cards
   ========================================================================= */
.cap-grid {
    margin-top: 56px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.cap-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
}
.cap-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-line);
    background: var(--bg-card-hover);
}
.cap-icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    display: grid; place-items: center;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    color: var(--accent-bright);
    margin-bottom: 20px;
}
.cap-icon svg { width: 22px; height: 22px; }
.cap-card h3 { font-size: 1.12rem; font-weight: 650; letter-spacing: -0.01em; }
.cap-card p { margin-top: 9px; color: var(--text-muted); font-size: 0.94rem; }

/* =========================================================================
   Products
   ========================================================================= */
.products-grid {
    margin-top: 56px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}
.product-card {
    position: relative;
    background:
        radial-gradient(120% 100% at 0% 0%, rgba(232,182,97,0.06), transparent 55%),
        var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 34px 32px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s var(--ease), border-color 0.3s;
}
.product-card:hover { transform: translateY(-5px); border-color: var(--accent-line); }

.product-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 4px;
}
.product-name {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 5px 11px;
    border-radius: 999px;
    white-space: nowrap;
}
.badge-dev {
    color: var(--accent-bright);
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
}
.badge-dev .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent-bright);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}
.badge-live {
    color: #7ee2a8;
    background: rgba(126, 226, 168, 0.10);
    border: 1px solid rgba(126, 226, 168, 0.25);
}

.product-desc { color: var(--text-muted); margin-top: 12px; font-size: 0.98rem; }

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}
.tag {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
}

.product-foot {
    margin-top: auto;
    padding-top: 26px;
}
.product-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--accent-bright);
    font-weight: 600;
    font-size: 0.92rem;
    transition: gap 0.2s var(--ease);
}
.product-link:hover { gap: 11px; }
.product-link svg { width: 15px; height: 15px; }
.product-note { color: var(--text-dim); font-size: 0.88rem; }

/* =========================================================================
   Our Story — timeline
   ========================================================================= */
.timeline {
    margin-top: 56px;
    position: relative;
    padding-left: 4px;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 9px; top: 6px; bottom: 6px;
    width: 1px;
    background: linear-gradient(180deg, var(--accent-line), var(--border) 40%, transparent);
}
.milestone {
    position: relative;
    padding-left: 42px;
    padding-bottom: 38px;
}
.milestone:last-child { padding-bottom: 0; }
.milestone::before {
    content: "";
    position: absolute;
    left: 4px; top: 5px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}
.milestone .year {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--accent);
    text-transform: uppercase;
}
.milestone h3 {
    margin-top: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.milestone p { color: var(--text-muted); font-size: 0.95rem; margin-top: 4px; }

/* =========================================================================
   Group structure
   ========================================================================= */
.group-wrap {
    margin-top: 56px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}
.group-copy p { color: var(--text-muted); font-size: 1.02rem; }
.group-copy p + p { margin-top: 16px; }
.group-copy .inline-link {
    color: var(--accent-bright);
    font-weight: 600;
    border-bottom: 1px solid var(--accent-line);
    transition: border-color 0.2s;
}
.group-copy .inline-link:hover { border-color: var(--accent-bright); }

.org {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    text-align: center;
    padding: 8px 0;
}
.org-node {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
    padding: 16px 22px;
    min-width: 190px;
    transition: border-color 0.3s, transform 0.3s var(--ease);
}
.org-node:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.org-node.root {
    background: linear-gradient(150deg, rgba(232,182,97,0.12), var(--bg-card));
    border-color: var(--accent-line);
}
.org-node .n-name { font-weight: 700; letter-spacing: -0.01em; }
.org-node .n-sub { font-size: 0.82rem; color: var(--text-muted); margin-top: 3px; }

.org-connector { width: 1px; height: 26px; background: var(--border-strong); }
.org-branches {
    display: flex;
    gap: 22px;
    position: relative;
    padding-top: 26px;
    width: 100%;
    justify-content: center;
}
.org-branches::before {
    content: "";
    position: absolute;
    top: 0; left: 25%; right: 25%;
    height: 1px;
    background: var(--border-strong);
}
.org-branch { position: relative; display: flex; flex-direction: column; align-items: center; }
.org-branch::before {
    content: "";
    position: absolute;
    top: -26px; left: 50%;
    width: 1px; height: 26px;
    background: var(--border-strong);
}

/* =========================================================================
   Contact
   ========================================================================= */
.contact-wrap {
    margin-top: 56px;
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 40px;
}
.company-block {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    padding: 30px;
    align-self: start;
}
.company-block h3 { font-size: 1.1rem; font-weight: 650; }
.company-detail { margin-top: 20px; }
.company-detail:first-of-type { margin-top: 24px; }
.company-detail .k {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
}
.company-detail .v { margin-top: 4px; color: var(--text); font-size: 0.98rem; }
.company-detail .v.placeholder { color: var(--text-dim); font-style: italic; }
.company-mail {
    display: inline-block;
    margin-top: 7px;
    color: var(--accent-bright);
    font-size: 0.94rem;
    font-weight: 500;
    border-bottom: 1px solid var(--accent-line);
    transition: border-color 0.2s;
}
.company-mail:hover { border-color: var(--accent-bright); }

/* Form */
.contact-form {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    padding: 30px;
}
.field { margin-bottom: 18px; }
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.field label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}
.field label .req { color: var(--accent); }
.field input,
.field textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-dim); }
.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent-line);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 130px; }

/* Honeypot — visually hidden but present in the DOM */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px; height: 1px;
    overflow: hidden;
}

.form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.form-status {
    font-size: 0.9rem;
    min-height: 1.2em;
}
.form-status.ok { color: #7ee2a8; }
.form-status.err { color: #f08a8a; }
.form-note {
    margin-top: 16px;
    font-size: 0.78rem;
    color: var(--text-dim);
}
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.btn .spinner {
    width: 15px; height: 15px;
    border: 2px solid rgba(26,18,6,0.35);
    border-top-color: #1a1206;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
    border-top: 1px solid var(--border);
    padding-block: 40px;
}
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.footer-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-nav a {
    font-size: 0.88rem;
    color: var(--text-muted);
    transition: color 0.2s;
}
.footer-nav a:hover { color: var(--text); }
.footer-copy { font-size: 0.85rem; color: var(--text-dim); }

/* =========================================================================
   Scroll-reveal
   ========================================================================= */
/* Progressive enhancement: only hide reveal elements when JS is active
   (the <html> element gets a "js" class on load). Without JS, or if the
   observer fails, all content stays fully visible. */
.js .reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
    will-change: opacity, transform;
}
.js .reveal.visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
    .js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    .badge-dev .dot, .btn .spinner { animation: none; }
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 900px) {
    .cap-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .products-grid { grid-template-columns: 1fr; }
    .group-wrap { grid-template-columns: 1fr; gap: 44px; }
    .contact-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
    .nav-links { display: none; }
    .cap-grid { grid-template-columns: 1fr; }
    .field-row { grid-template-columns: 1fr; }
    .hero-cta { flex-direction: column; align-items: stretch; }
    .hero-cta .btn { width: 100%; }
}
