:root {
  --bg-dark: #08080a;
  --bg-subtle: rgba(255, 255, 255, 0.025);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.2);
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --heading: #ffffff;
  
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.12);
  --green: #4ade80;
  --amber: #fbbf24;
  
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Plus Jakarta Sans', -apple-system, sans-serif;
  
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

.grid-bg {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: -1;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 80%);
}

/* Minimalist Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(8, 8, 10, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--heading);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo-accent {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 28px;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: color var(--transition);
}

.nav a:hover {
  color: var(--heading);
}

.nav-toggle {
  display: none;
}

/* Editorial Hero Section */
.hero {
  padding: 180px 0 120px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 48px;
  align-items: center;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--green);
  background: rgba(74, 222, 128, 0.06);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(74, 222, 128, 0.2);
  margin-bottom: 24px;
}

.status-pulse {
  width: 8px;
  height: 8px;
  background-color: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--green);
}

.hero-title {
  font-size: clamp(2.75rem, 6.5vw, 4.75rem);
  font-weight: 800;
  color: var(--heading);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin-bottom: 24px;
}

.hero-tagline {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 580px;
  line-height: 1.7;
  margin-bottom: 36px;
}

.tagline-rotate {
  color: var(--heading);
  font-weight: 600;
  transition: opacity 0.3s;
}

.tagline-rotate.fade {
  opacity: 0;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--heading);
  transition: all var(--transition);
}

.btn-primary {
  border-color: var(--heading);
  background: var(--heading);
  color: var(--bg-dark);
}

.btn-primary:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.btn-outline {
  border-color: var(--border);
  background: transparent;
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--border-hover);
  color: var(--heading);
}

.hero-social {
  display: flex;
  gap: 12px;
}

.hero-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition);
}

.hero-social a:hover {
  color: var(--heading);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.04);
}

/* Profile Photo Frame */
.hero-image-box {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.hero-image-frame {
  width: 260px;
  height: 260px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border-hover, #3b465e);
  margin: 0 auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

/* Section Structure */
.section {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}

.section-head {
  margin-bottom: 44px;
}

.section-num {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 6px;
}

.section-head h2 {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--heading);
  letter-spacing: -0.03em;
}

.section-sub {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 6px;
}

/* About Text */
.about-text {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 780px;
}

.about-text p {
  margin-bottom: 20px;
}

.about-text p:last-child {
  margin-bottom: 0;
}

/* Projects Grid */
.projects-grid, .skills-grid {
  display: grid;
  gap: 24px;
}

.project-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 32px;
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), background var(--transition);
}

.project-card:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.035);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.project-tag {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
}

.pill {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid;
}

.pill-amber {
  color: var(--amber);
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.08);
}

.project-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.project-desc {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
}

.project-tech-tags {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.project-tech-tags span {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* Skills Grid */
.skills-grid {
  grid-template-columns: repeat(3, 1fr);
}

.skill-category {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 28px;
  border-radius: var(--radius-lg);
  transition: border-color var(--transition);
}

.skill-category:hover {
  border-color: var(--border-hover);
}

.skill-category h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 12px;
}

.skill-category p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* Awards Section (Fixed Text Display Bug) */
.awards-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.award-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: center;
  padding: 24px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), transform var(--transition);
}

.award-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.award-frame {
  width: 100%;
  height: 140px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.award-photo-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.award-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.award-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.award-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.02em;
}

.award-meta {
  font-size: 0.8125rem;
  font-family: var(--mono);
  color: var(--text-dim);
}

.award-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 4px;
}

.cert-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition);
}

.cert-link:hover {
  color: var(--heading);
}

/* Contact Box */
.contact-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 48px 36px;
  border-radius: var(--radius-lg);
  text-align: center;
}

.contact-box p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 24px;
}

.contact-actions {
  display: flex;
  justify-content: center;
}

/* Terminal Widget */
.terminal {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 320px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.8rem;
  z-index: 90;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}

.terminal-header button {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
}

.terminal-body {
  padding: 14px;
  color: var(--text-main);
}

.terminal.minimized .terminal-body {
  display: none;
}

.prompt {
  color: var(--green);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--heading);
  color: var(--bg-dark);
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Rules */
@media (max-width: 900px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .award-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .award-frame {
    height: 160px;
  }
}

@media (max-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
  
  .hero-image-box {
    order: -1;
    margin-bottom: 20px;
  }

  .hero-image-frame {
    width: 220px;
    height: 220px;
  }

  .terminal {
    display: none;
  }
}