/* ====== Theme ====== */
:root {
    --bg: #05080c;
    --bg-2: #0b1118;
    --fg: #e6f1ff;
    --muted: #9fb2c5;
    --brand: #00ffff;
    --brand-2: #00b3ff;
    --glass: rgba(255,255,255,0.04);
    --card: rgba(9,14,22,0.8);
    --border: rgba(255,255,255,0.08);
    --radius: 18px;
    --shadow: 0 10px 40px rgba(0,0,0,0.35);
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

body {
    margin: 0;
    color: var(--fg);
    font-family: "Space Grotesk",system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji";
    background: var(--bg);
    overflow-x: hidden;
}

/* Fixed background so it never scrolls/repeats */
.bg-fixed {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(1200px 600px at 10% 10%, #06253a 0%, transparent 60%), radial-gradient(1000px 600px at 90% 20%, #0a2430 0%, transparent 60%), var(--bg);
    background-attachment: fixed;
}

.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="160" height="160" viewBox="0 0 160 160"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23n)" opacity="0.035"/></svg>');
    mix-blend-mode: soft-light;
}

.page-shell {
    position: relative;
    z-index: 2;
}

.container {
    width: 100%;
    max-width: 90vw;
    margin: 0 auto;
 
}


.section {
    padding: 32px 0 10px;
}

.section-head h2 {
    margin: 0;
}

.section-head p {
    color: #cfe6ff;
    margin: 6px 0 20px;
}

/* ===== Header / Nav ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
    background: linear-gradient(to bottom, rgba(5,8,12,0.85), rgba(5,8,12,0.25));
    border-bottom: 1px solid var(--border);
}

.nav {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--fg);
    font-weight: 700;
}

.logo {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #001014;
    font-weight: 800;
    box-shadow: var(--shadow);
}

.menu {
    margin-left: auto;
    display: flex;
    gap: 18px;
}

    .menu a {
        color: var(--fg);
        text-decoration: none;
        opacity: .8;
        padding: 8px 10px;
        border-radius: 10px;
    }

        .menu a.active, .menu a:hover {
            background: var(--glass);
            opacity: 1;
        }

.actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

#themeToggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--fg);
    padding: 8px 10px;
    border-radius: 12px;
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 14px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--border);
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #00151b;
    font-weight: 700;
}

.btn-ghost {
    background: transparent;
    color: var(--fg);
}

/* ===== Hero ===== */
.hero {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 26px;
    padding: 64px 0;
    align-items: center;
}

.eyebrow {
    color: var(--muted);
    letter-spacing: .2em;
    font-size: 12px;
    text-transform: uppercase;
}

.headline {
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.05;
    margin: 10px 0 16px;
}

.lede {
    color: #cfe6ff;
    max-width: 60ch;
}

.cta {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}

.badges {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    opacity: .9;
}

    .badges span {
        background: var(--glass);
        border: 1px solid var(--border);
        padding: 8px 10px;
        border-radius: 12px;
    }

.hero-card {
    width: min(960px, 92vw); /* same max width, responsive cap */
    margin-left: auto;
    margin-right: auto; /* hard center */
}
    .hero-card img {
        width: 300px;
        height: 300px;
        object-fit: cover;
        border-radius: 24px;
        border: 1px solid var(--border);
        box-shadow: var(--shadow);
    }

    .hero-card .glass {
        position: absolute;
        left: 14px;
        bottom: 14px;
        background: rgba(0,0,0,0.45);
        padding: 10px 12px;
        border-radius: 12px;
        border: 1px solid var(--border);
        backdrop-filter: blur(6px);
        font-size: 14px;
    }

/* Mobile hero: show image BEFORE text (your request) */
@media (max-width: 800px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-card {
        order: -1;
        justify-self: center;
        margin-bottom: 12px;
    }
}

/* ===== Generic cards / tokens ===== */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}

.pill {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--muted);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tag {
    font-size: 12px;
    background: #06141b;
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: 999px;
    color: #b7eaff;
}

.chips {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    background: var(--glass);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 12px;
}

/* ===== CONTACT (restored, neat padding) ===== */
.grid.contact-grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 24px;
    padding: 24px 0 8px;
}

@media (max-width: 900px) {
    .grid.contact-grid {
        grid-template-columns: 1fr;
    }
}

input, textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #06141b;
    color: var(--fg);
}

label {
    display: block;
    margin: 10px 0 6px;
    color: #cfe6ff;
}

textarea {
    resize: vertical;
}

/* ===== Footer ===== */
.site-footer {
    margin-top: 46px;
    border-top: 1px solid var(--border);
    background: rgba(5,8,12,0.6);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    padding: 24px 0;
}

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

    .socials li {
        margin: 6px 0;
    }

.copyright {
    text-align: center;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
}

/* ===== Two-line Timeline ===== */
.timeline-section {
   
    padding: 32px 0 20px;
    overflow: hidden;
}
/* keep lines inside section */

.twoline {
    position: relative;
    width: 100%;
}

/* Lines */
.line {
    position: absolute;
    top: 0;
    height: 100%;
    width: 2px;
    background: linear-gradient(to bottom, #0db6ff, #00ffd5);
    opacity: .6;
}

    .line.left {
        left: 32%;
        transform: translateX(-1px);
    }

    .line.right {
        left: 68%;
        transform: translateX(-1px);
    }

/* Year ticks (attached to left line) */
.ticks {
    position: absolute;
    top: 0;
    left: 32%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    pointer-events: none;
}

.tick {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 1px;
    background: var(--border);
}

    .tick .label {
        position: absolute;
        top: -7px;
        left: 10px;
        font-size: 12px;
        color: var(--muted);
    }

/* Items */
.vitem {
    position: absolute;
    left: 0;
    right: 0;
}

.node {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 0 0 6px rgba(0,255,213,0.08);
    border: 1px solid rgba(0,255,213,0.4);
    top: 10px;
}

    .node.left {
        left: 32%;
        transform: translateX(-50%);
    }

    .node.right {
        left: 68%;
        transform: translateX(-50%);
    }

    /* Small leader from node towards card (fixed length to avoid layout issues) */
    .node.left::after {
        content: "";
        position: absolute;
        top: 5px;
        left: -80px;
        width: 80px;
        height: 2px;
        background: var(--border);
    }

    .node.right::after {
        content: "";
        position: absolute;
        top: 5px;
        left: 12px;
        width: 80px;
        height: 2px;
        background: var(--border);
    }

.ilabel {
    position: absolute;
    top: -8px;
    max-width: 220px;
    color: #cfe6ff;
    font-size: 13px;
    line-height: 1.15;
}

    .ilabel.left {
        left: calc(68% - 240px);
        text-align: right;
    }

    .ilabel.right {
        left: calc(32% + 20px);
        text-align: left;
    }

    .ilabel .date {
        color: var(--muted);
    }

    .ilabel .title {
        font-weight: 700;
    }

/* Cards: left lane cards sit left side; right lane cards sit right side */
.card.left {
    position: absolute;
    left: 4%;
    width: 40%;
}

.card.right {
    position: absolute;
    right: 4%;
    width: 40%;
}

.chead {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

/* Responsive: stack cards centered, no connectors needed */
@media (max-width: 1100px) {
    .card.left, .card.right {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: 92%;
    }

    .ilabel.left {
        left: 50%;
        transform: translateX(-100%);
        text-align: right;
    }

    .ilabel.right {
        left: 50%;
        transform: translateX(0%);
        text-align: left;
    }

    .node.left::after, .node.right::after {
        width: 40px;
        left: auto;
        right: auto;
    }
}

/* ===== Modal (if you kept it) ===== */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    background: rgba(0,0,0,0.6);
    z-index: 100;
}

    .modal.show {
        display: grid;
    }

.modal-content {
    width: min(900px, 92vw);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 18px;
    box-shadow: var(--shadow);
    position: relative;
}

.modal-close {
    position: absolute;
    right: 18px;
    top: 18px;
    background: transparent;
    border: none;
    color: var(--fg);
    font-size: 22px;
    cursor: pointer;
}

.video iframe {
    width: 100%;
    height: 420px;
    border: 0;
    border-radius: 12px;
}


/* === Patch: hero centering + unified width + photo ring === */
.section.hero {
  min-height: calc(100vh - 120px); /* keep space for header/footer */
  display: flex;
  align-items: center;
}
.hero-card {
  width: min(1100px, 92vw); /* match .container width */
  margin-left: auto;
  margin-right: auto;
}
.hero-photo .img-wrap {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--card);
  padding: 10px;
}
/* double ring with subtle glow */
.hero-photo .img-wrap::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: calc(var(--radius) + 6px);
  border: 1px solid rgba(255,255,255,0.18);
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(13,182,255,0.15), 0 10px 30px rgba(0,0,0,0.35) inset;
}

/* eyebrow line above hero title */
.eyebrow {
  font-size: 14px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wave { display:inline-block; transform-origin: 70% 70%; }
@keyframes wave { 0%,100%{ transform:rotate(0deg); } 25%{ transform:rotate(18deg);} 50%{ transform:rotate(-12deg);} 75%{ transform:rotate(10deg);} }
.wave { animation: wave 2.2s ease-in-out 0.6s infinite; }

/* Make sure timeline cards don't overlap (defensive spacing) */




/* Background (layered gradients matching theme) */
body.theme-dark {
  background:
    radial-gradient(1200px 600px at 10% 10%, #06253a 0%, transparent 60%),
    radial-gradient(1000px 550px at 90% 20%, #0a2430 0%, transparent 60%),
    linear-gradient(180deg, #07121a 0%, #04121A 100%);
  background-attachment: fixed;
}
.noise-overlay { position: fixed; inset: 0; pointer-events: none; z-index: 0; mix-blend-mode: soft-light; opacity: 0.045; }


/* === Patch 2: fix timeline positioning (restore absolute layout) === */
.noise-overlay { z-index: 0; } /* keep noise below all content */

/* === Fix: restore absolute positioning for timeline items === */
/* behind cards & labels */


/* === Patch: Stronger blur + subtle backing for section tabs (mask the spine cleanly) === */
.timeline-section .section-chip{
  backdrop-filter: blur(36px);
  -webkit-backdrop-filter: blur(36px);
  background-color: rgba(7,18,26,0.78); /* slightly more opaque to soften line */
}


/* Contact form: spacing */
.contact-form label{
  display: flex;
  flex-direction: column;
  gap: 10px;           /* space between label text and input/textarea */
  margin-bottom: 14px; /* space between each label block */
}
.contact-form input,
.contact-form textarea{
  padding: 10px 12px;
}


/* Contact form notice styles */
.notice{
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  font-weight: 500;
}
.notice.success{ border-color: rgba(0,200,120,.35); box-shadow: 0 0 0 1px rgba(0,200,120,.14) inset; }
.notice.error{ border-color: rgba(255,80,80,.35); box-shadow: 0 0 0 1px rgba(255,80,80,.14) inset; }

/* Ensure spacing between label text and inputs */
.contact-form label{ display:flex; flex-direction:column; gap:10px; margin-bottom:14px; }
.contact-form input, .contact-form textarea{ padding:10px 12px; }


/* Contact page alerts (matches original JSX) */
.alert{padding:10px 12px;border-radius:10px;border:1px solid transparent;display:flex;gap:8px;align-items:center}
.alert.success{background:rgba(24,160,88,.12);border-color:rgba(24,160,88,.35);color:#d5ffe5}
.alert.error{background:rgba(200,64,64,.12);border-color:rgba(200,64,64,.35);color:#ffd6d6}
.alert .check{font-weight:900}


/* Wider cards on the timeline (closer to maximum width) */
body[data-page="portfolio"] .timeline-section{ --gutter: 3%; --cardw: 44%; }
body[data-page="home"] .timeline-section{ --gutter: 3%; --cardw: 44%; } /* apply to home timeline too */
@media (max-width: 980px){
  body[data-page="portfolio"] .timeline-section,
  body[data-page="home"] .timeline-section{ --gutter: 16px; --cardw: 92vw; } /* mobile safety */
}


/* Timeline width: fill each half of the container with minimal outer gutter */
body[data-page="home"] .timeline-section,
body[data-page="portfolio"] .timeline-section{
  --gutter: 0px;                 /* no outer padding */
  --cardw: calc(50% - 24px);     /* leave ~24px total clearance to the center spine/labels */
}
@media (max-width: 980px){
  body[data-page="home"] .timeline-section,
  body[data-page="portfolio"] .timeline-section{
    --gutter: 12px;
    --cardw: calc(100% - 24px);
  }
}


/* === Skills Orbit around hero card === */
.hero-card{ position: relative; overflow: hidden; }
.hero-card .skill-orbit{ position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-card .hero-grid{ position: relative; z-index: 1; }

.skill-pill{
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(7,18,26,0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.28), inset 0 0 0 1px rgba(0,255,213,0.10);
  color: var(--text);
  font-size: 14px;
  letter-spacing: .2px;
  white-space: nowrap;
  will-change: transform;
}
.skill-pill::before{
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(0,255,213,.95), rgba(13,182,255,.6));
  box-shadow: 0 0 10px rgba(13,182,255,.35);
}
@media (prefers-reduced-motion: reduce){
  .skill-pill{ animation: none !important; transition: none !important; }
}


/* === Skills Orbit v2: section-level layer & readable pills === */
.section.hero{ position: relative; }
.section.hero .skill-orbit{ position:absolute; inset:0; z-index:0; pointer-events:none; }
.hero-card{ overflow: visible; } /* allow pills to flow around outside the card */

/* readable pills (minimal tilt only) */
.skill-pill{ transform-origin: 50% 50%; }





/* === Global Skills Layer (document-sized, scrolls with page) === */
.skill-global{
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: auto; /* JS will set explicit pixel height to match document */
  pointer-events: none;
  z-index: 1; /* behind most positioned content; adjust if needed */
}
/* Pills keep default look from earlier; ensure they don't block clicks */
.skill-global .skill-pill{ pointer-events: none; }


/* === Global scroll chrome tweaks === */
html, body {
  /* Keep scrolling but hide the vertical scrollbar chrome */
  scrollbar-width: none;           /* Firefox */
  -ms-overflow-style: none;        /* IE/Edge legacy */
  overflow-x: hidden;              /* prevent accidental horizontal scroll */
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;                   /* WebKit */
}






/* === Portfolio: lengthen horizontal leaders by shifting nodes toward center === */
body[data-page="portfolio"] .node.left  { left: 40%; transform: translateX(-50%); }
body[data-page="portfolio"] .node.right { left: 60%; transform: translateX(-50%); }
body[data-page="portfolio"] .ticks      { left: 40%; transform: translateX(-50%); }


/* Portfolio: in-card date styling after removing floating title cards */
body[data-page="portfolio"] .mcard .mdate{
  font-size: 12px;
  line-height: 1.15;
  color: var(--muted);
  margin: 6px 0 10px;
  display: inline-block;
}


/* === Portfolio: force-remove floating title cards & their leader bars === */
body[data-page="portfolio"] .mlabel{ display: none !important; }
body[data-page="portfolio"] .hlead.label{ display: none !important; }


/* Home: in-card date after removing floating labels */
body[data-page="home"] .mcard .mdate{
  font-size: 12px;
  line-height: 1.15;
  color: var(--muted);
  margin: 6px 0 10px;
  display: inline-block;
}

/* Home: header date pill to make dates clearly visible */
body[data-page="home"] .mhead { position: relative; }
body[data-page="home"] .mhead .date-pill{
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(7,18,26,0.75);
  color: #9fe1ff;
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
}

/* Global: header date pill so dates are always visible */
.mhead { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; }
.mhead .date-pill{
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(7,18,26,0.85);
  color: #9fe1ff;
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
  z-index: 5;
}

/* Global: inline date under title */
.mcard .mdate-inline{
  font-size: 13px;
  line-height: 1.2;
  color: var(--muted);
  margin: 6px 0 10px;
}


/* === Tighten card spacing: titles & dates === */
.mcard .mhead,
.mcard .mhead h3{
  margin-top: 0 !important;
  padding-top: 0 !important;
}
.mcard .mhead{ margin-bottom: 0 !important; }
.mcard .mdate-inline{
  margin: 0 0 8px !important; /* no gap above the date; small gap below */
}



/* layout helper so title and its button sit together */
.mhead { display:flex; align-items:flex-start; gap:12px; justify-content:space-between; }
.mhead .mhead-left { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }


/* Compact title-level action button (scoped) */
.mhead .btn.btn-primary.btn-title{
  font-size: 0.95em;
  line-height: 1.2;
  padding: 4px 10px;
  border-radius: 6px;
  margin-left: 8px; /* a little afar from the title */
}


/* === Hero Card Max-Width (slightly larger) === */
.card.hero-card{
  max-width: 800px;
  width: min(100%, 800px);
  margin-left: auto;
  margin-right: auto;
}


/* === Hero Card Max-Width (800) === */
.card.hero-card{
  max-width: 800px !important;
  width: min(100%, 800px) !important;
  margin-left: auto;
  margin-right: auto;
}


/* Extra scroll space so the last project card can fully close */
.scroll-tail{ height: 65vh; width: 1px; }


/* === Smooth Scroll + Perf Hints === */
html{
  scroll-behavior: smooth;
  scrollbar-gutter: stable both-edges;
}
/* Reduce layout thrash for scroll-driven card growth */
.timeline-section article.mcard{
  will-change: height, transform;
}
.timeline-section article.mcard .grow-reveal{
  will-change: max-height;
}
/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
}




/* === Skill pill fit (no overflow, auto-width) === */
.skill-pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  /* Auto width to fit text; min height for circle-ish feel without clipping */
  width: auto;
  min-height: 38px;
  padding: 6px 12px;           /* comfy text padding */
  border-radius: 9999px;       /* pill shape, not a fixed circle */
  white-space: nowrap;         /* keep on one line */
  line-height: 1.1;
  font-size: clamp(12px, 1.06vw, 15px);
}
/* Keep icons (if any) aligned */
.skill-pill > img,
.skill-pill > svg{ width: 18px; height: 18px; margin-right: 6px; }
