/* =========================================================
   Faizan — portfolio stylesheet
   One theme, no gimmicks: paper background, ink text,
   a serif headline face, and a single navy accent.
========================================================= */

:root {
    --paper: #F6F6F3;
    --panel: #FFFFFF;
    --ink: #17191C;
    --ink-soft: #52534E;
    --ink-faint: #8B8C86;
    --line: #E1E0D9;
    --accent: #1F3A5F;
    --accent-soft: #E9EEF3;

    --serif: "Fraunces", Georgia, serif;
    --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

    --max-w: 1120px;
    --nav-h: 76px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--sans);
    background: var(--paper);
    color: var(--ink-soft);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 28px;
}

h1,
h2,
h3 {
    font-family: var(--serif);
    color: var(--ink);
    font-weight: 500;
    letter-spacing: -0.01em;
}

section[id] {
    scroll-margin-top: var(--nav-h);
}

/* ---------- Header ---------- */

#navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.nav-inner {
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 600;
    color: var(--ink);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-soft);
    padding-bottom: 4px;
    border-bottom: 1px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--ink);
    border-bottom-color: var(--accent);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--ink);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.open span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

.mobile-menu {
    display: none;
    flex-direction: column;
    gap: 4px;
    border-top: 1px solid var(--line);
    padding: 12px 28px 20px;
}

.mobile-menu.open {
    display: flex;
}

.mobile-menu a {
    font-size: 15px;
    font-weight: 500;
    color: var(--ink-soft);
    padding: 10px 0;
}

/* ---------- Hero ---------- */

.hero {
    padding: 88px 0 96px;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 56px;
    align-items: center;
}

.hero-text h1 {
    font-size: clamp(38px, 4.6vw, 58px);
    line-height: 1.08;
    margin-bottom: 22px;
    opacity: 0;
    transform: translateY(14px);
    animation: revealUp 0.7s ease 0.05s forwards;
}

.hero-lede {
    font-size: 17px;
    color: var(--ink-soft);
    max-width: 46ch;
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(14px);
    animation: revealUp 0.7s ease 0.2s forwards;
}

.hero-lede strong {
    color: var(--ink);
    font-weight: 600;
}

.hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px 24px;
    opacity: 0;
    transform: translateY(14px);
    animation: revealUp 0.7s ease 0.32s forwards;
}

@keyframes revealUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {

    .hero-text h1,
    .hero-lede,
    .hero-actions {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

.hero-photo {
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: 4px;
    border: 1px solid var(--line);
    overflow: hidden;
    background: var(--panel);
}

.hero-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.hero-photo-fallback {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-family: var(--serif);
    font-size: 64px;
    color: var(--ink-faint);
    background: var(--accent-soft);
}

/* ---------- Buttons / links ---------- */

.btn-primary {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 13px 26px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-primary:hover {
    background: #16304e;
}

.btn-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    border-bottom: 1px solid var(--ink-faint);
    padding-bottom: 2px;
    transition: border-color 0.15s ease;
}

.btn-text:hover {
    border-color: var(--ink);
}

/* ---------- Sections ---------- */

.section {
    padding: 96px 0;
    border-bottom: 1px solid var(--line);
}

.section.alt {
    background: var(--panel);
}

.section h2 {
    font-size: clamp(28px, 3vw, 36px);
    margin-bottom: 40px;
}

/* ---------- About ---------- */

.about-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 64px;
    align-items: start;
}

.about-copy p {
    margin-bottom: 18px;
    max-width: 62ch;
}

.about-copy p:last-child {
    margin-bottom: 0;
}

.facts {
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--panel);
    padding: 8px 24px;
}

.facts-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.facts-row:last-child {
    border-bottom: none;
}

.facts-row dt {
    color: var(--ink-faint);
    font-size: 13px;
    flex-shrink: 0;
}

.facts-row dd {
    color: var(--ink);
    font-weight: 500;
    font-size: 14px;
    text-align: right;
    word-break: break-word;
}

.facts-row a {
    border-bottom: 1px solid var(--line);
}

.facts-row a:hover {
    border-color: var(--accent);
}

/* ---------- What I build ---------- */

.build-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px 56px;
}

.build-item {
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.build-item h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.build-item p {
    font-size: 14.5px;
    max-width: 42ch;
}

/* ---------- Work / projects ---------- */

.project-list {
    display: flex;
    flex-direction: column;
}

.project-row {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    padding: 40px 0;
    border-top: 1px solid var(--line);
}

.project-row:last-child {
    padding-bottom: 0;
}

.project-thumb {
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--line);
    aspect-ratio: 4 / 3;
}

.project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.project-body h3 {
    font-size: 21px;
    margin-bottom: 10px;
}

.project-body p {
    font-size: 15px;
    max-width: 60ch;
    margin-bottom: 10px;
}

.project-stack {
    font-size: 13px !important;
    color: var(--ink-faint) !important;
    margin-bottom: 16px !important;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
}

.project-links a {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--accent);
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}

.project-links a:hover {
    border-color: var(--accent);
}

/* ---------- Skills ---------- */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.skill-group {
    padding: 22px 24px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--panel);
}

.skill-group h3 {
    font-size: 14px;
    color: var(--ink);
    margin-bottom: 8px;
}

.skill-group p {
    font-size: 14px;
    color: var(--ink-soft);
}

/* ---------- Contact ---------- */

.contact-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 64px;
    align-items: start;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-faint);
}

.form-group input,
.form-group textarea {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 12px 14px;
    font-family: var(--sans);
    font-size: 14px;
    color: var(--ink);
    outline: none;
    transition: border-color 0.15s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
}

.form-group textarea {
    height: 130px;
    resize: vertical;
}

.form-status {
    font-size: 13px;
    color: var(--accent);
    min-height: 18px;
}

.contact-direct {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--panel);
}

.contact-item {
    padding: 22px 24px;
    border-bottom: 1px solid var(--line);
}

.contact-item:last-child {
    border-bottom: none;
}

.contact-label {
    font-size: 11.5px;
    color: var(--ink-faint);
    margin-bottom: 5px;
}

.contact-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 3px;
}

.contact-sub {
    font-size: 12.5px;
    color: var(--ink-faint);
}

/* ---------- Footer ---------- */

footer {
    padding: 48px 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-left p {
    font-size: 13px;
    color: var(--ink-faint);
    margin-top: 4px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.footer-links a {
    font-size: 13.5px;
    color: var(--ink-soft);
    padding: 0 16px;
    border-left: 1px solid var(--line);
    transition: color 0.15s ease;
}

.footer-links a:first-child {
    border-left: none;
    padding-left: 0;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-copy {
    font-size: 13px;
    color: var(--ink-faint);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .hero-photo {
        max-width: 360px;
        margin: 0 auto;
    }

    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .build-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .project-row {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .project-thumb {
        max-width: none;
        width: 100%;
    }
}

@media (max-width: 720px) {
    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }
}

@media (max-width: 560px) {
    .container {
        padding: 0 20px;
    }

    .section {
        padding: 64px 0;
    }

    .hero {
        padding: 56px 0 64px;
    }

    .hero-text h1 {
        font-size: clamp(32px, 9vw, 40px);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Long values (like an email address) next to a short label
     wrap into an uneven right-aligned block at this width —
     stack label above value instead. */
    .facts-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .facts-row dd {
        text-align: left;
    }
}