/*
 * Portfolio redesign 2026
 * Direction: calm engineering, credible consulting, building automation.
 */

:root {
    --bg: #f6f4ef;
    --bg-soft: #ebe8df;
    --surface: #ffffff;
    --surface-subtle: #fdfbf7;
    --surface-strong: #172033;

    --text-main: #172033;
    --text-muted: #5d6879;
    --text-dim: #7b8493;

    --primary: #0f766e;
    --primary-dark: #0a5f59;
    --primary-soft: #dff3ef;
    --secondary: #2563eb;
    --secondary-soft: #e7efff;
    --accent: #c27818;
    --accent-soft: #fbecd7;
    --success: #16825d;

    --line: rgba(23, 32, 51, 0.12);
    --line-strong: rgba(23, 32, 51, 0.2);
    --shadow-sm: 0 8px 24px rgba(23, 32, 51, 0.08);
    --shadow-md: 0 18px 44px rgba(23, 32, 51, 0.12);

    --font-heading: "Space Grotesk", "Inter", "Segoe UI", sans-serif;
    --font-body: "Inter", "Segoe UI", Arial, sans-serif;
    --font-mono: "Fira Code", "Consolas", monospace;
    --font-sans: var(--font-body);

    --container-width: 1180px;
    --header-height: 76px;
    --section-spacing: 6rem;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 8px;

    /* Legacy aliases used by inline styles and existing components. */
    --bg-dark: var(--bg);
    --bg-glass: rgba(255, 255, 255, 0.82);
    --bg-glass-strong: rgba(255, 255, 255, 0.96);
    --bg-surface: var(--surface);
    --bg-surface-hover: #eef3f1;
    --primary-dim: rgba(15, 118, 110, 0.12);
    --primary-glow: rgba(15, 118, 110, 0.22);
    --border-light: var(--line);
    --border-glass: rgba(255, 255, 255, 0.72);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--text-main);
    line-height: 1.65;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(246, 244, 239, 0.96) 32rem),
        linear-gradient(90deg, rgba(15, 118, 110, 0.05) 0 1px, transparent 1px),
        linear-gradient(180deg, rgba(15, 118, 110, 0.04) 0 1px, transparent 1px),
        var(--bg);
    background-size: auto, 48px 48px, 48px 48px, auto;
    overflow-x: hidden;
}

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

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

p {
    margin-bottom: 1.3rem;
    color: var(--text-muted);
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--text-main);
    line-height: 1.14;
    letter-spacing: 0;
    margin-bottom: 1rem;
}

h1 {
    font-size: 4rem;
    font-weight: 700;
}

h2 {
    font-size: 2.3rem;
    font-weight: 700;
}

h3 {
    font-size: 1.35rem;
    font-weight: 650;
}

h4 {
    font-size: 1rem;
    font-weight: 650;
}

::selection {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.34);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 50%;
    z-index: 2000;
    transform: translateX(-50%);
    padding: 0.8rem 1.2rem;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    background: var(--surface-strong);
    color: #fff;
    font-weight: 700;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

.container {
    width: min(100% - 3rem, var(--container-width));
    margin-inline: auto;
}

.mono {
    font-family: var(--font-mono);
}

.cyan {
    color: var(--primary);
}

.text-gradient {
    color: var(--primary);
}

.material-symbols-outlined {
    font-family: "Material Symbols Outlined";
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    display: inline-block;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
    direction: ltr;
    vertical-align: -0.18em;
}

/* Navigation */
.navbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    width: 100%;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.88);
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    transform: none;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: box-shadow 0.24s ease, background 0.24s ease;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 30px rgba(23, 32, 51, 0.08);
    border-color: var(--line);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
}

.logo-icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 8px 18px rgba(15, 118, 110, 0.2);
}

.logo-icon .material-symbols-outlined {
    font-size: 20px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 0.95rem;
    border-radius: 999px;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.93rem;
    font-weight: 650;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.nav-link::after {
    display: none;
}

.hamburger {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-main);
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Hero */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 9rem 0 5rem;
    isolation: isolate;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(246, 244, 239, 1) 0%, rgba(246, 244, 239, 0.96) 34%, rgba(246, 244, 239, 0.7) 56%, rgba(246, 244, 239, 0.18) 100%),
        url("assets/hero-building-supervision.webp") center right / cover no-repeat;
    border-bottom: 1px solid var(--line);
}

.hero::before {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 160px;
    z-index: -1;
    background: linear-gradient(180deg, transparent, var(--bg));
}

.hero-container {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(340px, 0.72fr);
    gap: 4.5rem;
    align-items: center;
}

.hero-content,
.hero-text {
    position: relative;
    z-index: 2;
}

.terminal-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 38px;
    padding: 0 0.85rem;
    border: 1px solid rgba(15, 118, 110, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--primary-dark);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 750;
    letter-spacing: 0;
    box-shadow: 0 8px 24px rgba(23, 32, 51, 0.06);
}

.terminal-badge::after {
    display: none;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 5px rgba(22, 130, 93, 0.12);
    animation: none;
}

.hero-title {
    margin-top: 1.15rem;
    margin-bottom: 1rem;
}

.hero-title-large {
    font-size: 3.55rem;
}

.glitch-text {
    position: relative;
    display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
    display: none;
}

.typewriter-container {
    display: inline-flex !important;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    margin-top: 0.65rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.78);
    color: var(--primary-dark) !important;
    font-family: var(--font-body) !important;
    font-size: 1rem !important;
    font-weight: 700;
}

.hero-subtitle {
    max-width: 720px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 700;
}

.hero-description {
    max-width: 620px;
    margin: 1.15rem 0 2rem;
    color: var(--text-muted);
    font-size: 1.08rem;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.btn,
.btn-view-project {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    min-width: 150px;
    padding: 0.78rem 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 750;
    letter-spacing: 0;
    line-height: 1.1;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:hover,
.btn-view-project:hover {
    transform: translateY(-2px);
}

.btn-primary {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 12px 24px rgba(15, 118, 110, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 18px 30px rgba(15, 118, 110, 0.22);
}

.btn-secondary {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.82);
    border-color: var(--line-strong);
}

.btn-secondary:hover {
    background: var(--surface);
    border-color: var(--primary);
}

.hero-visual {
    position: relative;
    z-index: 2;
}

.terminal-window {
    max-width: 460px;
    margin-left: auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transform: none;
}

.terminal-window:hover {
    transform: translateY(-3px);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.68);
}

.terminal-buttons {
    display: flex;
    gap: 0.35rem;
}

.terminal-buttons span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--line-strong);
}

.terminal-buttons .close {
    background: #e26b4f;
}

.terminal-buttons .minimize {
    background: #d89b2b;
}

.terminal-buttons .maximize {
    background: #20a472;
}

.terminal-title {
    flex: 1;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 700;
    text-align: left;
}

.terminal-body {
    min-height: 260px;
    padding: 1.25rem;
    color: var(--text-main);
    font-family: var(--font-body);
}

.code-line {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 40px;
    margin-bottom: 0.65rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(246, 244, 239, 0.72);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.code-line:first-child {
    color: #fff;
    background: var(--surface-strong);
    border-color: var(--surface-strong);
}

.prompt {
    color: var(--accent);
    font-weight: 800;
}

.cmd {
    color: inherit;
    font-weight: 750;
}

.text-success {
    color: var(--success);
}

.text-dim {
    color: var(--text-dim);
}

.cursor-blink {
    animation: none;
    color: var(--primary);
    font-weight: 800;
}

/* Sections */
section.container,
.projects-section,
.skill-category,
.certifications-section {
    padding-top: var(--section-spacing);
}

.section-header {
    max-width: 780px;
    margin-bottom: 2.2rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.45rem;
}

.section-subtitle {
    margin: 0;
    color: var(--primary-dark);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
}

.section-line {
    width: 72px;
    height: 3px;
    margin-top: 1rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 3rem;
    align-items: start;
}

.about-text > p {
    max-width: 760px;
    font-size: 1rem;
}

.founder-note {
    margin: 2rem 0;
    padding: 1.35rem;
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    background: linear-gradient(90deg, var(--primary-soft), rgba(255, 255, 255, 0.72));
}

.founder-note h4 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
}

.founder-note p {
    margin-bottom: 0;
}

.founder-link {
    color: var(--primary-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 2rem;
}

.stat-card {
    min-height: 118px;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(15, 118, 110, 0.32);
}

.stat-number {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--primary-dark);
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 750;
}

.stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.skills-grid,
.services-grid,
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.15rem;
}

.services-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-card > p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.service-card .founder-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-weight: 600;
}

.skill-card,
.service-card,
.project-card,
.certification-card,
.contact-card,
.contact-form-container,
.timeline-content,
.tech-dashboard,
.cta-box {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow-sm);
}

.skill-card,
.service-card,
.project-card {
    position: relative;
    overflow: hidden;
    min-height: 100%;
    padding: 1.45rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.skill-card::before,
.service-card::before,
.project-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    opacity: 0.75;
}

.skill-card:hover,
.service-card:hover,
.project-card:hover {
    transform: translateY(-4px);
    border-color: rgba(15, 118, 110, 0.28);
    box-shadow: var(--shadow-md);
}

.skill-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.65rem;
    color: var(--text-main);
    font-weight: 750;
}

.service-icon,
.project-icon,
.cert-icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.service-icon .material-symbols-outlined,
.project-icon .material-symbols-outlined,
.cert-icon .material-symbols-outlined {
    font-size: 24px;
}

.service-card h3,
.project-card h3 {
    font-size: 1.18rem;
}

.service-card ul {
    margin-top: 1rem;
}

.service-card li,
.skill-list li {
    position: relative;
    margin-bottom: 0.65rem;
    padding-left: 1.1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.service-card li::before,
.skill-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.7em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
}

.skill-list li {
    padding-left: 0;
}

.skill-list li::before {
    display: none;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

/* Timeline */
.timeline-container {
    position: relative;
    max-width: 920px;
    margin-left: 0.4rem;
    padding-left: 1.6rem;
}

.timeline-container::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 9px;
    width: 2px;
    background: linear-gradient(180deg, var(--primary), rgba(15, 118, 110, 0.08));
}

.timeline-item {
    position: relative;
    margin-bottom: 1.2rem;
    padding-left: 2rem;
}

.timeline-dot {
    position: absolute;
    left: -0.32rem;
    top: 1.35rem;
    z-index: 2;
    width: 18px;
    height: 18px;
    border: 4px solid var(--bg);
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.3);
}

.timeline-content {
    padding: 1.45rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.timeline-item:hover .timeline-content {
    transform: translateX(4px);
    border-color: rgba(15, 118, 110, 0.28);
}

.timeline-date,
.timeline-tag,
.tag,
.project-badge,
.modal-badge,
.cert-year {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.28rem 0.58rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
}

.timeline-date {
    margin-bottom: 0.75rem;
}

.timeline-role {
    margin-bottom: 0.25rem;
    font-size: 1.18rem;
}

.timeline-company {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--secondary);
    font-weight: 800;
}

.timeline-desc {
    margin-bottom: 0.85rem;
}

.timeline-tags,
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.9rem;
}

.timeline-tag,
.tag {
    color: var(--text-muted);
    background: #f5f7f7;
}

/* Project pages */
.page-header {
    position: relative;
    padding: 8.5rem 0 3.5rem;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(90deg, rgba(246, 244, 239, 1), rgba(246, 244, 239, 0.82)),
        url("assets/hero-building-supervision.webp") center right / cover no-repeat;
}

.page-header h1 {
    max-width: 780px;
}

.page-header p {
    max-width: 620px;
    font-size: 1.05rem;
}

.projects-filter {
    padding: 2rem 0 0;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    padding: 0.45rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-sm);
}

.filter-btn {
    min-height: 38px;
    padding: 0 0.8rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 750;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.filter-btn:hover {
    color: var(--text-main);
    background: #f3f5f4;
}

.filter-btn.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.filter-btn.active::after {
    display: none;
}

.projects-section {
    padding-top: 4.25rem;
    padding-bottom: 3rem;
}

.project-card {
    display: flex;
    min-height: 330px;
    flex-direction: column;
}

.project-badge {
    width: fit-content;
    margin-bottom: 0.9rem;
    color: var(--accent);
    background: var(--accent-soft);
    border-color: rgba(194, 120, 24, 0.22);
}

.project-period {
    margin-bottom: 0.7rem;
    color: var(--primary-dark);
    font-size: 0.9rem;
    font-weight: 800;
}

.project-excerpt {
    flex: 1;
    margin-bottom: 1rem;
}

.btn-view-project {
    width: fit-content;
    min-width: auto;
    margin-top: 1.1rem;
    color: var(--primary-dark);
    background: var(--primary-soft);
    border-color: rgba(15, 118, 110, 0.2);
}

.btn-view-project:hover {
    background: var(--primary);
    color: #fff;
}

.add-project-cta {
    padding: 2rem 0 0;
}

.cta-box {
    padding: 1.6rem;
    background: linear-gradient(135deg, #fff, var(--surface-subtle));
}

.cta-box p {
    margin-bottom: 0;
}

.cta {
    margin-top: var(--section-spacing);
    background: var(--surface-subtle);
}

.cta-content {
    max-width: 760px;
    margin-inline: auto;
}

/* Modal */
.project-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.project-modal.active {
    visibility: visible;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(23, 32, 51, 0.54);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-container {
    position: absolute;
    inset: 50% auto auto 50%;
    width: min(92vw, 840px);
    max-height: 86vh;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: 0 34px 90px rgba(23, 32, 51, 0.28);
    transform: translate(-50%, -48%) scale(0.98);
    transition: transform 0.2s ease;
}

.project-modal.active .modal-container {
    transform: translate(-50%, -50%) scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--text-main);
    background: var(--surface);
    cursor: pointer;
    font-size: 1.4rem;
}

.modal-close:hover {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.modal-navigation {
    position: absolute;
    inset: 50% 0 auto;
    z-index: 4;
    display: flex;
    justify-content: space-between;
    padding: 0 0.7rem;
    pointer-events: none;
    transform: translateY(-50%);
}

.modal-nav-btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--text-main);
    background: var(--surface);
    cursor: pointer;
    pointer-events: auto;
}

.modal-nav-btn:hover {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.modal-content {
    max-height: 86vh;
    overflow-y: auto;
    padding: 2.2rem;
}

.modal-header {
    margin-bottom: 1.6rem;
    padding-right: 3rem;
    padding-bottom: 1.3rem;
    border-bottom: 1px solid var(--line);
}

.modal-header-top {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.modal-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--secondary-soft);
    font-size: 1.4rem;
}

.modal-badge-active {
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.modal-badge-completed {
    color: var(--success);
    background: rgba(22, 130, 93, 0.12);
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.meta-item {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 750;
}

.modal-body {
    display: grid;
    gap: 1.5rem;
}

.modal-section h3 {
    margin-bottom: 0.75rem;
    color: var(--primary-dark);
    font-size: 1rem;
}

.modal-section p {
    margin-bottom: 0.8rem;
}

.project-excerpt-large {
    padding: 1rem;
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 700;
}

.objectives-list li,
.results-list li {
    position: relative;
    margin-bottom: 0.65rem;
    padding-left: 1.4rem;
    color: var(--text-muted);
}

.objectives-list li::before,
.results-list li::before {
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 900;
}

.objectives-list li::before {
    content: ">";
}

.results-list li::before {
    content: "✓";
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.65rem;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 46px;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-subtle);
}

.tech-icon {
    font-size: 1.1rem;
}

.tech-name {
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 750;
}

/* Skills page */
header.hero[style] {
    min-height: 42vh !important;
    padding: 8.5rem 0 3.5rem !important;
    text-align: center;
}

header.hero[style] .hero-container {
    display: block;
}

header.hero[style] .hero-text {
    max-width: 860px !important;
    margin-inline: auto;
}

header.hero[style] .terminal-badge {
    margin-inline: auto;
}

.tech-dashboard {
    padding: 2rem;
    background: var(--surface);
}

.chart-container {
    position: relative;
    z-index: 1;
}

.certifications-section {
    padding-bottom: 2rem;
}

.certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.certification-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.2rem;
}

.cert-content p {
    margin-bottom: 0.6rem;
}

/* Contact */
.contact-section {
    padding-top: 9rem;
    padding-bottom: 4rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1fr);
    gap: 2rem;
    align-items: start;
}

.contact-links {
    display: grid;
    gap: 0.8rem;
    margin-top: 1.8rem;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.contact-card:hover {
    transform: translateX(4px);
    border-color: rgba(15, 118, 110, 0.28);
    box-shadow: var(--shadow-md);
}

.contact-card-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: var(--radius-md);
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.contact-card-label {
    display: block;
    color: var(--text-dim);
    font-size: 0.8rem;
    font-weight: 750;
    text-transform: uppercase;
}

.contact-card-value {
    display: block;
    color: var(--text-main);
    font-weight: 750;
}

.contact-form-container {
    padding: 1.6rem;
}

.contact-form-container h3 {
    color: var(--primary-dark);
}

.contact-form {
    display: grid;
    gap: 1rem;
}

.form-group {
    display: grid;
    gap: 0.45rem;
}

.form-group label {
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 750;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    min-height: 46px;
    padding: 0.72rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--text-main);
    background: var(--surface-subtle);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.form-group textarea {
    min-height: 132px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
    outline: none;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Footer */
footer,
.footer {
    margin-top: 0;
    padding: 3.2rem 0 1.8rem;
    color: rgba(255, 255, 255, 0.8);
    background: var(--surface-strong);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr 0.7fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    color: #fff;
}

.footer-section h4 {
    margin-bottom: 0.9rem;
    font-size: 0.86rem;
    text-transform: uppercase;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.68) !important;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.72);
}

.footer-section a:hover {
    color: #fff;
}

.footer-bottom {
    padding-top: 1.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.88rem;
}

/* Motion */
.reveal-hidden {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top {
    position: fixed;
    right: 1.4rem;
    bottom: 1.4rem;
    z-index: 900;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--primary-dark);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    color: #fff;
    background: var(--primary);
}

/* Premium polish pass */
:root {
    --bg: #f7f7f3;
    --bg-soft: #ecebe4;
    --surface-subtle: #fbfaf6;
    --surface-strong: #162033;
    --text-main: #162033;
    --text-muted: #586476;
    --primary: #0d8278;
    --primary-dark: #075e58;
    --primary-soft: #e0f4ef;
    --accent: #b96f16;
    --shadow-sm: 0 10px 30px rgba(22, 32, 51, 0.07);
    --shadow-md: 0 26px 70px rgba(22, 32, 51, 0.12);
}

body {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(247, 247, 243, 0.98) 30rem),
        linear-gradient(90deg, rgba(13, 130, 120, 0.035) 0 1px, transparent 1px),
        linear-gradient(180deg, rgba(13, 130, 120, 0.03) 0 1px, transparent 1px),
        var(--bg);
}

.navbar {
    background: rgba(255, 255, 255, 0.78);
    border-bottom-color: rgba(22, 32, 51, 0.09);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.93);
    box-shadow: 0 18px 44px rgba(22, 32, 51, 0.08);
}

.logo-icon {
    box-shadow:
        0 10px 22px rgba(13, 130, 120, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.nav-link {
    min-height: 40px;
    padding: 0 1rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-dark);
    background: linear-gradient(180deg, rgba(224, 244, 239, 0.94), rgba(224, 244, 239, 0.72));
    box-shadow: inset 0 0 0 1px rgba(13, 130, 120, 0.08);
}

.hero {
    min-height: 96vh;
    background:
        linear-gradient(90deg, rgba(247, 247, 243, 1) 0%, rgba(247, 247, 243, 0.98) 28%, rgba(247, 247, 243, 0.78) 52%, rgba(247, 247, 243, 0.1) 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.25), rgba(22, 32, 51, 0.18)),
        url("assets/hero-building-supervision.webp") center right / cover no-repeat;
}

.hero::after {
    content: "";
    position: absolute;
    inset: var(--header-height) 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(13, 130, 120, 0.28), rgba(37, 99, 235, 0.22), transparent);
}

.hero-text::before {
    content: "";
    display: block;
    width: 64px;
    height: 3px;
    margin-bottom: 1.6rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

header.hero[style] .hero-text::before {
    margin-inline: auto;
}

.terminal-badge,
.typewriter-container {
    background: rgba(255, 255, 255, 0.9);
    box-shadow:
        0 12px 30px rgba(22, 32, 51, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.hero-title-large {
    font-size: 3.78rem;
}

.hero-description {
    max-width: 650px;
}

.btn {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-primary {
    background: linear-gradient(180deg, #108f84, var(--primary-dark));
    border-color: rgba(7, 94, 88, 0.84);
    box-shadow:
        0 18px 34px rgba(13, 130, 120, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #0f8279, #054f4a);
    box-shadow:
        0 22px 42px rgba(13, 130, 120, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    box-shadow:
        0 12px 24px rgba(22, 32, 51, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.terminal-window {
    max-width: 500px;
    border-color: rgba(255, 255, 255, 0.82);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.86));
    box-shadow:
        0 30px 80px rgba(22, 32, 51, 0.16),
        0 0 0 1px rgba(255, 255, 255, 0.35) inset;
}

.terminal-window:hover {
    transform: translateY(-4px);
    box-shadow:
        0 36px 96px rgba(22, 32, 51, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.38) inset;
}

.terminal-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 247, 245, 0.76));
}

.code-line {
    border-color: rgba(22, 32, 51, 0.1);
    background: rgba(255, 255, 255, 0.74);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.code-line:first-child {
    background: linear-gradient(135deg, #162033, #22304a);
}

.code-line:not(:first-child)::before {
    content: "";
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.62;
}

.section-header {
    margin-bottom: 2.45rem;
}

.section-title {
    align-items: baseline;
}

.section-subtitle {
    color: var(--accent);
}

.about-grid {
    gap: 3.6rem;
}

.founder-note {
    background:
        linear-gradient(90deg, rgba(224, 244, 239, 0.92), rgba(255, 255, 255, 0.86)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent);
    box-shadow: 0 18px 42px rgba(13, 130, 120, 0.08);
}

.stat-card,
.skill-card,
.service-card,
.project-card,
.certification-card,
.contact-card,
.contact-form-container,
.timeline-content,
.tech-dashboard,
.cta-box {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.86));
    box-shadow:
        0 14px 38px rgba(22, 32, 51, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.skill-card,
.service-card,
.project-card {
    padding: 1.65rem;
}

.skill-card::before,
.service-card::before,
.project-card::before {
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary) 58%, var(--accent));
    opacity: 0.9;
}

.skill-card::after,
.service-card::after,
.project-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(135deg, rgba(13, 130, 120, 0.08), transparent 42%);
    transition: opacity 0.18s ease;
}

.skill-card:hover::after,
.service-card:hover::after,
.project-card:hover::after {
    opacity: 1;
}

.service-icon,
.project-icon,
.cert-icon,
.contact-card-icon {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 10px 24px rgba(13, 130, 120, 0.08);
}

.project-card {
    min-height: 350px;
}

.project-badge,
.timeline-date,
.timeline-tag,
.tag,
.modal-badge,
.cert-year {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.timeline-container::before {
    background: linear-gradient(180deg, var(--primary), var(--secondary), rgba(13, 130, 120, 0.08));
}

.timeline-content {
    border-left: 3px solid rgba(13, 130, 120, 0.22);
}

.page-header {
    min-height: 320px;
    display: flex;
    align-items: flex-end;
    background:
        linear-gradient(90deg, rgba(247, 247, 243, 1) 0%, rgba(247, 247, 243, 0.9) 48%, rgba(247, 247, 243, 0.44) 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(22, 32, 51, 0.14)),
        url("assets/hero-building-supervision.webp") center right / cover no-repeat;
}

.page-header::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(13, 130, 120, 0.24), rgba(185, 111, 22, 0.2), transparent);
}

.filter-buttons {
    background: rgba(255, 255, 255, 0.92);
    box-shadow:
        0 18px 44px rgba(22, 32, 51, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.filter-btn.active {
    background: linear-gradient(180deg, #108f84, var(--primary-dark));
}

.modal-container {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(252, 251, 247, 0.96));
}

.tech-item {
    background: rgba(255, 255, 255, 0.72);
}

.contact-form-container {
    box-shadow:
        0 26px 70px rgba(22, 32, 51, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(255, 255, 255, 0.72);
}

.footer {
    background:
        linear-gradient(180deg, #182237, #121a2b);
}

/* Responsive */
@media (max-width: 1080px) {
    .services-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    h1 {
        font-size: 3.25rem;
    }

    .hero-title-large {
        font-size: 3rem;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .hero-visual {
        max-width: 620px;
    }

    .terminal-window {
        margin-left: 0;
    }

    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --section-spacing: 4rem;
    }

    body {
        background-size: auto, 36px 36px, 36px 36px, auto;
    }

    h1 {
        font-size: 2.45rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .container {
        width: min(100% - 2rem, var(--container-width));
    }

    .navbar {
        height: 68px;
    }

    .nav-links {
        position: fixed;
        top: 68px;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.98);
        border-bottom: 1px solid var(--line);
        box-shadow: 0 16px 30px rgba(23, 32, 51, 0.08);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-link {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    .hamburger {
        display: flex;
    }

    .hero {
        min-height: auto;
        padding: 7rem 0 3rem;
        background:
            linear-gradient(180deg, rgba(246, 244, 239, 0.94), rgba(246, 244, 239, 0.96)),
            url("assets/hero-building-supervision.webp") center right / cover no-repeat;
    }

    .hero-title-large {
        font-size: 2.25rem;
    }

    .typewriter-container {
        font-size: 0.9rem !important;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }

    .terminal-body {
        min-height: auto;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-buttons {
        width: 100%;
    }

    .filter-btn {
        flex: 1 1 46%;
    }

    .project-card {
        min-height: auto;
    }

    .modal-content {
        padding: 1.4rem;
    }

    .modal-navigation {
        display: none;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2.05rem;
    }

    .logo-text {
        font-size: 0.94rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .services-grid,
    .skills-grid,
    .projects-grid,
    .certifications-grid {
        grid-template-columns: 1fr;
    }

    .contact-card {
        align-items: flex-start;
    }

    .contact-card-value {
        overflow-wrap: anywhere;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
