/* Katana Software Limited — site stylesheet
 * Boutique engineering consultancy: midnight navy, champagne gold,
 * warm ivory. Editorial type, calm confidence, no clutter.
 * Plain CSS, no frameworks. Mobile-first.
 */

/* ─── Reset ───────────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    /* Offsets in-page anchor jumps so section titles clear the
       sticky header instead of hiding beneath it. */
    scroll-padding-top: 92px;
}

img, svg { max-width: 100%; display: block; }

a { color: inherit; }

ul, dl, dd { margin: 0; padding: 0; }

ul { list-style: none; }

/* ─── Tokens ──────────────────────────────────────────────── */
:root {
    --midnight: #081D2D;
    --deep-navy: #10283B;
    --ink: #0F1720;
    --navy-line: #1C3852;     /* hairline borders on dark */
    --gold: #D4AF37;
    --champagne: #F0D28A;
    --ivory: #F2EFE6;
    --silver: #C7CED4;
    --silver-dim: rgba(199, 206, 212, 0.62);

    --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;

    --container: 1180px;
    --radius: 4px;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ─── Base ────────────────────────────────────────────────── */
body {
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.65;
    color: var(--silver);
    background: var(--midnight);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

@media (min-width: 760px) {
    .container { padding: 0 44px; }
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--champagne);
    color: var(--midnight);
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

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

/* ─── Header ──────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(8, 29, 45, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: background-color 240ms var(--ease),
        border-color 240ms var(--ease);
}

/* Subtle lift once the page scrolls — set by site.js. */
.site-header.is-scrolled {
    background: rgba(8, 29, 45, 0.94);
    border-bottom-color: rgba(212, 175, 55, 0.20);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    text-decoration: none;
    color: inherit;
}

.brand-mark {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-name {
    font-family: var(--serif);
    font-size: 23px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--ivory);
}

.brand-sub {
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 3.4px;
    text-transform: uppercase;
    color: var(--gold);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-nav a {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: var(--silver);
    text-decoration: none;
    padding: 9px 14px;
    border-radius: var(--radius);
    transition: color 180ms var(--ease), background-color 180ms var(--ease);
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: var(--ivory);
}

.site-nav .nav-cta {
    color: var(--champagne);
    border: 1px solid rgba(212, 175, 55, 0.38);
    margin-left: 6px;
}

.site-nav .nav-cta:hover,
.site-nav .nav-cta:focus-visible {
    color: var(--midnight);
    background: var(--champagne);
}

/* Compact header on phones — the gold mark alone carries the
   brand so the 3-link nav always fits on one row with no
   horizontal overflow, down to a 320px viewport. The full
   Katana wordmark + sub-label return at 561px and above. */
@media (max-width: 560px) {
    .brand-text { display: none; }
    .brand-mark { width: 40px; height: 40px; }
    .site-nav { gap: 4px; }
    .site-nav a { font-size: 13px; padding: 8px 10px; }
    .site-nav .nav-cta { margin-left: 4px; }
}

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: var(--radius);
    font-family: var(--sans);
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background-color 200ms var(--ease),
        color 200ms var(--ease), border-color 200ms var(--ease),
        transform 200ms var(--ease);
}

.btn-primary {
    background: linear-gradient(135deg, var(--champagne), var(--gold));
    color: var(--midnight);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--ivory);
    border-color: rgba(199, 206, 212, 0.30);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
    border-color: var(--champagne);
    color: var(--champagne);
}

/* ─── Hero ────────────────────────────────────────────────── */
.hero {
    position: relative;
    overflow: hidden;
    /* Layered, restrained: a soft champagne glow top-right over a
       deep navy vertical wash. No loud gradients. */
    background:
        radial-gradient(64% 56% at 86% 8%,
            rgba(212, 175, 55, 0.13) 0%,
            rgba(212, 175, 55, 0) 62%),
        linear-gradient(180deg, var(--midnight) 0%, var(--deep-navy) 100%);
}

.hero::before {
    /* Faint precision grid texture, very low contrast. */
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("../img/katana-bg-precision-grid.png");
    background-size: cover;
    opacity: 0.16;
    pointer-events: none;
}

.hero-inner {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 44px;
    align-items: center;
    padding: 76px 24px 84px;
}

@media (min-width: 920px) {
    .hero-inner {
        /* Copy column weighted wider so the headline holds
           'Precision software.' on a single line. */
        grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr);
        gap: 56px;
        padding: 116px 44px 124px;
    }
}

.eyebrow {
    margin: 0 0 22px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold);
}

.hero-title {
    margin: 0;
    font-family: var(--serif);
    font-weight: 600;
    /* Capped at 68px so 'Precision software.' fits the copy
       column on one line; the <br> then gives a clean two-line
       headline matching the brand mockup. */
    font-size: clamp(44px, 5.6vw, 68px);
    line-height: 1.06;
    letter-spacing: -0.3px;
    color: var(--ivory);
}

.hero-lede {
    margin: 26px 0 0;
    font-size: clamp(16.5px, 1.4vw, 18.5px);
    line-height: 1.62;
    color: var(--silver);
    max-width: 46ch;
}

.hero-actions {
    margin: 36px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.hero-visual {
    display: flex;
    justify-content: center;
}

.hero-motif {
    width: 100%;
    max-width: 440px;
    height: auto;
    filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.45));
}

@media (max-width: 919px) {
    /* Image follows the copy on mobile; cap it so it doesn't
       dominate the fold. */
    .hero-visual { order: 2; }
    .hero-motif { max-width: 340px; }
}

/* ─── Section base ────────────────────────────────────────── */
.section {
    padding: 92px 0;
}

@media (min-width: 760px) {
    .section { padding: 132px 0; }
}

.section-eyebrow {
    margin: 0 0 16px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold);
}

.section-title {
    margin: 0;
    font-family: var(--serif);
    font-weight: 600;
    font-size: clamp(32px, 4vw, 50px);
    line-height: 1.1;
    letter-spacing: -0.3px;
    color: var(--ivory);
}

.section-lede {
    margin: 18px 0 0;
    font-size: 17px;
    line-height: 1.62;
    color: var(--silver);
    max-width: 56ch;
}

/* ─── Services ────────────────────────────────────────────── */
.section-services {
    border-top: 1px solid var(--navy-line);
}

.service-grid {
    margin: 56px 0 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background: var(--navy-line);
    border: 1px solid var(--navy-line);
    border-radius: 6px;
    overflow: hidden;
}

@media (min-width: 680px) {
    .service-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1040px) {
    .service-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Cards sit on a 1px hairline grid — the gap shows the line
   through, giving a precise drafting-table feel without borders
   on every card. */
.service-card {
    background: var(--deep-navy);
    padding: 34px 30px 38px;
    transition: background-color 240ms var(--ease);
}

.service-card:hover {
    background: #143046;
}

.service-index {
    font-family: var(--serif);
    font-size: 18px;
    color: var(--gold);
    letter-spacing: 1px;
}

.service-card h3 {
    margin: 18px 0 10px;
    font-family: var(--serif);
    font-size: 25px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--ivory);
}

.service-card p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--silver-dim);
}

/* ─── Work ────────────────────────────────────────────────── */
.section-work {
    border-top: 1px solid var(--navy-line);
    background:
        radial-gradient(50% 60% at 100% 0%,
            rgba(212, 175, 55, 0.07) 0%,
            rgba(212, 175, 55, 0) 60%),
        var(--midnight);
}

/* Two stacked panels — a current client engagement and Katana's
   own product. Kept as separate cards so the two are never read
   as the same piece of work. */
.work-stack {
    margin: 56px 0 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.work-panel {
    background: var(--deep-navy);
    border: 1px solid var(--navy-line);
    border-radius: 6px;
    padding: 38px 30px 40px;
}

@media (min-width: 760px) {
    .work-panel { padding: 46px 44px 48px; }
}

.work-kicker {
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
}

.work-title {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 600;
    line-height: 1.15;
    color: var(--ivory);
}

.work-copy {
    margin: 18px 0 0;
    font-size: 16px;
    line-height: 1.66;
    color: var(--silver);
    max-width: 54ch;
}

.work-tags {
    margin: 26px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.work-tags li {
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: var(--champagne);
    padding: 6px 12px;
    border: 1px solid rgba(212, 175, 55, 0.26);
    border-radius: 999px;
}

.work-link {
    margin: 30px 0 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--champagne);
    text-decoration: none;
    border-bottom: 1px solid rgba(212, 175, 55, 0.32);
    padding-bottom: 3px;
    transition: border-color 180ms var(--ease), gap 180ms var(--ease);
}

.work-link:hover,
.work-link:focus-visible {
    border-bottom-color: var(--champagne);
    gap: 11px;
}

.work-link-arrow { flex-shrink: 0; }

/* ─── Contact ─────────────────────────────────────────────── */
.section-contact {
    border-top: 1px solid var(--navy-line);
}

.contact-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 44px;
    align-items: center;
}

@media (min-width: 880px) {
    .contact-inner {
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
        gap: 64px;
    }
}

.contact-card {
    background: var(--deep-navy);
    border: 1px solid var(--navy-line);
    border-radius: 6px;
    padding: 38px 36px 34px;
}

.contact-name {
    margin: 0;
    font-family: var(--serif);
    font-size: 27px;
    font-weight: 600;
    color: var(--ivory);
}

.contact-org {
    margin: 4px 0 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--gold);
}

.contact-list {
    margin: 28px 0 0;
    border-top: 1px solid var(--navy-line);
}

.contact-row {
    display: flex;
    align-items: baseline;
    gap: 18px;
    padding: 16px 0;
    border-bottom: 1px solid var(--navy-line);
}

.contact-row dt {
    flex-shrink: 0;
    width: 84px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--silver-dim);
}

.contact-row dd {
    margin: 0;
    font-size: 16px;
    min-width: 0;
    /* Email + LinkedIn URL are long unbreakable strings; allow them
       to wrap so they can't force the contact card — and with it the
       whole page — wider than a narrow phone viewport. */
    overflow-wrap: anywhere;
}

.contact-row a {
    color: var(--ivory);
    text-decoration: none;
    border-bottom: 1px solid rgba(212, 175, 55, 0.34);
    padding-bottom: 2px;
    transition: color 180ms var(--ease), border-color 180ms var(--ease);
}

.contact-row a:hover,
.contact-row a:focus-visible {
    color: var(--champagne);
    border-bottom-color: var(--champagne);
}

/* ─── Footer ──────────────────────────────────────────────── */
.site-footer {
    background: var(--ink);
    border-top: 1px solid var(--navy-line);
    padding: 40px 0;
}

.site-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px 32px;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
}

.footer-mark { width: 32px; height: 32px; }

.footer-name {
    font-family: var(--serif);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--ivory);
}

.footer-links {
    display: flex;
    gap: 22px;
}

.footer-links a {
    font-size: 13.5px;
    color: var(--silver-dim);
    text-decoration: none;
    transition: color 180ms var(--ease);
}

.footer-links a:hover,
.footer-links a:focus-visible {
    color: var(--champagne);
}

.footer-legal {
    margin: 0;
    margin-left: auto;
    font-size: 12.5px;
    letter-spacing: 0.3px;
    color: var(--silver-dim);
}

@media (max-width: 620px) {
    .footer-legal { margin-left: 0; flex-basis: 100%; }
}

/* ─── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
    .btn-primary:hover,
    .btn-primary:focus-visible { transform: none; }
}
