:root {
  --bg: #05060a;
  --card-bg: rgba(15, 17, 26, 0.55);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f4f5f7;
  --text-secondary: #9aa0ac;
  --accent-a: #7c5cff;
  --accent-b: #37e6c5;
  --accent-c: #ff5c8a;
  --linkedin: #0a66c2;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mx: 50%;
  --my: 50%;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 72px 24px 40px;
  position: relative;
}

body.error-page {
  justify-content: center;
  padding: 24px;
}

main {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* Animated gradient mesh background */
.mesh {
  position: fixed;
  inset: -20%;
  z-index: 0;
  background:
    radial-gradient(38% 38% at 20% 25%, rgba(124, 92, 255, 0.4) 0%, rgba(124, 92, 255, 0) 70%),
    radial-gradient(42% 42% at 80% 20%, rgba(55, 230, 197, 0.32) 0%, rgba(55, 230, 197, 0) 70%),
    radial-gradient(45% 45% at 50% 85%, rgba(255, 92, 138, 0.26) 0%, rgba(255, 92, 138, 0) 70%),
    var(--bg);
  filter: blur(40px) saturate(130%);
  animation: drift 22s ease-in-out infinite alternate;
  transform: translate3d(calc((var(--mx, 50%) - 50%) * -0.06), calc((var(--my, 50%) - 50%) * -0.06), 0);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

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

/* Subtle grain overlay for texture */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
  .mesh { animation: none; }
}

.card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 48px 40px 40px;
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: center;
  animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 6px 14px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  margin-bottom: 22px;
  background: rgba(255, 255, 255, 0.03);
}

.name {
  font-family: var(--font);
  font-size: clamp(36px, 6vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 10px;
  background: linear-gradient(100deg, #ffffff 20%, var(--accent-b) 45%, #ffffff 70%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s ease-in-out infinite;
}

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

.tagline {
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.6;
  margin: 0 0 32px;
}

.cta-row {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: 12px;
  background: var(--linkedin);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
  box-shadow: 0 8px 24px rgba(10, 102, 194, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(10, 102, 194, 0.45);
  filter: brightness(1.08);
}

.cta-primary:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 6px 16px rgba(10, 102, 194, 0.35);
}

.cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.cta-secondary:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}

.cta-secondary:active {
  transform: translateY(0) scale(0.97);
}

.cta-row-multi {
  gap: 14px;
  flex-wrap: wrap;
}

/* ---- 404 page ---- */

.error-card {
  max-width: 520px;
  padding-top: 44px;
}

.error-code {
  font-family: var(--font);
  font-size: clamp(72px, 16vw, 120px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 8px 0 4px;
  background: linear-gradient(100deg, #ffffff 20%, var(--accent-c) 45%, var(--accent-a) 70%, #ffffff 90%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s ease-in-out infinite;
}

.error-title {
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(20px, 3.4vw, 24px);
  letter-spacing: -0.015em;
  margin: 0 0 14px;
  color: var(--text-primary);
}

.li-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

.badge-wrap {
  display: flex;
  justify-content: center;
  min-height: 60px;
}

.hero .cta-row { margin-bottom: 8px; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.footer {
  position: relative;
  z-index: 2;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* ---- Content sections (Masura AI / About) ---- */

.section {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 720px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 44px 40px;
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.section-head {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 36px;
}

.section-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-b);
  margin-bottom: 14px;
}

.section h2 {
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(26px, 4vw, 32px);
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  color: var(--text-primary);
}

.section-intro {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
  margin: 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 32px;
}

.feature-card {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: left;
  opacity: 0;
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.section.visible .feature-card {
  animation: cardIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.section.visible .feature-card:nth-child(1) { animation-delay: 0.05s; }
.section.visible .feature-card:nth-child(2) { animation-delay: 0.15s; }
.section.visible .feature-card:nth-child(3) { animation-delay: 0.25s; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(220px circle at var(--fx, 50%) var(--fy, 50%), rgba(255, 255, 255, 0.08), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.feature-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.045);
  transform: translateY(-4px);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.feature-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: #05060a;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-a { background: linear-gradient(135deg, var(--accent-c), #ffb199); }
.icon-b { background: linear-gradient(135deg, var(--accent-a), #a996ff); }
.icon-c { background: linear-gradient(135deg, var(--accent-b), #9dffe9); }

.feature-card h3 {
  font-size: 15.5px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text-primary);
}

.feature-card p {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
}

.status-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: fit-content;
  margin: 0 auto;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12.5px;
  color: var(--text-secondary);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-b);
  box-shadow: 0 0 10px var(--accent-b);
  animation: pulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}

.about-body {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.75;
  max-width: 600px;
  margin: 0 auto 18px;
  text-align: left;
}

#about .cta-row {
  margin-top: 28px;
  margin-bottom: 0;
}

/* ---- Scroll reveal ---- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal.hero {
  opacity: 1;
  transform: none;
  animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
}

@media (max-width: 640px) {
  .feature-grid { grid-template-columns: 1fr; }
  .section { padding: 36px 24px; }
}

@media (max-width: 480px) {
  .card { padding: 40px 24px 32px; border-radius: 20px; }
}
