/* ============================================================
   HUZEFA NALKHEDA WALA — PORTFOLIO
   "Midnight Plum & Gold" editorial redesign
   Palette + type drawn from the Khadija/Between-Us system.
   Arabesque assets reused from webinar-relay (Aljamea).
   ============================================================ */

:root {
    /* Warm deep-plum base */
    --bg:          #1a1014;
    --bg2:         #150c11;
    --bg3:         #0f090c;

    /* Gold + rose accents (one signature accent, one warm secondary) */
    --gold:        #d6b06a;
    --gold-soft:   #ecd6a0;
    --rose:        #dd8d99;
    --rose-deep:   #c45f6e;

    /* Text on plum */
    --ink:         #f2e6dd;   /* warm cream — headings */
    --soft:        #d9c6c2;   /* body */
    --muted:       #bb9aa1;   /* captions */

    /* Surfaces */
    --panel:       rgba(255, 238, 228, 0.045);
    --panel-hi:    rgba(255, 238, 228, 0.07);
    --line:        rgba(214, 176, 106, 0.20);   /* gold hairline */
    --line-soft:   rgba(214, 176, 106, 0.12);

    /* Type */
    --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --sans:  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Rhythm */
    --container: 1120px;
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --space-2xl: 6rem;
    --space-3xl: 8rem;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

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

/* Girih lattice texture + plum vignette, fixed behind everything.
   Same technique as webinar-relay's .islamic-bg (very low opacity). */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(120% 80% at 50% -10%, #3a2030 0%, rgba(58,32,48,0) 55%),
        radial-gradient(100% 70% at 90% 8%, rgba(196,95,110,0.12) 0%, rgba(0,0,0,0) 60%),
        linear-gradient(180deg, var(--bg), var(--bg2));
}
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url('assets/islamic.png');
    background-size: 420px 420px;
    background-repeat: repeat;
    opacity: 0.05;
    /* nudge the cool lattice toward warm gold */
    filter: sepia(0.6) saturate(1.4) hue-rotate(-8deg) brightness(1.1);
    pointer-events: none;
}

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

::selection { background: rgba(221, 141, 153, 0.28); color: #fff; }

/* === Shared type === */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.eyebrow {
    display: inline-block;
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    color: var(--gold);
    margin-bottom: var(--space-md);
}

.serif { font-family: var(--serif); }

h1, h2, h3 { font-family: var(--serif); color: var(--ink); font-weight: 500; line-height: 1.12; letter-spacing: 0.005em; }

.section {
    padding: var(--space-3xl) 0;
    position: relative;
}

.section-head { max-width: 640px; margin-bottom: var(--space-2xl); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.section-title {
    font-size: clamp(2rem, 4.5vw, 3.1rem);
    color: var(--ink);
}
.section-title em { font-style: italic; color: var(--gold-soft); }

.section-intro {
    margin-top: var(--space-sm);
    color: var(--muted);
    font-size: 1.05rem;
}

/* === Arabesque frieze divider (border.png, tiled repeat-x) === */
.frieze {
    height: 30px;
    width: 100%;
    background-image: url('assets/border.png');
    background-repeat: repeat-x;
    background-size: auto 30px;
    background-position: center;
    opacity: 0.55;
    /* fade the ends so it reads as an ornament, not a hard band */
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
    /* warm the cream relief toward gold */
    filter: sepia(0.5) saturate(1.3) hue-rotate(-10deg) brightness(0.95);
}
.frieze.tiny { height: 22px; background-size: auto 22px; opacity: 0.4; }

/* Small gold rule with a diamond — the recurring divider motif */
.rule {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: var(--space-md) 0;
}
.rule::before, .rule::after {
    content: '';
    height: 1px;
    flex: 1;
    background: linear-gradient(90deg, transparent, var(--line));
}
.rule::after { background: linear-gradient(90deg, var(--line), transparent); }
.rule .diamond { color: var(--gold); font-size: 0.7rem; }
.rule.left::before { display: none; }
.rule.left { justify-content: flex-start; }
.rule.left::after { flex: 0 0 120px; }

/* === Navigation === */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 1.1rem 0;
    background: linear-gradient(180deg, rgba(21,12,17,0.85), rgba(21,12,17,0));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: padding 0.3s var(--ease), background 0.3s var(--ease);
}
.nav.scrolled {
    padding: 0.7rem 0;
    background: rgba(21,12,17,0.9);
    border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-logo {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--ink);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-logo .mark {
    width: 30px; height: 30px;
    border: 1px solid var(--gold);
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 0.8rem; color: var(--gold);
}
.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}
.nav-links a {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.25s var(--ease);
    position: relative;
}
.nav-links a:hover { color: var(--gold-soft); }
.nav-links a::after {
    content: '';
    position: absolute;
    left: 0; bottom: -6px;
    width: 0; height: 1px;
    background: var(--gold);
    transition: width 0.3s var(--ease);
}
.nav-links a:hover::after { width: 100%; }

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line);
    color: var(--gold);
    width: 42px; height: 42px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
}

/* === Hero === */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 7rem 0 3rem;
    position: relative;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.85fr;
    gap: var(--space-xl);
    align-items: center;
}
/* allow grid children to shrink so long text wraps instead of overflowing */
.hero-grid > * { min-width: 0; }
.hero-name {
    font-size: clamp(2.6rem, 6vw, 4.4rem);
    line-height: 1.03;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-bottom: var(--space-sm);
}
.hero-name em { font-style: italic; color: var(--gold-soft); display: block; }
.hero-sub {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    color: var(--rose);
    margin-bottom: var(--space-lg);
    font-weight: 500;
}
.hero-desc {
    font-size: 1.05rem;
    color: var(--soft);
    max-width: 33rem;
    margin-bottom: var(--space-md);
    line-height: 1.7;
}
.hero-desc strong { color: var(--gold-soft); font-weight: 600; }

.hero-stats {
    display: flex;
    gap: var(--space-lg);
    margin: var(--space-md) 0 var(--space-lg);
    flex-wrap: wrap;
}
.hero-stats .stat { min-width: 90px; }
.stat-number {
    font-family: var(--serif);
    font-size: 2.4rem;
    font-weight: 600;
    color: var(--gold);
    line-height: 1;
    display: block;
    font-variant-numeric: lining-nums;
}
/* keep data/version numbers as clean lining figures, not old-style */
.card-title, .card-kicker, .tl-date, .tag { font-variant-numeric: lining-nums; }
.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-top: 0.5rem;
}

.cta-row { display: flex; gap: var(--space-sm); flex-wrap: wrap; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.6rem;
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    text-decoration: none;
    border-radius: 2px;
    transition: all 0.3s var(--ease);
    cursor: pointer;
    border: 1px solid transparent;
}
.btn-primary {
    background: var(--gold);
    color: #1a1014;
}
.btn-primary:hover {
    background: var(--gold-soft);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(214,176,106,0.5);
}
.btn-ghost {
    background: transparent;
    color: var(--gold-soft);
    border-color: var(--line);
}
.btn-ghost:hover {
    border-color: var(--gold);
    background: var(--panel);
    transform: translateY(-2px);
}

/* Hero portrait — filled portrait card with an offset gold accent frame */
.hero-portrait {
    position: relative;
    justify-self: center;
    width: 100%;
    max-width: 360px;
}
/* offset gold frame sits BEHIND the card (not clipped) */
.hero-portrait::before {
    content: '';
    position: absolute;
    inset: 16px -16px -16px 16px;
    border: 1px solid var(--gold);
    border-radius: 8px;
    opacity: 0.45;
    z-index: 0;
}
.hero-portrait picture {
    position: relative;
    z-index: 1;
    display: block;
    aspect-ratio: 4 / 5;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background:
        radial-gradient(120% 80% at 50% 0%, rgba(214,176,106,0.10), rgba(0,0,0,0) 60%),
        linear-gradient(180deg, rgba(255,238,228,0.05), rgba(255,238,228,0.015));
}
.hero-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 8%;
    display: block;
    filter: grayscale(0.12) contrast(1.03);
}

/* === Cards (projects, research, education) === */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-md);
}
.card-grid.two { grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); }

.card {
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    padding: var(--space-lg);
    transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), var(--rose-deep));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--ease);
}
.card:hover {
    transform: translateY(-4px);
    border-color: var(--line);
    background: var(--panel-hi);
}
.card:hover::before { transform: scaleX(1); }
.card.feature { grid-column: span 2; }

.card-kicker {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--rose);
    font-weight: 600;
    margin-bottom: 0.75rem;
}
.card-title {
    font-family: var(--serif);
    font-size: 1.55rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}
.card-title .ext { font-size: 0.7rem; color: var(--gold); }
.card-desc { color: var(--soft); font-size: 0.98rem; line-height: 1.7; margin-bottom: var(--space-md); flex: 1; }

.tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: auto; }
.tag {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gold-soft);
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    background: rgba(214,176,106,0.05);
}

.card-link {
    margin-top: var(--space-md);
    align-self: flex-start;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--gold);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s var(--ease);
}
.card-link:hover { gap: 0.9rem; }

/* === About === */
.about-wrap { max-width: 780px; margin: 0 auto; text-align: center; }
.about-lede {
    font-family: var(--serif);
    font-size: clamp(1.4rem, 3vw, 2rem);
    line-height: 1.5;
    color: var(--ink);
    font-weight: 400;
}
.about-lede strong { color: var(--gold-soft); font-weight: 600; font-style: italic; }
.about-body { margin-top: var(--space-lg); color: var(--soft); font-size: 1.05rem; }

/* === Skills === */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-md);
}
.skill {
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    padding: var(--space-lg);
    background: var(--panel);
    transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.skill:hover { border-color: var(--line); transform: translateY(-3px); }
.skill h3 {
    font-family: var(--sans);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--gold);
    margin-bottom: var(--space-sm);
    display: flex; align-items: center; gap: 0.5rem;
}
.skill ul { list-style: none; }
.skill li {
    color: var(--soft);
    font-size: 0.95rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line-soft);
    padding-left: 1.1rem;
    position: relative;
}
.skill li:last-child { border-bottom: none; }
.skill li::before { content: '◆'; position: absolute; left: 0; color: var(--rose-deep); font-size: 0.55rem; top: 0.75rem; }

/* === Timeline === */
.timeline { position: relative; max-width: 760px; margin: 0 auto; padding-left: 2rem; }
.timeline::before {
    content: '';
    position: absolute;
    left: 6px; top: 6px; bottom: 6px;
    width: 1px;
    background: linear-gradient(180deg, var(--gold), var(--line-soft), transparent);
}
.tl-item { position: relative; padding-bottom: var(--space-xl); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
    content: '';
    position: absolute;
    left: -1.72rem; top: 0.4rem;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 4px rgba(214,176,106,0.15);
}
.tl-date { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--rose); margin-bottom: 0.4rem; }
.tl-item h3 { font-size: 1.4rem; margin-bottom: 0.2rem; }
.tl-org { color: var(--gold-soft); font-size: 0.9rem; margin-bottom: 0.6rem; }
.tl-item p { color: var(--soft); font-size: 0.98rem; }

/* === Contact === */
.contact { text-align: center; }
.contact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-xl);
    max-width: 900px;
    margin-left: auto; margin-right: auto;
}
.contact-card {
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    padding: var(--space-lg) var(--space-md);
    text-decoration: none;
    color: var(--soft);
    background: var(--panel);
    transition: all 0.3s var(--ease);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.contact-card:hover { border-color: var(--gold); transform: translateY(-4px); background: var(--panel-hi); }
.contact-card i { font-size: 1.5rem; color: var(--gold); }
.contact-card .cc-title { font-weight: 600; color: var(--ink); font-size: 0.95rem; }
.contact-card .cc-sub { font-size: 0.78rem; color: var(--muted); }

/* === Footer === */
.footer {
    border-top: 1px solid var(--line-soft);
    padding: var(--space-xl) 0 var(--space-lg);
    background: var(--bg2);
}
.footer-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-lg); margin-bottom: var(--space-lg); }
.footer-logo { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); letter-spacing: 0.06em; }
.footer-tag { color: var(--muted); font-size: 0.85rem; margin-top: 0.3rem; }
.footer-cols { display: flex; gap: var(--space-2xl); flex-wrap: wrap; }
.footer-col h4 { font-family: var(--sans); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--gold); margin-bottom: 0.8rem; }
.footer-col a { display: block; color: var(--muted); text-decoration: none; font-size: 0.9rem; padding: 0.25rem 0; transition: color 0.25s var(--ease); }
.footer-col a:hover { color: var(--gold-soft); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-sm); padding-top: var(--space-lg); border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 0.8rem; }

/* === Scroll progress === */
.progress {
    position: fixed; top: 0; left: 0; height: 2px; width: 0;
    background: linear-gradient(90deg, var(--gold), var(--rose-deep));
    z-index: 200;
}

/* === Reveal-on-scroll (subtle, like riseIn / .reveal) === */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* === Responsive === */
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; gap: var(--space-xl); }
    .hero-portrait { order: -1; max-width: 300px; }
    .card.feature { grid-column: span 1; }
    .card-grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    :root { --space-3xl: 5rem; --space-2xl: 3.5rem; }
    .nav-links {
        position: fixed;
        top: 68px; left: 5%; right: 5%;
        flex-direction: column;
        gap: 0.25rem;
        background: rgba(21,12,17,0.97);
        border: 1px solid var(--line);
        border-radius: 12px;
        padding: 1rem;
        display: none;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 0.7rem; text-align: center; }
    .nav-toggle { display: block; }
    .container { padding: 0 1.25rem; }
    .hero { padding: 6rem 0 2.5rem; }
    .hero-name { font-size: clamp(2.2rem, 11vw, 3.1rem); }
    .hero-sub { letter-spacing: 0.16em; overflow-wrap: break-word; }
    .hero-desc { max-width: 100%; font-size: 1rem; }
    .hero-stats { gap: var(--space-md); }
    .section-title { font-size: clamp(1.7rem, 7vw, 2.3rem); }
}

/* === Respect reduced motion (all your recent projects do this) === */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; scroll-behavior: auto !important; }
    .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    .card:hover, .btn:hover, .skill:hover, .contact-card:hover, .hero-portrait img { transform: none !important; }
}

/* === Keyboard focus (was missing before) === */
a:focus-visible, button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: 2px;
}
