/* ============================================================
   bashara.pt — professional redesign
   Design system + component styles
   ============================================================ */

:root {
    --ink: #14181F;          /* headings / dark sections */
    --slate: #3B4453;        /* body text */
    --muted: #6B7482;        /* secondary text */
    --accent: #A8202B;       /* brand crimson */
    --accent-dark: #7E1620;
    --accent-soft: #FBEDEE;
    --bg: #FFFFFF;
    --bg-alt: #F6F7F9;
    --line: #E7E9ED;
    --ring: rgba(168, 32, 43, 0.12);
    --shadow-sm: 0 1px 2px rgba(20, 24, 31, 0.04), 0 2px 8px rgba(20, 24, 31, 0.05);
    --shadow-md: 0 6px 24px rgba(20, 24, 31, 0.08), 0 2px 6px rgba(20, 24, 31, 0.05);
    --shadow-lg: 0 20px 50px rgba(20, 24, 31, 0.14);
    --radius: 14px;
    --radius-sm: 10px;
    --maxw: 1140px;
    --nav-h: 72px;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--sans);
    color: var(--slate);
    background: var(--bg);
    line-height: 1.65;
    margin: 0;
    overflow-x: hidden; /* safety net against sub-pixel horizontal scroll */
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Let grid/flex children shrink below their content size (prevents track blowout) */
.hero-grid > *, .grid > *, .steps > *, .timeline, .hero-cta > * { min-width: 0; }
.eyebrow { overflow-wrap: anywhere; }

h1, h2, h3, h4, h5 {
    font-family: var(--sans);
    color: var(--ink);
    line-height: 1.15;
    margin: 0 0 0.5em;
    font-weight: 700;
    letter-spacing: -0.02em;
}

p { margin: 0 0 1rem; }

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-dark); }

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

/* ---------- Layout helpers ---------- */
.wrap {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 92px 0;
    scroll-margin-top: var(--nav-h);
}
.section--alt { background: var(--bg-alt); }
.section--ink {
    background: var(--ink);
    background-image: radial-gradient(1200px 400px at 80% -10%, rgba(168,32,43,0.28), transparent 60%);
    color: #C9CFDA;
}
.section--ink h2, .section--ink h3 { color: #fff; }

.eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
}
.section--ink .eyebrow { color: #E7969C; }

.section-head { max-width: 720px; margin-bottom: 52px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); }
.section-head p { font-size: 1.1rem; color: var(--muted); margin-bottom: 0; }
.section--ink .section-head p { color: #A9B2C0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 600;
    font-size: 0.98rem;
    padding: 13px 26px;
    border-radius: 999px;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
    line-height: 1;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-dark); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-2px); }
.section--ink .btn-outline { color: #fff; border-color: rgba(255,255,255,0.28); }
.section--ink .btn-outline:hover { border-color: #fff; background: rgba(255,255,255,0.06); }

/* ============================================================
   Navigation
   ============================================================ */
.site-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    z-index: 1000;
}
.site-nav .wrap {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-brand img { height: 30px; width: auto; }
.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
    list-style: none;
    margin: 0; padding: 0;
}
.nav-links a {
    color: var(--slate);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}
.nav-links a:hover { color: var(--accent); }
.nav-links .btn { padding: 9px 20px; }
.nav-links .btn:hover { color: #fff; }

.nav-toggle {
    display: none;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
}
.nav-toggle span {
    display: block;
    width: 24px; height: 2px;
    background: var(--ink);
    margin: 5px 0;
    transition: .2s;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
    padding-top: calc(var(--nav-h) + 72px);
    padding-bottom: 96px;
    background:
        radial-gradient(900px 500px at 100% 0%, var(--accent-soft), transparent 55%),
        linear-gradient(180deg, #fff 0%, var(--bg-alt) 100%);
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 64px;
    align-items: center;
}
.hero h1 {
    font-size: clamp(2.4rem, 5.2vw, 3.6rem);
    margin-bottom: 18px;
}
.hero .lead {
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    color: var(--slate);
    font-weight: 500;
    margin-bottom: 18px;
}
.hero .lead b { color: var(--accent); font-weight: 700; }
.hero p.sub { font-size: 1.08rem; color: var(--muted); max-width: 540px; margin-bottom: 30px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 34px; }

.hero-trust {
    display: flex;
    gap: 34px;
    flex-wrap: wrap;
    border-top: 1px solid var(--line);
    padding-top: 26px;
}
.hero-trust .num { font-size: 1.7rem; font-weight: 700; color: var(--ink); letter-spacing: -0.03em; }
.hero-trust .lbl { font-size: 0.85rem; color: var(--muted); }

.hero-photo { position: relative; justify-self: center; }

/* Portrait with Matrix hover reveal */
.portrait {
    position: relative;
    width: 340px;
    height: 340px;
    margin: 0;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    z-index: 2;
    cursor: crosshair;
    outline: none;
    transition: box-shadow .5s ease;
}
.portrait-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.portrait-img.matrix {
    opacity: 0;
    filter: grayscale(1) contrast(1.45) brightness(0.5) sepia(1) saturate(3.4) hue-rotate(72deg);
    transition: opacity .55s ease;
}
/* Darken + green-tint the highlights so it reads as classic Matrix, not neon */
.portrait::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,20,4,0.55), rgba(0,12,2,0.78));
    opacity: 0;
    pointer-events: none;
    mix-blend-mode: multiply;
    transition: opacity .55s ease;
    z-index: 1;
}
.portrait-rain {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 2;
    mix-blend-mode: screen;
    pointer-events: none;
    transition: opacity .55s ease;
}
.portrait-scan {
    position: absolute;
    inset: 0;
    opacity: 0;
    z-index: 3;
    pointer-events: none;
    background:
        repeating-linear-gradient(0deg, rgba(0,0,0,0.32) 0 1px, transparent 1px 3px),
        radial-gradient(120% 90% at 50% 0%, transparent 55%, rgba(0,10,2,0.55) 100%);
    mix-blend-mode: overlay;
    transition: opacity .55s ease;
}
.portrait:hover, .portrait:focus-visible, .portrait.active {
    box-shadow: 0 0 0 1px rgba(0,255,90,0.45), 0 0 40px rgba(0,255,90,0.28), var(--shadow-lg);
}
.portrait:hover .portrait-img.matrix,
.portrait:focus-visible .portrait-img.matrix,
.portrait.active .portrait-img.matrix,
.portrait:hover .portrait-rain,
.portrait:focus-visible .portrait-rain,
.portrait.active .portrait-rain,
.portrait:hover .portrait-scan,
.portrait:focus-visible .portrait-scan,
.portrait.active .portrait-scan { opacity: 1; }
.portrait:hover::after,
.portrait:focus-visible::after,
.portrait.active::after { opacity: 1; }
.hero-photo::before {
    content: "";
    position: absolute;
    inset: -18px -18px auto auto;
    width: 160px; height: 160px;
    border-radius: 24px;
    background: var(--accent);
    opacity: 0.12;
    z-index: 1;
}
.hero-photo::after {
    content: "";
    position: absolute;
    left: -22px; bottom: -22px;
    width: 120px; height: 120px;
    border: 2px solid var(--accent);
    border-radius: 20px;
    opacity: 0.35;
    z-index: 1;
}

/* ============================================================
   Cards / grids
   ============================================================ */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card-item {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px 28px;
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .18s ease, border-color .18s ease;
}
.card-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #d9dce2; }
.card-icon {
    width: 52px; height: 52px;
    border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 20px;
}
.card-icon svg { width: 26px; height: 26px; }
.card-item h3 { font-size: 1.18rem; margin-bottom: 10px; }
.card-item p { color: var(--muted); font-size: 0.98rem; margin-bottom: 0; }

/* ---------- Approach steps (on ink) ---------- */
.steps { counter-reset: step; }
.step { position: relative; padding-left: 6px; }
.step .step-num {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #E7969C;
    margin-bottom: 14px;
    display: block;
}
.step h3 { font-size: 1.15rem; margin-bottom: 8px; }
.step p { color: #A9B2C0; font-size: 0.96rem; margin-bottom: 0; }
.step::before {
    content: "";
    display: block;
    width: 44px; height: 3px;
    background: var(--accent);
    border-radius: 3px;
    margin-bottom: 20px;
}

/* ---------- Stats ---------- */
.stat { text-align: center; padding: 20px 12px; }
.stat .num { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800; color: var(--ink); letter-spacing: -0.03em; line-height: 1; }
.stat .num span { color: var(--accent); }
.stat .lbl { color: var(--muted); font-size: 0.95rem; margin-top: 10px; }

/* ---------- Beyond work ---------- */
.beyond-card {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow-sm);
}
.beyond-card .card-icon { flex: 0 0 auto; margin-bottom: 0; }
.beyond-card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.beyond-card p { font-size: 0.95rem; color: var(--muted); margin-bottom: 10px; }
.text-link { font-weight: 600; font-size: 0.92rem; display: inline-flex; align-items: center; gap: 6px; }
.text-link svg { width: 15px; height: 15px; }

/* ---------- Contact ---------- */
.contact-cta { text-align: center; max-width: 640px; margin: 0 auto; }
.contact-cta h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.contact-cta p { color: #A9B2C0; font-size: 1.1rem; margin-bottom: 30px; }
.contact-cta .hero-cta { justify-content: center; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    background: #0D1116;
    color: #7E8695;
    padding: 40px 0;
    font-size: 0.9rem;
}
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.site-footer a { color: #A9B2C0; }
.site-footer a:hover { color: #fff; }
.footer-social { display: flex; gap: 18px; }

/* ---------- Experience timeline ---------- */
.timeline { position: relative; max-width: 820px; }
.timeline::before {
    content: "";
    position: absolute;
    left: 7px; top: 6px; bottom: 6px;
    width: 2px;
    background: var(--line);
}
.tl-item { position: relative; padding: 0 0 34px 40px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
    content: "";
    position: absolute;
    left: 0; top: 5px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--accent);
}
.tl-item.current::before { background: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.tl-role { font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.tl-meta { font-size: 0.92rem; color: var(--accent); font-weight: 600; margin: 2px 0 8px; }
.tl-meta .dot { color: var(--muted); font-weight: 400; margin: 0 8px; }
.tl-meta .period { color: var(--muted); font-weight: 500; }
.tl-item p { color: var(--muted); font-size: 0.98rem; margin-bottom: 0; }

/* ---------- Testimonials ---------- */
.quote-card {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 28px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.quote-card .mark {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 3.4rem;
    line-height: 0.6;
    color: var(--accent);
    opacity: 0.35;
    margin-bottom: 6px;
}
.quote-card blockquote { margin: 0 0 20px; font-size: 1rem; color: var(--slate); line-height: 1.7; }
.quote-card .who { margin-top: auto; }
.quote-card .who .name { font-weight: 700; color: var(--ink); font-size: 0.98rem; }
.quote-card .who .title { color: var(--muted); font-size: 0.86rem; line-height: 1.4; }

/* ---------- Experience "current" chip ---------- */
.tl-meta .now {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 2px 9px;
    border-radius: 999px;
    vertical-align: middle;
}

/* ---------- Industries / sectors ---------- */
.industry {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .18s ease, border-color .18s ease;
}
.industry:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #d9dce2; }
.industry .card-icon { width: 44px; height: 44px; border-radius: 11px; margin: 0; flex: 0 0 auto; }
.industry .card-icon svg { width: 22px; height: 22px; }
.industry h3 { font-size: 1.02rem; margin: 0 0 4px; }
.industry p { font-size: 0.88rem; color: var(--muted); margin: 0; }

/* ---------- Logo wall (companies worked with & for) ---------- */
.logo-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}
.logo-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 88px;
    padding: 16px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .18s ease;
}
.logo-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.logo-tile img {
    max-height: 30px;
    max-width: 118px;
    width: auto;
    filter: grayscale(1) opacity(0.48);
    transition: filter .2s ease;
}
.logo-tile:hover img { filter: grayscale(0) opacity(1); }
.logo-word {
    font-weight: 800;
    font-size: 1.04rem;
    letter-spacing: -0.02em;
    color: var(--muted);
    text-align: center;
    line-height: 1.15;
    transition: color .2s ease;
}
.logo-tile:hover .logo-word { color: var(--ink); }
.logo-word small {
    display: block;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    opacity: 0.7;
    margin-top: 3px;
}

/* ============================================================
   Certificates page
   ============================================================ */
.page-hero {
    padding-top: calc(var(--nav-h) + 64px);
    padding-bottom: 48px;
    background: linear-gradient(180deg, #fff 0%, var(--bg-alt) 100%);
    text-align: center;
}
.page-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.page-hero p { color: var(--muted); font-size: 1.1rem; max-width: 620px; margin: 0 auto; }

.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 22px;
}
.cert-card {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform .15s ease, box-shadow .18s ease;
}
.cert-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.cert-card .cert-thumb {
    background: var(--bg-alt);
    border-bottom: 1px solid var(--line);
    aspect-ratio: 4 / 3;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.cert-card .cert-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.cert-body { padding: 18px 20px; }
.cert-body .cert-title { font-weight: 700; color: var(--ink); font-size: 1.02rem; line-height: 1.3; margin-bottom: 6px; }
.cert-body .cert-company { color: var(--muted); font-size: 0.9rem; }
.cert-body .cert-year {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 3px 10px;
    border-radius: 999px;
}

/* ============================================================
   Minimal grid shim (Blog/recipe views still use these classes)
   ============================================================ */
.row { display: flex; flex-wrap: wrap; margin: 0 -12px; }
.row > [class*="col-"] { padding: 0 12px; }
.text-center { text-align: center; }
.text-justify { text-align: justify; }
.justify-content-center { justify-content: center; }
[class*="col-"] { width: 100%; }
.col-12, .col-lg-12 { width: 100%; }
@media (min-width: 992px) {
    .col-lg-1 { width: 8.333%; }
    .col-lg-3 { width: 25%; }
    .col-lg-9 { width: 75%; }
    .col-lg-11 { width: 91.666%; }
    .col-lg-12 { width: 100%; }
}

/* ============================================================
   Blog / Rambling (professional restyle, preserves markup)
   ============================================================ */
.main_content { padding-top: var(--nav-h); }
.blog-wrap { max-width: var(--maxw); margin: 0 auto; padding: calc(var(--nav-h) + 32px) 24px 72px; }
.blog-wrap h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.recipe_box { width: 100%; }
.padding-fix { margin: 0; }
.blog_banner_img { width: 100%; border-radius: var(--radius); margin-bottom: 20px; }
.blog_content { font-family: var(--sans); color: var(--slate); line-height: 1.8; }
.author_img {
    border-radius: 50%;
    width: 48px; height: 48px;
    object-fit: cover;
    border: 2px solid var(--accent);
    margin-right: 10px;
}
.author_block { color: var(--muted); font-size: 0.9rem; display: flex; align-items: center; }
.recipes_list_text { color: var(--slate); font-weight: 500; }
.recipes_list_text:hover { color: var(--accent); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .hero-grid { grid-template-columns: 1fr; gap: 44px; }
    .hero-photo { order: -1; }
    .portrait { width: 260px; height: 260px; }
}

@media (max-width: 720px) {
    .section { padding: 64px 0; }
    .nav-links {
        position: fixed;
        top: var(--nav-h); left: 0; right: 0;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 0;
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-md);
        transform: translateY(-140%);
        transition: transform .25s ease;
    }
    .nav-links.open { transform: translateY(0); }
    .nav-links li { padding: 0 24px; }
    .nav-links a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
    .nav-links li:last-child a { border-bottom: 0; }
    .nav-links .btn { justify-content: center; margin: 10px 0; }
    .nav-toggle { display: block; }
    .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
    /* Keep the short metric tiles two-up on phones */
    #results .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    #results .stat { padding: 16px 8px; }
    #results .stat .num { font-size: 1.9rem; }
    #results .stat .lbl { font-size: 0.82rem; }
    .hero-trust { gap: 22px; }
}
