/* ============================================
   DESIGN SYSTEM — hipo.is-a.dev
   ============================================ */

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

/* --- Custom Properties --- */
:root {
  --bg-primary:     #000000;
  --bg-secondary:   #0a0a0a;
  --bg-card:        #111111;
  --bg-elevated:    #1a1a1a;

  --text-primary:   #e0e0e0;
  --text-secondary: #888888;
  --text-bright:    #ffffff;

  --accent-green:   #00ff88;
  --accent-cyan:    #00d4ff;
  --accent-purple:  #b44aff;
  --accent-orange:  #ff6b35;

  --glow-green:     0 0 20px rgba(0,255,136,.3);
  --glow-cyan:      0 0 20px rgba(0,212,255,.3);
  --glow-purple:    0 0 20px rgba(180,74,255,.3);

  --border-subtle:  #222222;
  --border-accent:  #333333;

  --font-mono:  'JetBrains Mono', monospace;
  --font-sans:  'Inter', sans-serif;

  --nav-height: 72px;
}

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

a { color: var(--accent-green); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-cyan); }

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

::selection { background: rgba(0,255,136,.2); color: var(--text-bright); }

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-mono);
  color: var(--text-bright);
  font-weight: 700;
  line-height: 1.2;
}
h1 { font-size: clamp(2.4rem, 6vw, 5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); }
p  { max-width: 65ch; }

/* --- Utility --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.section {
  padding: 120px 0;
  position: relative;
}
.section-label {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--accent-green);
  text-transform: uppercase;
  letter-spacing: .15em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-label::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--accent-green);
}

/* --- Scanline Overlay (hero) --- */
.scanlines {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,.08) 2px,
    rgba(0,0,0,.08) 4px
  );
  z-index: 2;
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: background .4s, backdrop-filter .4s;
}
.nav.scrolled {
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-logo-mark {
  flex: 0 0 auto;
  display: block;
  filter: drop-shadow(0 0 18px rgba(34, 155, 255, .28));
}
.nav-logo span {
  letter-spacing: .02em;
}
.nav-logo .logo-accent {
  color: #7bdcff;
  text-shadow: 0 0 16px rgba(87, 209, 255, .35);
}
.nav-links {
  display: flex;
  list-style: none;
  gap: 36px;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .1em;
  position: relative;
  padding: 4px 0;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-green);
  box-shadow: var(--glow-green);
  transition: width .3s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text-bright); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  z-index: 1001;
}
.nav-hamburger span {
  display: block;
  width: 28px;
  height: 2px;
  background: var(--text-bright);
  transition: transform .3s, opacity .3s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Mobile overlay */
.nav-mobile {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.95);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  z-index: 999;
}
.nav-mobile.open { opacity: 1; pointer-events: auto; }
.nav-mobile a {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  color: var(--text-bright);
  letter-spacing: .1em;
}
.nav-mobile a:hover { color: var(--accent-green); }

/* ============================================
   HERO
   ============================================ */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 40%, rgba(25, 82, 255, .16) 0%, rgba(7, 15, 35, 0) 44%),
    radial-gradient(circle at 18% 18%, rgba(81, 221, 255, .12) 0%, rgba(11, 18, 38, 0) 32%),
    radial-gradient(ellipse at 50% 50%, #0b1226 0%, #050913 55%, #02050b 100%);
}
#particles-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hero-ambient-glow {
  position: absolute;
  inset: auto 50% 18%;
  width: min(76vw, 860px);
  aspect-ratio: 1.9;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(73, 198, 255, .24) 0%, rgba(23, 88, 255, .16) 38%, rgba(4, 9, 19, 0) 74%);
  filter: blur(26px);
  opacity: .95;
  z-index: 1;
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 0 24px;
  max-width: 900px;
}
.hero-title {
  margin-bottom: 16px;
  opacity: 0;
  text-shadow: 0 0 30px rgba(103, 227, 255, .08);
}
.hero-title .char {
  display: inline-block;
  transition: color .1s;
}
.hero-subtitle {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--accent-green);
  margin-bottom: 24px;
  min-height: 1.5em;
}
.cursor-blink {
  display: inline-block;
  width: 10px;
  height: 1.2em;
  background: var(--accent-green);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}
.hero-tagline {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  animation: float 2s ease-in-out infinite;
}
.scroll-indicator svg { width: 20px; height: 20px; stroke: var(--accent-green); }

/* ============================================
   SKILLS
   ============================================ */
#skills { background: var(--bg-secondary); }
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}
.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 32px 24px;
  position: relative;
  overflow: hidden;
  transition: border-color .3s, transform .3s;
}
.skill-card:hover {
  border-color: var(--accent-green);
  transform: translateY(-4px);
}
.skill-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 12px;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent-green), transparent 50%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .3s;
}
.skill-card:hover::before { opacity: 1; }

.skill-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  color: var(--accent-green);
}
.skill-icon svg { width: 100%; height: 100%; }
.skill-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}
.skill-card p {
  font-size: .9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Circuit background */
.circuit-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: .08;
  pointer-events: none;
}
.circuit-bg path {
  stroke: var(--accent-green);
  stroke-width: 1;
  fill: none;
}

/* ============================================
   ABOUT
   ============================================ */
#about { background: var(--bg-primary); }
.about-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 60px;
  align-items: center;
  margin-top: 48px;
}
.about-photo-wrapper {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 0 auto;
}
.about-photo-frame {
  position: absolute;
  inset: -10px;
  z-index: 1;
}
.about-photo-frame svg {
  width: 100%;
  height: 100%;
}
.about-photo-frame path {
  fill: none;
  stroke: var(--accent-green);
  stroke-width: 2;
}
.about-photo {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 2;
  filter: grayscale(.3);
  transition: filter .4s;
}
.about-photo:hover { filter: grayscale(0); }
.about-text h2 { margin-bottom: 20px; }
.about-text p {
  margin-bottom: 16px;
  color: var(--text-secondary);
}
.about-links {
  display: flex;
  gap: 20px;
  margin-top: 24px;
}
.about-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: .9rem;
  color: var(--text-primary);
  border: 1px solid var(--border-accent);
  padding: 10px 20px;
  border-radius: 8px;
  transition: border-color .3s, color .3s;
}
.about-link:hover {
  border-color: var(--accent-green);
  color: var(--accent-green);
}
.about-link svg { width: 18px; height: 18px; }

/* ============================================
   BLOG PREVIEW
   ============================================ */
#blog-preview { background: var(--bg-secondary); }
.blog-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 48px;
}
.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .3s, transform .3s;
}
.blog-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-4px);
}
.blog-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
}
.blog-card-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.blog-card-dot:nth-child(1) { background: #ff5f57; }
.blog-card-dot:nth-child(2) { background: #ffbd2e; }
.blog-card-dot:nth-child(3) { background: #28ca42; }
.blog-card-filename {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--text-secondary);
  margin-left: 8px;
}
.blog-card-body {
  padding: 24px;
}
.blog-card-date {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--accent-green);
  margin-bottom: 8px;
}
.blog-card-body h3 {
  margin-bottom: 12px;
}
.blog-card-body h3 a {
  color: var(--text-bright);
  transition: color .2s;
}
.blog-card-body h3 a:hover { color: var(--accent-green); }
.blog-card-excerpt {
  font-size: .9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.blog-view-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: .9rem;
  margin-top: 32px;
  color: var(--accent-green);
}
.blog-view-all svg {
  width: 16px;
  height: 16px;
  transition: transform .3s;
}
.blog-view-all:hover svg { transform: translateX(4px); }

/* ============================================
   CONTACT / FOOTER
   ============================================ */
#contact {
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}
#matrix-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: .12;
  pointer-events: none;
}
.contact-content {
  position: relative;
  z-index: 1;
  text-align: center;
}
.contact-content h2 {
  margin-bottom: 16px;
}
.contact-content p {
  color: var(--text-secondary);
  margin: 0 auto 40px;
  max-width: 500px;
}
.contact-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 60px;
}
.contact-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: .95rem;
  color: var(--text-primary);
  padding: 14px 28px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  transition: all .3s;
}
.contact-link:hover {
  border-color: var(--accent-green);
  color: var(--accent-green);
  box-shadow: var(--glow-green);
}
.contact-link svg { width: 20px; height: 20px; }

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding: 24px 0;
  text-align: center;
  font-size: .8rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  position: relative;
  z-index: 1;
}

/* ============================================
   KEYFRAMES
   ============================================ */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}
@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-8px); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes borderTrace {
  0%   { stroke-dashoffset: 1000; }
  100% { stroke-dashoffset: 0; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; text-align: center; }
  .about-links { justify-content: center; }
  .blog-cards { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .skills-grid { grid-template-columns: 1fr; }
  .section { padding: 80px 0; }
  .contact-links { flex-direction: column; align-items: center; }
  .about-links { flex-direction: column; align-items: center; }
  .nav-logo {
    gap: 10px;
    font-size: 1.1rem;
  }
  .nav-logo-mark {
    width: 38px;
    height: 38px;
  }
  .hero-content {
    padding: 0 20px;
  }
  .hero-ambient-glow {
    width: min(100vw, 580px);
    bottom: 24%;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .scroll-indicator { animation: none; }
  #particles-canvas, #matrix-canvas { display: none; }
}

/* ============================================
   BLOG PAGE STYLES
   ============================================ */
.blog-page-header {
  padding-top: calc(var(--nav-height) + 60px);
  padding-bottom: 40px;
  background: var(--bg-primary);
}
.blog-listing {
  background: var(--bg-secondary);
  padding: 60px 0 120px;
}
.blog-listing .blog-cards {
  margin-top: 0;
}

/* Blog post article */
.post-header {
  padding-top: calc(var(--nav-height) + 60px);
  padding-bottom: 40px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
}
.post-meta {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--accent-green);
  margin-bottom: 12px;
  display: flex;
  gap: 20px;
}
.post-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 24px 120px;
  font-size: 1.05rem;
  line-height: 1.8;
}
.post-content h2 {
  margin-top: 48px;
  margin-bottom: 16px;
}
.post-content h3 {
  margin-top: 36px;
  margin-bottom: 12px;
}
.post-content p {
  margin-bottom: 20px;
  color: var(--text-primary);
}
.post-content ul, .post-content ol {
  margin-bottom: 20px;
  padding-left: 24px;
  color: var(--text-primary);
}
.post-content li { margin-bottom: 8px; }
.post-content code {
  font-family: var(--font-mono);
  font-size: .9em;
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--accent-cyan);
}
.post-content pre {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 20px 24px;
  overflow-x: auto;
  margin-bottom: 24px;
}
.post-content pre code {
  background: none;
  padding: 0;
  font-size: .85rem;
  line-height: 1.6;
  color: var(--text-primary);
}
.post-content blockquote {
  border-left: 3px solid var(--accent-green);
  padding: 12px 20px;
  margin-bottom: 20px;
  color: var(--text-secondary);
  background: var(--bg-card);
  border-radius: 0 8px 8px 0;
}
.post-content a { text-decoration: underline; text-underline-offset: 3px; }

/* Post navigation */
.post-nav {
  display: flex;
  justify-content: space-between;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 80px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 32px;
}
.post-nav a {
  font-family: var(--font-mono);
  font-size: .85rem;
}
