/* ============================================
   CSS Variables
   ============================================ */
:root {
  --bg: #0a0a0b;
  --bg-elevated: #111113;
  --bg-card: #121214;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(167, 139, 250, 0.35);
  --text: #f5f5f7;
  --text-muted: #8a8a93;
  --text-dim: #5c5c66;
  --accent: #a78bfa;
  --accent-soft: rgba(167, 139, 250, 0.15);
  --accent-glow: rgba(167, 139, 250, 0.12);

  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --header-h: 72px;
  --footer-h: 56px;
  --gap: clamp(1.5rem, 3vw, 2.5rem);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.5;
}

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

button {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

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

/* ============================================
   Noise Texture
   ============================================ */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px 180px;
}

/* ============================================
   Ambient Glow
   ============================================ */
.ambient-glow {
  position: fixed;
  width: 60vw;
  height: 60vw;
  max-width: 700px;
  max-height: 700px;
  top: 20%;
  right: -10%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  animation: glowPulse 12s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.4; transform: scale(1) translate(0, 0); }
  50% { opacity: 0.7; transform: scale(1.08) translate(-2%, 3%); }
}

/* ============================================
   Page Layout
   ============================================ */
.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3.5rem);
}

/* ============================================
   Header
   ============================================ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(-12px);
  animation: fadeSlideIn 0.8s var(--ease-out) 0.15s forwards;
}

.logo {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: opacity 0.25s var(--ease);
}

.logo:hover {
  opacity: 0.8;
}

.logo-fara {
  color: var(--text);
}

.logo-dev {
  color: var(--accent);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.skills-label {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.menu-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border-hover);
  background: radial-gradient(circle at center, var(--accent) 0%, transparent 70%);
  opacity: 0.7;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.menu-dot:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* ============================================
   Main
   ============================================ */
.main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: var(--gap);
  align-items: center;
  padding: 0.5rem 0;
  min-height: 0;
}

/* ============================================
   Hero
   ============================================ */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 520px;
  padding-right: 1rem;
}

.headline {
  font-size: clamp(2rem, 4.2vw, 3.15rem);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--text);
}

.headline .line {
  display: block;
  opacity: 0;
  transform: translateY(22px);
  animation: lineReveal 0.9s var(--ease-out) forwards;
}

.headline .line:nth-child(1) { animation-delay: 0.35s; }
.headline .line:nth-child(2) { animation-delay: 0.48s; }
.headline .line:nth-child(3) { animation-delay: 0.61s; }
.headline .line:nth-child(4) { animation-delay: 0.74s; }

.headline .accent {
  color: var(--accent);
}

.headline-rule {
  width: 48px;
  height: 1.5px;
  background: var(--accent);
  margin: 1.35rem 0 1.25rem;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
  animation: ruleReveal 0.7s var(--ease-out) 0.95s forwards;
}

.description {
  font-size: clamp(0.875rem, 1.3vw, 0.95rem);
  font-weight: 400;
  line-height: 1.65;
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(14px);
  animation: fadeSlideIn 0.8s var(--ease-out) 1.05s forwards;
}

/* Connect */
.connect {
  margin-top: clamp(2rem, 4vh, 3.25rem);
  opacity: 0;
  transform: translateY(14px);
  animation: fadeSlideIn 0.8s var(--ease-out) 1.25s forwards;
}

.connect-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.3s var(--ease);
}

.social-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.social-link:hover {
  color: var(--text);
}

.social-link:hover::after {
  transform: scaleX(1);
}

.social-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease), color 0.3s var(--ease);
}

.social-link:hover .social-icon {
  transform: translateY(-2px);
  color: var(--accent);
}

/* ============================================
   Skills
   ============================================ */
.skills {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  width: 100%;
  max-width: 520px;
}

.skill-card {
  aspect-ratio: 1;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top-color: rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.75rem;
  cursor: default;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px);
  transition:
    transform 0.35s var(--ease),
    border-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease),
    background 0.35s var(--ease);
}

.skill-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--accent-soft) 0%, transparent 65%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}

.skill-card:hover {
  transform: translateY(-4px);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.09) 0%,
    rgba(255, 255, 255, 0.03) 100%
  );
  border-color: var(--border-hover);
  box-shadow:
    0 8px 28px -8px rgba(167, 139, 250, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

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

.skill-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  transition: transform 0.35s var(--ease);
}

.skill-card:hover .skill-icon {
  transform: scale(1.08);
}

.skill-name {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.01em;
  transition: color 0.3s var(--ease), transform 0.3s var(--ease);
}

.skill-card:hover .skill-name {
  color: var(--text);
  transform: translateY(-1px);
}

/* Staggered entrance for cards */
.skill-card:nth-child(1) { animation: cardIn 0.7s var(--ease-out) 0.55s forwards; }
.skill-card:nth-child(2) { animation: cardIn 0.7s var(--ease-out) 0.62s forwards; }
.skill-card:nth-child(3) { animation: cardIn 0.7s var(--ease-out) 0.69s forwards; }
.skill-card:nth-child(4) { animation: cardIn 0.7s var(--ease-out) 0.76s forwards; }
.skill-card:nth-child(5) { animation: cardIn 0.7s var(--ease-out) 0.83s forwards; }
.skill-card:nth-child(6) { animation: cardIn 0.7s var(--ease-out) 0.90s forwards; }
.skill-card:nth-child(7) { animation: cardIn 0.7s var(--ease-out) 0.97s forwards; }
.skill-card:nth-child(8) { animation: cardIn 0.7s var(--ease-out) 1.04s forwards; }

/* ============================================
   Footer
   ============================================ */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--footer-h);
  flex-shrink: 0;
  opacity: 0;
  animation: fadeSlideIn 0.8s var(--ease-out) 1.4s forwards;
}

.copyright {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.copyright .dot {
  color: var(--accent);
  margin: 0 0.15rem;
}

.available {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  transition: color 0.3s var(--ease);
}

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

.available .arrow {
  display: inline-block;
  animation: arrowNudge 2.4s ease-in-out infinite;
}

@keyframes arrowNudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

/* ============================================
   Keyframes
   ============================================ */
@keyframes fadeSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lineReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ruleReveal {
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

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

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .ambient-glow,
  .available .arrow {
    animation: none !important;
  }

  .header,
  .headline .line,
  .headline-rule,
  .description,
  .connect,
  .skill-card,
  .footer {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .skill-card:hover {
    transform: none;
  }
}

/* ============================================
   Responsive — Large Desktop
   ============================================ */
@media (min-width: 1600px) {
  .page {
    max-width: 1500px;
  }

  .skills-grid {
    max-width: 560px;
    gap: 0.85rem;
  }
}

/* ============================================
   Responsive — Laptop / smaller desktop
   ============================================ */
@media (max-width: 1200px) {
  .headline {
    font-size: clamp(1.85rem, 3.8vw, 2.75rem);
  }

  .skills-grid {
    max-width: 460px;
    gap: 0.65rem;
  }

  .skill-icon {
    width: 24px;
    height: 24px;
  }

  .skill-name {
    font-size: 0.65rem;
  }
}

@media (max-width: 1024px) {
  .main {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .hero {
    max-width: 100%;
    padding-right: 0;
  }

  .skills-grid {
    max-width: 100%;
  }
}

/* ============================================
   Responsive — Tablet
   ============================================ */
@media (max-width: 860px) {
  :root {
    --header-h: 64px;
    --footer-h: 52px;
  }

  .main {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 2rem;
    align-content: center;
    padding: 1rem 0;
  }

  .hero {
    max-width: 100%;
    text-align: left;
  }

  .headline {
    font-size: clamp(1.9rem, 5.5vw, 2.6rem);
  }

  .skills {
    justify-content: center;
  }

  .skills-grid {
    max-width: 420px;
    margin: 0 auto;
  }

  .connect {
    margin-top: 1.75rem;
  }
}

/* ============================================
   Responsive — Mobile
   ============================================ */
@media (max-width: 560px) {
  body {
    overflow-y: auto;
  }

  .page {
    padding: 0 1.15rem;
    min-height: auto;
  }

  .header {
    height: 56px;
  }

  .main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 0.5rem 0 1.5rem;
  }

  .headline {
    font-size: 1.85rem;
  }

  .headline-rule {
    margin: 1.1rem 0 1rem;
  }

  .description {
    font-size: 0.875rem;
  }

  .connect {
    margin-top: 1.5rem;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    max-width: 100%;
  }

  .skill-card {
    aspect-ratio: 1.15;
    border-radius: 10px;
    gap: 0.5rem;
  }

  .skill-icon {
    width: 22px;
    height: 22px;
  }

  .skill-name {
    font-size: 0.68rem;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    height: auto;
    padding: 1rem 0 1.5rem;
  }

  .available {
    font-size: 0.65rem;
  }
}

@media (max-width: 380px) {
  .headline {
    font-size: 1.65rem;
  }

  .social-links {
    gap: 0.4rem 1rem;
  }

  .social-link {
    font-size: 0.8rem;
  }
}
