/* Root variables for color theming */
:root {
    --color-accent: #f59e0b;
    --color-highlight: #f8fafc;
    --background-accent: rgba(245, 158, 11, 0.14);
}

html {
    scroll-behavior: smooth;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background: #0f2438;
    color: #cbd5e1;
    padding: 2rem 1rem;
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 6rem;
}

@media (min-width: 640px) {
    body {
        padding: 4rem 2rem;
    }
}

@media (min-width: 1024px) {
    body {
        padding: 6rem;
    }
}

#logo-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background: #0f2438;
    transition: opacity 0.65s ease, transform 0.65s ease;
}

#logo-splash img {
    max-width: min(45vw, 280px);
    max-height: min(45vh, 280px);
    width: auto;
    height: auto;
}

#logo-splash.fade-out {
    opacity: 0;
    transform: scale(0.92);
    pointer-events: none;
}

#corner-logo {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    width: 72px;
    padding: 0.5rem;
    border-radius: 1rem;
    background: rgba(15, 36, 56, 0.95);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

#corner-logo img {
    width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 1023px) {
    header {
        position: relative;
        padding-top: 5rem;
    }

    #corner-logo {
        position: absolute;
        top: 2rem;
        left: 1rem;
        right: auto;
        width: 56px;
        padding: 0.35rem;
        z-index: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    #logo-splash {
        display: none;
    }
}

p::selection,
h1::selection,
h2::selection,
h3::selection,
h4::selection,
h5::selection,
h6::selection {
    background: var(--color-accent);
    color: #030712;
}

.underlay {
    position: fixed;
    background: #111827;
    inset: 0;
    opacity: 0.25;
}

header,
main,
footer {
    position: relative;
    z-index: 10;
}

header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 520px;
    position: relative;
}

header h1,
header h4,
.lighttext {
    color: var(--color-highlight);
}

header a {
    text-decoration: none;
}

header h1 {
    font-weight: 600;
}

header h4 {
    font-weight: 400;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

nav a {
    font-size: 0.9rem;
    display: inline-flex;
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.4rem;
    width: 50px;
    height: 50px;
    border: 1px solid rgba(248, 250, 252, 0.2);
    border-radius: 999px;
    background: rgba(3, 7, 18, 0.85);
    color: var(--color-highlight);
    cursor: pointer;
    padding: 0.6rem;
    flex-shrink: 0;
}

.menu-toggle span {
    display: block;
    width: 85%;
    height: 2.5px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 180ms ease, opacity 180ms ease;
}

.menu-toggle.open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 900px) {
    .menu-toggle {
        display: inline-flex;
    }

    .site-nav {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
        position: absolute;
        top: calc(100% + 0.6rem);
        left: 0;
        right: 0;
        padding: 1rem;
        background: rgba(3, 7, 18, 0.98);
        border: 1px solid rgba(248, 250, 252, 0.12);
        border-radius: 1rem;
        z-index: 30;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-6px);
        transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
    }

    .site-nav.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    .site-nav a {
        display: block;
    }
}

@media (min-width: 901px) {
    .site-nav {
        display: flex;
    }
}

.social-link-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.social-link {
    font-size: 1.5rem;
    color: inherit;
    text-decoration: none;
}

.social-link:hover {
    color: var(--color-highlight);
}

main {
    display: flex;
    flex-direction: column;
    gap: 6rem;
}

section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

section h2,
.experience-card h3 {
    text-transform: uppercase;
    font-size: 1rem;
    font-weight: 500;
}

.sticky-header {
    position: sticky;
    top: 0;
    padding: 1rem 0;
}

.sticky-header h2 {
    position: relative;
    z-index: 2;
}

.sticky-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.95);
    opacity: 0.95;
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.about-content p {
    font-size: 1.1rem;
}

.anchor-text {
    color: var(--color-highlight);
    text-decoration: none;
    transition-duration: 1000ms;
}

.anchor-text:hover {
    color: var(--color-accent);
}

.experience-contents,
.projects-contents {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.experience-card,
.project-card {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 1rem;
    background: rgba(15, 23, 42, 0.82);
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.25);
}

.card-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tenure {
    opacity: 0.7;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.experience-card p {
    font-size: 0.95rem;
}

.card-header {
    font-weight: 500;
    font-size: 1rem;
}

.anchor-icon {
    padding-left: 0.5rem;
}

.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--color-accent);
}

.tag {
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    background: rgba(245, 158, 11, 0.14);
}

.tag p {
    font-size: 0.8rem;
}

footer {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    justify-content: space-between;
    align-items: flex-start;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    width: 100%;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    padding-bottom: 2rem;
}

.footer-heading {
    color: var(--color-highlight);
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.footer-section p,
.footer-section a {
    line-height: 1.6;
    font-size: 0.9rem;
}

.footer-credits {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
    align-items: center;
    text-align: center;
}

.footer-credits p {
    font-size: 0.75rem;
    opacity: 0.8;
}

footer p {
    font-size: 0.9rem;
}

.scroll-to-top {
    text-decoration: none;
    color: var(--color-accent);
    background: var(--background-accent);
    padding: 0 0.75rem;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    border-radius: 100%;
    overflow: hidden;
    transition-duration: 200ms;
}

.scroll-to-top:hover {
    opacity: 0.6;
}

/* ─── Legal pages (privacy.html, terms.html) ─────────────────────────────── */

body.legal-page {
    display: block;
    padding: 2rem;
}

.legal-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    line-height: 1.6;
    gap: 0.6rem;
}

.legal-container h1 {
    color: var(--color-highlght);
    margin-bottom: 0.5rem;
    font-size: 2.3rem;
    font-weight: 600;
}

.legal-container .last-updated {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    opacity: 0.8;
}

.legal-container h2 {
    color: var(--color-highlght);
    margin-top: 0.75rem;
    margin-bottom: 0.4rem;
    font-size: 1.05rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.legal-container section {
    margin-bottom: 0.5rem;
}

.legal-container p,
.legal-container li {
    margin-bottom: 0.4rem;
    color: #94a3b8;
    font-size: 0.95rem;
}

.legal-container ul {
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.legal-container strong {
    color: var(--color-highlght);
}

.legal-doc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.legal-doc-footer .last-updated {
    margin-bottom: 0;
}

.back-link {
    color: var(--color-accent);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 300ms ease;
    font-size: 0.9rem;
}

.back-link:hover {
    opacity: 0.8;
}

.back-link:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
    border-radius: 2px;
    opacity: 1;
}

@media (max-width: 1023px) {
    .legal-container {
        padding-top: 5.5rem;
    }
}

@media (max-width: 640px) {
    .legal-container {
        padding: 2rem 1rem;
        padding-top: 5.5rem;
    }

    .legal-container h1 {
        font-size: 1.8rem;
    }

    .legal-container h2 {
        font-size: 1rem;
    }
}

/* ─────────────────────────────────────────────────────────────────────────── */

@media (min-width: 640px){
    .project-card,
    .experience-card{
        grid-template-columns: repeat(4, minmax(0,1fr));
    }

    .card-column,
    .experience-card{
        grid-column: span 3 / span 3;
    }

    .project-image-container{
        order: 0;
    }

    header{
        max-width: unset;
    }

    header h1{
        font-size: 3rem;
    }
    
    header h4{
        font-size: 1.3rem;
    }

    header p {
        max-width: 300px;
    }
    .social-link-container{
        gap: 1.5rem;
    }

    .social-link-container i {
        font-size: 2rem;
    }
    
}

@media (min-width: 1024px){
    body{
        grid-template-columns: repeat(2, minmax(0,1fr));
        gap: 1rem;
        padding: 6rem;
        padding-top: 0;
    }

    header{
        position: sticky;
        top: 0;
        margin-left: auto;
        height: 100vh;
        padding-bottom: 6rem;
    }

    header h1{
        font-size: 3rem;
    }
    
    header h4{
        font-size: 1.3rem;
    }

    header p {
        max-width: 300px;
    }

    nav a{
            display: flex;
            flex-direction: column;
            font-size: 1.1rem;
    }

    nav {
        display: flex;
        flex-direction: column;
        flex: 1;
        gap: 0.75rem;
    }

    .social-link-container{
        gap: 1.5rem;
    }

    .social-link-container i {
        font-size: 2rem;
    }

    header,
    main {
        padding-top: 6rem;
        max-width: 600px;
        width: 100%;
    }

    main{
        margin-right: auto;
    }

    .sticky-header{
        display: none;
    }

    footer{
        grid-column: span 2 / span 2;
        flex-direction: column;
        max-width: 1200px;
        margin: 0 auto;
        width: 100%;
        align-items: center;
    }

    .footer-content {
        max-width: 100%;
    }

    .footer-credits {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    

}

/* ─── Contact Form Styles ─────────────────────────────────────────────────── */

.contact-intro {
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.6;
}

.inquiry-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.6) 0%, rgba(30, 41, 59, 0.4) 100%);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.25);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-label {
    color: var(--color-highlight);
    font-weight: 500;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-input,
textarea,
select {
    padding: 0.75rem 1rem;
    background: rgba(3, 7, 18, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.5rem;
    color: var(--color-highlight);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 200ms ease;
    outline: none;
}

.form-input:hover,
textarea:hover,
select:hover {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(3, 7, 18, 0.7);
}

.form-input:focus,
textarea:focus,
select:focus {
    border-color: var(--color-accent);
    background: rgba(3, 7, 18, 0.8);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
    font-family: 'Inter', sans-serif;
}

textarea::placeholder,
.form-input::placeholder {
    color: rgba(203, 213, 225, 0.5);
}

/* Radio Button Styles */
.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: opacity 200ms ease;
}

.radio-label:hover,
.checkbox-label:hover {
    opacity: 0.8;
}

.radio-label input[type="radio"],
.checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(148, 163, 184, 0.4);
    border-radius: 0.4rem;
    background: rgba(3, 7, 18, 0.6);
    cursor: pointer;
    transition: all 200ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.radio-label input[type="radio"] {
    border-radius: 50%;
}

.radio-label input[type="radio"]:hover,
.checkbox-label input[type="checkbox"]:hover {
    border-color: rgba(245, 158, 11, 0.5);
}

.radio-label input[type="radio"]:checked,
.checkbox-label input[type="checkbox"]:checked {
    background: var(--color-accent);
    border-color: var(--color-accent);
    box-shadow: inset 0 0 0 3px #0f2438;
}

.radio-label input[type="radio"]:focus-visible,
.checkbox-label input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.radio-text,
.checkbox-text {
    color: var(--color-highlight);
    font-size: 0.95rem;
}

/* Submit Button */
.submit-btn {
    padding: 0.95rem 2rem;
    background: linear-gradient(135deg, var(--color-accent) 0%, #f59e0b 100%);
    color: #030712;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 300ms ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.25);
    align-self: flex-start;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(245, 158, 11, 0.35);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
}

.form-note {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: -0.5rem;
}

/* Mobile responsiveness for forms */
@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .inquiry-form {
        padding: 2rem 1.5rem;
        gap: 1.75rem;
        border-radius: 0.75rem;
    }

    .form-group {
        gap: 0.95rem;
    }

    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }

    .form-input,
    textarea,
    select {
        padding: 0.9rem 1rem;
        font-size: 1rem;
    }

    .radio-group,
    .checkbox-group {
        gap: 1rem;
    }

    .radio-label,
    .checkbox-label {
        gap: 0.9rem;
        padding: 0.6rem 0;
    }

    .radio-text,
    .checkbox-text {
        font-size: 0.95rem;
    }

    .submit-btn {
        width: 100%;
        align-self: stretch;
        padding: 1.1rem 2rem;
        font-size: 0.95rem;
        margin-top: 0.5rem;
    }

    .form-note {
        font-size: 0.85rem;
    }
}