/* =========================================================
   SHDWTEK — dark, tech/circuit themed stylesheet
   ========================================================= */

:root {
  --bg: #05070a;
  --bg-alt: #0a0e14;
  --surface: #10151d;
  --surface-hover: #161d27;
  --border: #1e2733;
  --text: #e6edf3;
  --text-muted: #8b98a5;
  --accent: #003b99;
  --accent-light: #2f8fff;
  --accent-glow: #4fd7ff;
  --radius: 12px;
  --max-width: 1120px;
  --transition: 200ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  display: block;
}

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
  color: var(--text-muted);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- animated circuit background ---------- */

.circuit-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 20%, rgba(0, 59, 153, 0.25), transparent 40%),
    radial-gradient(circle at 85% 60%, rgba(79, 215, 255, 0.12), transparent 45%),
    linear-gradient(180deg, #05070a 0%, #060a10 100%);
  background-color: var(--bg);
}

.circuit-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background-image:
    linear-gradient(rgba(79, 215, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 215, 255, 0.35) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 0%, black, transparent 75%);
}

/* ---------- header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(5, 7, 10, 0.75);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.brand-name {
  font-size: 1.1rem;
}

.site-nav {
  display: flex;
  gap: 28px;
}

.nav-link {
  position: relative;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--accent-glow);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--accent-glow);
  transition: width var(--transition);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  box-shadow: 0 0 0 rgba(79, 215, 255, 0);
}

.btn-primary:hover {
  box-shadow: 0 0 24px rgba(79, 215, 255, 0.45);
  transform: translateY(-2px);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent-glow);
  color: var(--accent-glow);
}

/* ---------- hero ---------- */

.hero {
  padding: 100px 0 80px;
  text-align: center;
}

.hero-logo {
  width: 96px;
  height: 96px;
  margin: 0 auto 24px;
  border-radius: 50%;
  box-shadow: 0 0 40px rgba(79, 215, 255, 0.35);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.8rem;
  color: var(--accent-glow);
  font-weight: 600;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  max-width: 780px;
  margin: 0 auto 20px;
}

.accent-text {
  background: linear-gradient(135deg, var(--accent-light), var(--accent-glow));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lede {
  max-width: 620px;
  margin: 0 auto 32px;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- section titles ---------- */

.section-title {
  font-size: 2rem;
  text-align: center;
}

.section-subtitle {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 48px;
}

.projects,
.about {
  padding: 80px 0;
}

.about-inner {
  max-width: 720px;
  text-align: center;
  margin: 0 auto;
}

/* ---------- project grid / cards ---------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-glow);
  box-shadow: 0 12px 32px rgba(0, 59, 153, 0.35);
}

.project-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.project-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 59, 153, 0.85);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.4px;
  backdrop-filter: blur(4px);
}

.project-card-body {
  padding: 20px 22px 4px;
  flex: 1;
}

.project-card-body h3 {
  font-size: 1.15rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag-list li {
  font-size: 0.72rem;
  color: var(--accent-glow);
  border: 1px solid rgba(79, 215, 255, 0.3);
  padding: 3px 10px;
  border-radius: 999px;
}

.project-card-cta {
  display: block;
  padding: 16px 22px 22px;
  color: var(--accent-glow);
  font-weight: 600;
  font-size: 0.9rem;
}

.project-card-placeholder {
  align-items: center;
  justify-content: center;
  text-align: center;
  border-style: dashed;
  opacity: 0.6;
}

.project-card-placeholder .project-card-body {
  padding: 40px 22px;
}

/* ---------- project detail page ---------- */

.project-hero {
  padding: 60px 0 40px;
  background: linear-gradient(180deg, rgba(0, 59, 153, 0.18), transparent);
  border-bottom: 1px solid var(--border);
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--accent-glow);
}

.project-hero-inner .status-badge {
  position: static;
  display: inline-block;
  margin-bottom: 14px;
}

.project-hero-inner h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.project-tagline {
  font-size: 1.1rem;
  color: var(--text);
}

.project-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.project-body {
  padding: 48px 0 100px;
}

.project-cover {
  width: 160px;
  border-radius: var(--radius);
  margin: 0 auto 32px;
  box-shadow: 0 0 30px rgba(0, 59, 153, 0.3);
}

.project-summary {
  font-size: 1.05rem;
  max-width: 760px;
}

.tag-list-large {
  margin-bottom: 40px;
}

.project-columns {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
  margin-top: 24px;
}

.project-section {
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.project-section:last-child {
  border-bottom: none;
}

.project-section h2 {
  font-size: 1.3rem;
  color: var(--accent-glow);
}

.project-audio .audio-player {
  width: 100%;
  max-width: 480px;
  margin-top: 12px;
}

.feature-list li,
.tech-list li,
.link-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.feature-list li::before {
  content: "▹ ";
  color: var(--accent-glow);
}

.link-list a {
  color: var(--accent-glow);
  font-weight: 600;
}

.aside-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.aside-block h3 {
  font-size: 1rem;
  color: var(--text);
}

.code-view-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--accent-glow);
  font-weight: 600;
  font-size: 0.9rem;
}

.demo-gif-details {
  margin-top: 16px;
}

.demo-gif-details summary {
  color: var(--accent-glow);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  list-style: none;
}

.demo-gif-details summary::-webkit-details-marker {
  display: none;
}

.demo-gif-details summary::before {
  content: '\25B8';
  display: inline-block;
  margin-right: 6px;
  transition: transform var(--transition);
}

.demo-gif-details[open] summary::before {
  transform: rotate(90deg);
}

.demo-gif-image {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 12px;
}

.demo-gif-caption {
  font-size: 0.8rem;
  margin: 8px 0 0;
}

.code-view-link:hover {
  color: #fff;
}

/* ---------- code view page ---------- */

.code-view-header {
  padding: 48px 0 16px;
}

.code-lang-badge {
  color: var(--accent-glow);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0 100px;
  overflow-x: auto;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
}

/* ---------- 404 ---------- */

.not-found {
  text-align: center;
  padding: 140px 0;
}

.not-found h1 {
  font-size: 5rem;
  color: var(--accent-glow);
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.footer-links {
  display: flex;
  gap: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--accent-glow);
}

.footer-copy {
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  color: #5b6672;
  margin: 16px 0 0;
}

/* ---------- scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .site-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(5, 7, 10, 0.97);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition);
  }

  .site-nav.is-open {
    max-height: 260px;
  }

  .nav-toggle {
    display: flex;
  }

  .project-columns {
    grid-template-columns: 1fr;
  }
}
