* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --red: #ef4444;
  --red-deep: #dc2626;
  --red-soft: #f87171;
  --ink: #f8fafc;
  --muted: rgba(248, 250, 252, 0.72);
  --line: rgba(239, 68, 68, 0.28);
  --panel: rgba(15, 23, 42, 0.35);
}

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  background: linear-gradient(135deg, #7f1d1d 0%, #450a0a 50%, #0f172a 100%) fixed;
}

/* ===== ACCESSIBILITY ===== */
.skip-link {
  position: absolute; left: 12px; top: -60px;
  background: var(--red); color: #fff; padding: 10px 16px;
  border-radius: 10px; text-decoration: none; font-weight: 700; z-index: 300;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--red-soft); outline-offset: 3px; border-radius: 4px; }

/* ===== SCROLL PROGRESS BAR ===== */
.progress-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--red), #fb923c);
  z-index: 200; transition: width 0.1s linear;
}

/* ===== BACKGROUND GLOW BLOBS ===== */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5; }
.blob1 { width: 420px; height: 420px; background: #ef4444; top: -120px; left: -100px; animation: drift 18s ease-in-out infinite; }
.blob2 { width: 360px; height: 360px; background: #7c3aed; bottom: -140px; right: -80px; animation: drift 24s ease-in-out infinite reverse; }
.blob3 { width: 300px; height: 300px; background: #f59e0b; top: 40%; left: 55%; opacity: 0.3; animation: drift 30s ease-in-out infinite; }
@keyframes drift { 0%,100% { transform: translate(0,0); } 50% { transform: translate(40px,60px); } }

/* ===== NAV ===== */
header { position: fixed; top: 0; left: 0; width: 100%; z-index: 100; }
nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(20px, 5vw, 48px);
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-brand { font-weight: 800; letter-spacing: 1px; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.nav-brand span { color: var(--red); }
.nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.92rem;
  padding: 6px 12px; border-radius: 999px; transition: color 0.25s, background 0.25s;
}
.nav-links a:hover { color: var(--ink); background: rgba(239, 68, 68, 0.18); }
.nav-links a.active { color: var(--ink); background: rgba(239, 68, 68, 0.22); }

/* ===== LAYOUT ===== */
section { padding: clamp(80px, 14vh, 140px) clamp(20px, 6vw, 24px); max-width: 900px; margin: 0 auto; }

h2 {
  font-size: clamp(1.8rem, 4vw, 2.3rem); color: #fff; margin-bottom: 18px;
  position: relative; display: inline-block;
}
h2::after {
  content: ""; position: absolute; left: 0; bottom: -8px;
  width: 48px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--red), transparent);
}
.section-lead { color: var(--red-soft); font-weight: 600; margin-bottom: 26px; }

/* ===== HERO ===== */
.hero { text-align: center; padding-top: clamp(140px, 22vh, 200px); }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.85rem; font-weight: 600; color: var(--muted);
  padding: 6px 14px; border: 1px solid var(--line);
  border-radius: 999px; background: rgba(15, 23, 42, 0.4);
  margin-bottom: 22px; animation: fadeUp 0.6s ease both;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%; background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,0.6); }
  70% { box-shadow: 0 0 0 10px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

.hero h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); line-height: 1.15; margin-bottom: 14px; animation: fadeUp 0.6s ease 0.05s both; }
.gradient-text {
  background: linear-gradient(90deg, #ef4444, #f87171, #fb923c, #ef4444);
  background-size: 250% auto;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: shimmer 6s linear infinite;
}
@keyframes shimmer { to { background-position: 250% center; } }

.rotator { font-size: clamp(1.1rem, 3vw, 1.4rem); font-weight: 600; animation: fadeUp 0.6s ease 0.1s both; }
.rotate-word {
  color: var(--red-soft); border-bottom: 2px solid rgba(239, 68, 68, 0.4);
  display: inline-block; min-width: 7ch; text-align: left;
  transition: opacity 0.25s, transform 0.25s;
}
.rotate-word.swap { opacity: 0; transform: translateY(6px); }
.hero .sub { color: var(--muted); max-width: 560px; margin: 8px auto 30px; animation: fadeUp 0.6s ease 0.15s both; }

.btn-group { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; animation: fadeUp 0.6s ease 0.2s both; }

/* ===== HERO PROMPT CARD ===== */
.prompt-card {
  max-width: 460px; margin: 40px auto 0; text-align: left;
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  animation: fadeUp 0.7s ease 0.3s both;
}
.pc-head {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid rgba(248, 250, 252, 0.08);
}
.pc-head span { width: 10px; height: 10px; border-radius: 50%; background: rgba(248,250,252,0.25); }
.pc-head span:first-child { background: var(--red); }
.pc-head em { margin-left: 8px; font-style: normal; font-size: 0.78rem; color: var(--muted); letter-spacing: 0.5px; }
.pc-body { padding: 16px; font-size: 0.9rem; }
.pc-line { margin-bottom: 10px; color: var(--ink); }
.pc-line b {
  display: inline-block; min-width: 34px; margin-right: 8px;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  color: var(--red-soft);
}
.pc-caret {
  display: inline-block; width: 8px; height: 1em; vertical-align: -2px;
  background: var(--red-soft); animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.pc-steps { list-style: none; margin-top: 8px; }
.pc-steps li {
  position: relative; padding-left: 26px; margin: 8px 0;
  color: var(--muted); font-size: 0.85rem; opacity: 0;
  animation: stepIn 0.4s ease forwards;
}
.pc-steps li::before {
  content: "\2713"; position: absolute; left: 0; top: -1px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(74, 222, 128, 0.18); color: #4ade80;
  font-size: 0.7rem; display: flex; align-items: center; justify-content: center;
}
.pc-steps li:nth-child(1) { animation-delay: 2.2s; }
.pc-steps li:nth-child(2) { animation-delay: 3.0s; }
.pc-steps li:nth-child(3) { animation-delay: 3.8s; }
@keyframes stepIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

/* ===== TECH ROW ===== */
.tech-row {
  list-style: none; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin-top: 34px; animation: fadeUp 0.6s ease 0.4s both;
}
.tech-row li {
  font-size: 0.82rem; font-weight: 600; color: var(--muted);
  padding: 6px 12px; border: 1px solid rgba(248, 250, 252, 0.14);
  border-radius: 8px; background: rgba(15, 23, 42, 0.3);
}
.tech-row li:nth-child(-n+3) { color: var(--red-soft); border-color: var(--line); }

/* ===== STATS ===== */
.stats { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; margin-top: 44px; animation: fadeUp 0.6s ease 0.48s both; }
.stat { min-width: 140px; padding: 16px 20px; border: 1px solid rgba(248, 250, 252, 0.12); border-radius: 14px; background: var(--panel); }
.stat strong { display: block; font-size: 1.8rem; color: #fff; }
.stat span { font-size: 0.8rem; color: var(--muted); }

/* ===== BUTTONS ===== */
.btn {
  background: linear-gradient(90deg, var(--red), var(--red-deep));
  color: #fff; padding: 13px 28px; border-radius: 12px;
  text-decoration: none; font-weight: 700; display: inline-block;
  border: 0; cursor: pointer; font-size: 1rem; font-family: inherit;
  transition: transform 0.25s, box-shadow 0.25s, filter 0.25s;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35);
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 12px 34px rgba(239, 68, 68, 0.55); filter: brightness(1.05); }
.btn-outline { background: transparent; border: 1px solid var(--red); color: var(--red-soft); box-shadow: none; }
.btn-outline:hover { background: rgba(239, 68, 68, 0.12); box-shadow: 0 8px 24px rgba(239, 68, 68, 0.2); }

/* ===== HOW I WORK - STEPS ===== */
.steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.steps li {
  padding: 24px; border-radius: 16px;
  border: 1px solid rgba(248, 250, 252, 0.12); background: var(--panel);
  transition: transform 0.3s, border-color 0.3s;
}
.steps li:hover { transform: translateY(-5px); border-color: var(--red); }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; margin-bottom: 12px;
  font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
}
.steps h3 { font-size: 1.1rem; margin-bottom: 6px; }
.steps p { color: var(--muted); font-size: 0.92rem; }

/* ===== PROJECT CARDS ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column;
  background: rgba(30, 41, 59, 0.55);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(239, 68, 68, 0.25);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.card:hover { transform: translateY(-6px); border-color: var(--red); box-shadow: 0 16px 40px rgba(239, 68, 68, 0.28); }
.card-media {
  height: 140px; display: flex; align-items: center; justify-content: center;
  font-weight: 800; letter-spacing: 1px; color: rgba(248,250,252,0.5);
  background: linear-gradient(135deg, rgba(239,68,68,0.25), rgba(124,58,237,0.25));
  border-bottom: 1px solid rgba(239, 68, 68, 0.25);
}
.card-soon .card-media { background: linear-gradient(135deg, rgba(148,163,184,0.18), rgba(15,23,42,0.3)); }
.card-body { padding: 20px 22px; flex: 1; }
.card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card h3 { font-size: 1.2rem; }
.card-year { font-size: 0.8rem; color: var(--muted); }
.card p { color: var(--muted); font-size: 0.95rem; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tags li { font-size: 0.72rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgba(239, 68, 68, 0.14); color: var(--red-soft); }

.card-actions {
  display: flex; gap: 10px; padding: 0 22px 20px;
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}
.card:hover .card-actions, .card:focus-within .card-actions { max-height: 60px; opacity: 1; }
.card-actions a {
  flex: 1; text-align: center; font-size: 0.85rem; font-weight: 700;
  padding: 8px 10px; border-radius: 10px; text-decoration: none;
  background: rgba(239, 68, 68, 0.16); color: var(--red-soft); transition: background 0.2s;
}
.card-actions a:hover { background: rgba(239, 68, 68, 0.3); color: #fff; }

/* ===== ABOUT FACTS ===== */
.facts { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 24px; }
.facts li { padding: 16px; border-radius: 12px; border: 1px solid rgba(248, 250, 252, 0.12); background: var(--panel); }
.facts strong { display: block; color: var(--red-soft); margin-bottom: 4px; }
.facts span { color: var(--muted); font-size: 0.88rem; }

/* ===== CONTACT FORM ===== */
#contact { text-align: center; }
#contact h2 { display: inline-block; }
.contact-form { max-width: 460px; margin: 26px auto 20px; text-align: left; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  background: rgba(15, 23, 42, 0.5); color: var(--ink);
  border: 1px solid rgba(248, 250, 252, 0.16); font: inherit; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--red); background: rgba(15, 23, 42, 0.7); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact-form .btn { width: 100%; }
.form-status { font-size: 0.88rem; margin-top: 10px; min-height: 1.2em; color: var(--red-soft); }
.form-status.ok { color: #4ade80; }

/* ===== FOOTER ===== */
footer { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 0.85rem; border-top: 1px solid rgba(248, 250, 252, 0.1); }

/* ===== SCROLL FADE-IN ===== */
.fade { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade.visible { opacity: 1; transform: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  nav { flex-direction: column; gap: 10px; }
  .nav-links { justify-content: center; }
  .card-actions { max-height: 60px; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.001s !important; }
  .fade { opacity: 1; transform: none; }
  .pc-steps li { opacity: 1; }
  html { scroll-behavior: auto; }
}
