/* ==========================================================================
   main.css — Global Styles, Variables, Layout, Navbar, Sidebar, Footer
   Portfolio: Martin Nguyen — Game Designer & UI/UX Specialist
   ==========================================================================
   TABLE OF CONTENTS
   1.  CSS Custom Properties (Design Tokens)
   2.  Reset & Base
   3.  Typography
   4.  Layout Helpers
   5.  Navbar
   6.  Social Sidebar
   7.  Hero Section
   8.  Section Divider
   9.  Footer
   10. Responsive / Mobile
   ========================================================================== */


/* ============================================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
      Edit these to retheme the entire site instantly.
   ============================================================ */
:root {
  /* --- Colours --- */
  --color-bg:          #040404;   /* Darkened base background              */
  --color-surface:     #0e0e0e;   /* Navbar / elevated surface             */
  --color-card:        #111111;   /* Card background                       */
  --color-card-hover:  #181818;   /* Card hover background                 */
  --color-accent:      #7FFF00;   /* Chartreuse-green primary accent       */
  --color-accent-dim:  rgba(127, 255, 0, 0.10);  /* Soft glow tint        */
  --color-accent-glow: rgba(127, 255, 0, 0.40);  /* Border glow           */
  --color-text:        #EEEEEE;   /* Primary text                         */
  --color-text-muted:  #A0A0A0;   /* Subdued / secondary text (high contrast) */
  --color-border:      rgba(255, 255, 255, 0.07); /* Default borders      */
  --color-nav-bg:      rgba(4, 4, 4, 0.88);       /* Frosted navbar       */

  /* --- Sidebar --- */
  --sidebar-width:     56px;

  /* --- Navbar --- */
  --nav-height:        64px;

  /* --- Spacing --- */
  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:   16px;
  --space-lg:   32px;
  --space-xl:   64px;
  --space-2xl: 128px;

  /* --- Typography ---
     --font-heading: clean, bold modern sans-serif.
     --font-name: display font for your name with natural, graceful descenders.
     Preloaded options you can easily swap:
       'Outfit'            - (Active) Modern, bold, natural, graceful g & y curves
       'Space Grotesk'     - Tech/cyber/game-dev bold aesthetic
       'Plus Jakarta Sans' - Geometric neo-grotesque
       'Inter'             - Swiss neutral modernist
  */
  --font-heading: 'Outfit', 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-name:    'Outfit', var(--font-heading);
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* --- Radii (subtle, crisp, modern corners) --- */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  10px;
  --radius-pill: 999px;

  /* --- Transitions --- */
  --transition-fast:   150ms ease;
  --transition-normal: 280ms ease;
  --transition-slow:   480ms ease;

  /* --- Shadows --- */
  --shadow-card:  0 2px 20px rgba(0, 0, 0, 0.6);
  --shadow-glow:  0 0 24px var(--color-accent-glow);
}


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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  /* Prevents horizontal overflow on mobile */
  overflow-x: hidden;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  /* Push content right so it clears the fixed sidebar */
  padding-left: var(--sidebar-width);
  /* Push content down so it clears the fixed navbar */
  padding-top: var(--nav-height);
  min-height: 100vh;
  /* The canvas lives behind everything via z-index */
  position: relative;
}

/* Prevent default list styling everywhere */
ul, ol { list-style: none; }

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

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

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

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}


/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */

/* Display — very large headings (hero name) */
.text-display {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 7vw, 6.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

/* H1 equivalent */
.text-h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

/* H2 equivalent */
.text-h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

/* Section labels — small caps above headings */
.text-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
}

/* Body paragraph */
.text-body {
  font-size: 1rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 65ch;
}

/* Accent highlight text */
.text-accent { color: var(--color-accent); }


/* ============================================================
   4. LAYOUT HELPERS
   ============================================================ */

/* Full-width page content wrapper */
.page-content {
  position: relative;
  z-index: 1; /* Sits above the canvas (z-index: 0) */
}

/* Standard section container — centred, max-width capped */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

/* Generic section padding */
.section {
  padding-block: var(--space-xl);
}

/* Two-column grid helper */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
}

/* Flex row shorthand */
.flex-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* 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;
}


/* ============================================================
   5. NAVBAR
      Fixed top bar, transparent → frosted glass on scroll.
      Name/logo on the left, nav links on the right.
      Inspired by the clean horizontal nav on maeve.odoo.com
   ============================================================ */

.navbar {
  position: fixed;
  top: 0;
  /* Start AFTER the sidebar, span the rest of the viewport */
  left: var(--sidebar-width);
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  display: flex;
  align-items: center;
  padding-inline: var(--space-lg);
  /* Start fully transparent */
  background: transparent;
  transition: background var(--transition-normal),
              backdrop-filter var(--transition-normal),
              border-bottom var(--transition-normal);
}

/* State added by JS when user scrolls down */
.navbar.scrolled {
  background: var(--color-nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
}

/* Brand / logo — left side */
.navbar__brand {
  font-family: var(--font-name, var(--font-heading));
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text);
  /* Push nav links to the far right */
  margin-right: auto;
  transition: color var(--transition-fast);
}

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

/* Brand: first name normal, last name accented */
.navbar__brand span { color: var(--color-accent); }

/* Nav link list — right side */
.navbar__links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.navbar__link {
  position: relative;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  padding-block: var(--space-xs);
  transition: color var(--transition-fast);
}

/* Underline slide-in effect on hover */
.navbar__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width var(--transition-normal);
}

.navbar__link:hover,
.navbar__link.active {
  color: var(--color-text);
}

.navbar__link:hover::after,
.navbar__link.active::after {
  width: 100%;
}

/* Hamburger toggle — hidden on desktop */
.navbar__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  /* Sits above overlay */
  z-index: 110;
}

.navbar__hamburger span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition-normal),
              opacity var(--transition-normal);
  transform-origin: center;
}

/* Animate hamburger → X when menu is open */
.navbar__hamburger.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.navbar__hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.navbar__hamburger.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile full-screen overlay menu */
.navbar__mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--color-bg);
  z-index: 105;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.navbar__mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

.navbar__mobile-menu .navbar__link {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
}


/* ============================================================
   6. SOCIAL SIDEBAR
      Fixed left strip, always visible. Contains icon buttons
      for each social platform. Add/remove <li> items to edit.
   ============================================================ */

.social-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  z-index: 99;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  /* Subtle right border to separate from page */
  border-right: 1px solid var(--color-border);
  background: rgba(8, 8, 8, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Each social icon link */
.social-sidebar__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  transition: color var(--transition-fast),
              transform var(--transition-fast),
              filter var(--transition-fast);
}

.social-sidebar__link:hover {
  color: var(--color-accent);
  transform: scale(1.2);
  /* Soft accent glow on the icon itself */
  filter: drop-shadow(0 0 6px var(--color-accent));
}

.social-sidebar__link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Thin vertical line above and below the icons */
.social-sidebar::before,
.social-sidebar::after {
  content: '';
  display: block;
  width: 1px;
  flex: 1;
  background: var(--color-border);
  max-height: 80px;
}


/* ============================================================
   7. HERO SECTION
      Two-column layout: text left, image right.
      Full viewport height on the home page.
   ============================================================ */

.hero {
  min-height: clamp(450px, calc(100vh - var(--nav-height)), 680px);
  position: relative;
  display: grid;
  /* Left text column gets more space */
  grid-template-columns: 1fr auto;
  align-items: center;
  align-content: center;
  gap: clamp(var(--space-lg), 4vw, var(--space-2xl));
  padding-block: var(--space-lg) var(--space-xl);
}

.hero__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.hero__role {
  /* Small label shown above the name */
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
}

/* Small pulsing dot beside the role label */
.hero__role::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

.hero__name {
  font-family: var(--font-name, var(--font-heading));
  font-size: clamp(3.2rem, 7.5vw, 6.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;            /* Gives descenders breathing room */
  padding-bottom: 0.22em;       /* Critical: guarantees 'g' and 'y' never clip at bottom */
  margin-bottom: -0.1em;        /* Balances spacing into the tagline below */
  background: linear-gradient(135deg, #ffffff 35%, #e2e8f0 75%, #b0bec5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;        /* Expands background canvas around descender padding */
  overflow: visible;
}

.hero__tagline {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--color-text-muted);
  max-width: 52ch;
  line-height: 1.65;
}

.hero__mission {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.5;
  max-width: 52ch;
  background: linear-gradient(135deg, var(--color-accent) 0%, #a0ff50 50%, #ffffff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  margin-top: var(--space-xs);
}

/* CTA button */
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding: 14px 28px;
  background: var(--color-accent);
  color: #040404;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-accent);
  transition: background var(--transition-fast),
              color var(--transition-fast),
              box-shadow var(--transition-fast),
              transform var(--transition-fast);
}

.btn-cta:hover {
  background: transparent;
  color: var(--color-accent);
  box-shadow: 0 0 28px var(--color-accent-glow);
  transform: translateY(-2px);
}

.btn-cta:active { transform: translateY(0); }

.btn-cta svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform var(--transition-fast);
}

.btn-cta:hover svg { transform: translateY(3px); }

/* ---- Hero image ---- */
/* Container: no forced aspect ratio — let the photo dictate height */
.hero__image-wrap {
  width: clamp(200px, 24vw, 320px);
  flex-shrink: 0;
  position: relative;
  /* Subtle accent corner glow */
  filter: drop-shadow(0 0 32px rgba(127, 255, 0, 0.08));
}

/* Real photo fills the container naturally */
.hero__image-wrap img {
  width: 100%;
  height: auto;                /* Natural height — no cropping */
  display: block;
  object-fit: contain;         /* Show full image, no clipping */
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

/* Placeholder label — hidden when a real <img> is present */
/* To restore placeholder look, remove the <img> tag */
.hero__image-label {
  display: none; /* Hidden — placeholder text removed as requested */
}


/* ============================================================
   8. SECTION DIVIDER
      Thin horizontal rule matching the reference image.
   ============================================================ */

.section-divider {
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--color-border) 20%,
    var(--color-border) 80%,
    transparent
  );
  margin-block: var(--space-sm);
}

/* ---- Scroll Indicator (Standardized across pages) ---- */
.scroll-indicator {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  animation: float 2s infinite ease-in-out;
  z-index: 5;
}

@keyframes float {
  0%, 100% {
    transform: translate(-50%, 0);
  }
  50% {
    transform: translate(-50%, 8px);
  }
}

.scroll-indicator svg {
  width: 22px;
  height: 22px;
  fill: var(--color-accent);
  opacity: 0.85;
}

@media (max-width: 900px) {
  .scroll-indicator {
    position: relative;
    bottom: auto;
    margin-top: var(--space-xl);
  }
}


/* ============================================================
   9. FOOTER
      Minimal single-line footer at the bottom of every page.
   ============================================================ */

.site-footer {
  padding: var(--space-lg) var(--space-lg);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

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

.site-footer a {
  color: var(--color-accent);
  transition: opacity var(--transition-fast);
}

.site-footer a:hover { opacity: 0.7; }

/* ---- Footer & Mobile Menu Social Links ---- */
.footer-socials,
.mobile-menu-socials {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.footer-socials a,
.mobile-menu-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.03);
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.footer-socials a:hover,
.mobile-menu-socials a:hover {
  color: var(--color-accent);
  border-color: rgba(127, 255, 0, 0.4);
  box-shadow: 0 0 12px rgba(127, 255, 0, 0.25);
  transform: translateY(-2px);
  opacity: 1;
}

.footer-socials a svg,
.mobile-menu-socials a svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.mobile-menu-socials {
  margin-top: var(--space-md);
  gap: var(--space-md);
}

.mobile-menu-socials a {
  width: 44px;
  height: 44px;
}

.mobile-menu-socials a svg {
  width: 22px;
  height: 22px;
}


/* ============================================================
   10. RESPONSIVE / MOBILE
       Sidebar hides on small screens, hamburger appears.
   ============================================================ */

@media (max-width: 900px) {
  /* Hero switches to single column */
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero__image-wrap {
    margin-inline: auto;
    width: clamp(180px, 50vw, 260px);
  }
  .hero__tagline { margin-inline: auto; }
  .btn-cta { align-self: center; }
  .hero__role { justify-content: center; }

  /* Grid 2 collapses */
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  body {
    /* No sidebar padding on mobile */
    padding-left: 0;
  }

  /* Hide desktop sidebar */
  .social-sidebar { display: none; }

  /* Navbar spans full width on mobile */
  .navbar { left: 0; }

  /* Hide desktop nav links, show hamburger */
  .navbar__links { display: none; }
  .navbar__hamburger { display: flex; }

  /* Show mobile menu overlay */
  .navbar__mobile-menu { display: flex; }

  /* Footer stacks */
  .site-footer {
    flex-direction: column;
    text-align: center;
  }
}
