/*
 * ============================================================
 *  Theme Name:  Ajla Maho — Personal Page
 *  Description: Dark personal portfolio stylesheet
 *  Author:      Ajla Maho
 *  Version:     1.0.0
 *  License:     GPL-2.0-or-later
 * ============================================================
 *
 *  TABLE OF CONTENTS
 *  ─────────────────
 *  00. Google Fonts Import
 *  01. CSS Custom Properties (Design Tokens)
 *  02. Reset & Base
 *  03. Custom Cursor
 *  04. Noise Overlay
 *  05. Navigation
 *  06. Hero Section
 *      06a. Grid Background
 *      06b. Glow Orbs
 *      06c. Hero Inner / Typography
 *      06d. Buttons
 *      06e. Scroll Hint
 *  07. Section Shared Styles
 *  08. About Section
 *  09. Skills Section
 *  10. Projects Section
 *  11. Contact Section
 *  12. Footer
 *  13. Particles
 *  14. Animations & Keyframes
 *  15. Utilities
 *  16. Responsive / Media Queries
 * ============================================================
 */


/* ============================================================
   00. GOOGLE FONTS IMPORT
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');


/* ============================================================
   01. CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================ */
:root {
  /* ── Backgrounds ── */
  --bg:          #0a090d;
  --bg2:         #100f14;
  --surface:     #15131c;

  /* ── Borders ── */
  --border:      #2a2535;

  /* ── Accent Palette ── */
  --accent1:     #c084fc;   /* violet – primary highlight    */
  --accent2:     #f0abfc;   /* pink-violet – italic accents  */
  --accent3:     #818cf8;   /* indigo – secondary highlight  */
  --gold:        #e0c97b;   /* warm gold – special callouts  */

  /* ── Text ── */
  --text:        #e2dff0;
  --muted:       #7c7a96;

  /* ── Typography ── */
  --font-head:   'Cormorant Garamond', Georgia, serif;
  --font-mono:   'Space Mono', 'Courier New', monospace;

  /* ── Spacing ── */
  --section-pad: 7rem 2rem;
  --max-width:   1100px;
  --max-contact: 700px;

  /* ── Transitions ── */
  --ease-fast:   .2s ease;
  --ease-std:    .25s ease;
  --ease-slow:   .4s ease;

  /* ── Z-index Stack ── */
  --z-cursor:    9999;
  --z-ring:      9998;
  --z-noise:     9997;
  --z-nav:       100;
  --z-particles: 1;
}


/* ============================================================
   02. RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  margin:     0;
  padding:    0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size:       16px;
}

body {
  background:  var(--bg);
  color:       var(--text);
  font-family: var(--font-mono);
  overflow-x:  hidden;
  cursor:      none;
  line-height: 1.6;
}

img,
svg {
  display:   block;
  max-width: 100%;
}

a {
  color:           inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 300;
}


/* ============================================================
   03. CUSTOM CURSOR
   ============================================================ */
#cursor {
  position:         fixed;
  top:              0;
  left:             0;
  width:            14px;
  height:           14px;
  background:       var(--accent1);
  border-radius:    50%;
  pointer-events:   none;
  z-index:          var(--z-cursor);
  transition:       transform .15s ease, background var(--ease-fast);
  mix-blend-mode:   screen;
  will-change:      transform;
}

#cursor-ring {
  position:       fixed;
  top:            0;
  left:           0;
  width:          40px;
  height:         40px;
  border:         1px solid var(--accent1);
  border-radius:  50%;
  pointer-events: none;
  z-index:        var(--z-ring);
  transition:     transform .35s ease, opacity .3s;
  opacity:        .5;
  will-change:    transform;
}

/* Cursor states on interactive elements */
#cursor.is-hovered {
  background: var(--accent2);
}

#cursor-ring.is-hovered {
  opacity: .8;
}


/* ============================================================
   04. NOISE OVERLAY
   ============================================================ */
body::before {
  content:          '';
  position:         fixed;
  inset:            0;
  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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity:          .03;
  pointer-events:   none;
  z-index:          var(--z-noise);
}


/* ============================================================
   05. NAVIGATION
   ============================================================ */
nav {
  position:        fixed;
  top:             0;
  width:           100%;
  z-index:         var(--z-nav);
  padding:         1.4rem 3rem;
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  background:      linear-gradient(to bottom, #0a090ddd, transparent);
  backdrop-filter: blur(4px);
}

.nav-logo {
  font-family:    var(--font-head);
  font-size:      1.5rem;
  font-weight:    300;
  letter-spacing: .1em;
  color:          var(--accent2);
  cursor:         none;
}

.nav-links {
  display: flex;
  gap:     2.5rem;
}

.nav-links a {
  font-size:      .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color:          var(--muted);
  transition:     color var(--ease-fast);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--accent1);
}


/* ============================================================
   06. HERO SECTION
   ============================================================ */
#hero {
  min-height:      100vh;
  display:         flex;
  align-items:     center;
  justify-content: center;
  flex-direction:  column;
  position:        relative;
  padding:         6rem 2rem 4rem;
  overflow:        hidden;
}

/* ── 06a. Grid Background ── */
#hero::after {
  content:          '';
  position:         absolute;
  inset:            0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size:  60px 60px;
  opacity:          .3;
  mask-image:       radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent);
  pointer-events:   none;
}

/* ── 06b. Glow Orbs ── */
.orb {
  position:       absolute;
  border-radius:  50%;
  filter:         blur(80px);
  pointer-events: none;
  animation:      drift 12s ease-in-out infinite alternate;
}

.orb1 {
  width:            500px;
  height:           500px;
  background:       rgba(192, 132, 252, .12);
  top:              -10%;
  left:             -10%;
  animation-delay:  0s;
}

.orb2 {
  width:            400px;
  height:           400px;
  background:       rgba(129, 140, 248, .1);
  bottom:           -5%;
  right:            -5%;
  animation-delay:  -4s;
}

.orb3 {
  width:            300px;
  height:           300px;
  background:       rgba(240, 171, 252, .08);
  top:              40%;
  left:             50%;
  animation-delay:  -8s;
}

/* ── 06c. Hero Inner / Typography ── */
.hero-inner {
  position:   relative;
  z-index:    2;
  text-align: center;
}

.hero-tag {
  display:        inline-block;
  font-size:      .65rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color:          var(--accent1);
  border:         1px solid var(--accent1);
  padding:        .35rem 1rem;
  border-radius:  2px;
  margin-bottom:  2rem;
  animation:      fadeUp .8s ease both;
}

h1 {
  font-family:    var(--font-head);
  font-size:      clamp(4rem, 10vw, 9rem);
  font-weight:    300;
  line-height:    .95;
  letter-spacing: -.01em;
  color:          var(--text);
  animation:      fadeUp .8s .15s ease both;
}

h1 em {
  font-style:              italic;
  background:              linear-gradient(135deg, var(--accent1), var(--accent2), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip:         text;
}

.hero-sub {
  font-size:      .8rem;
  letter-spacing: .15em;
  color:          var(--muted);
  margin-top:     1.5rem;
  animation:      fadeUp .8s .3s ease both;
}

.hero-sub span {
  color: var(--gold);
}

/* ── 06d. Buttons ── */
.hero-cta {
  display:         flex;
  gap:             1rem;
  justify-content: center;
  margin-top:      3rem;
  animation:       fadeUp .8s .45s ease both;
}

.btn {
  font-family:    var(--font-mono);
  font-size:      .7rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  padding:        .85rem 2rem;
  border-radius:  2px;
  text-decoration: none;
  cursor:         none;
  transition:     all var(--ease-std);
  display:        inline-block;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent1), var(--accent3));
  color:      var(--bg);
  border:     none;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  opacity:    .85;
  transform:  translateY(-2px);
  box-shadow: 0 10px 30px rgba(192, 132, 252, .3);
}

.btn-outline {
  border:     1px solid var(--border);
  color:      var(--muted);
  background: transparent;
}

.btn-outline:hover,
.btn-outline:focus-visible {
  border-color: var(--accent1);
  color:        var(--accent1);
  transform:    translateY(-2px);
}

/* ── 06e. Scroll Hint ── */
.scroll-hint {
  position:        absolute;
  bottom:          2.5rem;
  left:            50%;
  transform:       translateX(-50%);
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  gap:             .5rem;
  animation:       fadeUp 1s .9s ease both;
}

.scroll-hint span {
  font-size:      .55rem;
  letter-spacing: .2em;
  color:          var(--muted);
  text-transform: uppercase;
}

.scroll-line {
  width:      1px;
  height:     50px;
  background: linear-gradient(to bottom, var(--accent1), transparent);
  animation:  lineGrow 2s ease infinite;
}


/* ============================================================
   07. SECTION SHARED STYLES
   ============================================================ */
section {
  padding:    var(--section-pad);
  max-width:  var(--max-width);
  margin:     0 auto;
}

.section-label {
  font-size:      .6rem;
  letter-spacing: .4em;
  text-transform: uppercase;
  color:          var(--accent1);
  margin-bottom:  1rem;
}

.section-title {
  font-family:   var(--font-head);
  font-size:     clamp(2.5rem, 5vw, 4.5rem);
  font-weight:   300;
  line-height:   1.1;
  margin-bottom: 3rem;
}

.section-title em {
  font-style: italic;
  color:      var(--accent2);
}


/* ============================================================
   08. ABOUT SECTION
   ============================================================ */
#about {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   5rem;
  align-items:           center;
}

/* Image column */
.about-image-wrap {
  position: relative;
}

.about-frame {
  width:          100%;
  aspect-ratio:   3 / 4;
  background:     var(--surface);
  border:         1px solid var(--border);
  border-radius:  4px;
  position:       relative;
  overflow:       hidden;
  display:        flex;
  align-items:    center;
  justify-content: center;
}

.about-frame::before {
  content:    '';
  position:   absolute;
  inset:      0;
  background: linear-gradient(135deg, rgba(192, 132, 252, .15), rgba(129, 140, 248, .1));
}

.avatar-svg {
  width:   70%;
  opacity: .8;
}

.about-frame-deco {
  position:       absolute;
  top:            -20px;
  right:          -20px;
  width:          100%;
  height:         100%;
  border:         1px solid var(--border);
  border-radius:  4px;
  pointer-events: none;
}

.about-badge {
  position:      absolute;
  bottom:        -1rem;
  left:          -1rem;
  background:    var(--surface);
  border:        1px solid var(--border);
  padding:       1rem 1.5rem;
  border-radius: 4px;
}

.about-badge .num {
  font-family: var(--font-head);
  font-size:   2.5rem;
  color:       var(--accent1);
  line-height: 1;
}

.about-badge .label {
  font-size:      .6rem;
  letter-spacing: .2em;
  color:          var(--muted);
  text-transform: uppercase;
  margin-top:     .2rem;
}

/* Text column */
.about-text p {
  font-size:     .82rem;
  line-height:   1.9;
  color:         var(--muted);
  margin-bottom: 1.2rem;
}

.about-text p strong {
  color:       var(--text);
  font-weight: 700;
}

.about-text .btn-outline {
  margin-top: 1.5rem;
}


/* ============================================================
   09. SKILLS SECTION
   ============================================================ */
#skills {
  border-top: 1px solid var(--border);
}

.skills-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap:                   1.5rem;
}

.skill-card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: 4px;
  padding:       2rem;
  position:      relative;
  overflow:      hidden;
  transition:    transform var(--ease-std), border-color var(--ease-std);
}

/* Animated top-border accent */
.skill-card::before {
  content:          '';
  position:         absolute;
  top:              0;
  left:             0;
  right:            0;
  height:           2px;
  background:       linear-gradient(90deg, var(--accent1), var(--accent3));
  transform:        scaleX(0);
  transform-origin: left;
  transition:       transform var(--ease-slow);
}

.skill-card:hover {
  transform:    translateY(-4px);
  border-color: var(--accent1);
}

.skill-card:hover::before {
  transform: scaleX(1);
}

.skill-icon {
  font-size:     1.6rem;
  margin-bottom: 1rem;
}

.skill-name {
  font-family:   var(--font-head);
  font-size:     1.4rem;
  font-weight:   400;
  margin-bottom: .5rem;
  color:         var(--text);
}

.skill-desc {
  font-size:   .7rem;
  line-height: 1.7;
  color:       var(--muted);
}

.skill-tags {
  display:    flex;
  flex-wrap:  wrap;
  gap:        .4rem;
  margin-top: 1.2rem;
}

.tag {
  font-size:      .6rem;
  letter-spacing: .1em;
  padding:        .2rem .6rem;
  border:         1px solid var(--border);
  border-radius:  2px;
  color:          var(--muted);
}


/* ============================================================
   10. PROJECTS SECTION
   ============================================================ */
#projects {
  border-top: 1px solid var(--border);
}

.projects-list {
  display:        flex;
  flex-direction: column;
  gap:            2px;
}

.project-row {
  display:               grid;
  grid-template-columns: 3rem 1fr auto;
  gap:                   2rem;
  align-items:           center;
  padding:               2rem 0;
  border-bottom:         1px solid var(--border);
  transition:            padding-left var(--ease-std);
  cursor:                none;
}

.project-row:hover {
  padding-left: 1rem;
}

.project-num {
  font-size:      .65rem;
  color:          var(--accent1);
  letter-spacing: .1em;
}

.project-info h3 {
  font-family:   var(--font-head);
  font-size:     1.8rem;
  font-weight:   300;
  color:         var(--text);
  margin-bottom: .3rem;
}

.project-info span {
  font-size:      .68rem;
  color:          var(--muted);
  letter-spacing: .15em;
}

.project-arrow {
  width:           44px;
  height:          44px;
  border:          1px solid var(--border);
  border-radius:   50%;
  display:         flex;
  align-items:     center;
  justify-content: center;
  color:           var(--muted);
  transition:      all var(--ease-std);
  flex-shrink:     0;
  font-size:       1rem;
}

.project-row:hover .project-arrow {
  border-color: var(--accent1);
  color:        var(--accent1);
  background:   rgba(192, 132, 252, .1);
}


/* ============================================================
   11. CONTACT SECTION
   ============================================================ */
#contact {
  border-top:  1px solid var(--border);
  text-align:  center;
  max-width:   var(--max-contact);
  padding-top: 7rem;
}

.big-text {
  font-family:   var(--font-head);
  font-size:     clamp(3rem, 8vw, 7rem);
  font-weight:   300;
  line-height:   1;
  color:         var(--text);
  margin-bottom: 1.5rem;
}

.big-text em {
  font-style: italic;
  color:      var(--accent1);
}

#contact p {
  font-size:     .78rem;
  color:         var(--muted);
  line-height:   1.8;
  margin-bottom: 2.5rem;
}

.contact-links {
  display:         flex;
  gap:             1rem;
  justify-content: center;
  flex-wrap:       wrap;
}

.contact-link {
  display:        flex;
  align-items:    center;
  gap:            .5rem;
  font-size:      .7rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color:          var(--muted);
  text-decoration: none;
  border:         1px solid var(--border);
  padding:        .7rem 1.5rem;
  border-radius:  2px;
  transition:     all var(--ease-std);
}

.contact-link:hover,
.contact-link:focus-visible {
  color:        var(--accent1);
  border-color: var(--accent1);
  transform:    translateY(-2px);
}


/* ============================================================
   12. FOOTER
   ============================================================ */
footer {
  border-top:  1px solid var(--border);
  padding:     2rem 3rem;
  display:     flex;
  justify-content: space-between;
  align-items: center;
  max-width:   var(--max-width);
  margin:      0 auto;
}

footer p {
  font-size:      .6rem;
  color:          var(--muted);
  letter-spacing: .1em;
}

footer span {
  color: var(--accent1);
}


/* ============================================================
   13. PARTICLES
   ============================================================ */
.particles {
  position:       fixed;
  inset:          0;
  pointer-events: none;
  z-index:        var(--z-particles);
}

.particle {
  position:      absolute;
  width:         2px;
  height:        2px;
  border-radius: 50%;
  background:    var(--accent1);
  opacity:       0;
  animation:     particleFly linear infinite;
}


/* ============================================================
   14. ANIMATIONS & KEYFRAMES
   ============================================================ */

/* Fade up — used for hero entrance */
@keyframes fadeUp {
  from {
    opacity:   0;
    transform: translateY(20px);
  }
  to {
    opacity:   1;
    transform: translateY(0);
  }
}

/* Orb floating drift */
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(30px, -30px) scale(1.08); }
}

/* Scroll line grow */
@keyframes lineGrow {
  0%,  100% { transform: scaleY(0); transform-origin: top; }
  50%        { transform: scaleY(1); transform-origin: top; }
}

/* Typewriter cursor blink */
@keyframes blink {
  0%,  100% { opacity: 1; }
  50%        { opacity: 0; }
}

/* Floating particles rise */
@keyframes particleFly {
  0%   { opacity: 0;  transform: translateY(0)     scale(1); }
  10%  { opacity: .6;                                         }
  90%  { opacity: .2;                                         }
  100% { opacity: 0;  transform: translateY(-100vh) scale(0); }
}

/* Scroll reveal (applied via JS) */
.reveal {
  opacity:    0;
  transform:  translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}

.reveal.is-visible {
  opacity:   1;
  transform: translateY(0);
}


/* ============================================================
   15. UTILITIES
   ============================================================ */

/* Typewriter cursor pipe */
.typewriter::after {
  content:   '|';
  color:     var(--accent1);
  animation: blink 1s step-end infinite;
}

/* Gradient text helper */
.gradient-text {
  background:              linear-gradient(135deg, var(--accent1), var(--accent2), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip:         text;
}

/* Visually hidden (accessibility) */
.sr-only {
  position:  absolute;
  width:     1px;
  height:    1px;
  padding:   0;
  margin:    -1px;
  overflow:  hidden;
  clip:      rect(0, 0, 0, 0);
  white-space: nowrap;
  border:    0;
}


/* ============================================================
   16. RESPONSIVE / MEDIA QUERIES
   ============================================================ */

/* ── Tablet (≤ 1024px) ── */
@media (max-width: 1024px) {
  nav {
    padding: 1.2rem 2rem;
  }

  #about {
    gap: 3rem;
  }

  footer {
    padding: 1.5rem 2rem;
  }
}

/* ── Mobile (≤ 768px) ── */
@media (max-width: 768px) {

  /* Nav */
  nav {
    padding: 1rem 1.5rem;
  }

  .nav-links {
    gap: 1.5rem;
  }

  .nav-links a {
    font-size:      .6rem;
    letter-spacing: .12em;
  }

  /* Hero */
  #hero {
    padding: 5rem 1.5rem 4rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items:    center;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  /* About – stack to single column */
  #about {
    grid-template-columns: 1fr;
    gap:                   2.5rem;
  }

  .about-frame-deco {
    display: none; /* hide decorative offset border on small screens */
  }

  /* Skills – 1 column on very small */
  .skills-grid {
    grid-template-columns: 1fr;
  }

  /* Projects */
  .project-row {
    grid-template-columns: 2.5rem 1fr auto;
    gap:                   1rem;
  }

  .project-info h3 {
    font-size: 1.4rem;
  }

  /* Contact */
  #contact {
    padding: 4rem 1.5rem;
  }

  .contact-links {
    flex-direction: column;
    align-items:    center;
  }

  .contact-link {
    width:           100%;
    max-width:       280px;
    justify-content: center;
  }

  /* Footer */
  footer {
    flex-direction: column;
    gap:            .5rem;
    text-align:     center;
    padding:        1.5rem;
  }

  /* Sections */
  section {
    padding: 4rem 1.5rem;
  }
}

/* ── Small Mobile (≤ 480px) ── */
@media (max-width: 480px) {
  .nav-links {
    display: none; /* hide full nav on tiny screens – can replace with hamburger */
  }

  h1 {
    font-size: clamp(3.5rem, 16vw, 5rem);
  }

  .orb1,
  .orb2,
  .orb3 {
    display: none; /* reduce GPU load on low-end devices */
  }
}

/* ── Reduced Motion (accessibility) ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration:   0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration:  0.01ms !important;
  }
}