/* ============================================================
   DESIGN TOKENS
   Update these variables to retheme the entire site at once.
   ============================================================ */
:root {
  --bg:         #0F0A1F;   /* page background - near-black void purple */
  --surface:    #1A1230;   /* card/cell background */
  --surface-2:  #221A3D;   /* raised card variant */
  --violet:     #6D28D9;   /* primary action color */
  --violet-dim: #5B21B6;   /* darker violet for gradients */
  --lavender:   #A78BFA;   /* accent, labels, links */
  --lilac:      #C4B5FD;   /* lighter accent */
  --pale:       #E9D5FF;   /* highlights, blockquote text */
  --text:       #F5F3FF;   /* primary text */
  --text-dim:   #B3A8D1;   /* secondary / muted text */
  --border:     rgba(167, 139, 250, 0.15);  /* subtle card border */
  --radius:     18px;      /* default border-radius */

  --font-display: "Space Grotesk", sans-serif;
  --font-body:    "Inter", sans-serif;
  --font-mono:    "JetBrains Mono", monospace;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Respect user motion preferences - disable animations if requested */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--violet); color: #fff; }

/* Keyboard focus ring - visible only for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--lavender);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============================================================
   CURSOR HALO
   A soft background glow that follows the mouse - purely
   atmospheric, sits behind everything, normal cursor unchanged.
   ============================================================ */
#cursor-halo {
  pointer-events: none;      /* never intercept clicks */
  position: fixed;
  z-index: 9999;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  /* Radial gradient fades from a faint violet center to fully transparent */
  background: radial-gradient(
    circle,
    rgba(124, 58, 237, 0.10) 0%,
    rgba(124, 58, 237, 0.04) 40%,
    transparent 70%
  );
  /* Offset by half its size so the center tracks the cursor */
  transform: translate(-50%, -50%);
  /* Smooth lag behind pointer: transition on left/top gives a trailing feel */
  transition: left 0.08s ease-out, top 0.08s ease-out;
  /* Hidden on touch where there's no cursor */
  display: none;
}
/* Only show on devices that support hover (i.e. have a real pointer) */
@media (hover: hover) {
  #cursor-halo { display: block; }
}

/* ============================================================
   AMBIENT BACKGROUND GLOW
   Two fixed radial gradients give depth to the dark background.
   ============================================================ */
body::before, body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
body::before {
  top: -25%; left: -15%;
  width: 75vw; height: 75vw;
  max-width: 900px; max-height: 900px;
  background: radial-gradient(circle, rgba(92,33,182,0.3) 0%, transparent 65%);
}
body::after {
  bottom: -20%; right: -20%;
  width: 65vw; height: 65vw;
  max-width: 800px; max-height: 800px;
  background: radial-gradient(circle, rgba(167,139,250,0.15) 0%, transparent 65%);
}

/* ============================================================
   LAYOUT WRAPPER
   ============================================================ */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 18px 70px;
}

/* Narrower wrapper for inner (About / Blog) pages */
.wrap-narrow {
  max-width: 780px;
}

/* ============================================================
   NAV
   Mobile-first: logo + icon links always visible.
   Text nav links hidden on mobile, shown at ≥700px.
   Hamburger shown on mobile, hidden at ≥700px.
   ============================================================ */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px 30px;
  position: relative; /* anchor for mobile dropdown */
}

/* Logo / site name */
.nav .logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.nav .logo .bracket {
  color: var(--lavender);
  font-family: var(--font-mono);
  font-weight: 400;
}

/* Icon links (GitHub + LinkedIn) - always visible in header */
.nav-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto; /* push to right before the hamburger / cta */
}
.nav-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.nav-icons a:hover { color: var(--lavender); border-color: var(--lavender); background: rgba(167,139,250,0.06); }
.nav-icons svg { width: 18px; height: 18px; fill: currentColor; }

/* Text nav links - hidden by default on mobile */
.nav-links {
  list-style: none;
  display: none; /* overridden to flex at ≥700px */
  align-items: center;
  gap: 24px;
}
.nav-links a {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-dim);
  position: relative;
  padding: 4px 0;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }
/* Underline slide-in on hover */
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 1px;
  background: var(--lavender);
  transition: width 0.2s ease;
}
.nav-links a:hover::after { width: 100%; }

/* "Start a project" pill - always visible */
.cta-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--lavender);
  border: 1px solid var(--border);
  padding: 8px 15px;
  border-radius: 999px;
  white-space: nowrap;
  min-height: 36px;
  display: flex;
  align-items: center;
  transition: background 0.2s, border-color 0.2s;
}
.cta-link:hover { background: var(--surface); border-color: var(--lavender); }

/* Mobile hamburger button */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle span {
  display: block;
  width: 17px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
/* Hamburger → X animation when menu is open */
.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); }

/* Mobile dropdown panel (the opened menu) */
@media (max-width: 699px) {
  .nav-links {
    position: absolute;
    top: calc(100% - 16px);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    z-index: 100;
  }
  /* .open class is toggled by JS */
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 1rem;
    display: block;
  }
  .nav-links a:hover { background: rgba(167,139,250,0.08); }
  .nav-links a::after { display: none; }
}

/* Desktop nav - show links, hide hamburger */
@media (min-width: 700px) {
  .nav-links { display: flex; position: static; background: none; border: none; padding: 0; box-shadow: none; }
  .nav-toggle { display: none; }
}

/* ============================================================
   BACK LINK (inner pages only)
   ============================================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--lavender);
  margin-bottom: 30px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--pale); }

/* ============================================================
   BENTO GRID
   Single column on mobile → 4 columns at ≥700px.
   Each .cell variant controls its own column span via
   named classes (.hero, .about, .skills, etc.)
   ============================================================ */
.bento {
  display: grid;
  grid-template-columns: 1fr; /* mobile: stack all cells */
  gap: 14px;
}

/* Base cell styles shared by every bento card */
.cell {
  background: linear-gradient(145deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  position: relative;
  overflow: hidden;
}

/* Small mono label above each cell's content ("// about", "stack", etc.) */
.cell-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--lavender);
  opacity: 0.8;
  display: block;
  margin-bottom: 12px;
}

.cell h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.cell p { color: var(--text-dim); font-size: 0.93rem; }

/* ============================================================
   HERO CELL
   ============================================================ */
.hero { padding: 36px 24px 30px; }

/* "freelance.dev ▌" blinking cursor eyebrow */
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--lavender);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
@keyframes blink { 0%,49%{opacity:1} 50%,100%{opacity:0} }

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 8vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  max-width: 600px; /* prevent headline stretching across the full-width cell */
}
.hero h1 .accent { color: var(--lavender); }

.hero-sub {
  color: var(--text-dim);
  font-size: 1rem;
  max-width: 460px;
  margin-bottom: 26px;
}

/* CTA button group */
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.93rem;
  padding: 13px 22px;
  border-radius: 12px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary {
  background: linear-gradient(135deg, var(--lavender), var(--violet-dim, #5B21B6));
  color: #fff;
  box-shadow: 0 8px 22px rgba(124,58,237,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(124,58,237,0.45); }
.btn-primary:active { transform: none; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--lavender); background: rgba(167,139,250,0.06); }

/* ============================================================
   AVAILABILITY CELL
   ============================================================ */
.available { display: flex; align-items: flex-start; gap: 12px; }
.avail-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #4ADE80;
  margin-top: 6px;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(74,222,128,0.18);
}

/* Timeline item inside experience cell */
.timeline { display: flex; flex-direction: column; gap: 18px; }
.timeline-item { padding-left: 18px; border-left: 2px solid var(--border); }
.timeline-item .role {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.timeline-item .company {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--lavender);
  margin-bottom: 6px;
}
.timeline-item .timeline-desc { color: var(--text-dim); font-size: 0.88rem; line-height: 1.5; }

/* ============================================================
   SKILLS PILLS
   ============================================================ */
.skills-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.skill-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(167,139,250,0.1);
  border: 1px solid var(--border);
  color: var(--lilac);
}

/* ============================================================
   PROJECT CELLS
   ============================================================ */
.project { display: flex; flex-direction: column; gap: 14px; }

/* Image / screenshot placeholder - swap <span> for <img> */
.project-thumb {
  height: 150px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--violet-dim, #5B21B6) 0%, var(--bg) 130%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* If you add a real <img> inside .project-thumb: */
.project-thumb img { width: 100%; height: 100%; object-fit: cover; }

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--lavender);
  letter-spacing: 0.04em;
}
.project-stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.project-stack span {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 999px;
}

/* ============================================================
   CONTACT SECTION
   ============================================================ */
.contact h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  font-weight: 800;
  margin-bottom: 8px;
  max-width: 480px; /* prevent heading stretching across the full-width contact cell */
}
.contact > p { color: var(--text-dim); margin-bottom: 26px; max-width: 400px; font-size: 0.95rem; }

form { display: flex; flex-direction: column; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--lavender);
}
.field input, .field textarea, .field select {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 15px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.97rem;
  min-height: 48px;   /* touch-friendly tap target */
  transition: border-color 0.15s, background 0.15s;
  appearance: none;
}
.field textarea { min-height: 115px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: rgba(248,247,255,0.28); }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--lavender);
  background: rgba(167,139,250,0.05);
}

/* Two-column row for name + email on wider screens */
.form-row { display: grid; grid-template-columns: 1fr; gap: 14px; }

.form-note {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 8px;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  text-align: center;
  margin-top: 52px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-dim);
}
footer a { color: var(--lavender); }
footer a:hover { color: var(--pale); }

/* ============================================================
   BENTO GRID - DESKTOP SPANS (≥700px = 4-column grid)
   Each class controls how many columns that cell occupies.
   ============================================================ */
@media (min-width: 700px) {
  .bento {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  /* hero spans all 4 columns */
  .cell-hero    { grid-column: 1 / -1; }
  /* status + project share a row (2+2) */
  .cell-avail   { grid-column: span 2; }
  .cell-project { grid-column: span 2; }
  /* experience spans full width */
  .cell-exp     { grid-column: 1 / -1; }
  /* skills + blog teaser share a row (2+2) */
  .cell-skills  { grid-column: span 2; }
  .cell-blog    { grid-column: span 2; }
  /* contact full width */
  .cell-contact { grid-column: 1 / -1; }

  .form-row { grid-template-columns: 1fr 1fr; }
}

/* Wide screens - more padding */
@media (min-width: 980px) {
  .wrap { padding: 28px 30px 80px; }
  .hero { padding: 52px 44px 44px; }
  .hero h1 { font-size: 3.8rem; }
}

/* ============================================================
   INNER PAGE - ARTICLE LAYOUT
   Used by about.html and blog.html / blog-post.html
   ============================================================ */
.page-header { margin-bottom: 36px; }
.page-header .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--lavender);
  display: block;
  margin-bottom: 12px;
}
.page-header h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 6vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.page-header h1 .accent { color: var(--lavender); }
.page-header .intro { color: var(--text-dim); font-size: 1rem; max-width: 540px; }

/* Meta pills - role, year, stack etc. on project / blog posts */
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.meta-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(167,139,250,0.1);
  border: 1px solid var(--border);
  color: var(--lilac);
}

/* Hero image placeholder on inner pages */
.page-hero-img {
  width: 100%;
  height: 220px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--violet-dim, #5B21B6) 0%, var(--bg) 130%);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 38px;
  overflow: hidden;
}
/* Swap the <span> for an <img> when you have a real image:
   .page-hero-img img { width:100%; height:100%; object-fit:cover; } */

/* Article body - prose content area */
.prose { display: flex; flex-direction: column; gap: 22px; }

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 8px;
}
.prose h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}
.prose p { color: var(--text-dim); font-size: 0.97rem; line-height: 1.7; }

/* Bullet list with lavender chevron markers */
.prose ul { list-style: none; display: flex; flex-direction: column; gap: 8px; padding: 0; }
.prose ul li { color: var(--text-dim); padding-left: 20px; position: relative; font-size: 0.95rem; }
.prose ul li::before { content: "›"; position: absolute; left: 0; color: var(--lavender); font-family: var(--font-mono); }

/* Callout / pull-quote card inside prose */
.callout {
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.callout .cell-label { margin-bottom: 8px; }
.callout p { color: var(--text); font-size: 1rem; }

/* Two-column image split for case studies */
.img-split { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 600px) { .img-split { grid-template-columns: 1fr 1fr; } }
.img-split .page-hero-img { margin-bottom: 0; min-height: 160px; height: 100%; }

/* Bottom CTA card - appears at end of inner pages */
.page-cta {
  margin-top: 52px;
  padding: 30px 22px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  text-align: center;
}
.page-cta h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.page-cta p { color: var(--text-dim); font-size: 0.93rem; margin-bottom: 20px; }

/* ============================================================
   BLOG INDEX - grid of post cards
   ============================================================ */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 8px;
}
@media (min-width: 600px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }

/* Individual blog card */
.blog-card {
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s, transform 0.2s;
}
.blog-card:hover { border-color: var(--lavender); transform: translateY(-2px); }
.blog-card .post-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--lavender);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.blog-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}
.blog-card p { color: var(--text-dim); font-size: 0.87rem; line-height: 1.5; }
.blog-card .post-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: auto; /* push to bottom of card */
}
.yt-link {
  color: #14c514;
}