/* ==========================================================
   ETM — style.css
   Headings: Instrument Serif   Body: Geist Mono
   ========================================================== */

:root {
    --bg: #ffffff;
    --bg-soft: #ffffff;
    --surface: #ffffff;

    --text: #000000;            /* fully black in light mode */
    --text-muted: #5f5f5f;
    --text-subtle: #767676;

    --blue: #1709d5;            /* fills, buttons, shadows */
    --blue-text: #1709d5;       /* every blue text — same in both themes */
    --blue-soft: rgba(23, 9, 213, 0.08);
    --blue-shadow: rgba(23, 9, 213, 0.16);

    --border: #e7e7e7;
    --nav-bg: rgba(255, 255, 255, 0.9);

    --shadow-sm: 0 4px 20px rgba(23, 9, 213, 0.06);
    --shadow-md: 0 12px 40px rgba(23, 9, 213, 0.10);
    --shadow-neutral: 0 12px 30px rgba(0, 0, 0, 0.08);

    --heading: "Instrument Serif", Georgia, "Times New Roman", serif;
    --body: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

    --t: 0.35s ease;

    /* Contest-winner accents */
    --win-badge: #F43F8E;       /* starburst badge */
    --win-icon:  #FFFFFF;       /* solid trophy */
    --win-text:  #C2185B;       /* winner label */
}

[data-theme="dark"] {
    --bg: #000000;
    --bg-soft: #000000;
    --surface: #000000;

    --text: #ffffff;            /* fully white in dark mode */
    --text-muted: #a8a8a8;
    --text-subtle: #8a8a8a;

    --blue: #1709d5;
    --blue-text: #1709d5;       /* kept identical on purpose; see note in reply */
    --blue-soft: rgba(23, 9, 213, 0.18);
    --blue-shadow: rgba(23, 9, 213, 0.34);

    --border: #202020;
    --nav-bg: rgba(0, 0, 0, 0.9);

    --shadow-sm: 0 4px 24px rgba(23, 9, 213, 0.18);
    --shadow-md: 0 14px 45px rgba(23, 9, 213, 0.28);
    --shadow-neutral: 0 12px 30px rgba(23, 9, 213, 0.22);

    --win-badge: #FF65A3;
    --win-icon:  #000000;
    --win-text:  #FF80AB;
}

/* ------------------------------ RESET ------------------------------ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* smooth light/dark switching for every colour */
    transition:
        background-color var(--t),
        color var(--t),
        border-color var(--t),
        box-shadow var(--t);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--body);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }
svg { display: block; flex-shrink: 0; }

::selection { background: var(--text); color: var(--bg); }

:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 3px;
}

/* ---------------------------- TYPOGRAPHY --------------------------- */

h1, h2, h3,
.brand-text, .footer-brand, .section-marker, .eyebrow, .fact dt {
    font-family: var(--heading);
}

h1, h2, h3 { font-weight: 400; }

h1 {
    font-size: clamp(3rem, 8vw, 7.25rem);
    line-height: 0.95;
    letter-spacing: -0.035em;
    overflow-wrap: break-word;
}

h2 {
    font-size: clamp(2.5rem, 5vw, 5rem);
    line-height: 0.98;
    letter-spacing: -0.025em;
    overflow-wrap: break-word;
}

h3 { font-size: 1.65rem; line-height: 1.05; }

/* Blue highlighted words: identical in light and dark */
h1 .accent,
h2 em {
    color: var(--blue-text);
    font-style: italic;
}

p {
    font-family: var(--body);
    font-size: 0.88rem;
    line-height: 1.8;
    color: var(--text);
}

.container {
    width: min(1180px, 88%);
    margin: 0 auto;
}

/* ---------------------------- NAVIGATION --------------------------- */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--nav-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    width: min(1280px, 92%);
    min-height: 76px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.brand-text {
    color: var(--text);
    font-size: 2rem;
    line-height: 1;
    letter-spacing: 0.02em;
}

/* The only blue accent in the header */
.shop-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.28rem 0.7rem;
    color: var(--blue-text);
    background: var(--blue-soft);
    border: 1px solid rgba(23, 9, 213, 0.22);
    border-radius: 999px;
    font-size: 0.66rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.shop-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--blue);
}

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

.nav-links a {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.nav-links a:hover,
.nav-links a.nav-cta { color: var(--text); }

.nav-links a.nav-cta {
    padding-bottom: 2px;
    border-bottom: 1px solid var(--text);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.theme-btn,
.mobile-menu-btn {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.theme-btn:hover,
.mobile-menu-btn:hover {
    color: var(--text);
    background: #f1f1f1;
}
[data-theme="dark"] .theme-btn:hover,
[data-theme="dark"] .mobile-menu-btn:hover { background: #141414; }

.theme-btn svg,
.mobile-menu-btn svg { width: 18px; height: 18px; }

.mobile-menu-btn { display: none; }
.mobile-menu-btn .icon-close { display: none; }
.mobile-menu-btn[aria-expanded="true"] .icon-menu { display: none; }
.mobile-menu-btn[aria-expanded="true"] .icon-close { display: block; }

[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }

/* ------------------------------ HERO ------------------------------- */

.hero {
    min-height: 100vh;
    min-height: 100svh;
    padding: 150px 0 100px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.hero-content { max-width: 1000px; }

.eyebrow {
    display: inline-block;
    margin-bottom: 2rem;
    color: #000000;
    font-size: 1.1rem;
}

[data-theme="dark"] .eyebrow { color: #ffffff; }

.hero-description {
    max-width: 650px;
    margin-top: 2.5rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.hero-location {
    margin-top: 1rem;
    color: var(--text-subtle);
    font-size: 0.7rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem;
    margin-top: 2.5rem;
}

/* Hero social squares (GitHub, LinkedIn, X, Instagram) */
.hero-socials {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.hero-socials a {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid rgba(59, 53, 232, 0.35);
    border-radius: 3px;
    transition:
        color var(--t), border-color var(--t), background-color var(--t),
        box-shadow var(--t), transform 0.25s ease;
}
.hero-socials a:hover,
.hero-socials a:focus-visible {
    color: var(--text);
    border-color: #3B35E8;
    background: rgba(59, 53, 232, 0.06);
    box-shadow: 0 6px 18px rgba(59, 53, 232, 0.18);
    transform: translateY(-2px);
}
.hero-socials svg { width: 18px; height: 18px; }

/* ----------------------------- BUTTONS ----------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    min-height: 46px;
    padding: 0.75rem 1.2rem;
    font-size: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    transition:
        background-color var(--t), color var(--t), border-color var(--t),
        box-shadow var(--t), transform 0.25s ease;
}

.btn svg { width: 15px; height: 15px; }

.btn-primary {
    color: #ffffff;
    background: var(--blue);
    border-color: var(--blue);
    box-shadow: 0 8px 25px var(--blue-shadow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px var(--blue-shadow);
}

.btn-secondary {
    color: var(--text);
    background: transparent;
}
.btn-secondary:hover {
    color: var(--blue-text);
    border-color: var(--blue);
}

/* White button that sits inside the blue contact box */
.btn-light {
    color: var(--blue);
    background: #ffffff;
    border-color: #ffffff;
    font-weight: 500;
    overflow-wrap: anywhere;
}
.btn-light:hover { transform: translateY(-2px); background: #f1f0ff; }

/* ------------------------- SECTION STRUCTURE ----------------------- */

section {
    padding: 120px 0;
    border-bottom: 1px solid var(--border);
}

.section-marker {
    margin-bottom: 4rem;
    color: var(--blue-text);
    font-size: 1.05rem;
}

.section-heading {
    max-width: 760px;
    margin-bottom: 4rem;
}
.section-heading h2 { margin-bottom: 1.5rem; }
.section-heading p { max-width: 520px; }

/* ------------------------------ ABOUT ------------------------------ */

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8rem;
}

.about-intro h2 { max-width: 500px; }
.about-text { max-width: 570px; }
.about-text p + p { margin-top: 1.5rem; }

/* ROVIE link inside the About paragraph: permanent blue, both themes */
.rovie-link {
    color: #1709d5;
    font-weight: 500;
    border-bottom: 1px solid currentColor;
    padding-bottom: 1px;
    transition: opacity 0.2s ease, border-color var(--t);
}
.rovie-link:hover { opacity: 0.75; }

/* Facts table (neutral lines, no blue) */
.facts {
    margin-top: 6rem;
    border-top: 1px solid var(--border);
}

.fact {
    display: grid;
    grid-template-columns: 11rem 1fr;
    gap: 1.5rem;
    padding: 1.1rem 0;
    align-items: baseline;
    border-bottom: 1px solid var(--border);
}

.fact dt {
    color: var(--text);
    font-size: 1.5rem;
    line-height: 1.2;
}

.fact dd {
    color: var(--text);
    font-family: var(--body);
    font-size: 0.85rem;
    line-height: 1.7;
}

/* ------------------------------ FOCUS ------------------------------ */

.focus { background: var(--bg-soft); }

.focus-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--border);
}

.focus-item {
    min-height: 300px;
    padding: 2rem 1.5rem 2rem 0;
    border-right: 1px solid var(--border);
}
.focus-item:not(:first-child) { padding-left: 1.5rem; }
.focus-item:last-child { border-right: none; }

.focus-number {
    display: block;
    margin-bottom: 5rem;
    color: var(--blue-text);
    font-size: 0.65rem;
}

.focus-item h3 { margin-bottom: 1rem; }

/* ----------------------------- TOOLKIT ----------------------------- */

.toolkit { border-top: 1px solid var(--border); }

.toolkit-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 2rem;
    padding: 1.8rem 0;
    border-bottom: 1px solid var(--border);
}

.toolkit-label {
    color: var(--text-muted);
    font-family: var(--body);
    font-size: 0.72rem;
}

.toolkit-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.2rem;
    color: var(--text);
    font-family: var(--body);
    font-size: 0.8rem;
}

/* ----------------------------- PROJECTS ---------------------------- */

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.project-card {
    min-height: 430px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition:
        background-color var(--t), color var(--t), border-color var(--t),
        box-shadow var(--t), transform 0.35s ease;
}

.project-card:hover {
    border-color: var(--blue);
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.project-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 6rem;
    color: var(--text);
    font-size: 0.64rem;
}
.project-top span:first-child { color: var(--blue-text); }

.project-card h3 { margin-bottom: 1.2rem; color: var(--text); }
.project-card p { color: var(--text); }

.project-stack {
    margin-top: 1.5rem;
    color: var(--blue-text);
    font-size: 0.66rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    margin-top: auto;
    padding-top: 2rem;
    color: var(--text);
    font-size: 0.7rem;
    border-bottom: 1px solid var(--text);
    /* keep the underline tight to the text, not the padding */
    padding-bottom: 2px;
    margin-top: auto;
}
.project-link:hover { color: var(--blue-text); border-color: var(--blue); }
.project-link svg { width: 13px; height: 13px; }

/* Contest-winner card: badge replaces the category tag (top right) */
.project-card--winner { scroll-margin-top: 100px; }

.project-top--badge {
    align-items: center;
    margin-bottom: 1.5rem;
}

.win-badge {
    display: block;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}
.win-badge svg { width: 100%; height: 100%; overflow: visible; }

.win-badge-star {
    fill: var(--win-badge);
    stroke: var(--win-badge);
    stroke-width: 3;
    stroke-linejoin: round;
    transition: fill var(--t), stroke var(--t);
}
.win-badge-trophy {
    fill: var(--win-icon);
    transition: fill var(--t);
}

.project-card p.win-label {
    margin-bottom: 1.5rem;
    color: var(--win-text);
    font-family: var(--body);
    font-size: 0.68rem;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.01em;
}

/* Highlight when reached from the About link */
.project-card.is-highlighted {
    border-color: var(--blue);
    box-shadow: var(--shadow-md);
}

/* ---------------------------- PHILOSOPHY --------------------------- */

.statement-inner { max-width: 900px; }
.statement h2 { font-size: clamp(3rem, 7vw, 7rem); }

/* ----------------------------- CONTACT ----------------------------- */

.contact { padding: 120px 0 140px; }

.contact-box {
    padding: 5rem 8%;
    color: #ffffff;
    background: var(--blue);
    border-radius: 8px;
    box-shadow: 0 20px 60px var(--blue-shadow);
}

.contact-box h2 {
    max-width: 14ch;
    margin-bottom: 1.75rem;
    color: #ffffff;
}

.contact-box p {
    max-width: 520px;
    margin-bottom: 2.25rem;
    color: rgba(255, 255, 255, 0.86);
}

/* ------------------------------ FOOTER ----------------------------- */

footer { padding: 2.5rem 0; border-bottom: none; }

.footer-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 2rem;
}

.footer-brand { color: var(--text); font-size: 1.6rem; }

.footer-note {
    margin-left: 0.7rem;
    color: var(--text-subtle);
    font-size: 0.62rem;
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.footer-social a {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 50%;
}
.footer-social a:hover { color: var(--text); border-color: var(--text); }
.footer-social svg { width: 16px; height: 16px; }

.footer-copy {
    justify-self: end;
    color: var(--text-subtle);
    font-size: 0.62rem;
}

/* ---------------------------- ANIMATIONS --------------------------- */
/* Hero entrance is pure CSS (no JS needed), so the first screen can never
   stay blank on Safari / iPhone. */
.hero-anim { animation: heroIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes heroIn {
    from { opacity: 0; transform: translateY(25px); }
    to   { opacity: 1; transform: none; }
}

/* Content is visible by default. It is only hidden when JS is running,
   and the .no-reveal safety net shows it again if anything fails. */

.js .fade-in {
    opacity: 0;
    transform: translateY(25px);
    transition:
        opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.js .fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
.no-reveal .fade-in {
    opacity: 1 !important;
    transform: none !important;
}

/* ---------------------------- RESPONSIVE --------------------------- */

@media (max-width: 1000px) {
    .project-grid { grid-template-columns: repeat(2, 1fr); }
    .project-card { min-height: 380px; }
    .project-top { margin-bottom: 4rem; }
    .project-top--badge { margin-bottom: 1.5rem; }
    .project-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        max-height: calc(100vh - 76px);
        overflow-y: auto;
        padding: 1.25rem 4% 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1.1rem;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-neutral);
    }
    .nav-links.active { display: flex; }
    .nav-links a { font-size: 0.85rem; }

    .mobile-menu-btn { display: grid; }

    .focus-grid { grid-template-columns: repeat(2, 1fr); }
    .focus-item:nth-child(2) { border-right: none; }
    .focus-item:nth-child(3),
    .focus-item:nth-child(4) { border-top: 1px solid var(--border); }
    .focus-item:nth-child(3) { padding-left: 0; }
    .focus-item { min-height: 260px; }

    .about-grid,
    .footer-content {
        grid-template-columns: 1fr;
    }
    .about-grid { gap: 3.5rem; }

    .footer-content { text-align: center; gap: 1.5rem; }
    .footer-social { justify-content: center; }
    .footer-copy { justify-self: center; }

    .contact-box { padding: 4rem 7%; }
}

@media (max-width: 700px) {
    .fact { grid-template-columns: 1fr; gap: 0.15rem; }
    .facts { margin-top: 4rem; }
}

@media (max-width: 640px) {
    .container { width: 90%; }
    .nav-container { width: 90%; gap: 0.5rem; min-height: 68px; }
    .brand-group { gap: 0.6rem; }
    .brand-text { font-size: 1.75rem; }
    .shop-tag { font-size: 0.58rem; padding: 0.22rem 0.55rem; gap: 0.35rem; }
    .nav-links { max-height: calc(100vh - 68px); }

    .hero { padding: 120px 0 72px; }
    .eyebrow { font-size: 1rem; margin-bottom: 1.5rem; }
    h1 { font-size: clamp(2.7rem, 13vw, 4.2rem); }
    .hero-description { margin-top: 2rem; }

    section { padding: 80px 0; }
    .section-marker { margin-bottom: 2.5rem; }

    .focus-grid { grid-template-columns: 1fr; }
    .focus-item,
    .focus-item:not(:first-child),
    .focus-item:nth-child(3) {
        min-height: auto;
        padding: 1.5rem 0;
        border-right: none;
        border-top: none;
        border-bottom: 1px solid var(--border);
    }
    .focus-item:last-child { border-bottom: none; }
    .focus-number { margin-bottom: 2.5rem; }

    .toolkit-row { grid-template-columns: 1fr; gap: 0.8rem; padding: 1.4rem 0; }

    .project-grid { grid-template-columns: 1fr; }
    .project-card { min-height: auto; padding: 1.6rem; }
    .project-card:last-child:nth-child(odd) { grid-column: auto; }
    .project-top { margin-bottom: 3rem; }
    .project-top--badge { margin-bottom: 1.25rem; }
    .win-badge { width: 44px; height: 44px; }
    .project-card p.win-label { margin-bottom: 1.25rem; }

    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions .btn { width: 100%; }
    /* squares span the button's width, evenly spaced, flush with both edges */
    .hero-socials { width: 100%; justify-content: space-between; gap: 0; margin-top: 0.9rem; }

    .contact { padding: 80px 0 100px; }
    .contact-box { padding: 3rem 1.5rem; }
    .contact-box .btn { width: 100%; }
}

@media (max-width: 340px) {
    .shop-tag { font-size: 0.52rem; padding: 0.2rem 0.45rem; }
    .brand-text { font-size: 1.55rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .js .fade-in { opacity: 1; transform: none; }
}
