/* ==========================================================================
   Site-wide design system - romandidomizio.com
   One shared stylesheet: tokens, base, header/footer, components, pages.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Roboto+Mono:wght@400;700&display=swap');

/* ----------------------------- Tokens ---------------------------------- */
:root {
    --hm-bg-0: #060913;
    --hm-bg-1: #0b1120;
    --hm-panel: rgba(15, 23, 42, 0.55);
    --hm-panel-solid: #0e1526;
    --hm-border: rgba(148, 163, 184, 0.16);
    --hm-border-strong: rgba(56, 189, 248, 0.45);
    --hm-text: #e2e8f0;
    --hm-muted: #94a3b8;
    --hm-accent: #38bdf8;
    --hm-accent-2: #22d3ee;
    --hm-radius: 14px;
    --hm-font-display: 'Orbitron', sans-serif;
    --hm-font-body: 'Roboto Mono', monospace;
}

/* ------------------------------ Base ----------------------------------- */
html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-color: var(--hm-bg-0);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(56, 189, 248, 0.13), transparent 60%),
        linear-gradient(rgba(56, 189, 248, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.035) 1px, transparent 1px);
    background-size: 100% 100%, 44px 44px, 44px 44px;
    background-attachment: fixed;
    color: var(--hm-text);
    font-family: var(--hm-font-body);
}

.hm-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--hm-accent);
    color: #04121e;
    padding: 0.6rem 1rem;
    border-radius: 0 0 8px 0;
    font-family: var(--hm-font-body);
    z-index: 100;
}

.hm-skip-link:focus {
    left: 0;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--hm-accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ----------------------------- Header ---------------------------------- */
.header-container {
    width: 100%;
    max-width: 100vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.5rem;
    background: rgba(6, 9, 19, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--hm-border);
    box-sizing: border-box;
}

.myname {
    text-decoration: none;
    font-family: var(--hm-font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--hm-text);
    white-space: nowrap;
    transition: color 0.2s ease;
}

.myname:hover {
    color: var(--hm-accent);
}

.nav-buttons {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
    flex-wrap: wrap;
    flex: 1;
}

.hdr-btn {
    font-family: var(--hm-font-body);
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--hm-muted);
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.hdr-btn:hover {
    color: var(--hm-text);
    background-color: rgba(56, 189, 248, 0.08);
}

.hdr-btn[aria-current="page"] {
    color: var(--hm-accent);
    border-color: rgba(56, 189, 248, 0.3);
    background-color: rgba(56, 189, 248, 0.08);
}

.social-links {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.social-icon {
    width: 26px;
    height: auto;
    display: block;
    opacity: 0.75;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.social-links a:hover .social-icon {
    opacity: 1;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .nav-buttons {
        gap: 0.2rem;
    }

    .hdr-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}

/* ----------------------------- Footer ---------------------------------- */
.site-footer {
    border-top: 1px solid var(--hm-border);
    margin-top: 5rem;
}

.site-footer-inner {
    max-width: 1060px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-footer-copy {
    color: var(--hm-muted);
    font-size: 0.8rem;
    margin: 0;
}

.site-footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.site-footer-links a {
    color: var(--hm-muted);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s ease;
}

.site-footer-links a:hover {
    color: var(--hm-accent);
}

@media (max-width: 600px) {
    .site-footer-inner {
        flex-direction: column;
        text-align: center;
    }
}

/* --------------------------- Page scaffold ------------------------------ */
.hm-main {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 1.5rem 2rem 1.5rem;
}

.hm-page-header {
    padding: 3.5rem 0 2.5rem 0;
    border-bottom: 1px solid var(--hm-border);
    margin-bottom: 2.5rem;
}

.hm-page-title {
    font-family: var(--hm-font-display);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--hm-text);
    margin: 0;
}

.hm-page-sub {
    color: var(--hm-muted);
    line-height: 1.7;
    max-width: 640px;
    margin: 0.85rem 0 0 0;
    font-size: 0.95rem;
}

.hm-eyebrow {
    font-family: var(--hm-font-body);
    font-size: 0.75rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--hm-accent);
    margin: 0 0 0.7rem 0;
}

.hm-section {
    margin: 4.5rem 0;
}

.hm-hero + .hm-section {
    margin-top: 2.5rem;
}

.hm-section-head {
    margin-bottom: 1.75rem;
}

.hm-h2 {
    font-family: var(--hm-font-display);
    font-size: clamp(1.3rem, 2.4vw, 1.7rem);
    font-weight: 700;
    color: var(--hm-text);
    margin: 0;
}

.hm-section-sub {
    color: var(--hm-muted);
    max-width: 620px;
    margin: 0.6rem 0 0 0;
    line-height: 1.65;
    font-size: 0.9rem;
}

.hm-subhead {
    font-family: var(--hm-font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--hm-text);
    margin: 3rem 0 0.5rem 0;
}

/* ----------------------------- Buttons ---------------------------------- */
.hm-btn {
    font-family: var(--hm-font-body);
    font-size: 0.9rem;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    display: inline-block;
}

.hm-btn-primary {
    background: linear-gradient(135deg, var(--hm-accent), var(--hm-accent-2));
    color: #04121e;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.25);
}

.hm-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(56, 189, 248, 0.35);
}

.hm-btn-ghost {
    border: 1px solid var(--hm-border);
    color: var(--hm-text);
    background: transparent;
}

.hm-btn-ghost:hover {
    border-color: var(--hm-border-strong);
    transform: translateY(-2px);
}

.hm-inline-link {
    color: var(--hm-accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(56, 189, 248, 0.35);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.hm-inline-link:hover {
    color: var(--hm-accent-2);
    border-bottom-color: var(--hm-accent-2);
}

/* ------------------------------ Cards ----------------------------------- */
.hm-card {
    background: var(--hm-panel);
    border: 1px solid var(--hm-border);
    border-radius: var(--hm-radius);
    padding: 1.4rem;
    transition: border-color 0.25s ease, transform 0.25s ease;
    box-sizing: border-box;
}

.hm-card:hover {
    border-color: var(--hm-border-strong);
    transform: translateY(-3px);
}

.hm-card h3 {
    font-family: var(--hm-font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--hm-text);
    margin: 0 0 0.5rem 0;
}

.hm-card p {
    color: var(--hm-muted);
    font-size: 0.9rem;
    line-height: 1.65;
    margin: 0;
}

.hm-card-icon {
    color: var(--hm-accent);
    margin-bottom: 0.85rem;
    display: inline-flex;
}

.hm-card-icon svg {
    width: 22px;
    height: 22px;
}

.hm-grid {
    display: grid;
    gap: 1.1rem;
}

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

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

/* ------------------------------ Tags ------------------------------------ */
.hm-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.85rem;
}

.hm-tag {
    font-family: var(--hm-font-body);
    font-size: 0.72rem;
    color: var(--hm-text);
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: 999px;
    padding: 0.22rem 0.65rem;
    white-space: nowrap;
}

/* -------------------------- Entry (list) cards --------------------------
   Shared by Experience, Projects, Certifications, Education content.     */
.hm-entries {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hm-entry {
    background: var(--hm-panel);
    border: 1px solid var(--hm-border);
    border-radius: var(--hm-radius);
    padding: 1.75rem;
    transition: border-color 0.25s ease;
}

.hm-entry:hover {
    border-color: var(--hm-border-strong);
}

.hm-entry-head {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.hm-entry-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 0;
    background: transparent;
    padding: 0;
    box-sizing: border-box;
    flex-shrink: 0;
}

.hm-entry-title {
    font-family: var(--hm-font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--hm-text);
    margin: 0 0 0.3rem 0;
}

.hm-entry-org {
    color: var(--hm-accent);
    font-size: 0.85rem;
    margin: 0 0 0.15rem 0;
}

.hm-entry-meta {
    color: var(--hm-muted);
    font-size: 0.8rem;
    margin: 0;
}

.hm-entry-link {
    color: var(--hm-accent);
    text-decoration: none;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(56, 189, 248, 0.35);
    transition: color 0.2s ease, border-color 0.2s ease;
    word-break: break-all;
}

.hm-entry-link:hover {
    color: var(--hm-accent-2);
    border-bottom-color: var(--hm-accent-2);
}

.hm-bullets {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hm-bullets li {
    position: relative;
    padding-left: 1.3rem;
    margin-bottom: 0.55rem;
    color: var(--hm-muted);
    font-size: 0.9rem;
    line-height: 1.65;
}

.hm-bullets li:last-child {
    margin-bottom: 0;
}

.hm-bullets li::before {
    content: "\203A";
    position: absolute;
    left: 0;
    color: var(--hm-accent);
}

.hm-bullets b,
.hm-bullets strong {
    color: var(--hm-text);
    font-weight: 700;
}

.hm-entry-media {
    display: block;
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: 10px;
    margin: 0 auto 1.25rem auto;
    background: transparent;
}

.hm-entry-media-sm {
    max-height: 160px;
}

.hm-media-pair {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.hm-media-pair .hm-entry-media {
    min-width: 0;
    margin-bottom: 0;
    max-height: 220px;
}

video.hm-entry-media {
    max-height: 280px;
    border: 1px solid var(--hm-border);
}

/* ----------------------------- Education -------------------------------- */
.hm-degree {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.hm-degree-name {
    font-family: var(--hm-font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--hm-text);
    margin: 0 0 0.3rem 0;
}

.hm-course-group h3 {
    margin-bottom: 1rem;
}

.grad-note {
    border: 1px dashed var(--hm-border);
    border-radius: var(--hm-radius);
    background: rgba(15, 23, 42, 0.35);
    padding: 1rem 1.25rem;
}

.grad-note p {
    margin: 0;
    color: var(--hm-muted);
    font-style: italic;
    line-height: 1.65;
    font-size: 0.9rem;
}

/* ------------------------------- About ---------------------------------- */
.hm-prose p {
    color: var(--hm-muted);
    line-height: 1.8;
    font-size: 0.95rem;
    margin: 0 0 1.1rem 0;
}

.hm-prose p:last-child {
    margin-bottom: 0;
}

.hm-prose strong {
    color: var(--hm-text);
    font-weight: 700;
}

.hm-about-section {
    margin: 2.75rem 0;
    max-width: 720px;
}

.hm-about-section .hm-h2 {
    font-size: 1.2rem;
    margin-bottom: 0.9rem;
}

.hm-media-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 2.5rem;
    align-items: center;
    max-width: none;
}

.hm-media-split .hm-split-text {
    max-width: 720px;
}

.hm-photo {
    width: 100%;
    height: auto;
    border-radius: var(--hm-radius);
    border: 0;
    display: block;
}

/* -------------------------- Homepage: hero ------------------------------ */
.hm-hero {
    padding: 4.5rem 0 2rem 0;
}

.hm-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 200px;
    gap: 3rem;
    align-items: center;
}

.hm-h1 {
    font-family: var(--hm-font-display);
    font-size: clamp(1.9rem, 4.6vw, 2.9rem);
    line-height: 1.14;
    font-weight: 700;
    color: var(--hm-text);
    margin: 0 0 1.1rem 0;
    letter-spacing: 0.01em;
}

.hm-h1 .hm-h1-accent {
    display: block;
    background: linear-gradient(90deg, var(--hm-accent), var(--hm-accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hm-lead {
    font-size: clamp(0.95rem, 1.6vw, 1.05rem);
    line-height: 1.75;
    color: var(--hm-muted);
    max-width: 620px;
    margin: 0 0 1.5rem 0;
}

.hm-portrait {
    width: 100%;
    height: 240px;
    max-height: 240px;
    object-fit: cover;
    object-position: 50% 0%;
    border-radius: 18px;
    border: 0;
    box-shadow: 0 20px 45px rgba(3, 7, 18, 0.55);
    display: block;
}

.hm-now {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid var(--hm-border);
    background: var(--hm-panel);
    border-radius: 999px;
    padding: 0.4rem 0.95rem;
    font-size: 0.78rem;
    color: var(--hm-muted);
    margin-bottom: 1.75rem;
}

.hm-now-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--hm-accent-2);
    box-shadow: 0 0 8px rgba(34, 211, 238, 0.8);
    flex-shrink: 0;
}

.hm-now strong {
    color: var(--hm-text);
    font-weight: 400;
}

.hm-hero-cta {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    align-items: center;
}

/* --------------------- Homepage: credibility strip ---------------------- */
.hm-cred {
    border-top: 1px solid var(--hm-border);
    border-bottom: 1px solid var(--hm-border);
    padding: 1.4rem 0;
    margin: 2.25rem 0 0 0;
}

.hm-cred-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
    justify-content: space-between;
    margin: 0;
    padding: 0;
}

.hm-cred-list li {
    font-size: 0.78rem;
    color: var(--hm-muted);
}

.hm-cred-list li strong {
    display: block;
    color: var(--hm-text);
    font-weight: 400;
    font-size: 0.88rem;
    margin-bottom: 0.1rem;
}

/* ----------------------- Homepage: impact list -------------------------- */
.hm-impact-item {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 1.25rem;
    padding: 1.4rem 0;
    border-bottom: 1px solid var(--hm-border);
}

.hm-impact-item:last-of-type {
    border-bottom: none;
}

.hm-impact-org {
    font-size: 0.82rem;
    color: var(--hm-accent);
    padding-top: 0.15rem;
    margin: 0;
}

.hm-impact-body h3 {
    font-family: var(--hm-font-display);
    font-size: 0.98rem;
    color: var(--hm-text);
    margin: 0 0 0.4rem 0;
}

.hm-impact-body p {
    color: var(--hm-muted);
    line-height: 1.65;
    margin: 0;
    font-size: 0.88rem;
}

/* ------------------------ Homepage: what's next ------------------------- */
.hm-next {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.07), rgba(15, 23, 42, 0.4));
    border: 1px solid var(--hm-border);
    border-radius: 18px;
    padding: 2.25rem 2rem;
}

.hm-next .hm-section-head {
    margin-bottom: 1rem;
}

.hm-next p {
    color: var(--hm-muted);
    line-height: 1.75;
    max-width: 680px;
    margin: 0 0 0.85rem 0;
    font-size: 0.92rem;
}

.hm-next p:last-of-type {
    margin-bottom: 0;
}

.hm-next strong {
    color: var(--hm-text);
    font-weight: 400;
}

/* ------------------------- Homepage: explore ---------------------------- */
.hm-explore-actions {
    display: flex;
    justify-content: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin: 1.25rem 0 0 0;
}

.hm-explore-actions .hm-btn-sm {
    font-size: 0.78rem;
    padding: 0.45rem 0.85rem;
}


/* ------------------------- Homepage: contact ---------------------------- */
.hm-contact {
    text-align: center;
}

.hm-contact .hm-section-sub {
    margin-left: auto;
    margin-right: auto;
}

.hm-contact-actions {
    display: flex;
    justify-content: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-top: 1.75rem;
}

/* ---------------------------- 404 page ---------------------------------- */
.hm-error {
    text-align: center;
    padding: 6rem 0 4rem 0;
}

.hm-error-code {
    font-family: var(--hm-font-display);
    font-size: clamp(3.5rem, 10vw, 6rem);
    font-weight: 700;
    background: linear-gradient(90deg, var(--hm-accent), var(--hm-accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 0 0 0.5rem 0;
}

.hm-error p {
    color: var(--hm-muted);
    max-width: 460px;
    margin: 0 auto 2rem auto;
    line-height: 1.7;
}

.hm-error .hm-hero-cta {
    justify-content: center;
}

/* ------------------------------ Motion ---------------------------------- */
@keyframes hmRise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hm-rise {
    animation: hmRise 0.6s ease both;
}

.hm-rise-2 { animation-delay: 0.1s; }
.hm-rise-3 { animation-delay: 0.2s; }
.hm-rise-4 { animation-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
    .hm-rise,
    .hm-rise-2,
    .hm-rise-3,
    .hm-rise-4 {
        animation: none;
    }

    * {
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ---------------------------- Responsive -------------------------------- */
@media (max-width: 900px) {
    .hm-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .hm-explore-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .hm-impact-item {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .hm-hero-grid {
        grid-template-columns: minmax(0, 1fr) 170px;
        gap: 2rem;
    }

    .hm-media-split {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .hm-media-split .hm-photo {
        max-width: 420px;
    }

    .hm-portrait {
        max-height: 220px;
    }
}

@media (max-width: 600px) {
    .hm-grid-3,
    .hm-grid-2 {
        grid-template-columns: 1fr;
    }

    .hm-explore-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hm-section {
        margin: 3.5rem 0;
    }

    .hm-hero {
        padding-top: 2.5rem;
    }

    .hm-hero .hm-eyebrow {
        font-size: 0.62rem;
        letter-spacing: 0.12em;
    }

    .hm-hero-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .hm-portrait {
        max-width: 160px;
        height: 180px;
        max-height: 180px;
        order: 1;
        justify-self: center;
    }

    .hm-hero-cta .hm-btn {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    .hm-cred-list {
        flex-direction: column;
        gap: 0.9rem;
    }

    .hm-next {
        padding: 1.75rem 1.25rem;
    }

    .hm-page-header {
        padding-top: 2.5rem;
    }

    .hm-entry {
        padding: 1.25rem;
    }

    .hm-entry-head {
        flex-direction: row;
        gap: 0.9rem;
    }

    .hm-media-pair {
        flex-direction: column;
    }
}
