/* ========================================================
   Fityan Portfolio - Modern Minimal Dark UI
   Direction: cleaner, simpler, less dashboard/glow, content-first.
   ======================================================== */
:root {
    color-scheme: light;
    --bg-color: #f7f8fb;
    --surface: #ffffff;
    --surface-soft: #f1f5f9;
    --text-main: #111827;
    --text-muted: #5b6472;
    --accent-color: #d6a94a;
    --accent-soft: rgba(214, 169, 74, .12);
    --card-bg: #ffffff;
    --nav-bg: rgba(255, 255, 255, .82);
    --border-color: #e2e8f0;
    --shadow: 0 20px 50px rgba(15, 23, 42, .08);
    --shadow-soft: 0 10px 26px rgba(15, 23, 42, .06);
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg-color: #0b0f14;
    --surface: #111820;
    --surface-soft: #151e28;
    --text-main: #f3f7fb;
    --text-muted: #9aa7b5;
    --accent-color: #d6a94a;
    --accent-soft: rgba(214, 169, 74, .12);
    --card-bg: #111820;
    --nav-bg: rgba(11, 15, 20, .82);
    --border-color: rgba(148, 163, 184, .18);
    --shadow: 0 22px 56px rgba(0, 0, 0, .30);
    --shadow-soft: 0 12px 28px rgba(0, 0, 0, .22);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
    min-height: 100vh;
    background: var(--bg-color);
    color: var(--text-main);
    font-family: 'Fira Sans', sans-serif;
    line-height: 1.65;
    overflow-x: hidden;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 0%, var(--accent-soft), transparent 34rem),
        linear-gradient(to bottom, transparent, rgba(148, 163, 184, .035));
}
main, footer, header { position: relative; z-index: 1; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 4px; border-radius: 10px; }

.highlight { color: var(--accent-color); font-weight: 800; letter-spacing: -.035em; }
section { padding: 5.8rem clamp(1.25rem, 6vw, 8rem); }
.section-title {
    width: min(1120px, 100%);
    margin: 0 auto 2.25rem;
    color: var(--text-main);
    font-size: clamp(1.9rem, 3.5vw, 2.85rem);
    line-height: 1.08;
    letter-spacing: -.045em;
    text-align: left;
}
.section-title::after {
    content: "";
    display: block;
    width: 72px;
    height: 3px;
    margin-top: .9rem;
    border-radius: 999px;
    background: var(--accent-color);
}

/* Header */
header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.nav-container {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 1rem clamp(1rem, 3vw, 1.5rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}
.brand .name {
    font-family: 'Fira Code', monospace;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -.03em;
}
nav { display: flex; align-items: center; gap: 1rem; }
.nav-links { display: flex; align-items: center; gap: 1.15rem; }
.nav-links li a {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    padding: .45rem .62rem;
    border-radius: 999px;
    color: var(--text-muted);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    overflow: hidden;
    transition: color .24s ease, transform .24s ease;
}
.nav-links li a::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--accent-soft), rgba(214, 169, 74, .22));
    opacity: 0;
    transform: scaleX(.25);
    transform-origin: left;
    transition: transform .32s cubic-bezier(.2, .8, .2, 1), opacity .24s ease;
}
.nav-links li a::after {
    content: "";
    position: absolute;
    left: .62rem;
    right: .62rem;
    bottom: .3rem;
    height: 2px;
    border-radius: 999px;
    background: var(--accent-color);
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .32s cubic-bezier(.2, .8, .2, 1), opacity .2s ease;
}
.nav-links li a:hover,
.nav-links li a.active,
.nav-links li a.is-clicking {
    color: var(--accent-color);
    transform: translateY(-1px);
}
.nav-links li a:hover::before,
.nav-links li a.active::before,
.nav-links li a.is-clicking::before {
    opacity: 1;
    transform: scaleX(1);
}
.nav-links li a:hover::after,
.nav-links li a.active::after,
.nav-links li a.is-clicking::after {
    opacity: 1;
    transform: scaleX(1);
}
.nav-links li a:active { transform: translateY(0) scale(.97); }
#theme-toggle {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-main);
    cursor: pointer;
    transition: border-color .18s ease, color .18s ease, transform .18s ease;
}
#theme-toggle:hover { border-color: var(--accent-color); color: var(--accent-color); transform: translateY(-1px); }

/* Hero */
.hero {
    width: min(1120px, 100%);
    min-height: 100svh;
    margin: 0 auto;
    padding-top: 8rem;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(280px, .72fr);
    align-items: center;
    gap: clamp(2rem, 6vw, 4.5rem);
}
.hero-content { padding-right: 0; }
.hero-eyebrow {
    display: inline-flex;
    margin-bottom: 1.1rem;
    padding: .38rem .65rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-muted);
    font-family: 'Fira Code', monospace;
    font-size: .78rem;
    font-weight: 600;
}
.hero-content h1 {
    max-width: 780px;
    margin-bottom: 1rem;
    font-size: clamp(2.85rem, 6.5vw, 5.35rem);
    line-height: 1.02;
    letter-spacing: -.045em;
}
.hero-content h2 {
    margin-bottom: 1.35rem;
    color: var(--text-main);
    font-size: clamp(1.18rem, 2vw, 1.55rem);
    font-weight: 600;
}
.hero-content p {
    max-width: 710px;
    margin-bottom: 2rem;
    color: var(--text-muted);
    font-size: clamp(1rem, 1.35vw, 1.1rem);
    line-height: 1.85;
}
.hero-content p strong { color: var(--text-main); font-weight: 700; }
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: .85rem 1.15rem;
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    background: var(--accent-color);
    color: var(--bg-color);
    font-weight: 800;
    transition: transform .18s ease, filter .18s ease;
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.05); }
.hero-image { display: flex; justify-content: flex-end; }
.hero-image img {
    width: min(360px, 100%);
    height: auto;
    display: block;
    object-fit: contain;
    object-position: center top;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    box-shadow: var(--shadow);
    filter: saturate(.96) contrast(1.02);
}

/* Experience */
.timeline {
    width: min(820px, 100%);
    margin: 0 auto;
    padding-left: 1.6rem;
    border-left: 1px solid var(--border-color);
}
.timeline-item { position: relative; margin-bottom: 1.3rem; }
.timeline-dot {
    position: absolute;
    left: -2.05rem;
    top: 1.3rem;
    width: 12px;
    height: 12px;
    border: 2px solid var(--bg-color);
    border-radius: 50%;
    background: var(--accent-color);
}
.timeline-content {
    padding: 1.4rem;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--card-bg);
    box-shadow: var(--shadow-soft);
}
.timeline-content h3 { color: var(--text-main); font-size: 1.18rem; }
.timeline-content h4 { color: var(--accent-color); font-size: .96rem; font-weight: 700; margin: .15rem 0 .8rem; }
.timeline-content p { color: var(--text-muted); }

/* Projects & Articles */
.project-grid {
    width: min(1120px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.project-card,
.article-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 100%;
    padding: 1.35rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--card-bg);
    box-shadow: var(--shadow-soft);
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.project-card { cursor: pointer; }
.project-card:hover,
.article-card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--accent-color) 54%, var(--border-color));
    background: color-mix(in srgb, var(--card-bg) 92%, var(--accent-color) 8%);
}
.card-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 1.1rem;
    border-radius: 14px;
    background: var(--surface-soft);
    color: var(--accent-color);
    font-size: 1.25rem;
}
.project-card h3,
.article-card h3 {
    margin-bottom: .75rem;
    color: var(--text-main);
    font-size: 1.15rem;
    line-height: 1.28;
    letter-spacing: -.025em;
}
.project-card p,
.article-card p {
    flex-grow: 1;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: .94rem;
    line-height: 1.68;
}
.project-card span[style*="font-size: 0.75rem"],
.article-card .article-date {
    font-family: 'Fira Code', monospace !important;
    border-radius: 999px !important;
}
.project-link-btn {
    position: relative;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: .5rem .82rem;
    margin-top: .25rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: transparent;
    color: var(--text-main);
    font-size: .84rem;
    font-weight: 800;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.project-link-btn:hover {
    border-color: var(--accent-color);
    background: var(--accent-color);
    color: var(--bg-color);
}
.article-card .article-date {
    display: inline-flex !important;
    background: var(--surface-soft) !important;
    color: var(--accent-color) !important;
    border: 1px solid var(--border-color) !important;
}

/* Skills */
.skills-container {
    width: min(900px, 100%);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .75rem;
}
.skill-tag {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    min-height: 46px;
    padding: .75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--card-bg);
    color: var(--text-main);
    font-weight: 700;
    transition: transform .18s ease, border-color .18s ease, color .18s ease;
}
.skill-tag i { color: var(--accent-color); }
.skill-tag:hover { transform: translateY(-2px); border-color: var(--accent-color); color: var(--accent-color); }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content {
    position: relative;
    width: min(720px, 100%);
    max-height: 90vh;
    overflow: auto;
    padding: clamp(1.35rem, 4vw, 2.35rem);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
    transform: translateY(20px);
    transition: transform .2s ease;
}
.modal-overlay.active .modal-content { transform: translateY(0); }
.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--text-main);
    cursor: pointer;
}
.close-modal:hover { color: var(--accent-color); border-color: var(--accent-color); }
#modal-title {
    margin: 0 3rem 1.4rem 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: clamp(1.35rem, 3vw, 1.9rem);
    letter-spacing: -.035em;
}
.modal-section { margin-bottom: 1.15rem; }
.modal-section h3 { display: flex; align-items: center; gap: .55rem; margin-bottom: .35rem; color: var(--accent-color); font-size: 1rem; }
.modal-section p { color: var(--text-muted); line-height: 1.72; }

/* Contact & Footer */
#contact { text-align: center; }
#contact .section-title { text-align: center; }
#contact .section-title::after { margin-left: auto; margin-right: auto; }
.contact-links {
    width: min(980px, 100%);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: .85rem;
    flex-wrap: wrap;
}
.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    min-height: 46px;
    padding: .85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--card-bg);
    color: var(--text-main);
    font-weight: 700;
    transition: transform .18s ease, color .18s ease, border-color .18s ease;
}
.contact-btn i { color: var(--accent-color); }
.contact-btn:hover { transform: translateY(-2px); color: var(--accent-color); border-color: var(--accent-color); }
footer {
    padding: 2rem 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    text-align: center;
    background: var(--surface);
}

/* Taste skill pass: editorial dark portfolio refinement */
[data-theme="dark"] {
    --bg-color: #080b0f;
    --surface: #0f151c;
    --surface-soft: #151b23;
    --card-bg: rgba(15, 21, 28, .78);
    --text-muted: #a6afba;
    --border-color: rgba(214, 169, 74, .16);
    --shadow: 0 28px 80px rgba(0, 0, 0, .38);
    --shadow-soft: 0 14px 36px rgba(0, 0, 0, .22);
}
body::before {
    background:
        radial-gradient(circle at 16% -8%, rgba(214, 169, 74, .16), transparent 30rem),
        radial-gradient(circle at 88% 12%, rgba(255, 255, 255, .055), transparent 24rem),
        linear-gradient(135deg, transparent 0 49%, rgba(214, 169, 74, .035) 49% 50%, transparent 50% 100%);
}
header {
    border-bottom-color: rgba(214, 169, 74, .13);
}
.nav-container {
    padding-top: .82rem;
    padding-bottom: .82rem;
}
.brand .name {
    color: var(--accent-color);
}
.hero {
    min-height: 100dvh;
    padding-top: 6.4rem;
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, .58fr);
}
.hero-content,
.hero-image {
    animation: tasteReveal .72s cubic-bezier(.16, 1, .3, 1) both;
}
.hero-image { animation-delay: .12s; }
.hero-eyebrow {
    background: rgba(214, 169, 74, .07);
    color: color-mix(in srgb, var(--accent-color) 78%, var(--text-main));
}
.hero-content h1 {
    max-width: 720px;
    font-size: clamp(2.75rem, 6vw, 5rem);
}
.hero-content h2 {
    color: var(--accent-color);
    letter-spacing: -.015em;
}
.hero-content p {
    max-width: 62ch;
    line-height: 1.78;
}
.btn-primary,
.contact-btn,
.project-link-btn {
    transition: transform .22s cubic-bezier(.16, 1, .3, 1), filter .22s ease, background .22s ease, color .22s ease, border-color .22s ease;
}
.btn-primary {
    box-shadow: 0 14px 32px rgba(214, 169, 74, .18);
}
.hero-image {
    position: relative;
}
.hero-image::before {
    content: "";
    position: absolute;
    inset: -16px 18px 18px -16px;
    border: 1px solid rgba(214, 169, 74, .18);
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(214, 169, 74, .08), transparent 52%);
    pointer-events: none;
}
.hero-image img {
    position: relative;
    width: min(340px, 100%);
    border-color: rgba(214, 169, 74, .20);
}
.section-title {
    margin-bottom: 2rem;
}
.timeline-content,
.project-card,
.article-card,
.skill-tag,
.contact-btn {
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.project-grid {
    gap: 1.05rem;
}
.project-card,
.article-card {
    overflow: hidden;
}
.project-card::before,
.article-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(214, 169, 74, .10), transparent 42%);
    opacity: 0;
    transition: opacity .22s ease;
    pointer-events: none;
}
.project-card:hover::before,
.article-card:hover::before {
    opacity: 1;
}
.project-card:hover,
.article-card:hover,
.skill-tag:hover,
.contact-btn:hover {
    transform: translateY(-3px);
}
.card-icon {
    border: 1px solid rgba(214, 169, 74, .14);
    background: rgba(214, 169, 74, .08);
}
@keyframes tasteReveal {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}

/* Responsive */
@media (max-width: 1040px) {
    .hero { grid-template-columns: 1fr; text-align: left; padding-top: 7.5rem; min-height: auto; }
    .hero-image { justify-content: flex-start; }
    .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    .nav-container { padding: .85rem 1rem; }
    .nav-links { display: none; }
    section { padding: 4.5rem 1rem; }
    .hero { padding-top: 7rem; }
    .hero-content h1 { font-size: clamp(2.55rem, 12vw, 3.8rem); line-height: 1.04; }
    .hero-image img { width: min(320px, 100%); }
    .hero-image::before { inset: -10px 12px 12px -10px; }
    .project-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .btn-primary, .contact-btn { width: 100%; justify-content: center; }
    .project-card, .article-card { border-radius: 18px; padding: 1.15rem; }
    .contact-links { align-items: stretch; }
}


/* Positioning pass: Data Analyst + Data Scientist clarity */
.section-intro {
    width: min(1120px, 100%);
    margin: -1rem auto 2rem;
    max-width: 68ch;
    color: var(--text-muted);
    font-size: 1.02rem;
    line-height: 1.75;
}
.skill-groups {
    width: min(980px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 1.15rem;
}
.skill-group {
    padding: 1.2rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--card-bg);
    box-shadow: var(--shadow-soft);
}
.skill-group h3 {
    margin-bottom: .85rem;
    color: var(--accent-color);
    font-size: 1.05rem;
    letter-spacing: -.02em;
}
.skill-group .skills-container {
    width: 100%;
    justify-content: flex-start;
}
@media (max-width: 820px) {
    .section-intro { margin-top: -.75rem; }
    .skill-group { padding: 1rem; }
}


/* Portfolio positioning update: role tracks and CV buttons */
.section-intro {
    width: min(1120px, 100%);
    margin: -1.25rem auto 2rem;
    color: var(--text-muted);
    font-size: 1.02rem;
    line-height: 1.75;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
}
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: .85rem 1.05rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text-main);
    font-weight: 800;
    transition: transform .18s ease, color .18s ease, border-color .18s ease, background .18s ease;
}
.btn-secondary:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: var(--accent-soft);
}
.role-fit-grid {
    width: min(1120px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.role-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .85rem;
    padding: 1.35rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--card-bg);
    box-shadow: var(--shadow-soft);
}
.role-card h3 {
    color: var(--text-main);
    font-size: 1.1rem;
    line-height: 1.3;
    letter-spacing: -.025em;
}
.role-card p {
    color: var(--text-muted);
    font-size: .94rem;
    line-height: 1.68;
    flex: 1;
}
@media (max-width: 860px) {
    .role-fit-grid { grid-template-columns: 1fr; }
    .hero-actions { align-items: stretch; }
    .hero-actions a { width: 100%; }
}
