/* ==========================================================================
   Daerfe — index3 redesign (v3: personal hero with blended photo)
   ========================================================================== */

:root {
    --bg: #0a0f1c;
    --bg-soft: #0f172a;
    --surface: #131c30;
    --surface-2: #1b2740;
    --border: #25324d;
    --text: #e6ecf5;
    --muted: #9aa8c2;
    --faint: #6b7a99;
    --accent: #5b8cff;
    --accent-2: #8b6bff;
    --amber: #f59e0b;
    --radius: 16px;
    --maxw: 1080px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3 { font-family: 'Space Grotesk', 'Inter', sans-serif; line-height: 1.15; }

a { color: var(--accent); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: #9ab6ff; }

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

.skip-link {
    position: absolute; left: -9999px; top: 0;
    background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 1000;
}
.skip-link:focus { left: 0; }

/* ---------- Nav ---------- */
.site-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s var(--ease);
    border-bottom: 1px solid transparent;
}
.site-nav.scrolled {
    background: rgba(10, 15, 28, 0.82);
    backdrop-filter: blur(14px);
    border-bottom-color: var(--border);
}
.nav-inner {
    max-width: var(--maxw); margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px;
}
.brand {
    display: inline-flex; align-items: center; gap: 9px;
    font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.25rem;
    color: var(--text); letter-spacing: 0.5px;
}
.brand:hover { color: var(--text); }
.brand-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 14px rgba(91, 140, 255, 0.7);
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
    color: var(--muted); font-size: 0.95rem; font-weight: 500; position: relative;
}
.nav-links a:not(.nav-cta)::after {
    content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 0.25s var(--ease);
}
.nav-links a:not(.nav-cta):hover,
.nav-links a.active { color: var(--text); }
.nav-links a.active::after { width: 100%; }
.nav-cta {
    padding: 8px 18px; border-radius: 999px; color: var(--text) !important;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    font-weight: 600;
}
.nav-cta:hover { filter: brightness(1.1); }

.nav-toggle {
    display: none; flex-direction: column; gap: 5px; background: none; border: 0;
    cursor: pointer; padding: 8px;
}
.nav-toggle span {
    width: 24px; height: 2px; background: var(--text); border-radius: 2px;
    transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero (with blended photo) ---------- */
.hero {
    position: relative; min-height: 100vh;
    display: flex; flex-direction: column; justify-content: center;
    padding: 120px 24px 80px;
    overflow: hidden;
}

/* Photo of Dan in the mountains — grayscale, blended into the bg via gradients.
   Sits on the right; the left/bottom fade to --bg so the text stays readable. */
.hero-photo {
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: url("header_wide_776.webp") no-repeat;
    background-position: right 18% center;
    background-size: cover;
    /* Photo itself is essentially greyscale; the colour comes from the
       blue/purple v2 tint layer below rather than the original image. */
    filter: grayscale(0.92) contrast(1.05) brightness(0.92);
    /* Let the dark background show through a little so the photo sits back. */
    opacity: 0.6;
}
/* Duotone tint — pushes the photo toward the v2 blue → purple palette. */
.hero-photo::before {
    content: ""; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(120deg,
        rgba(91, 140, 255, 0.55) 0%,
        rgba(139, 107, 255, 0.42) 58%,
        rgba(245, 158, 11, 0.16) 100%);
    mix-blend-mode: soft-light;
}
.hero-photo::after {
    content: ""; position: absolute; inset: 0; z-index: 2;
    background:
        linear-gradient(90deg,
            var(--bg) 0%,
            rgba(10, 15, 28, 0.90) 30%,
            rgba(13, 19, 42, 0.42) 62%,
            rgba(15, 21, 46, 0.26) 80%,
            rgba(10, 15, 28, 0.52) 100%),
        linear-gradient(180deg,
            rgba(10, 15, 28, 0.82) 0%,
            transparent 24%,
            transparent 58%,
            var(--bg) 100%);
}

.hero-glow {
    position: absolute; inset: 0; z-index: 3; pointer-events: none;
    background:
        radial-gradient(55% 50% at 18% 20%, rgba(91, 140, 255, 0.32), transparent 70%),
        radial-gradient(48% 48% at 82% 72%, rgba(139, 107, 255, 0.26), transparent 70%);
    mix-blend-mode: screen;
}
.hero-inner { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; width: 100%; }
.eyebrow {
    text-transform: uppercase; letter-spacing: 0.28em; font-size: 0.8rem;
    color: var(--accent); font-weight: 600; margin: 0 0 18px;
}
.hero-title {
    font-size: clamp(2.8rem, 8vw, 5.5rem); margin: 0; font-weight: 700; letter-spacing: -1px;
    background: linear-gradient(180deg, #ffffff, #b9c6e6);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-role {
    font-size: clamp(1.15rem, 2.4vw, 1.6rem); color: var(--text); font-weight: 600;
    margin: 12px 0 0;
}
.hero-tagline {
    max-width: 560px; color: var(--muted); font-size: 1.08rem; margin: 22px 0 0;
    text-shadow: 0 1px 18px rgba(10, 15, 28, 0.8);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: 0.98rem;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
    border: 1px solid transparent; cursor: pointer;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
    box-shadow: 0 10px 30px rgba(91, 140, 255, 0.32);
}
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 14px 38px rgba(91, 140, 255, 0.45); }
.btn-ghost { background: rgba(10, 15, 28, 0.35); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }

.hero-stats {
    display: flex; flex-wrap: wrap; gap: 36px; margin: 48px 0 0;
}
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats dt {
    font-family: 'Space Grotesk', sans-serif; font-size: 1.7rem; font-weight: 700; color: var(--text);
}
.hero-stats dd { margin: 2px 0 0; color: var(--faint); font-size: 0.9rem; }

.scroll-cue {
    position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
    z-index: 2; color: var(--muted); font-size: 1.3rem;
    width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(10, 15, 28, 0.35);
    animation: bob 2s ease-in-out infinite;
}
.scroll-cue:hover { color: var(--text); border-color: var(--accent); }
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 7px); } }

/* ---------- Sections ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 96px 24px; }
.section-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 18px; }
.section-index {
    font-family: 'Space Grotesk', sans-serif; font-size: 0.95rem; font-weight: 600;
    color: var(--accent); opacity: 0.8;
}
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0; }
.section-intro { max-width: 640px; color: var(--muted); margin: 0 0 44px; font-size: 1.05rem; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: start; }
.about-text p { color: var(--muted); margin: 0 0 18px; font-size: 1.06rem; }
.about-card {
    margin: 0; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}
.about-card img {
    width: 140px; height: 140px; object-fit: cover; border-radius: 50%; margin: 0 auto 16px;
    border: 3px solid var(--surface-2); box-shadow: 0 0 0 1px var(--border);
}
.about-card figcaption { display: flex; flex-direction: column; gap: 2px; }
.about-card strong { color: var(--text); font-size: 1.05rem; }
.about-card span { color: var(--faint); font-size: 0.9rem; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
    content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2), transparent);
}
.timeline-item {
    position: relative; padding: 0 0 36px 40px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
    content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px;
    border-radius: 50%; background: var(--bg);
    border: 3px solid var(--accent); box-shadow: 0 0 12px rgba(91, 140, 255, 0.6);
}
.timeline-period {
    display: inline-block; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--accent);
    background: rgba(91, 140, 255, 0.1); border: 1px solid var(--border);
    padding: 3px 12px; border-radius: 999px; margin-bottom: 10px;
}
.timeline-body h3 { margin: 0; font-size: 1.2rem; color: var(--text); }
.timeline-org { margin: 2px 0 8px; color: var(--accent-2); font-weight: 500; font-style: italic; }
.timeline-body p:last-child { margin: 0; color: var(--muted); }

/* ---------- Skills ---------- */
.skill-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.skill-group {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px; transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.skill-group:hover { transform: translateY(-3px); border-color: var(--accent); }
.skill-group h3 { margin: 0 0 16px; font-size: 1.05rem; color: var(--text); }
.skill-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 9px; }
.skill-tags li {
    padding: 7px 15px; border-radius: 999px; font-size: 0.9rem; color: var(--text);
    background: var(--surface-2); border: 1px solid var(--border);
    transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.skill-group:hover .skill-tags li { background: rgba(91, 140, 255, 0.12); }

/* ---------- Projects ---------- */
.project-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.project-card {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
    padding: 34px 24px 26px; border-radius: var(--radius);
    background: linear-gradient(180deg, var(--surface), var(--bg-soft));
    border: 1px solid var(--border); color: var(--text);
    transition: transform 0.28s var(--ease), border-color 0.28s var(--ease), box-shadow 0.28s var(--ease);
    position: relative; overflow: hidden;
}
.project-card::before {
    content: ""; position: absolute; inset: 0; opacity: 0;
    background: radial-gradient(70% 60% at 50% 0%, rgba(91, 140, 255, 0.18), transparent 70%);
    transition: opacity 0.3s var(--ease);
}
.project-card:hover {
    transform: translateY(-6px); border-color: var(--accent); color: var(--text);
    box-shadow: 0 24px 50px rgba(0,0,0,0.45);
}
.project-card:hover::before { opacity: 1; }
.project-logo {
    display: flex; align-items: center; justify-content: center; height: 64px; margin-bottom: 6px;
    color: #e6ecf5; position: relative; z-index: 1;
}
.project-logo svg { display: block; height: 100%; width: auto; max-width: 210px; }
.project-name { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 1.15rem; position: relative; z-index: 1; }
.project-desc { font-size: 0.92rem; color: var(--muted); position: relative; z-index: 1; }
.project-go {
    margin-top: 6px; font-size: 0.85rem; font-weight: 600; color: var(--accent);
    opacity: 0; transform: translateY(6px); transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
    position: relative; z-index: 1;
}
.project-card:hover .project-go { opacity: 1; transform: translateY(0); }

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact-card {
    max-width: 680px; margin: 0 auto; padding: 56px 36px; border-radius: 24px;
    background: linear-gradient(180deg, var(--surface), var(--bg-soft));
    border: 1px solid var(--border); position: relative; overflow: hidden;
    box-shadow: 0 30px 70px rgba(0,0,0,0.4);
}
.contact-card::before {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(60% 80% at 50% 0%, rgba(139, 107, 255, 0.18), transparent 70%);
}
.contact-card > * { position: relative; z-index: 1; }
.contact-card h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin: 8px 0 12px; }
.contact-card p { color: var(--muted); max-width: 460px; margin: 0 auto 28px; }
.contact-card .hero-actions { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); }
.footer-inner {
    max-width: var(--maxw); margin: 0 auto; padding: 32px 24px;
    display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.footer-brand {
    display: inline-flex; align-items: center; gap: 9px;
    font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: var(--text);
}
.socials { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; }
.socials img { width: 30px; filter: brightness(0) invert(0.7); transition: transform 0.2s var(--ease), filter 0.2s var(--ease); }
.socials a { display: inline-flex; padding: 8px; }
.socials a:hover img { transform: scale(1.15); filter: brightness(0) invert(1); }
.copywrite { margin: 0; color: var(--faint); font-size: 0.85rem; font-style: italic; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }

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

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .about-grid { grid-template-columns: 1fr; }
    .about-card { max-width: 320px; }
    .project-links { grid-template-columns: 1fr; max-width: 420px; }
}

@media (max-width: 720px) {
    .nav-toggle { display: flex; }
    .nav-links {
        position: fixed; inset: 0 0 0 auto; width: min(78vw, 320px);
        flex-direction: column; align-items: flex-start; gap: 8px;
        background: var(--bg-soft); border-left: 1px solid var(--border);
        padding: 96px 28px 28px; transform: translateX(100%);
        transition: transform 0.35s var(--ease); box-shadow: -20px 0 60px rgba(0,0,0,0.5);
    }
    .nav-links.open { transform: translateX(0); }
    .nav-links a { font-size: 1.1rem; width: 100%; padding: 8px 0; }
    .nav-cta { margin-top: 8px; }
    .skill-groups { grid-template-columns: 1fr; }
    .section { padding: 72px 22px; }
    .hero-stats { gap: 24px; }

    /* On narrow screens the face sits top-right; darken more so text stays legible */
    .hero-photo { background-position: right 26% top 22%; }
    .hero-photo::after {
        background:
            linear-gradient(180deg,
                rgba(10, 15, 28, 0.55) 0%,
                rgba(10, 15, 28, 0.78) 45%,
                var(--bg) 88%),
            linear-gradient(90deg, rgba(10, 15, 28, 0.55), rgba(10, 15, 28, 0.35));
    }
}
