/* ============================================================
   Rakib Hasan — portfolio
   Bricolage Grotesque + Geist Mono, warm paper palette,
   coral accent, light/dark via html.dark
   ============================================================ */

/* ---------- tokens ---------- */
:root {
    --font-sans: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
    --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

    /* light */
    --bg: #f4f1ed;
    --card: #edebe7;
    --fg: #071009;
    --fg-soft: #1b211c;
    --muted: #505851;
    --muted-bg: #e6e4e1;
    --ghost: #c9c5be;
    --border: #d4d0cb;
    --border-soft: #dad7d2;
    --accent: #f94144;
    --accent-deep: #e7000b;
    --accent-soft: #ff6467;
    --green: #4db956;
    --green-soft: #67bb6b;

    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 8px;

    --shadow-card: 0 1px 2px rgba(7, 16, 9, 0.04), 0 6px 20px -6px rgba(7, 16, 9, 0.08);
    --shadow-lift: 0 2px 4px rgba(7, 16, 9, 0.05), 0 14px 34px -10px rgba(7, 16, 9, 0.16);

    --container: 1152px;
}

html.dark {
    --bg: oklch(0.14 0.015 150);
    --card: oklch(0.155 0.014 150);
    --fg: oklch(0.92 0.008 80);
    --fg-soft: oklch(0.82 0.01 80);
    --muted: oklch(0.66 0.012 150);
    --muted-bg: oklch(0.26 0.012 150);
    --ghost: oklch(0.32 0.012 150);
    --border: oklch(0.24 0.012 150);
    --border-soft: oklch(0.21 0.012 150);
    --accent: #ff6467;
    --accent-deep: #ff7a5c;
    --green: #67bb6b;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px -8px rgba(0, 0, 0, 0.45);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.4), 0 16px 40px -12px rgba(0, 0, 0, 0.6);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--fg);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color 0.25s ease, color 0.25s ease;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

::selection { background: var(--accent); color: #fff; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

main { flex: 1 0 auto; }

/* ---------- nav ---------- */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    justify-content: center;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 0;
    pointer-events: none;
}

.nav-pill {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    background: color-mix(in srgb, var(--card) 80%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: var(--shadow-card);
}

.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-icon { width: 16px; height: 16px; flex-shrink: 0; }

.nav-item:hover { background: var(--muted-bg); color: var(--fg); }

.nav-item.active {
    background: var(--muted-bg);
    color: var(--fg);
    font-weight: 500;
}

.nav-divider {
    width: 1px;
    height: 20px;
    margin: 0 4px;
    background: var(--border);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover { background: var(--muted-bg); color: var(--fg); }

.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }

html.dark .theme-toggle .icon-moon { display: none; }
html.dark .theme-toggle .icon-sun { display: block; }

/* ---------- hero ---------- */
.hero {
    display: grid;
    grid-template-columns: minmax(280px, 330px) 1fr;
    gap: 56px;
    align-items: start;
    padding-top: 96px;
    padding-bottom: 96px;
}

/* profile card */
.profile-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    text-align: center;
    transition: box-shadow 0.2s ease;
}

.profile-card:hover { box-shadow: var(--shadow-lift); }

@media (min-width: 1000px) {
    .profile-card { position: sticky; top: 88px; }
}

.photo-wrap {
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 2 / 3;
}

.photo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

html.dark .photo-wrap img {
    filter: brightness(0.92) saturate(0.9);
}

.profile-name {
    margin: 16px 0 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.social-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--accent);
    transition: background-color 0.15s ease;
}

.social-btn:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }

.social-btn svg { width: 18px; height: 18px; }

/* hero text */
.hero-title {
    margin: 0;
    font-size: clamp(2.9rem, 6vw, 3.9rem);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.02;
    color: var(--fg);
}

.hero-title--ghost { color: var(--ghost); }

.hero-bio {
    max-width: 480px;
    margin: 28px 0 0;
    font-size: 1.02rem;
    line-height: 1.7;
    color: var(--muted);
}

/* ---------- skills ---------- */
.skills { margin-top: 34px; }

.skills-label {
    margin: 0 0 14px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.skills-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, max-content);
    gap: 10px;
    justify-content: start;
}

.skill-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--fg-soft);
    box-shadow: var(--shadow-card);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.skill-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }

.skill-icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent); }

/* rotating status line */
.status-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--muted);
    min-height: 1.6em;
}

.status-arrow { color: var(--accent); font-weight: 600; }

.status-item {
    display: inline-block;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.status-item.fade-out { opacity: 0; transform: translateY(4px); }
.status-item.fade-in { opacity: 1; transform: translateY(0); }

/* terminal */
.terminal {
    margin-top: 28px;
    max-width: 560px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    font-family: var(--font-mono);
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-soft);
    background: color-mix(in srgb, var(--card) 92%, var(--fg) 8%);
}

.t-dot { width: 11px; height: 11px; border-radius: 50%; }
.t-red { background: #ff5f57; }
.t-yellow { background: #febc2e; }
.t-green { background: #28c840; }

.terminal-title {
    margin-left: 8px;
    font-size: 0.76rem;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.terminal-body {
    padding: 18px 20px 20px;
    font-size: 0.88rem;
    line-height: 1.9;
    color: var(--fg-soft);
}

.term-line { display: flex; gap: 10px; white-space: pre-wrap; }

.term-prompt { color: var(--green); font-weight: 600; user-select: none; }
.term-prompt--alt { color: var(--accent); }

.term-cursor {
    color: var(--accent);
    animation: blink 1.1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ---------- shipping section ---------- */
.shipping { padding-bottom: 120px; }

.section-title {
    margin: 0 0 40px;
    font-size: clamp(2.2rem, 4.5vw, 3.2rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.section-title span { display: block; }
.section-title--ghost { color: var(--ghost); }

.shipping-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
}

/* feature card */
.feature-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-card);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--green);
    margin-bottom: 18px;
}

.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: var(--green); }
.dot-orange { background: var(--accent); }

.card-title {
    margin: 0 0 14px;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.card-title--sm { font-size: 1.15rem; margin: 0; }

.card-desc {
    margin: 0 0 22px;
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--muted);
    max-width: 52ch;
}

.card-desc--sm { margin-bottom: 18px; }

.feat-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 28px;
    margin-bottom: 26px;
}

.feat-list { list-style: none; margin: 0; padding: 0; }

.feat-list li {
    position: relative;
    padding-left: 16px;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--fg-soft);
    margin-bottom: 10px;
}

.feat-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn svg { width: 15px; height: 15px; }

.btn-solid {
    background: var(--fg);
    color: var(--bg);
}

.btn-solid:hover { opacity: 0.85; transform: translateY(-1px); }

.btn-outline {
    background: transparent;
    color: var(--fg);
    border: 1px solid var(--border);
}

.btn-outline:hover { border-color: var(--fg-soft); transform: translateY(-1px); }

.btn-sm { height: 34px; padding: 0 14px; font-size: 0.85rem; }

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.card-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
    display: inline-block;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--muted);
}

/* side column */
.side-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.building {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.building-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 16px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.building-list { list-style: none; margin: 0; padding: 0; }

.building-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.94rem;
    color: var(--fg-soft);
    border-bottom: 1px solid var(--border-soft);
}

.building-list li:last-child { border-bottom: none; }

/* small cards */
.small-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.small-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }

.small-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.os-tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--muted);
    white-space: nowrap;
}

/* ---------- projects section ---------- */
.projects { padding-top: 96px; padding-bottom: 40px; }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.proj-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 26px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.proj-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }

.proj-key {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.proj-tag {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--green);
}

.proj-name {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.proj-desc {
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.65;
    color: var(--muted);
    flex: 1;
}

.proj-meta {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--muted);
}

.proj-actions { margin-top: 6px; }

/* skeleton / reserved slots */
.proj-card--skeleton {
    border-style: dashed;
    border-color: var(--border);
    box-shadow: none;
    background: transparent;
    min-height: 196px;
    justify-content: center;
}

.proj-card--skeleton:hover { transform: none; box-shadow: none; }

.proj-name--skeleton { color: var(--ghost); }

/* ---------- cta section ---------- */
.cta {
    border-top: 1px solid var(--border);
}

.cta-inner {
    padding-top: 96px;
    padding-bottom: 96px;
}

.cta-title {
    margin: 0 0 20px;
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.05;
    display: flex;
    flex-direction: column;
}

.cta-title--ghost { color: var(--ghost); }

.cta-desc {
    max-width: 420px;
    margin: 0 0 26px;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--muted);
}

.cta-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 22px;
}

.text-link {
    font-size: 0.92rem;
    color: var(--muted);
    transition: color 0.15s ease;
}

.text-link:hover { color: var(--fg); }

/* ---------- footer ---------- */
.footer {
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 26px;
    padding-bottom: 26px;
    font-size: 0.88rem;
    color: var(--muted);
}

.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }

.footer-links a { transition: color 0.15s ease; }
.footer-links a:hover { color: var(--fg); }

/* ---------- reveal on scroll ---------- */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .term-cursor { animation: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 40px;
        padding-top: 104px;
        padding-bottom: 72px;
    }

    .profile-card {
        max-width: 360px;
        margin: 0 auto;
        width: 100%;
    }

    .hero-text { min-width: 0; }

    .shipping-grid { grid-template-columns: 1fr; }
    .side-col { gap: 20px; }
}

@media (max-width: 640px) {
    .nav-label { display: none; } /* icon-only nav on phones, like the original */

    .container { padding-left: 16px; padding-right: 16px; }

    .hero {
        gap: 36px;
        padding-top: 112px;
        padding-bottom: 64px;
    }

    .profile-card { max-width: 100%; }

    .hero-title { font-size: clamp(2.5rem, 11vw, 3rem); }

    .hero-bio { margin-top: 22px; font-size: 0.98rem; }

    .skills-grid {
        display: grid;
        grid-template-columns: repeat(3, max-content);
        gap: 10px;
        justify-content: start;
    }

    .status-line { font-size: 0.78rem; }

    .terminal { margin-top: 24px; }
    .terminal-body { font-size: 0.8rem; padding: 16px 16px 18px; line-height: 1.85; }

    .shipping { padding-bottom: 80px; }
    .section-title { margin-bottom: 28px; }

    .feature-card { padding: 22px; }
    .feat-cols { grid-template-columns: 1fr; }

    .card-actions .btn { flex: 1; justify-content: center; }

    .cta-inner { padding-top: 64px; padding-bottom: 64px; }
    .cta-title { font-size: clamp(2rem, 10vw, 2.6rem); }

    .footer-inner { justify-content: center; text-align: center; }
}
