/* ==========================================================================
   M-Robotics Static Website Styles
   --------------------------------------------------------------------------
   This stylesheet is intentionally dependency-free so the site can be deployed
   directly to GitHub Pages. Classes are reusable across all pages.
   ========================================================================== */

/* CSS custom properties centralize the visual system for easy future updates. */
:root {
    --color-black: #0f1115;
    --color-ink: #1f242b;
    --color-muted: #5f6875;
    --color-line: #dfe3e8;
    --color-soft: #f5f7f9;
    --color-white: #ffffff;
    --color-accent: #2c6f73;
    --color-accent-dark: #1f5558;
    --shadow-soft: 0 20px 50px rgba(15, 17, 21, 0.08);
    --radius: 8px;
    --container: 1160px;
    --header-height: 76px;
}

/* Smooth scrolling supports anchor navigation without JavaScript. */
html {
    scroll-behavior: smooth;
}

/* Border-box sizing makes layouts predictable across responsive breakpoints. */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Base typography uses system fonts for performance and zero external assets. */
body {
    margin: 0;
    color: var(--color-ink);
    background: var(--color-white);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
}

/* Images scale down naturally and never overflow their containers. */
img {
    display: block;
    max-width: 100%;
}

/* Link styling is restrained and aligned with the minimalist design direction. */
a {
    color: inherit;
    text-decoration: none;
}

/* Headings use strong weight and compact line-height for an engineering feel. */
h1,
h2,
h3 {
    margin: 0;
    color: var(--color-black);
    font-weight: 700;
    line-height: 1.12;
}

h1 {
    font-size: clamp(2.35rem, 5vw, 4.75rem);
    max-width: 900px;
}

.hero h1 {
    font-size: clamp(1.5rem, 3.2vw, 3.04rem);
}

h2 {
    font-size: clamp(1.8rem, 3vw, 3rem);
}

h3 {
    font-size: 1.2rem;
}

p {
    margin: 0;
}

/* Accessible skip link appears only when focused by keyboard users. */
.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1000;
    transform: translateY(-150%);
    padding: 10px 14px;
    color: var(--color-white);
    background: var(--color-black);
    border-radius: var(--radius);
    transition: transform 180ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

/* Container is reused on all pages to keep content aligned and readable. */
.container {
    width: min(100% - 40px, var(--container));
    margin-inline: auto;
}

/* Header stays visible while scrolling and receives a subtle shadow via JS. */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--color-line);
    backdrop-filter: blur(14px);
}

.site-header.is-scrolled {
    box-shadow: 0 10px 28px rgba(15, 17, 21, 0.08);
}

/* Navbar uses flex layout on desktop and switches to a dropdown on mobile. */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: max-content;
}

.brand__logo {
    width: 42px;
    height: 42px;
    border-radius: 6px;
}

.brand__name {
    color: var(--color-black);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 14px;
    color: var(--color-muted);
    border-radius: 6px;
    font-size: 0.94rem;
    font-weight: 600;
    transition: color 180ms ease, background 180ms ease;
}

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

/* The hamburger is hidden on desktop and displayed by media query below. */
.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--color-line);
    border-radius: 6px;
    background: var(--color-white);
    cursor: pointer;
}

.nav-toggle__bar {
    display: block;
    width: 20px;
    height: 2px;
    margin: 5px auto;
    background: var(--color-black);
    transition: transform 180ms ease, opacity 180ms ease;
}

/* Hero keeps a clean white background with no decorative image layer. */
.hero {
    position: relative;
    min-height: calc(100vh - var(--header-height));
    overflow: hidden;
    display: grid;
    align-items: center;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-line);
}

.hero__content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 0.54fr) minmax(420px, 0.46fr);
    gap: clamp(24px, 4vw, 56px);
    align-items: center;
    padding-block: 88px;
}

.hero__butterfly {
    width: min(44vw, 602px);
    max-width: none;
    justify-self: end;
    background: transparent;
    object-fit: contain;
    transform: translateY(-16mm);
}

.hero__summary {
    max-width: 660px;
    margin-top: 22px;
    color: var(--color-muted);
    font-size: 1.12rem;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

/* Eyebrow text is reused for section labels and keeps hierarchy consistent. */
.eyebrow {
    margin-bottom: 14px;
    color: var(--color-accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Buttons are used for true actions and prominent navigation only. */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.button:hover,
.button:focus {
    transform: translateY(-2px);
}

.button--primary {
    color: var(--color-white);
    background: var(--color-black);
}

.button--primary:hover,
.button--primary:focus {
    background: var(--color-accent-dark);
}

.button--secondary {
    color: var(--color-black);
    background: var(--color-white);
    border-color: var(--color-line);
}

.button--secondary:hover,
.button--secondary:focus {
    border-color: var(--color-accent);
    background: var(--color-soft);
}

/* General section spacing is shared by home, projects, services, and contact. */
.section {
    padding-block: 86px;
}

.section--muted {
    background: var(--color-soft);
    border-block: 1px solid var(--color-line);
}

.section-heading {
    max-width: 720px;
    margin-bottom: 34px;
}

.section-heading p:last-child {
    margin-top: 14px;
    color: var(--color-muted);
}

/* Reveal animation is applied by IntersectionObserver for polished section entry. */
[data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 700ms ease, transform 700ms ease;
}

[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* About Me card keeps long biography content readable for recruiters. */
.about-me-section {
    background:
        linear-gradient(180deg, rgba(245, 247, 249, 0.86), rgba(255, 255, 255, 1));
}

.about-me__container {
    max-width: 1080px;
}

.about-me-card {
    position: relative;
    overflow: hidden;
    padding: clamp(28px, 5vw, 52px);
    border: 1px solid rgba(223, 227, 232, 0.9);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(16px);
}

.about-me-card__accent {
    position: absolute;
    top: clamp(28px, 5vw, 52px);
    bottom: clamp(28px, 5vw, 52px);
    left: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--color-accent), var(--color-black));
}

.about-me-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.profile-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    color: var(--color-white);
    background: var(--color-black);
    border: 1px solid rgba(15, 17, 21, 0.18);
    border-radius: 10px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 2px 0 rgba(15, 17, 21, 0.35);
    transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.profile-action:hover,
.profile-action:focus {
    background: var(--color-accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 0 rgba(15, 17, 21, 0.26);
}

.about-me__header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 26px;
}

.about-me-profile {
    display: grid;
    justify-items: center;
    gap: 26px;
    margin-bottom: 34px;
    text-align: center;
}

.about-me-profile__photo {
    width: clamp(190px, 30vw, 330px);
    height: clamp(190px, 30vw, 330px);
    object-fit: cover;
    border: 1px solid var(--color-line);
    border-radius: 50%;
    background: var(--color-white);
    box-shadow: 0 18px 44px rgba(15, 17, 21, 0.08);
}

.about-me-profile__name {
    max-width: 900px;
    font-size: clamp(1.92rem, 5.44vw, 4rem);
    line-height: 1.04;
}

.section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    color: var(--color-accent);
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    background: var(--color-soft);
}

.section-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.about-me__content {
    max-width: 940px;
    padding-left: clamp(0px, 3vw, 30px);
    color: var(--color-muted);
    font-size: clamp(1rem, 1.2vw, 1.08rem);
    line-height: 1.78;
}

.about-me__content p + p {
    margin-top: 18px;
}

.about-me__more {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 420ms ease, opacity 320ms ease;
}

.about-me-card.is-expanded .about-me__more {
    opacity: 1;
}

.about-me__toggle {
    margin-top: 28px;
    margin-left: clamp(0px, 3vw, 30px);
}

/* Page hero is more compact than the home hero for interior pages. */
.page-hero {
    padding-block: 82px;
    background: var(--color-soft);
    border-bottom: 1px solid var(--color-line);
}

.page-hero__inner {
    max-width: 850px;
}

.projects-page .page-hero {
    padding-block: 48px calc(48px - 10mm);
    background: var(--color-white);
}

.projects-page .page-hero__inner {
    max-width: var(--container);
}

.projects-page .page-hero .page-hero__inner h1 {
    position: relative;
    top: -10mm;
    margin-bottom: -10mm;
    font-size: clamp(1.2rem, 2.56vw, 2.43rem);
}

.projects-page .card-grid--two {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.projects-page .project-card--large .project-card__body {
    padding: 22px;
}

.page-hero p:last-child {
    max-width: 720px;
    margin-top: 18px;
    color: var(--color-muted);
    font-size: 1.08rem;
}

/* Grid utilities keep repeated card layouts consistent across the site. */
.card-grid,
.info-grid,
.service-grid {
    display: grid;
    gap: 22px;
}

.card-grid--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.project-card,
.info-card,
.service-card,
.contact-panel,
.contact-form {
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    background: var(--color-white);
    box-shadow: 0 1px 0 rgba(15, 17, 21, 0.03);
}

.project-card {
    overflow: hidden;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.project-card--link {
    display: block;
}

.project-card--link:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px rgba(44, 111, 115, 0.12), var(--shadow-soft);
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: #c6cdd4;
    box-shadow: var(--shadow-soft);
}

.project-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: var(--color-soft);
}

.project-card__body {
    padding: 22px;
}

.project-card__body p {
    margin-top: 10px;
    color: var(--color-muted);
}

.project-card--large .project-card__body {
    padding: 26px;
}

/* Project detail pages share a readable case-study layout. */
.project-detail-hero {
    padding-block: 72px;
    background: var(--color-soft);
    border-bottom: 1px solid var(--color-line);
}

.project-detail-hero__inner {
    display: grid;
    grid-template-columns: 1fr 0.85fr;
    gap: 44px;
    align-items: center;
}

.project-detail-hero__text p:last-child {
    max-width: 720px;
    margin-top: 18px;
    color: var(--color-muted);
    font-size: 1.08rem;
}

.project-detail-hero__image {
    overflow: hidden;
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    background: var(--color-white);
    box-shadow: var(--shadow-soft);
}

.project-detail-hero__image img {
    width: 100%;
    aspect-ratio: 16 / 11;
    object-fit: cover;
    cursor: zoom-in;
}

.project-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 28px;
    align-items: start;
}

.project-detail-card {
    padding: 30px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    background: var(--color-white);
    box-shadow: 0 1px 0 rgba(15, 17, 21, 0.03);
}

.project-detail-card p,
.project-detail-card li {
    color: var(--color-muted);
}

.project-detail-card p {
    margin-top: 14px;
}

.inline-blue-link {
    color: #4aaee8;
    font-weight: 400;
    border-bottom: 0;
    text-decoration: none;
}

.inline-blue-link:visited,
.inline-blue-link:hover,
.inline-blue-link:focus {
    color: #2388c2;
    font-weight: 400;
    border-bottom: 0;
    text-decoration: none;
}

.project-detail-list {
    display: grid;
    gap: 12px;
    margin: 18px 0 0;
    padding-left: 20px;
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 28px;
}

.project-gallery figure {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    background: var(--color-white);
    min-width: 0;
}

.project-gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    cursor: zoom-in;
}

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

.video-frame {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--color-black);
}

.video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-frame--placeholder {
    display: grid;
    place-items: center;
    color: var(--color-white);
    background: var(--color-black);
}

.video-frame--placeholder p {
    margin: 0;
    color: inherit;
    font-weight: 800;
}

.project-media {
    display: grid;
    gap: 34px;
    margin-top: 32px;
}

.project-media__section h2 {
    margin-bottom: 14px;
    font-size: clamp(1.35rem, 2.2vw, 1.9rem);
}

.project-media__group {
    display: grid;
    gap: 10px;
}

.project-media__group + .project-media__group {
    margin-top: 22px;
}

.project-media__group h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.project-media-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(320px, 420px);
    gap: 18px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding: 2px 2px 16px;
    scroll-padding-inline: 2px;
    scroll-snap-type: inline mandatory;
}

.project-media-row figure {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    background: var(--color-white);
    scroll-snap-align: start;
}

.project-media-row img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    cursor: zoom-in;
}

.document-preview-card {
    position: relative;
    display: grid;
    aspect-ratio: 4 / 3;
    place-items: center;
    gap: 10px;
    padding: 28px;
    color: var(--color-black);
    text-align: center;
    text-decoration: none;
    background: linear-gradient(135deg, var(--color-white), var(--color-light));
}

.document-preview-card--pdf {
    display: block;
    overflow: hidden;
    padding: 0;
    background: var(--color-white);
}

.document-preview-card iframe {
    position: absolute;
    top: 0;
    left: -28%;
    width: 128%;
    height: 100%;
    border: 0;
    pointer-events: none;
}

.document-preview-card__link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.document-preview-card span {
    display: inline-grid;
    width: 64px;
    height: 64px;
    place-items: center;
    border: 2px solid var(--color-accent);
    border-radius: var(--radius-sm);
    color: var(--color-accent);
    font-weight: 900;
    letter-spacing: 0.08em;
}

.document-preview-card strong {
    font-size: 1rem;
}

.project-media-row figcaption {
    padding: 12px 14px;
    color: var(--color-muted);
    font-size: 0.92rem;
}

.model-preview {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    min-height: 0;
    max-height: none;
    background: linear-gradient(180deg, #f7f9fb 0%, #eef3f6 100%);
    cursor: grab;
}

.model-preview--modal {
    width: min(1100px, 92vw);
    height: min(72vh, 720px);
    aspect-ratio: auto;
    border-radius: 0 0 var(--radius) var(--radius);
    background: transparent;
}

.model-preview::before {
    content: "";
    display: block;
    padding-top: 75%;
}

.model-preview--modal::before {
    display: none;
}

.model-preview:active {
    cursor: grabbing;
}

.model-preview canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.model-preview__status {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    max-width: min(520px, 80vw);
    padding: 16px 18px;
    border-radius: var(--radius);
    color: var(--color-black);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
    font-size: 0.95rem;
    text-align: center;
    pointer-events: none;
}

.model-preview-trigger {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.model-preview-trigger img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: var(--color-white);
    cursor: pointer;
}

.model-preview-trigger:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 3px;
}

.model-viewer-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 17, 21, 0.86);
}

.model-viewer-modal__dialog {
    overflow: hidden;
    width: min(1100px, 92vw);
    max-height: 88vh;
    border-radius: var(--radius);
    background: transparent;
}

.model-viewer-modal__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.2);
}

.model-viewer-modal__bar h2 {
    margin: 0;
    font-size: 1rem;
}

.model-viewer-modal__close {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-line);
    border-radius: 50%;
    color: var(--color-black);
    background: var(--color-white);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.model-viewer-modal__close:hover,
.model-viewer-modal__close:focus-visible {
    border-color: var(--color-black);
}

.project-gallery figcaption {
    padding: 12px 14px;
    color: var(--color-muted);
    font-size: 0.92rem;
}

.back-link {
    display: inline-flex;
    margin-bottom: 22px;
    color: var(--color-black);
    font-weight: 800;
    border-bottom: 2px solid var(--color-accent);
}

/* Image preview modal lets project images expand without leaving the page. */
.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 17, 21, 0.86);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.image-lightbox.is-open {
    opacity: 1;
    pointer-events: auto;
}

.image-lightbox__dialog {
    position: relative;
    display: grid;
    gap: 14px;
    max-width: min(1120px, 96vw);
    max-height: 92vh;
}

.image-lightbox__image {
    display: block;
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: var(--radius);
    background: var(--color-white);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.image-lightbox__caption {
    color: var(--color-white);
    text-align: center;
}

.image-lightbox__close {
    position: absolute;
    top: -18px;
    right: -18px;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 50%;
    color: var(--color-white);
    background: var(--color-black);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

/* The split layout supports short text blocks next to summaries or actions. */
.split {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 54px;
    align-items: start;
}

.feature-list {
    color: var(--color-muted);
    font-size: 1.05rem;
}

.text-link {
    display: inline-flex;
    margin-top: 18px;
    color: var(--color-black);
    font-weight: 800;
    border-bottom: 2px solid var(--color-accent);
}

.text-link:hover,
.text-link:focus {
    color: var(--color-accent-dark);
}

/* About page cards use numeric labels for a precise engineering tone. */
.info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-card,
.service-card {
    padding: 28px;
    transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.info-card:hover,
.service-card:hover {
    transform: translateY(-3px);
    border-color: #c6cdd4;
    box-shadow: var(--shadow-soft);
}

.info-card__index {
    display: inline-flex;
    margin-bottom: 34px;
    color: var(--color-accent);
    font-size: 0.82rem;
    font-weight: 800;
}

.info-card p,
.service-card p {
    margin-top: 12px;
    color: var(--color-muted);
}

/* Services fit three columns on wide screens and collapse naturally. */
.service-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Contact page pairs business details with a clear static form interface. */
.contact-layout {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 28px;
    align-items: start;
}

.contact-panel,
.contact-form {
    padding: 30px;
}

.contact-panel > p {
    color: var(--color-muted);
}

.contact-details {
    display: grid;
    gap: 18px;
    margin: 28px 0 0;
}

.contact-details div {
    padding-top: 18px;
    border-top: 1px solid var(--color-line);
}

.contact-details dt {
    color: var(--color-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.contact-details dd {
    margin: 6px 0 0;
    color: var(--color-black);
    font-weight: 700;
}

.contact-details a:hover,
.contact-details a:focus {
    color: var(--color-accent-dark);
}

.contact-form {
    display: grid;
    gap: 18px;
}

.form-field {
    display: grid;
    gap: 8px;
}

.form-field label {
    color: var(--color-black);
    font-weight: 700;
}

.form-field input,
.form-field textarea {
    width: 100%;
    border: 1px solid var(--color-line);
    border-radius: 6px;
    padding: 13px 14px;
    color: var(--color-black);
    background: var(--color-white);
    font: inherit;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.form-field textarea {
    resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px rgba(44, 111, 115, 0.12);
}

.form-note {
    color: var(--color-muted);
    font-size: 0.9rem;
}

/* Footer is intentionally quiet and consistent across every page. */
.site-footer {
    padding-block: 28px;
    color: var(--color-muted);
    background: var(--color-black);
}

.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.site-footer a {
    color: var(--color-white);
    font-weight: 700;
}

.site-footer a:hover,
.site-footer a:focus {
    color: #d8f0ef;
}

/* Tablet and touch breakpoints use the compact menu before links become crowded. */
@media (max-width: 1200px), (hover: none) and (pointer: coarse) {
    .card-grid--four,
    .service-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .projects-page .card-grid--two {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav-toggle {
        display: block;
    }

    .nav-toggle.is-open .nav-toggle__bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-toggle.is-open .nav-toggle__bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.is-open .nav-toggle__bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-menu {
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        display: grid;
        gap: 0;
        padding: 10px 14px 16px;
        background: var(--color-white);
        border-bottom: 1px solid var(--color-line);
        box-shadow: var(--shadow-soft);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        transition: opacity 180ms ease, transform 180ms ease;
    }

    .nav-menu.is-open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

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

    .split,
    .contact-layout,
    .project-detail-hero__inner,
    .project-detail-layout {
        grid-template-columns: 1fr;
    }

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

/* Mobile navigation and stacked content rules. */
@media (max-width: 760px) {
    :root {
        --header-height: 68px;
    }

    .container {
        width: min(100% - 28px, var(--container));
    }

    .brand__logo {
        width: 38px;
        height: 38px;
    }

    .nav-toggle {
        display: block;
    }

    .nav-toggle.is-open .nav-toggle__bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-toggle.is-open .nav-toggle__bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.is-open .nav-toggle__bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-menu {
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        display: grid;
        gap: 0;
        padding: 10px 14px 16px;
        background: var(--color-white);
        border-bottom: 1px solid var(--color-line);
        box-shadow: var(--shadow-soft);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        transition: opacity 180ms ease, transform 180ms ease;
    }

    .nav-menu.is-open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

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

    .hero {
        min-height: auto;
    }

    .hero__content {
        grid-template-columns: 1fr;
        gap: 28px;
        padding-block: 64px;
    }

    .hero__butterfly {
        width: min(86vw, 448px);
        justify-self: start;
    }

    .page-hero {
        padding-block: 64px;
    }

    .projects-page .page-hero {
        padding-block: 42px calc(42px - 10mm);
    }

    .section {
        padding-block: 64px;
    }

    .about-me__header {
        align-items: flex-start;
    }

    .section-icon {
        width: 48px;
        height: 48px;
    }

    .about-me__content,
    .about-me__toggle {
        padding-left: 0;
        margin-left: 0;
    }

    .card-grid--four,
    .card-grid--two,
    .info-grid,
    .service-grid,
    .project-gallery,
    .project-gallery--videos {
        grid-template-columns: 1fr;
    }

    .site-footer__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .about-page .about-me-actions {
        justify-content: flex-end;
        margin-bottom: 18px;
    }

    .about-page .profile-action {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 48px;
        padding: 0 20px;
        color: var(--color-white);
        background: var(--color-black);
        border: 1px solid rgba(15, 17, 21, 0.18);
        border-radius: 10px;
        font-weight: 800;
        line-height: 1;
        box-shadow: 0 2px 0 rgba(15, 17, 21, 0.35);
    }

    .about-page .about-me-card {
        padding: clamp(28px, 5vw, 52px);
        border: 1px solid rgba(223, 227, 232, 0.9);
        border-radius: var(--radius);
        background: rgba(255, 255, 255, 0.86);
        box-shadow: var(--shadow-soft);
    }

    .about-page .about-me-profile {
        display: grid;
        justify-items: center;
        gap: 24px;
        margin-bottom: 30px;
        text-align: center;
    }

    .about-page .about-me-profile__photo {
        width: min(62vw, 330px);
        height: min(62vw, 330px);
        max-width: 330px;
        max-height: 330px;
        object-fit: cover;
        border: 1px solid var(--color-line);
        border-radius: 50%;
        box-shadow: 0 18px 44px rgba(15, 17, 21, 0.08);
    }

    .about-page .about-me-profile__name {
        max-width: 900px;
        margin-inline: auto;
        font-size: clamp(2.2rem, 9vw, 4rem);
        line-height: 1.04;
        text-align: center;
    }

    .about-page .about-me__content {
        max-width: 940px;
        color: var(--color-muted);
        font-size: clamp(1rem, 2.7vw, 1.08rem);
        line-height: 1.78;
    }

    .about-page .about-me__more {
        overflow: hidden;
        max-height: 0;
        opacity: 0;
    }
}

/* Small-phone refinements keep form and card content from feeling cramped. */
@media (max-width: 420px) {
    .hero__butterfly {
        width: min(90vw, 392px);
    }

    .project-card__body,
    .project-card--large .project-card__body,
    .info-card,
    .service-card,
    .contact-panel,
    .contact-form {
        padding: 22px;
    }

    .button {
        width: 100%;
    }

    .about-page .button,
    .about-page .profile-action {
        width: auto;
    }

    .about-page .about-me-actions {
        justify-content: flex-end;
        gap: 10px;
    }

    .about-page .profile-action {
        min-height: 46px;
        padding-inline: 18px;
    }

    .about-page .about-me-profile__photo {
        width: min(72vw, 300px);
        height: min(72vw, 300px);
    }

    .about-page .about-me-profile__name {
        font-size: clamp(2rem, 10vw, 3rem);
    }
}

/* Respect users who prefer reduced motion while keeping content fully usable. */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
    }
}
