/* ============================================================
   RNIII Portfolio — Shared Stylesheet
   ============================================================ */

/* --- Theme Variables ---------------------------------------- */
:root {
    /* Dark mode (default) */
    --bg:           #0e0e16;
    --bg-elev:      #131320;
    --surface:      #1b1b2a;
    --card:         #20202f;
    --card-hover:   #252536;
    --border:       rgba(255,255,255,0.07);
    --border-strong:rgba(255,255,255,0.14);

    --text:         #e4e4f0;
    --text-muted:   #7272a0;
    --text-faint:   #47476a;

    --accent:       #7c6eff;
    --accent-dim:   rgba(124, 110, 255, 0.18);
    --accent-glow:  rgba(124, 110, 255, 0.35);
    --cyan:         #00d4ff;
    --cyan-dim:     rgba(0, 212, 255, 0.15);
    --coral:        #ff6b6b;
    --coral-dim:    rgba(255, 107, 107, 0.15);
    --green:        #00e5a0;

    --shadow-sm:    0 2px 12px rgba(0,0,0,0.4);
    --shadow-md:    0 8px 32px rgba(0,0,0,0.5);
    --shadow-lg:    0 20px 60px rgba(0,0,0,0.6);

    --radius:       10px;
    --radius-lg:    16px;

    --transition:   color 0.3s ease, background-color 0.3s ease,
                    border-color 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="light"] {
    --bg:           #f6f6fc;
    --bg-elev:      #eeeef8;
    --surface:      #ffffff;
    --card:         #ffffff;
    --card-hover:   #f4f4fc;
    --border:       rgba(0,0,0,0.08);
    --border-strong:rgba(0,0,0,0.16);

    --text:         #1a1a2e;
    --text-muted:   #636382;
    --text-faint:   #a0a0c0;

    --accent:       #5b52df;
    --accent-dim:   rgba(91, 82, 223, 0.12);
    --accent-glow:  rgba(91, 82, 223, 0.25);
    --cyan:         #0094cc;
    --cyan-dim:     rgba(0, 148, 204, 0.12);
    --coral:        #d94f4f;
    --coral-dim:    rgba(217, 79, 79, 0.12);
    --green:        #00a87a;

    --shadow-sm:    0 2px 12px rgba(0,0,0,0.08);
    --shadow-md:    0 8px 32px rgba(0,0,0,0.1);
    --shadow-lg:    0 20px 60px rgba(0,0,0,0.12);
}

/* --- Reset & Base ------------------------------------------- */
*, *::before, *::after {
    margin: 0; padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: var(--transition);
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* --- Typography --------------------------------------------- */
h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.2;
    color: var(--text);
}

/* --- Navigation -------------------------------------------- */
nav {
    position: fixed;
    top: 0; width: 100%;
    z-index: 1000;
    padding: 0 5%;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: color-mix(in srgb, var(--bg) 60%, transparent);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

/* Logo */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.5px;
    color: var(--text);
    text-decoration: none;
}

.nav-logo .logo-rn {
    font-weight: 800;
    color: var(--text);
}

.nav-logo .logo-divider {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--accent);
    display: inline-block;
    margin: 0 3px;
    flex-shrink: 0;
}

.nav-logo .logo-iii {
    font-weight: 300;
    letter-spacing: 3px;
    color: var(--accent);
    font-size: 1.15rem;
    line-height: 1;
    align-self: center;
}

/* Nav links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}

.nav-links a {
    padding: 0.4rem 0.85rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 6px;
    transition: color 0.25s ease, background 0.25s ease;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
    background: var(--accent-dim);
}

.nav-links a.active {
    color: var(--accent);
}

/* Nav right side */
.nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Theme toggle */
.theme-toggle {
    width: 38px; height: 38px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: var(--accent);
}

.theme-toggle svg { width: 18px; height: 18px; }
.icon-sun    { display: none; }
.icon-moon   { display: block; }
[data-theme="light"] .icon-sun  { display: block; }
[data-theme="light"] .icon-moon { display: none; }

/* CTA in nav */
.nav-cta {
    height: 38px !important;
    padding: 0 1rem !important;
    display: inline-flex !important;
    align-items: center !important;
    background: var(--accent);
    color: #fff !important;
    border-radius: 7px;
    font-size: 0.82rem !important;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: opacity 0.25s ease, transform 0.2s ease;
}

.nav-cta:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    background: var(--accent) !important;
}

/* Mobile menu button */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 6px;
    margin-left: 0.25rem;
}

.nav-hamburger span {
    display: block;
    width: 22px; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hamburger → X when menu is open */
nav.nav-open .nav-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
nav.nav-open .nav-hamburger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
nav.nav-open .nav-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile dropdown */
.nav-links.open {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: color-mix(in srgb, var(--bg-elev) 95%, transparent);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    padding: 0.75rem 5% 1rem;
    border-bottom: 1px solid var(--border);
    gap: 0.15rem;
    z-index: 999;
    animation: menuSlide 0.2s ease forwards;
}

@keyframes menuSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Buttons ----------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px var(--accent-glow);
    opacity: 0.92;
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border-strong);
}

.btn-secondary:hover {
    background: var(--surface);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--accent);
    padding-left: 0;
    padding-right: 0;
}

.btn-ghost:hover {
    gap: 0.75rem;
}

/* --- Section Commons --------------------------------------- */
.section {
    padding: 7rem 5%;
}

.section-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}

.section-label::before {
    content: 'III';
    display: inline-block;
    font-weight: 300;
    letter-spacing: 3px;
    color: var(--accent);
    margin-right: 0.65rem;
    font-size: 1em;
    vertical-align: baseline;
    opacity: 1;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 520px;
    line-height: 1.7;
}

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

/* --- Cards ------------------------------------------------- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-strong);
}

/* --- Tags / Pills ------------------------------------------ */
.tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 100px;
    background: var(--accent-dim);
    color: var(--accent);
    letter-spacing: 0.2px;
}

.tag-cyan  { background: var(--cyan-dim);  color: var(--cyan);  }
.tag-coral { background: var(--coral-dim); color: var(--coral); }

/* --- Footer ------------------------------------------------ */
footer {
    background: var(--bg-elev);
    border-top: 1px solid var(--border);
    padding: 3rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    color: var(--text);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.footer-links a {
    font-size: 0.88rem;
    color: var(--text-muted);
    transition: color 0.25s ease;
}

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

.footer-copy {
    font-size: 0.82rem;
    color: var(--text-faint);
}

/* --- Scroll reveal base states (when JS loaded) ------------ */
body.js-ready .reveal {
    opacity: 0;
    transform: translateY(32px);
}

body.js-ready .reveal-left {
    opacity: 0;
    transform: translateX(-32px);
}

body.js-ready .reveal-scale {
    opacity: 0;
    transform: scale(0.93);
}

/* --- Utility ----------------------------------------------- */
.container {
    max-width: 1160px;
    margin: 0 auto;
}

.text-accent  { color: var(--accent); }
.text-cyan    { color: var(--cyan); }
.text-coral   { color: var(--coral); }
.text-muted   { color: var(--text-muted); }

.divider {
    height: 1px;
    background: var(--border);
    margin: 2rem 0;
}

/* --- Responsive -------------------------------------------- */
@media (max-width: 900px) {
    .nav-links { display: none; }
    .nav-hamburger { display: flex; }
}

@media (max-width: 768px) {
    .section { padding: 5rem 5%; }
    footer { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; }
}

@media (max-width: 480px) {
    .section { padding: 3.5rem 5%; }
    .section-header { margin-bottom: 2.5rem; }
    .section-title {
        font-size: clamp(1.6rem, 7vw, 2.5rem);
        letter-spacing: -0.5px;
    }
    .section-subtitle { font-size: 0.95rem; }
    .btn {
        font-size: 0.88rem;
        padding: 0.7rem 1.4rem;
    }
    footer { padding: 2.5rem 5%; gap: 1rem; }
    .footer-links { flex-wrap: wrap; gap: 1rem; }
}
