/* ==========================================================================
   Tsvetan Kunev — site styles
   Single, hand-maintained stylesheet (no build step). Served directly.
   Sections: 0) fonts  1) reset  2) tokens  3) base  4) layout  5) header/nav
   6) home  7) content  8) about/cv  9) certificates + lightbox
   10) forms  11) alerts  12) footer  13) helpers  14) reveal  15) print
   ========================================================================== */

/* 0) Self-hosted fonts (woff2, subset per unicode-range; only the subset a page
   actually uses is fetched). Inter = body/UI, Manrope = headings. Files live in
   /assets/fonts/. See CLAUDE.md before swapping the pairing. --------------- */
@font-face{font-family:'Inter';font-style:normal;font-weight:400;font-display:swap;src:url('/assets/fonts/inter-400-cyrillic.woff2') format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;}
@font-face{font-family:'Inter';font-style:normal;font-weight:400;font-display:swap;src:url('/assets/fonts/inter-400-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;}
@font-face{font-family:'Inter';font-style:normal;font-weight:400;font-display:swap;src:url('/assets/fonts/inter-400-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'Inter';font-style:normal;font-weight:500;font-display:swap;src:url('/assets/fonts/inter-500-cyrillic.woff2') format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;}
@font-face{font-family:'Inter';font-style:normal;font-weight:500;font-display:swap;src:url('/assets/fonts/inter-500-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;}
@font-face{font-family:'Inter';font-style:normal;font-weight:500;font-display:swap;src:url('/assets/fonts/inter-500-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'Inter';font-style:normal;font-weight:600;font-display:swap;src:url('/assets/fonts/inter-600-cyrillic.woff2') format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;}
@font-face{font-family:'Inter';font-style:normal;font-weight:600;font-display:swap;src:url('/assets/fonts/inter-600-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;}
@font-face{font-family:'Inter';font-style:normal;font-weight:600;font-display:swap;src:url('/assets/fonts/inter-600-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'Inter';font-style:normal;font-weight:700;font-display:swap;src:url('/assets/fonts/inter-700-cyrillic.woff2') format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;}
@font-face{font-family:'Inter';font-style:normal;font-weight:700;font-display:swap;src:url('/assets/fonts/inter-700-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;}
@font-face{font-family:'Inter';font-style:normal;font-weight:700;font-display:swap;src:url('/assets/fonts/inter-700-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'Manrope';font-style:normal;font-weight:700;font-display:swap;src:url('/assets/fonts/manrope-700-cyrillic.woff2') format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;}
@font-face{font-family:'Manrope';font-style:normal;font-weight:700;font-display:swap;src:url('/assets/fonts/manrope-700-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;}
@font-face{font-family:'Manrope';font-style:normal;font-weight:700;font-display:swap;src:url('/assets/fonts/manrope-700-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'Manrope';font-style:normal;font-weight:800;font-display:swap;src:url('/assets/fonts/manrope-800-cyrillic.woff2') format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;}
@font-face{font-family:'Manrope';font-style:normal;font-weight:800;font-display:swap;src:url('/assets/fonts/manrope-800-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;}
@font-face{font-family:'Manrope';font-style:normal;font-weight:800;font-display:swap;src:url('/assets/fonts/manrope-800-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}

/* 1) Minimal modern reset -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset, legend { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

/* 2) Design tokens --------------------------------------------------------- */
:root {
    --navy:        #30395C;   /* brand primary (kept) */
    --navy-dark:   #262e4a;
    --blue:        #4A6491;   /* brand secondary (kept) */
    --blue-accent: #3d6bb5;   /* brighter accent for links / focus */
    --sky:         #D0E4F2;   /* brand tint (kept) */
    --sky-soft:    #eaf3fb;

    --bg:      #f3f6fb;
    --surface: #ffffff;
    --ink:     #20242f;
    --muted:   #5a6474;
    --line:    #e4e9f1;

    --danger:  #c0392b;
    --danger-bg: #fdecea;
    --success: #1e7d47;
    --success-bg: #e7f6ed;

    --radius:    14px;
    --radius-sm: 9px;
    --card-radius: clamp(0px, 2vw, 18px);
    --shadow-sm: 0 1px 2px rgba(24,34,64,.06), 0 2px 6px rgba(24,34,64,.06);
    --shadow-md: 0 6px 18px rgba(24,34,64,.09), 0 18px 42px rgba(24,34,64,.10);

    --maxw: 1120px;
    --gutter: clamp(16px, 4vw, 40px);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
    --font-head: 'Manrope', var(--font);
}

/* 3) Base ------------------------------------------------------------------ */
body {
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
strong { font-weight: 700; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -0.02em; }
a { color: var(--blue-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* 4) Layout ---------------------------------------------------------------- */
.container {
    width: min(100% - 2 * var(--gutter), var(--maxw));
    margin-inline: auto;
}
/* The white "page card" wrapping header + content + footer.
   No `overflow:hidden` here — it would break the sticky header. Instead the
   header/footer round their own outer corners to match the card. */
.page {
    max-width: var(--maxw);
    margin: 0 auto;
    background: var(--surface);
    border-radius: 0 0 var(--card-radius) var(--card-radius);
    box-shadow: var(--shadow-md);
}
.content {
    padding: clamp(16px, 2.5vw, 30px) var(--gutter) clamp(22px, 3.5vw, 40px);
    color: var(--ink);
    min-height: 40vh;
}

/* 5) Header / navigation --------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
}
.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
}
.brand {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.1;
    text-decoration: none;
    color: var(--navy);
    margin-right: auto;
}
.brand:hover { text-decoration: none; }
.brand strong {
    font-family: var(--font-head);
    font-size: clamp(19px, 3.4vw, 26px);
    font-weight: 800;
    letter-spacing: -0.02em;
}
.brand span {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--blue);
}
.langs { display: flex; align-items: center; gap: 8px; }
.langs a {
    display: inline-flex;
    padding: 3px;
    border-radius: 5px;
    line-height: 0;
    opacity: 0.5;
    transition: opacity .15s ease;
}
.langs a:hover { opacity: 0.9; }
.langs a[aria-current="true"] { opacity: 1; }
/* both flags are the same visible size; the active one is full-opacity with a
   navy ring, the other is dimmed. No filled box (that inflated the active). */
.langs img { height: 13px; width: auto; border-radius: 2px; display: block; box-shadow: 0 0 0 1px rgba(24,34,64,.15); }
.langs a[aria-current="true"] img { box-shadow: 0 0 0 1.5px var(--navy); }

/* hamburger */
.nav-toggle {
    display: none;
    width: 44px; height: 44px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    padding: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}
.nav-toggle span {
    display: block;
    width: 22px; height: 2px;
    background: var(--navy);
    border-radius: 2px;
    transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* navy nav bar (kept as brand identity) */
.mainnav { background: var(--navy); }
.mainnav > .container { display: flex; }
.mainnav ul { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.mainnav li { position: relative; }
.mainnav .has-submenu > a::after {
    content: "";
    display: inline-block;
    width: 0; height: 0;
    margin-left: 7px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    opacity: .8;
}
.mainnav a {
    display: block;
    padding: 14px 18px;
    color: #dfe6f4;
    font-size: 15.5px;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.mainnav a:hover,
.mainnav .has-submenu:hover > a,
.mainnav a:focus-visible { background: rgba(255,255,255,.10); color: #fff; }
.mainnav a[aria-current="page"] {
    color: #fff;
    box-shadow: inset 0 -3px 0 var(--sky);
}
/* submenu */
.mainnav .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 210px;
    background: var(--navy-dark);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: 6px;
    display: none;
    z-index: 60;
}
.mainnav .has-submenu:hover .submenu,
.mainnav .has-submenu:focus-within .submenu,
.mainnav .submenu.open { display: block; }
.mainnav .submenu a {
    padding: 10px 12px;
    border-radius: 7px;
    font-size: 14.5px;
}
.mainnav .submenu a:hover { background: rgba(255,255,255,.10); }
.submenu-toggle { display: none; }

/* 6) Home ------------------------------------------------------------------ */
.hero {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(20px, 4vw, 40px);
    align-items: center;
    padding-bottom: clamp(14px, 2.2vw, 20px);
    border-bottom: 1px solid var(--line);
}
.image-frame {
    flex: 0 0 auto;
    width: 190px;
    padding: 8px;
    background: linear-gradient(160deg, var(--sky-soft), var(--sky));
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin: 0 auto;
}
.image-frame img { border-radius: 8px; width: 100%; }
.home-text {
    flex: 1 1 340px;
    color: var(--navy);
    font-size: clamp(16px, 2.2vw, 19px);
    line-height: 1.7;
    font-style: normal;
    text-align: left;
}
.home-text h1 {
    font-weight: 800;
    font-size: clamp(28px, 4.8vw, 40px);
    line-height: 1.1;
    letter-spacing: -0.025em;
    margin-bottom: 8px;
}
.home-text p { margin: 0; }

/* hero lead */
.home-text .lead {
    font-size: clamp(16px, 2.2vw, 18px);
    line-height: 1.55;
    color: var(--navy);
    margin: 0 0 12px;
}

/* credential / standard pills */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.pills li {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--blue-accent);
    background: var(--sky-soft);
    border: 1px solid var(--sky);
    padding: 5px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

/* hero call-to-action buttons */
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* shared button component (primary CTA + ghost outline) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 700;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: transform .12s ease, box-shadow .18s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
/* buttons live inside .content, which underlines links — opt them out */
.content a.btn { text-decoration: none; }
.btn-primary { background: var(--navy); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--navy-dark); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--sky); }
.btn-ghost:hover { background: var(--sky-soft); border-color: var(--blue); }

/* home "how I can help" heading */
/* qualified with .content so it beats `.content h2` (same element is an <h2>) */
.content .home-services-title {
    margin: clamp(16px, 2.2vw, 22px) 0 0;
    font-size: clamp(19px, 2.8vw, 24px);
    color: var(--navy);
}

.home-services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: clamp(12px, 1.8vw, 16px);
}
.home-services li {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 14px;
    background: var(--sky-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    color: var(--navy);
    font-size: 15.5px;
    line-height: 1.6;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.home-services li:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--sky);
}
.home-services li p { margin: 0; }

/* service icon badge (icon() helper renders the inner svg.svc-icon) */
.svc-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(160deg, #fff, var(--sky-soft));
    border: 1px solid var(--sky);
    color: var(--blue-accent);
    box-shadow: var(--shadow-sm);
}
.svc-icon { width: 24px; height: 24px; display: block; }

/* 7) Content typography ---------------------------------------------------- */
.content h1,
.content h2 {
    font-weight: 800;
    font-size: clamp(25px, 4vw, 33px);
    line-height: 1.18;
    color: var(--navy);
    letter-spacing: -0.02em;
    margin-bottom: 22px;
}
.content h3 {
    font-size: clamp(18px, 2.6vw, 22px);
    color: var(--navy);
    margin: 30px 0 14px;
}
.content p { margin: 0 0 16px; max-width: 72ch; }
.content a { text-decoration: underline; text-underline-offset: 2px; }
.services p { font-size: 18px; }

dl { margin: 0 0 20px; }
dl dt { font-weight: 700; color: var(--navy); margin-top: 12px; }
dl dd { margin: 0 0 4px; }

/* 8) About / CV ------------------------------------------------------------ */
#cv {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0 24px;
}
#cv tbody.thead th {
    text-align: left;
    font-family: var(--font-head);
    font-size: clamp(17px, 2.4vw, 20px);
    color: var(--navy);
    font-weight: 800;
    padding: 22px 12px 8px;
    border-bottom: 2px solid var(--sky);
    line-height: 1.3;
}
#cv tbody th {
    width: 200px;
    text-align: left;
    vertical-align: top;
    padding: 8px 14px 8px 12px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--blue);
    border-bottom: 1px solid var(--line);
}
#cv tbody td {
    text-align: left;
    vertical-align: top;
    padding: 8px 12px;
    font-size: 15px;
    line-height: 1.6;
    border-bottom: 1px solid var(--line);
}
#cv tbody td ul { list-style: disc inside; }
#cv .empty td { border: none; padding: 4px; }

.to-top {
    display: inline-block;
    float: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--blue);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--sky-soft);
}
.to-top:hover { background: var(--sky); text-decoration: none; }

/* 9) Certificates + lightbox ---------------------------------------------- */
.certificates {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
    padding: 24px 0;
}
.certificates .certificate {
    display: block;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease;
}
.certificates .certificate:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.certificates .certificate img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: contain;
    background: #fff;
    border-radius: 4px;
}

.lightbox {
    position: fixed; inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15,20,38,.86);
    z-index: 1000;
}
.lightbox.open { display: flex; }
.lb-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 0;
    max-width: min(92vw, 900px);
}
.lightbox img {
    max-width: min(92vw, 900px);
    max-height: 80vh;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.lb-caption {
    color: #e7eefb;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    max-width: 60ch;
}
.lb-counter {
    position: absolute;
    top: 26px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.72);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .05em;
}
.lightbox button {
    position: absolute;
    background: rgba(255,255,255,.14);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 52px; height: 52px;
    font-size: 26px;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s ease;
}
.lightbox button:hover { background: rgba(255,255,255,.28); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* 10) Forms ---------------------------------------------------------------- */
form { margin-top: 8px; }
form fieldset {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 22px;
    background: #fbfcfe;
}
form legend {
    font-weight: 700;
    color: var(--navy);
    font-size: 16px;
    padding: 0 8px;
    font-style: normal;
}
/* space each label/input row (fields are bare <div>s in the markup) */
form fieldset > div,
form .field { margin-bottom: 16px; }
form fieldset > div:last-child { margin-bottom: 0; }
form label {
    display: block;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 6px;
}
form input[type=text],
form input[type=email],
form input[type=tel],
form input[type=date],
form input[type=number],
form textarea {
    width: 100%;
    padding: 11px 13px;
    font-size: 15.5px;
    background: var(--surface);
    border: 1px solid #c7d0de;
    border-radius: var(--radius-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
}
form input:focus,
form textarea:focus {
    outline: none;
    border-color: var(--blue-accent);
    box-shadow: 0 0 0 3px rgba(61,107,181,.18);
}
form textarea { min-height: 130px; resize: vertical; }

/* checkbox rows */
.checkbox { margin-bottom: 6px; }
.checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
}
.checkbox input[type=checkbox] {
    width: 18px; height: 18px;
    margin-top: 3px;
    accent-color: var(--navy);
    flex: 0 0 auto;
}

/* two-column quotation form */
#quotation .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    align-items: start;
}
#quotation .form-grid > div { min-width: 0; }
#quotation .form-grid fieldset { margin-bottom: 22px; }
#quotation .form-grid fieldset:last-child { margin-bottom: 0; }

.captcha { margin: 8px 0 20px; }

button[type=submit],
input[type=submit] {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: var(--navy);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    padding: 13px 30px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    transition: background .15s ease, transform .1s ease;
}
button[type=submit]:hover,
input[type=submit]:hover { background: var(--navy-dark); }
button[type=submit]:active,
input[type=submit]:active { transform: translateY(1px); }

/* 11) Alerts --------------------------------------------------------------- */
.input-error {
    display: block;
    margin-top: 6px;
    padding: 7px 12px;
    font-size: 13.5px;
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid #f3b7b0;
    border-radius: 7px;
    width: auto;
}
.success {
    padding: 14px 18px;
    margin-bottom: 22px;
    font-size: 15px;
    color: var(--success);
    background: var(--success-bg);
    border: 1px solid #b7e0c6;
    border-radius: var(--radius-sm);
}

/* 12) Footer --------------------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--line);
    padding: 22px var(--gutter);
    text-align: center;
    font-size: 13.5px;
    color: var(--muted);
    background: #fbfcfe;
    border-radius: 0 0 var(--card-radius) var(--card-radius);
}
.site-footer a { color: var(--blue); font-weight: 600; }

/* 13) Helpers -------------------------------------------------------------- */
.clear { clear: both; }
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

/* Skip-to-content link — off-screen until keyboard-focused */
.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 200;
    background: var(--navy);
    color: #fff;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: var(--shadow-md);
    transition: top .18s ease;
}
.skip-link:focus { top: 0; text-decoration: none; }
#main:focus { outline: none; }

/* 14) Scroll reveal -------------------------------------------------------- */
/* The <html> gets `.js` from an inline head script before first paint, so these
   only apply when JS is on (no-JS users always see content). scripts.js adds
   `.is-visible` via IntersectionObserver. */
.js .u-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s ease, transform .6s cubic-bezier(.22,.61,.36,1);
    will-change: opacity, transform;
}
.js .u-reveal.is-visible { opacity: 1; transform: none; }
/* stagger cards / thumbnails within a group */
.js .home-services .u-reveal:nth-child(2) { transition-delay: .08s; }
.js .home-services .u-reveal:nth-child(3) { transition-delay: .16s; }
.js .certificates .u-reveal:nth-child(3n+2) { transition-delay: .06s; }
.js .certificates .u-reveal:nth-child(3n+3) { transition-delay: .12s; }

/* ==========================================================================
   Responsive — mobile navigation + stacking
   ========================================================================== */
@media (max-width: 760px) {
    .nav-toggle { display: flex; }

    .mainnav {
        position: absolute;
        left: 0; right: 0;
        background: var(--navy);
        box-shadow: var(--shadow-md);
        display: none;
    }
    .mainnav.open { display: block; }
    .mainnav > .container { width: 100%; display: block; }
    .mainnav ul { flex-direction: column; }
    .mainnav li { border-top: 1px solid rgba(255,255,255,.08); }
    .mainnav a { padding: 15px 20px; }
    .mainnav a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--sky); }

    /* submenu becomes an accordion */
    .mainnav .has-submenu > a::after { display: none; }
    .mainnav .has-submenu { display: flex; flex-wrap: wrap; align-items: center; }
    .mainnav .has-submenu > a { flex: 1; }
    .submenu-toggle {
        display: flex;
        align-items: center; justify-content: center;
        width: 52px; align-self: stretch;
        background: transparent; border: none;
        color: #dfe6f4; font-size: 20px;
    }
    .submenu-toggle::before { content: "＋"; }
    .submenu-toggle[aria-expanded="true"]::before { content: "－"; }
    .mainnav .submenu {
        position: static;
        display: none;
        width: 100%;
        box-shadow: none;
        border-radius: 0;
        background: rgba(0,0,0,.18);
        padding: 0;
    }
    .mainnav .submenu.open { display: block; }
    .mainnav .submenu a { padding-left: 34px; border-radius: 0; }

    #quotation .form-grid { grid-template-columns: 1fr; }
    .home-text { text-align: center; }
    .home-text .pills,
    .home-text .hero-actions { justify-content: center; }
}

/* CV table: stack label above value on small screens */
@media (max-width: 620px) {
    #cv, #cv tbody, #cv tr, #cv th, #cv td { display: block; width: auto; }
    #cv tbody th { border-bottom: none; padding: 10px 12px 0; }
    #cv tbody td { padding-top: 2px; }
    #cv tbody.thead th { padding-top: 26px; }
}

@media (max-width: 420px) {
    body { font-size: 16px; }
    .content { padding-left: 18px; padding-right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
    /* never leave reveal targets hidden when motion is off */
    .js .u-reveal { opacity: 1 !important; transform: none !important; }
}

/* 15) Print — clean CV / page output (chrome & interactive bits removed) ---- */
@media print {
    body { background: #fff; color: #000; font-size: 12pt; }
    .page { max-width: 100%; margin: 0; box-shadow: none; border-radius: 0; }
    .site-header, .mainnav, .nav-toggle, .langs, .skip-link,
    .site-footer, .hero-actions, .to-top, .lightbox { display: none !important; }
    .content { padding: 0; min-height: 0; }
    a { color: #000; }
    .u-reveal { opacity: 1 !important; transform: none !important; }
    .image-frame { box-shadow: none; background: none; padding: 0; }
    .pills li { border: 1px solid #999; color: #000; background: none; }
    #cv { font-size: 10.5pt; }
    #cv tbody.thead th { border-bottom: 1.5px solid #000; color: #000; }
    #cv tbody th { color: #333; }
    #cv tr, .home-services li, form fieldset { break-inside: avoid; page-break-inside: avoid; }
}
