/* style.css */
:root {
  --paper: #ffffff;
  --paper-alt: #f8fafc;
  --ink: #0f172a;
  --ink-light: #475569;
  --primary: #3fc45b;
  --primary-hover: #35a84e;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  
  --radius: 12px;
  --radius-lg: 24px;
  --radius-pill: 99px;
  
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 20px 40px rgba(15, 23, 42, 0.12);
  --stick-shadow: 0 12px 32px rgba(63, 196, 91, 0.15);

  --font-sans: 'Inter', system-ui, sans-serif;
  --font-display: 'Baloo 2', system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Base Reset & Typography */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4, .brand {
  font-family: var(--font-display);
  line-height: 1.1;
  color: var(--ink);
}
h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 700; margin-bottom: 1rem; }
h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
p { font-size: 1.125rem; color: var(--ink-light); margin-bottom: 1.5rem; }
a { color: inherit; text-decoration: none; transition: all 0.2s ease; }
ul, ol { list-style: none; }
img, svg { max-width: 100%; display: block; }

/* Layout Helpers */
.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}
section { padding: 6rem 0; }

/* Navigation */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  border-bottom: 1px solid transparent;
  transition: transform 0.3s ease, padding 0.3s ease, border-color 0.3s;
}
.site-nav[data-scrolled="true"] { padding: 0.5rem 0; box-shadow: var(--shadow-sm); border-color: var(--border); }
.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.brand svg { width: 32px; height: 32px; transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.brand:hover svg { transform: scale(1.1) rotate(-5deg); }

.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}
.nav-links a {
  font-weight: 500;
  color: var(--ink-light);
  position: relative;
  font-size: 1.05rem;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 100%; height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}
.nav-links a:hover::after, .nav-links a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}
.nav-links .nav-cta {
  background: var(--ink);
  color: var(--paper) !important;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
}
.nav-links .nav-cta:hover { background: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.nav-links .nav-cta::after { display: none; }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); position: relative; transition: 0.2s; }
.nav-toggle span::before, .nav-toggle span::after {
  content: ''; position: absolute; left: 0; width: 100%; height: 2px; background: var(--ink); transition: 0.2s;
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { bottom: -6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { bottom: 0; transform: rotate(-45deg); }


/* Hero Section */
.hero {
  padding: 180px 0 100px;
  position: relative;
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 1.5rem;
}
.dot { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; box-shadow: 0 0 12px var(--primary); animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

.hero h1 .pop { color: var(--primary); }
.hero h1 .stroke {
  color: transparent;
  -webkit-text-stroke: 2px var(--ink);
  position: relative;
}
.hero-sub {
  font-size: 1.25rem;
  max-width: 45ch;
  margin-top: 1.5rem;
  min-height: 5em; /* Prevent layout shift while typing */
}
.terminal-cursor {
  display: inline-block;
  width: 9px;
  height: 1.15em;
  background-color: var(--primary);
  vertical-align: -2px;
  margin-left: 3px;
  border-radius: 1px;
  box-shadow: 0 0 8px rgba(63, 196, 91, 0.6);
  animation: cursor-blink 0.85s infinite;
}
@keyframes cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  border: 2px solid transparent;
}
.btn-primary { background: var(--primary); color: white; box-shadow: var(--shadow-md); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-4px) scale(1.02); box-shadow: var(--stick-shadow); color: white; }
.btn-dark { background: var(--ink); color: white; }
.btn-dark:hover { background: #1e293b; transform: translateY(-4px) scale(1.02); box-shadow: var(--shadow-hover); color: white; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--ink); background: var(--paper-alt); transform: translateY(-4px) scale(1.02); color: var(--ink); }

/* Hero Art (Stickers & Mascot) */
.hero-art {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-mascot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 78%;
  max-height: 85%;
  z-index: 1;
  object-fit: contain;
  filter: drop-shadow(0 16px 32px rgba(15, 23, 42, 0.12));
  animation: mascot-float 5s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes mascot-float {
  0% { transform: translate(-50%, -50%) translateY(0px); }
  100% { transform: translate(-50%, -50%) translateY(-10px); }
}

.sticker {
  position: absolute;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  transform-style: preserve-3d;
  cursor: pointer;
  z-index: 2;
  user-select: none;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), 
              box-shadow 0.25s ease, 
              border-color 0.25s ease, 
              background-color 0.25s ease;
  transform: translate(calc(var(--mx, 0) * 1px), calc(var(--my, 0) * 1px));
}

.sticker svg {
  width: 26px;
  height: 26px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

/* Interactive Hover Animation on Stickers */
.sticker:hover {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 16px 32px rgba(63, 196, 91, 0.2), 0 4px 12px rgba(15, 23, 42, 0.08);
  transform: translate(calc(var(--mx, 0) * 1px), calc(var(--my, 0) * 1px - 8px)) scale(1.06);
  z-index: 10;
}

.sticker:hover svg {
  transform: scale(1.2) rotate(8deg);
}

.sticker:active {
  transform: translate(calc(var(--mx, 0) * 1px), calc(var(--my, 0) * 1px - 2px)) scale(0.98);
}

/* Surrounding Positions based on the reference layout */
.s1 { top: 2%; left: 16%; }             /* Passwords locked (Top-left) */
.s2 { top: 32%; left: -6%; }            /* Bug hunting (Left middle) */
.s3 { bottom: 14%; left: -2%; }         /* Threat modeling (Left bottom) */
.s4 { top: 12%; right: -2%; }           /* Key rotation (Right top) */
.s5 { top: 48%; right: -8%; }           /* Watching logs (Right middle) */
.s6 { bottom: 4%; right: 12%; }         /* Wi-Fi hardened (Bottom right) */

/* Sections */
.section-head { text-align: center; max-width: 800px; margin: 0 auto 4rem; }
.section-head h2 { margin: 1rem 0; }
.section-head p { margin: 0 auto; max-width: 60ch; }

.band-dark { background: var(--ink); color: var(--paper); padding: 5rem 0; }
.band-dark .label { color: var(--ink-light); }
.band-dark .section-head h2, .band-dark h3 { color: var(--paper); }
.band-mint { background: var(--paper-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* Cards & Grid */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}
.card::before {
  content: ''; position: absolute; inset: 0; border-radius: var(--radius-lg);
  background: radial-gradient(600px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(63,196,91,0.06), transparent 40%);
  opacity: 0; transition: opacity 0.3s; z-index: 0; pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card > * { position: relative; z-index: 1; }

.icon-badge {
  width: 56px; height: 56px;
  background: #f1f5f9;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.5rem;
  transition: transform 0.3s ease;
}
.card:hover .icon-badge { transform: scale(1.1) rotate(5deg); }
.icon-badge svg { width: 28px; height: 28px; }

/* Stats */
.stat-strip {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 2rem;
  text-align: center;
}
.stat-strip .num {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.stat-strip .label { font-size: 1.1rem; font-weight: 500; }

/* Tags */
.pill-tag {
  display: inline-flex;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--paper-alt);
  color: var(--ink);
  border: 1px solid var(--border);
  width: fit-content;
}
.tag-awareness { background: #e0f2fe; color: #0284c7; border-color: #bae6fd; }
.tag-network { background: #dcfbe0; color: #166534; border-color: #bbf7d0; }
.tag-web { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.tag-malware { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.tag-privacy { background: #f3e8ff; color: #7e22ce; border-color: #e9d5ff; }

/* Blog Elements & Mascot */
.blog-hero {
  padding: 130px 0 20px;
  overflow: visible;
}

.blog-hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: flex-end;
}

.blog-hero-art {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  position: relative;
  width: 100%;
  padding-top: 2rem;
}

.blog-mascot {
  max-width: 100%;
  max-height: 280px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin-left: auto;
  margin-top: auto;
  filter: drop-shadow(0 16px 32px rgba(15, 23, 42, 0.12));
  animation: blog-mascot-float 5s ease-in-out infinite alternate;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes blog-mascot-float {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-8px); }
}

.blog-mascot:hover {
  transform: scale(1.04) rotate(-1deg);
}

/* Resume Hero & Mascot */
.resume-hero {
  padding: 130px 0 40px;
  overflow: visible;
}

.resume-hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}

.resume-hero-art {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  width: 100%;
}

.resume-mascot {
  max-width: 100%;
  max-height: 330px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin-left: auto;
  filter: drop-shadow(0 16px 32px rgba(15, 23, 42, 0.12));
  animation: blog-mascot-float 5s ease-in-out infinite alternate;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.resume-mascot:hover {
  transform: scale(1.04) rotate(1deg);
}

/* Contact Hero & Mascot */
.contact-hero {
  padding: 130px 0 40px;
  overflow: visible;
}

.contact-hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}

.contact-hero-art {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  width: 100%;
}

.contact-mascot {
  max-width: 100%;
  max-height: 310px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin-left: auto;
  filter: drop-shadow(0 16px 32px rgba(15, 23, 42, 0.12));
  animation: blog-mascot-float 5s ease-in-out infinite alternate;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.contact-mascot:hover {
  transform: scale(1.04) rotate(-1deg);
}

.filter-bar {
  display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; margin-bottom: 3rem;
}
.filter-pill {
  background: var(--paper); border: 1px solid var(--border); color: var(--ink-light);
  padding: 0.75rem 1.5rem; border-radius: var(--radius-pill);
  font-weight: 600; cursor: pointer; transition: all 0.2s ease;
  font-size: 1rem;
}
.filter-pill:hover { border-color: var(--ink); color: var(--ink); }
.filter-pill[aria-pressed="true"] { background: var(--ink); color: white; border-color: var(--ink); box-shadow: var(--shadow-md); }

.post-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem;
}

/* Markdown Content Styling */
.post-content { max-width: 800px; margin: 0 auto; padding: 4rem 2rem; font-size: 1.125rem; }
.post-content h2 { margin-top: 3rem; color: var(--ink); }
.post-content p { margin-bottom: 1.5rem; line-height: 1.8; }
.post-content code { background: var(--paper-alt); padding: 0.2rem 0.4rem; border-radius: 4px; font-family: var(--font-mono); font-size: 0.9em; border: 1px solid var(--border); color: #db2777; }
.post-content pre { background: var(--ink); color: white; padding: 1.5rem; border-radius: var(--radius); overflow-x: auto; margin-bottom: 1.5rem; box-shadow: var(--shadow-md); }
.post-content pre code { background: transparent; border: none; padding: 0; color: #e2e8f0; }
.post-content blockquote { border-left: 4px solid var(--primary); padding-left: 1.5rem; margin-left: 0; color: var(--ink-light); font-style: italic; }

/* Footer */
.site-footer { background: var(--paper-alt); border-top: 1px solid var(--border); padding: 5rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 4rem; margin-bottom: 4rem; }
.footer-grid h4 { margin-bottom: 1.5rem; }
.footer-links li { margin-bottom: 0.75rem; }
.footer-links a { color: var(--ink-light); }
.footer-links a:hover { color: var(--primary); padding-left: 4px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 2rem; border-top: 1px solid var(--border); color: var(--ink-light); font-size: 0.9rem; flex-wrap: wrap; gap: 1rem; }

/* Animations & Interaction classes */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s cubic-bezier(0.5, 0, 0, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }

/* Contact Page */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 4rem; }
.contact-info { display: flex; flex-direction: column; gap: 1.5rem; }
.contact-info .card { padding: 2rem; }
.link-row { font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.link-row:hover { color: var(--primary); }

.form-card { background: var(--surface); padding: 2.5rem; border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.form-card.success-mode #contact-form { display: none; }
.form-card.success-mode #form-success { display: flex; }
#form-success { display: none; align-items: flex-start; gap: 1rem; padding: 1.5rem; background: #dcfbe0; border: 1px solid #bbf7d0; border-radius: var(--radius); font-weight: 500; color: #166534; }
#form-success svg { flex-shrink: 0; margin-top: 2px; }

/* Forms */
.field { margin-bottom: 1.5rem; position: relative; }
.field label { display: block; font-weight: 600; margin-bottom: 0.5rem; font-size: 0.95rem; }
.field input, .field select, .field textarea { width: 100%; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); font-family: inherit; font-size: 1rem; transition: all 0.2s; background: var(--paper-alt); color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(63, 196, 91, 0.1); background: var(--surface); }
.field textarea { min-height: 150px; resize: vertical; }
.field.error input, .field.error textarea { border-color: #ef4444; background: #fef2f2; }
.field-error { display: none; color: #ef4444; font-size: 0.85rem; font-weight: 500; margin-top: 0.5rem; }
.field.error .field-error { display: block; }

.btn-block { width: 100%; display: flex; }
.form-note { font-size: 0.85rem; color: var(--ink-light); text-align: center; margin-top: 1.5rem; margin-bottom: 0; }

/* Mobile */
@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .blog-hero .wrap { grid-template-columns: 1fr; }
  .blog-hero-art { margin-top: 1rem; }
  .blog-mascot { max-height: 220px; }
  .resume-hero .wrap { grid-template-columns: 1fr; }
  .resume-hero-art { margin-top: 1.5rem; }
  .resume-mascot { max-height: 240px; }
  .contact-hero .wrap { grid-template-columns: 1fr; }
  .contact-hero-art { margin-top: 1.5rem; }
  .contact-mascot { max-height: 230px; }
  .footer-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .nav-links {
    position: fixed; top: 80px; left: 0; right: 0; background: var(--paper);
    flex-direction: column; padding: 2rem; gap: 1.5rem;
    box-shadow: var(--shadow-md); clip-path: polygon(0 0, 100% 0, 100% 0, 0 0); transition: clip-path 0.3s ease;
  }
  .nav-links.active { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
  .nav-toggle { display: block; }
  h1 { font-size: 2.5rem; }
}
