/* ====================================================================
   RONI DAS — PORTFOLIO
   Design direction: a developer's editor, not a template.
   Palette pulls from Sylhet's tea hills (deep green) and early light
   on a terminal screen (warm amber) instead of the usual violet glow.
   ==================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* --- surfaces --- */
    --bg: #0f1512;
    --bg-alt: #121a16;
    --surface: #17201b;
    --surface-hi: #1d2921;
    --border: rgba(232, 180, 92, 0.14);
    --border-hi: rgba(232, 180, 92, 0.4);

    /* --- ink --- */
    --ink: #eef2ee;
    --ink-dim: #a6b5ac;
    --ink-faint: #6f7f76;

    /* --- accents --- */
    --amber: #e8b45c;
    --amber-soft: rgba(232, 180, 92, 0.12);
    --teal: #4fb286;
    --teal-soft: rgba(79, 178, 134, 0.12);
    --rose: #d97b6c;

    /* --- type --- */
    --serif: 'Fraunces', Georgia, serif;
    --mono: 'JetBrains Mono', 'SF Mono', monospace;
    --sans: 'Inter', -apple-system, sans-serif;

    /* --- misc --- */
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse 800px 500px at 15% -10%, rgba(79, 178, 134, 0.10), transparent),
        radial-gradient(ellipse 700px 500px at 100% 20%, rgba(232, 180, 92, 0.07), transparent);
    background-attachment: fixed;
}

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

::selection { background: var(--amber); color: #14180f; }

:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 3px;
    border-radius: 4px;
}

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--teal);
    letter-spacing: 0.02em;
    margin-bottom: 14px;
}
.eyebrow::before { content: '›'; color: var(--amber); font-weight: 700; }

/* ==================== NAVIGATION ==================== */
nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    background: rgba(15, 21, 18, 0.82);
    backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--serif);
    font-size: 1.35rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--ink);
    display: flex;
    align-items: baseline;
    gap: 6px;
    transition: color 0.25s var(--ease);
}
.logo span { font-family: var(--mono); font-size: 0.7rem; color: var(--amber); font-weight: 500; }
.logo:hover { color: var(--teal); }

.nav-links {
    display: flex;
    list-style: none;
    gap: 4px;
    font-family: var(--mono);
    font-size: 0.85rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--ink-dim);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.nav-links a:hover { color: var(--ink); background: var(--surface-hi); }

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 6px;
}
.hamburger span { width: 22px; height: 2px; background: var(--amber); border-radius: 2px; transition: transform 0.25s var(--ease), opacity 0.25s var(--ease); }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile {
    display: none;
    list-style: none;
    flex-direction: column;
    padding: 8px 24px 18px;
    font-family: var(--mono);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
}
.nav-mobile.open { display: flex; }
.nav-mobile a { display: block; padding: 10px 4px; color: var(--ink-dim); text-decoration: none; }
.nav-mobile a:hover { color: var(--amber); }

/* ==================== HERO ==================== */
#home {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 140px 0 80px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 56px;
    align-items: center;
}

.hero-text h1 {
    font-family: var(--serif);
    font-size: clamp(2.6rem, 5vw, 4.2rem);
    font-weight: 600;
    line-height: 1.05;
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}
.hero-text h1 em {
    font-style: italic;
    color: var(--amber);
}

.hero-text .lede {
    color: var(--ink-dim);
    font-size: 1.08rem;
    max-width: 46ch;
    margin-bottom: 32px;
}

.hero-text .lede strong { color: var(--ink); font-weight: 600; }

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 36px; }

.btn {
    font-family: var(--sans);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 13px 26px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn-primary { background: var(--amber); color: #17140a; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -10px rgba(232, 180, 92, 0.45); }
.btn-outline { border-color: var(--border-hi); color: var(--ink); }
.btn-outline:hover { background: var(--surface-hi); transform: translateY(-2px); }

.social-row { display: flex; gap: 10px; }
.social-row a {
    width: 42px; height: 42px;
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--ink-dim);
    text-decoration: none;
    transition: all 0.25s var(--ease);
}
.social-row a:hover { border-color: var(--teal); color: var(--teal); transform: translateY(-3px); }
.social-row svg { width: 17px; height: 17px; }

/* --- hero "editor window" photo frame --- */
.editor-frame {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    max-width: 380px;
    margin: 0 auto;
}
.editor-titlebar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--surface-hi);
    border-bottom: 1px solid var(--border);
}
.editor-titlebar .dot { width: 10px; height: 10px; border-radius: 50%; }
.editor-titlebar .dot:nth-child(1) { background: #e8626255; border: 1px solid #e86262aa; }
.editor-titlebar .dot:nth-child(2) { background: #e8b45c55; border: 1px solid var(--amber); }
.editor-titlebar .dot:nth-child(3) { background: #4fb28655; border: 1px solid var(--teal); }
.editor-titlebar .filename { margin-left: 8px; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-faint); }
.editor-photo { aspect-ratio: 1/1; background: linear-gradient(160deg, var(--surface-hi), var(--bg-alt)); overflow: hidden; }
.editor-photo img { width: 100%; height: 100%; object-fit: cover; }
.editor-caption { padding: 10px 16px; font-family: var(--mono); font-size: 0.72rem; color: var(--ink-faint); border-top: 1px solid var(--border); }
.editor-caption .ok { color: var(--teal); }

/* ==================== SECTION SHELL ==================== */
.section { padding: 110px 0; position: relative; }
.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head h2 {
    font-family: var(--serif);
    font-size: clamp(2rem, 3.6vw, 2.9rem);
    font-weight: 600;
    letter-spacing: -0.01em;
}
.section-head p { color: var(--ink-dim); margin-top: 10px; font-size: 1.05rem; }

#about { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* ==================== ABOUT — clickable file list ==================== */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.about-card {
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    cursor: pointer;
    font-family: var(--sans);
    color: inherit;
    transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), background 0.25s var(--ease);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}
.about-card:hover, .about-card:focus-visible {
    border-color: var(--border-hi);
    background: var(--surface-hi);
    transform: translateY(-4px);
}
.about-card .card-top { display: flex; align-items: center; justify-content: space-between; }
.about-card .icon { font-size: 1.5rem; }
.about-card h3 { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
.about-card p { color: var(--ink-dim); font-size: 0.94rem; line-height: 1.6; }
.about-card .expand-hint {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--teal);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 6px;
}
.about-card .expand-hint svg { width: 12px; height: 12px; transition: transform 0.25s var(--ease); }
.about-card:hover .expand-hint svg { transform: translateX(3px); }

/* ==================== MODAL — an "opened file" ==================== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(10, 13, 11, 0.72);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
    width: 100%;
    max-width: 640px;
    max-height: 84vh;
    background: var(--surface);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(16px) scale(0.98);
    transition: transform 0.3s var(--ease);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }

.modal-titlebar {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px;
    background: var(--surface-hi);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.modal-titlebar .dot { width: 10px; height: 10px; border-radius: 50%; }
.modal-titlebar .dot:nth-child(1) { background: #e86262aa; }
.modal-titlebar .dot:nth-child(2) { background: var(--amber); }
.modal-titlebar .dot:nth-child(3) { background: var(--teal); }
.modal-titlebar .path { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-faint); margin-left: 6px; }
.modal-close {
    margin-left: auto;
    background: none; border: none; color: var(--ink-dim);
    font-family: var(--mono); font-size: 1rem; cursor: pointer;
    width: 28px; height: 28px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.modal-close:hover { background: var(--border); color: var(--ink); }

.modal-body { padding: 30px 32px 34px; overflow-y: auto; }
.modal-body .icon { font-size: 1.8rem; margin-bottom: 10px; display: block; }
.modal-body h3 { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; margin-bottom: 16px; }
.modal-body p { color: var(--ink-dim); margin-bottom: 14px; line-height: 1.75; }
.modal-body ul { list-style: none; margin: 4px 0 14px; }
.modal-body li { color: var(--ink-dim); padding: 6px 0 6px 20px; position: relative; line-height: 1.6; }
.modal-body li::before { content: '→'; position: absolute; left: 0; color: var(--amber); }
.modal-body .tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.modal-body .tag {
    font-family: var(--mono); font-size: 0.72rem;
    background: var(--teal-soft); color: var(--teal);
    border: 1px solid rgba(79,178,134,0.3);
    padding: 5px 10px; border-radius: 20px;
}

body.modal-locked { overflow: hidden; }

/* ==================== PROJECTS ==================== */
.projects-list { display: flex; flex-direction: column; gap: 28px; }

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 44px;
    align-items: center;
    transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.project-card:hover { border-color: var(--border-hi); transform: translateY(-3px); }

/* Real project screenshots are ~1350x650 (roughly 2.08:1) — the frame is
   sized to that ratio and sits inset in its own card, not stretched
   full-bleed, so nothing gets cropped or distorted. */
.project-media {
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1350 / 650;
    border: 1px solid var(--border);
    background: linear-gradient(150deg, var(--teal-soft), var(--amber-soft));
    box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.55);
}
.project-media img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }

.project-info .kicker { font-family: var(--mono); font-size: 0.75rem; color: var(--amber); margin-bottom: 8px; display: block; }
.project-info h3 { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; margin-bottom: 12px; }
.project-info p { color: var(--ink-dim); margin-bottom: 18px; line-height: 1.75; max-width: 46ch; }
.tech-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tech-badge {
    font-family: var(--mono); font-size: 0.75rem;
    background: var(--surface-hi); color: var(--ink-dim);
    border: 1px solid var(--border);
    padding: 5px 12px; border-radius: 20px;
}
.project-link {
    font-family: var(--sans); font-weight: 600; font-size: 0.92rem;
    color: var(--teal); text-decoration: none;
    display: inline-flex; align-items: center; gap: 6px;
}
.project-link:hover { color: var(--amber); }

/* ==================== EXPERIENCE — commit log ==================== */
.log { max-width: 760px; margin: 0 auto; position: relative; }
.log::before {
    content: '';
    position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px;
    background: linear-gradient(var(--teal), var(--amber));
    opacity: 0.35;
}
.log-item { position: relative; padding-left: 34px; margin-bottom: 30px; }
.log-item:last-child { margin-bottom: 0; }
.log-dot {
    position: absolute; left: 0; top: 6px;
    width: 15px; height: 15px; border-radius: 50%;
    background: var(--bg-alt);
    border: 2px solid var(--teal);
}
.log-item:first-child .log-dot { border-color: var(--amber); background: var(--amber); }
.log-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.log-card:hover { border-color: var(--border-hi); transform: translateX(4px); }
.log-meta {
    font-family: var(--mono); font-size: 0.78rem; color: var(--teal);
    display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px;
}
.log-meta .org a { color: var(--ink-dim); text-decoration: underline; text-decoration-color: var(--border-hi); text-underline-offset: 3px; }
.log-meta .org a:hover { color: var(--amber); }
.log-card h4 { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; margin-bottom: 8px; }
.log-card p { color: var(--ink-dim); font-size: 0.94rem; line-height: 1.65; }

/* ==================== CONTACT ==================== */
#contact { background: var(--bg-alt); border-top: 1px solid var(--border); }
.contact-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 48px; }
.contact-block { margin-bottom: 26px; }
.contact-block .label { font-family: var(--mono); font-size: 0.78rem; color: var(--amber); display: block; margin-bottom: 6px; }
.contact-block a, .contact-block p { color: var(--ink-dim); text-decoration: none; }
.contact-block a:hover { color: var(--teal); }
.contact-block .links { display: flex; gap: 6px; flex-wrap: wrap; color: var(--ink-dim); }
.contact-block .links a { color: var(--ink-dim); }
.contact-block .links span { color: var(--ink-faint); }

.contact-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px;
}
.field { margin-bottom: 16px; }
.field input, .field textarea {
    width: 100%;
    padding: 13px 15px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--ink);
    border-radius: var(--radius-sm);
    font-family: var(--sans);
    font-size: 0.95rem;
    resize: none;
    transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-faint); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--teal); background: var(--surface-hi); }
.contact-form .btn-primary { width: 100%; justify-content: center; margin-top: 4px; }

/* ==================== FOOTER ==================== */
footer { border-top: 1px solid var(--border); padding: 56px 0 30px; background: var(--bg); }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 30px; flex-wrap: wrap; margin-bottom: 40px; }
.footer-brand h2 { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; }
.footer-brand p { color: var(--ink-dim); margin-top: 6px; }
.footer-brand .fmail { color: var(--ink-faint); font-family: var(--mono); font-size: 0.85rem; margin-top: 14px; display: inline-flex; gap: 8px; align-items: center; text-decoration: none; }
.footer-brand .fmail:hover { color: var(--teal); }
.footer-socials { display: flex; gap: 10px; }
.footer-socials a {
    width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--ink-dim); text-decoration: none;
    transition: all 0.25s var(--ease);
}
.footer-socials a:hover { border-color: var(--teal); color: var(--teal); transform: translateY(-3px); }
.footer-socials svg { width: 18px; height: 18px; }
.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 22px;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
    font-family: var(--mono); font-size: 0.78rem; color: var(--ink-faint);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 860px) {
    .hero-grid { grid-template-columns: 1fr; }
    .editor-frame { max-width: 320px; }
    .project-card { grid-template-columns: 1fr; padding: 28px; gap: 24px; }
    .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }
    .section { padding: 76px 0; }
    #home { padding: 120px 0 60px; }
}

@media (max-width: 480px) {
    .container { padding: 0 18px; }
    .btn { width: 100%; justify-content: center; }
    .cta-row { flex-direction: column; }
    .modal-body { padding: 24px 20px 28px; }
}