/* ============================================
   ajithrn.com - 2026
   Personal site
   ============================================ */

/* ----- Custom Properties ----- */
:root {
  --color-bg: #263238;
  --color-surface: #2e3b42;
  --color-text: #ffffff;
  --color-text-muted: #b0bec5;
  --color-accent: #e0e0e0;
  --color-accent-hover: #ffffff;
  --color-glow: rgba(255, 255, 255, 0.05);
  --color-border: rgba(255, 255, 255, 0.1);

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;

  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2.5rem;
  --spacing-xl: 4rem;

  --radius: 12px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----- Reset ----- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* ----- Hero Section ----- */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--spacing-lg);
  position: relative;
  overflow: hidden;
}

.hero__content {
  max-width: 600px;
  width: 100%;
  animation: fadeUp 0.6s ease-out;
}

.hero__greeting {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-sm);
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.hero__wave {
  font-family: var(--font-mono);
  color: var(--color-accent);
  font-size: 1rem;
}

.hero__label {
  letter-spacing: 0.02em;
}

.hero__name {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-xs);
}

.hero__accent {
  color: var(--color-accent);
  animation: blink 1.2s step-end infinite;
}

.hero__title {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.hero__location {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-lg);
}

/* ----- Skills ----- */
.hero__skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: var(--spacing-lg);
}

.hero__skills span {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  opacity: 0.5;
  transition: opacity var(--transition);
}

.hero__skills span:hover {
  opacity: 1;
}

.hero__skills span:not(:last-child)::after {
  content: '/';
  margin-left: 0.75rem;
  opacity: 0.3;
}

/* ----- CTA Button ----- */
.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.85rem 1.75rem;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--color-text);
  transition: var(--transition);
  margin-bottom: var(--spacing-xl);
}

.hero__cta:hover {
  background: #e0e0e0;
  border-color: #e0e0e0;
  color: #263238;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.hero__cta:active {
  transform: translateY(0);
}

.hero__cta svg {
  transition: transform var(--transition);
}

.hero__cta:hover svg {
  transform: translateX(3px);
}

/* ----- Social Links ----- */
.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.hero__links a {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  position: relative;
  padding-bottom: 2px;
  transition: color var(--transition);
}

.hero__links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width var(--transition);
}

.hero__links a:hover {
  color: var(--color-accent-hover);
}

.hero__links a:hover::after {
  width: 100%;
}

/* ----- Background Canvas ----- */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  will-change: transform;
}

/* ----- Background Glow ----- */
.hero__glow {
  position: absolute;
  width: 600px;
  height: 600px;
  top: 30%;
  right: -10%;
  background: radial-gradient(circle, var(--color-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
  animation: pulse 8s ease-in-out infinite alternate;
}

/* ----- Animations ----- */
@keyframes fadeUp {
  from {
    transform: translateY(12px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes blink {
  from, to {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

@keyframes pulse {
  from {
    opacity: 0.5;
    transform: translate(-30%, -60%) scale(1);
  }
  to {
    opacity: 1;
    transform: translate(-30%, -60%) scale(1.2);
  }
}

/* ----- Responsive ----- */
@media (max-width: 640px) {
  .hero {
    padding: var(--spacing-md);
    align-items: flex-end;
    padding-bottom: 15vh;
  }

  .hero__name {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .hero__links {
    gap: var(--spacing-sm);
  }

  .hero__glow {
    width: 300px;
    height: 300px;
  }
}

/* ----- Prefers Color Scheme: Light ----- */
@media (prefers-color-scheme: light) {
  :root {
    --color-bg: #eceff1;
    --color-surface: #ffffff;
    --color-text: #263238;
    --color-text-muted: #546e7a;
    --color-accent: #37474f;
    --color-accent-hover: #263238;
    --color-glow: rgba(38, 50, 56, 0.06);
    --color-border: rgba(0, 0, 0, 0.08);
  }

  .hero__cta {
    color: #ffffff;
    background: #37474f;
    border-color: #37474f;
  }

  .hero__cta:hover {
    background: #263238;
    border-color: #263238;
    color: #ffffff;
  }
}

/* ----- Reduced Motion ----- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ----- Focus Styles ----- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}
