/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --red: #e63946;
  --red-dark: #c1121f;
  --red-deep: #9b1d20;
  --red-glow: rgba(230, 57, 70, 0.35);
  --red-subtle: rgba(230, 57, 70, 0.07);
  --red-light: #fef2f2;
  --white: #ffffff;
  --white-soft: #fafafa;
  --gray-50: #f7f7f7;
  --gray-100: #eeeeee;
  --gray-200: #d4d4d4;
  --gray-300: #a3a3a3;
  --gray-400: #737373;
  --gray-500: #525252;
  --black: #0a0a0a;
  --black-soft: #171717;
  --black-muted: #262626;

  --bg: var(--white);
  --bg-soft: var(--white-soft);
  --bg-card: var(--white);
  --bg-card-hover: var(--gray-50);
  --text: var(--black);
  --text-secondary: var(--gray-500);
  --text-muted: var(--gray-400);
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
  --shadow-red: 0 8px 32px rgba(230, 57, 70, 0.2);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', var(--font-sans);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

/* ===== CURSOR GLOW ===== */
.cursor-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 57, 70, 0.25) 0%, rgba(230, 57, 70, 0.08) 30%, transparent 65%);
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.4s ease;
  filter: blur(30px);
}

/* ===== NOISE OVERLAY ===== */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

/* ===== CONTAINER ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== NAVIGATION ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 20px 0;
  transition: all 0.4s var(--ease-out);
}

.nav.scrolled {
  padding: 12px 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--black);
}

.logo-bracket {
  color: var(--red);
}

.nav-links {
  display: flex;
  gap: 40px;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.3s ease;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--red);
  transition: width 0.3s var(--ease-out);
}

.nav-link:hover {
  color: var(--black);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--black);
  border-radius: 2px;
  transition: all 0.3s var(--ease-out);
}

.nav-burger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-burger.active span:nth-child(2) {
  opacity: 0;
}

.nav-burger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out);
}

.mobile-menu.active {
  opacity: 1;
  pointer-events: all;
}

.mobile-link {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--black);
  transition: color 0.3s ease;
}

.mobile-link:hover {
  color: var(--red);
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--white);
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: perspective(500px) rotateX(15deg);
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

.hero-gradient {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 900px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 57, 70, 0.08) 0%, transparent 55%);
  filter: blur(60px);
  animation: pulse 6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 80px 24px 0;
  max-width: 900px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 100px;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--red);
  margin-bottom: 32px;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  color: var(--black);
}

.hero-line {
  display: block;
}

.text-gradient {
  background: linear-gradient(135deg, var(--red) 0%, #ff6b6b 50%, var(--red-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-stroke {
  -webkit-text-stroke: 2.5px var(--red);
  -webkit-text-fill-color: transparent;
  transition: all 0.4s var(--ease-out);
}

.text-stroke:hover {
  -webkit-text-fill-color: var(--red);
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  border: none;
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--red);
  color: var(--white);
  box-shadow: 0 0 0 0 var(--red-glow);
}

.btn-primary:hover {
  background: var(--red-dark);
  box-shadow: var(--shadow-red);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--black);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--border-hover);
  background: var(--gray-50);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ===== HERO STATS ===== */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 28px 40px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--black);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* ===== SCROLL INDICATOR ===== */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--red), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 1; height: 40px; }
  50% { opacity: 0.5; height: 25px; }
}

/* ===== SECTIONS ===== */
.section {
  padding: 120px 0;
  position: relative;
  background: var(--white);
}

.section-accent {
  background: var(--gray-50);
}

.section-header {
  margin-bottom: 64px;
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--red);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--black);
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-top: 16px;
  max-width: 500px;
}

/* ===== ABOUT ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.about-lead {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--black);
  margin-bottom: 20px;
  line-height: 1.6;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.8;
}

.about-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
}

.card-glow {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.4), transparent 50%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.about-card-inner {
  padding: 40px;
  background: var(--white);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.about-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.about-info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.info-value {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--black);
}

.status-available {
  color: #16a34a;
  position: relative;
  padding-left: 16px;
}

.status-available::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  animation: blink 2s ease-in-out infinite;
}

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 28px;
}

.project-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.5s var(--ease-out);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: rgba(230, 57, 70, 0.25);
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(230, 57, 70, 0.1);
}

/* Browser-style preview window */
.project-preview {
  position: relative;
  width: 100%;
  height: 320px;
  background: var(--gray-50);
  overflow: hidden;
}

.project-preview-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  height: 36px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
}

.preview-dots {
  display: flex;
  gap: 6px;
}

.preview-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.preview-dots span:nth-child(1) { background: #ff5f57; }
.preview-dots span:nth-child(2) { background: #ffbd2e; }
.preview-dots span:nth-child(3) { background: #28c840; }

.preview-url {
  flex: 1;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 12px;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-preview-scroll {
  position: absolute;
  top: 36px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

/* Screenshot image scroll */
.screenshot-wrap {
  transition: transform 4s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}

.screenshot-wrap img {
  width: 100%;
  display: block;
}

.project-card:hover .screenshot-wrap.loaded {
  transform: translateY(calc(-100% + 320px));
  transition: transform 6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Fade overlay bottom */
.project-preview-scroll::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, var(--white), transparent);
  z-index: 1;
  pointer-events: none;
}

/* Placeholder when no screenshot */
.preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--gray-300);
  background: var(--gray-50);
}

.preview-placeholder span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.project-card-body {
  padding: 24px 28px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.project-tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--red-subtle);
  color: var(--red);
}

.project-card-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--black);
}

.project-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  flex: 1;
}

.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--red);
  transition: gap 0.3s var(--ease-out);
}

.project-card:hover .project-card-link {
  gap: 12px;
}

.project-card-domain {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--gray-50);
  padding: 4px 10px;
  border-radius: 6px;
}

/* Project empty state */
.project-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  border: 2px dashed var(--border);
  border-radius: 20px;
  text-align: center;
  background: var(--white);
}

.empty-icon {
  color: var(--gray-300);
  margin-bottom: 16px;
  opacity: 0.5;
}

.project-empty p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.empty-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== STACK ===== */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.stack-card {
  padding: 32px 24px;
  border-radius: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: all 0.4s var(--ease-out);
}

.stack-card:hover {
  border-color: rgba(230, 57, 70, 0.25);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(230, 57, 70, 0.08);
}

.stack-icon {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

.stack-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 4px;
}

.stack-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== CONTACT ===== */
.contact-wrapper {
  max-width: 700px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px;
  border-radius: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.4s var(--ease-out);
}

.contact-card:hover {
  border-color: rgba(230, 57, 70, 0.2);
  box-shadow: var(--shadow-md);
  transform: translateX(8px);
}

.contact-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--red);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
}

.contact-value {
  font-weight: 600;
  font-size: 1rem;
  color: var(--black);
}

.contact-arrow {
  margin-left: auto;
  color: var(--gray-300);
  transition: all 0.3s var(--ease-out);
}

.contact-card:hover .contact-arrow {
  color: var(--red);
  transform: translate(4px, -4px);
}

/* ===== FOOTER ===== */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  background: var(--black);
  color: var(--white);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--gray-400);
}

/* ===== SCROLL PROGRESS BAR ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red), #ff6b6b, var(--red-dark));
  width: 0%;
  z-index: 10001;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--red-glow);
}

/* ===== MARQUEE ===== */
.marquee {
  overflow: hidden;
  padding: 20px 0;
  background: var(--black);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.marquee-reverse {
  background: var(--black);
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 32px;
  white-space: nowrap;
  animation: marqueeScroll 25s linear infinite;
  width: max-content;
}

.marquee-track-reverse {
  animation: marqueeScrollReverse 30s linear infinite;
}

@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes marqueeScrollReverse {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

.marquee-item {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.marquee-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

/* ===== SECTION GRID BACKGROUND ===== */
.has-grid {
  position: relative;
}

.section-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.018) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
  pointer-events: none;
}

/* ===== SECTION DIVIDERS ===== */
.section-divider {
  height: 80px;
  background: var(--white);
  clip-path: polygon(0 0, 100% 0, 100% 20%, 0 100%);
  margin-top: -1px;
  position: relative;
  z-index: 2;
}

.section-divider-reverse {
  background: var(--gray-50);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 20%);
}

/* ===== REVEAL WORDS ===== */
.reveal-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px) rotateX(-15deg);
  animation: revealWord 0.7s var(--ease-out) forwards;
}

.reveal-word:nth-child(1) { animation-delay: 0.3s; }
.reveal-word:nth-child(2) { animation-delay: 0.45s; }
.reveal-word:nth-child(3) { animation-delay: 0.6s; }

.hero-line:nth-child(2) .reveal-word { animation-delay: 0.8s; }

@keyframes revealWord {
  0% { opacity: 0; transform: translateY(20px) rotateX(-15deg); }
  100% { opacity: 1; transform: translateY(0) rotateX(0); }
}

/* ===== STACK CARD GRADIENT BORDER ===== */
.stack-card {
  position: relative;
  overflow: hidden;
}

.stack-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, transparent, transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  transition: background 0.5s ease;
}

.stack-card:hover::before {
  background: linear-gradient(135deg, var(--red), #ff6b6b, var(--red-dark), var(--red));
  background-size: 300% 300%;
  animation: gradientBorder 3s linear infinite;
}

@keyframes gradientBorder {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===== ANIMATIONS ===== */
[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-burger {
    display: flex;
  }

  .mobile-menu {
    display: flex;
  }

  .hero-title {
    font-size: clamp(2rem, 6vw, 3.5rem);
  }

  .hero-line {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 0.3em;
  }

  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 32px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
    margin-bottom: 48px;
  }

  .hero-actions .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .hero-stats {
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    border-radius: 16px;
  }

  .stat-divider {
    width: 40px;
    height: 1px;
  }

  .hero-badge {
    font-size: 0.7rem;
    padding: 6px 16px;
  }

  .scroll-indicator {
    display: none;
  }

  .section {
    padding: 72px 0;
  }

  .section-header {
    margin-bottom: 40px;
  }

  .section-title {
    font-size: clamp(1.6rem, 5vw, 2.5rem);
  }

  .section-desc {
    font-size: 0.95rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .about-lead {
    font-size: 1.1rem;
  }

  .about-card-inner {
    padding: 28px 20px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .project-preview {
    height: 220px;
  }

  .project-card:hover .screenshot-wrap.loaded {
    transform: translateY(calc(-100% + 220px));
    transition: transform 6s cubic-bezier(0.25, 0.1, 0.25, 1);
  }

  .project-card-body {
    padding: 20px;
  }

  .project-card-title {
    font-size: 1.15rem;
  }

  .project-card-desc {
    font-size: 0.85rem;
  }

  .stack-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .stack-card {
    padding: 24px 12px;
  }

  .stack-card h3 {
    font-size: 0.85rem;
  }

  .contact-card {
    padding: 18px 20px;
  }

  .contact-value {
    font-size: 0.9rem;
  }

  .section-divider {
    height: 40px;
  }

  .marquee {
    padding: 16px 0;
  }

  .marquee-item {
    font-size: 0.8rem;
  }

  .marquee-track {
    gap: 24px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .nav-inner {
    padding: 0 16px;
  }

  .hero-title {
    font-size: 1.8rem;
    line-height: 1.15;
  }

  .hero-subtitle {
    font-size: 0.9rem;
  }

  .hero-stats {
    padding: 16px;
    gap: 12px;
  }

  .stat-number {
    font-size: 1.2rem;
  }

  .stat-label {
    font-size: 0.65rem;
  }

  .section {
    padding: 56px 0;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .about-text p {
    font-size: 0.9rem;
  }

  .about-card-inner {
    padding: 20px 16px;
  }

  .info-label, .info-value {
    font-size: 0.8rem;
  }

  .project-preview {
    height: 180px;
  }

  .project-card:hover .screenshot-wrap.loaded {
    transform: translateY(calc(-100% + 180px));
  }

  .project-card-body {
    padding: 16px;
  }

  .project-card-tags {
    gap: 6px;
    margin-bottom: 10px;
  }

  .project-tag {
    font-size: 0.6rem;
    padding: 3px 8px;
  }

  .project-card-title {
    font-size: 1.05rem;
  }

  .project-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .stack-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stack-card {
    padding: 20px 10px;
  }

  .stack-icon svg {
    width: 28px;
    height: 28px;
  }

  .stack-card h3 {
    font-size: 0.75rem;
  }

  .stack-card p {
    font-size: 0.65rem;
  }

  .contact-card {
    padding: 16px;
    gap: 12px;
  }

  .contact-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .contact-label {
    font-size: 0.65rem;
  }

  .contact-value {
    font-size: 0.85rem;
  }

  .contact-arrow {
    display: none;
  }

  .marquee-item {
    font-size: 0.7rem;
  }

  .marquee-track {
    gap: 16px;
  }

  .section-divider {
    height: 30px;
  }

  .preview-url {
    max-width: 150px;
  }

  .footer {
    padding: 24px 0;
  }

  .footer-logo {
    font-size: 0.95rem;
  }

  .footer-copy {
    font-size: 0.7rem;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  .hero-title {
    font-size: 1.5rem;
  }

  .hero-badge {
    font-size: 0.65rem;
    padding: 5px 12px;
  }

  .btn {
    padding: 12px 20px;
    font-size: 0.8rem;
  }

  .stack-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== SELECTION ===== */
::selection {
  background: var(--red);
  color: var(--white);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--white);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-200);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-300);
}
