/* ==========================================================================
   RHYS WYLES — Personal Website
   Design System + Component Styles
   ========================================================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Architects+Daughter&family=JetBrains+Mono:wght@400;500&display=swap');

/* ==========================================================================
   1. DESIGN TOKENS (CSS Custom Properties)
   ========================================================================== */
:root {
  /* --- Color Palette (Neubrutalism Theme) --- */
  --bg-primary: #f2ebd9; /* Beige paper tint */
  --bg-surface: #ffffff; /* pure white cards */
  --bg-elevated: #ffffff;

  --text-primary: #000000;
  --text-secondary: #000000;
  --text-tertiary: #111111;

  --accent: #ff0044; /* Vibrant pink/red */
  --accent-hover: #ffffff;
  --accent-muted: #ffa3bc;

  --border: #000000;
  --border-light: #000000;

  --font-sans: 'Architects Daughter', cursive;
  --font-heading: 'Bangers', display;
  --font-mono: 'Courier New', 'JetBrains Mono', monospace;

  /* Massive typography scale */
  --text-xs: 0.85rem;
  --text-sm: 1rem;
  --text-base: 1.125rem;
  --text-lg: 1.35rem;
  --text-xl: 1.7rem;
  --text-2xl: 2.2rem;
  --text-3xl: 3rem;
  --text-4xl: clamp(3.5rem, 5vw, 4.5rem);
  --text-5xl: clamp(4rem, 6vw, 6.5rem);

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 80px;
  --space-10: 96px;
  --space-11: 128px;

  /* Hard, offset shadows */
  --shadow-sm: 4px 4px 0px #000000;
  --shadow-md: 8px 8px 0px #000000;
  --shadow-lg: 12px 12px 0px #000000;
  --shadow-glow: none;
  --shadow-accent: 8px 8px 0px #000000;

  /* Instant snappy transitions */
  --transition-fast: 100ms ease-out;
  --transition-base: 150ms ease-out;
  --transition-slow: 300ms ease-out;

  /* Absolutely completely sharp corners */
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  --radius-xl: 0px;
  --radius-full: 0px;

    /* Comic Halftone */
  --bg-comic-dots: radial-gradient(circle, #000 1px, transparent 1.5px);
  --bg-comic-size: 10px 10px;

  /* Layout */
  --max-width: 1200px;
  --nav-height: 64px;
  --content-width: 800px;
}


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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative; /* ensure proper z-indexing context */
}

/* Global Subtle grain overlay for tactile depth */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: var(--bg-comic-dots);
  background-size: var(--bg-comic-size);
  opacity: 0.08;
  z-index: -1;
  pointer-events: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

ul {
  list-style: none;
}

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

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: var(--accent);
  color: var(--bg-primary);
}


/* ==========================================================================
   3. ACCENT LINE (top of page)
   ========================================================================== */
.accent-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 12px;
  background-image: var(--bg-comic-dots);
  background-size: var(--bg-comic-size);
  background-color: var(--accent);
  border-bottom: 4px solid #000;
  z-index: 1001;
}

@keyframes shimmer {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}


/* ==========================================================================
   4. NAVIGATION
   ========================================================================== */
.nav {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: var(--max-width);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
  z-index: 1000;
  border-radius: var(--radius-full);
  border: 3px solid #000;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}


.nav__logo {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 400;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0px #00ffff, -2px -2px 0px #ff00ff;
  color: var(--text-primary);
  transition: transform var(--transition-fast);
}

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

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.nav__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  position: relative;
  padding: var(--space-2) 0;
  transition: color var(--transition-fast);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition-base);
}

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

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

.btn--nav {
  padding: 8px 18px;
  min-height: 36px;
  font-size: var(--text-xs);
}

/* Mobile hamburger */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  padding: 4px 0;
  cursor: pointer;
  z-index: 1002;
}

.nav__toggle span {
  display: block;
  width: 100%;
  height: 4px;
  background: var(--text-primary);
  border-radius: 9999px; /* Give it slightly pill-shaped comic edges */
  transition: transform var(--transition-base), opacity var(--transition-fast);
}

.nav__toggle.open span:first-child {
  transform: translateY(7px) rotate(45deg);
}

.nav__toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav__toggle.open span:last-child {
  transform: translateY(-7px) rotate(-45deg);
}


/* ==========================================================================
   5. HERO SECTION
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-11) var(--space-7) var(--space-9);
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Constellation canvas — fixed behind hero content */
#constellationCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* Subtle grain overlay for tactile depth */
.hero::before {
  display: none;
}

.hero>* {
  position: relative;
  z-index: 1;
}

.hero__greeting {
  display: block;
  max-width: max-content;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: #fff;
  background-color: var(--accent); /* Comic Pink/Red */
  border: 2px solid #000;
  box-shadow: 3px 3px 0px #000;
  padding: 4px 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: var(--space-4);
  transform: rotate(-2deg);
}

.hero__name {
  font-family: var(--font-heading);
  letter-spacing: 2px;
  text-shadow: 3px 3px 0px #00ffff, -3px -3px 0px #ff00ff;
  color: #000;
  font-size: var(--text-5xl);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: var(--space-3);
}

.hero__title {
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: var(--space-6);
}

.hero__highlight {
  display: inline-block;
  color: #000;
  background-color: #00ffff; /* Cyan block */
  border: 3px solid #000;
  box-shadow: 4px 4px 0px #ff00ff; /* Magenta Shadow */
  padding: 0 12px;
  transform: rotate(-2deg);
  margin: 0 4px;
}

.hero__highlight:last-child {
  background-color: #ffea00; /* Yellow block */
  box-shadow: 4px 4px 0px var(--accent); /* Red Shadow */
  transform: rotate(2deg);
}

.hero__description {
  max-width: 65ch;
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-7);
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;
}


/* ==========================================================================
   6. BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 14px 28px;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  letter-spacing: 2px;
  border-radius: 9999px; /* Pill shape like speech bubble */
  border-bottom-right-radius: 0; /* Tail of the bubble */
  transition: all var(--transition-base);
  min-height: 48px;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 3px solid #000;
  box-shadow: 4px 4px 0px #000;
}

.btn-primary:hover {
  background: #ffea00;
  border-color: #000;
  transform: translate(-4px, -4px) scale(1.05); /* Pop out and up */
  box-shadow: 8px 8px 0px #000 !important; /* Thick solid shadow */
  color: #000;
}

.btn-outline {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 3px solid #000; /* Black solid border */
  box-shadow: 4px 4px 0px #000 !important;
}

.btn-outline:hover {
  background: #00ffff; /* Cyan pop */
  border-color: #000;
  transform: translate(-4px, -4px) scale(1.05); /* Pop out and up */
  box-shadow: 8px 8px 0px #000 !important; /* Thick solid shadow */
  color: #000;
}

/* --- Social Icon Buttons (Hero) --- */
.socials {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: #000;
  border: 3px solid #000;
  border-radius: var(--radius-full); /* Make them circular */
  box-shadow: 2px 2px 0px #000;
  background: var(--bg-surface);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.social-link:hover {
  background: var(--accent); /* Pop to bright pink */
  transform: translate(-2px, -2px); /* Jump up */
  box-shadow: 4px 4px 0px #000; /* Drop heavier shadow */
}

.social-link:active {
  transform: translate(2px, 2px); /* Clack down */
  box-shadow: 0px 0px 0px #000; 
}

.social-link svg {
  width: 22px;
  height: 22px;
}


/* ==========================================================================
   7. SECTIONS — Common Patterns
   ========================================================================== */
.section {
  padding: var(--space-10) var(--space-7);
  max-width: var(--max-width);
  margin: 0 auto;
}

.section__header {
  margin-bottom: var(--space-8);
}

.section__label {
  display: block;
  max-width: max-content;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: #000;
  background-color: #ffea00; /* Comic yellow */
  border: 2px solid #000;
  box-shadow: 3px 3px 0px #000;
  padding: 4px 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: var(--space-4);
  transform: rotate(-2deg);
}

.section__header[style*="text-align: center"] .section__label {
  margin-left: auto;
  margin-right: auto;
}


.section__title {
  font-family: var(--font-heading);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 3px 3px 0px #00ffff, -3px -3px 0px #ff00ff;
  color: #000;
  border-bottom: 6px solid #000;
  display: inline-block;
  padding-bottom: var(--space-2);
  font-size: var(--text-3xl);
  line-height: 1.2;
}

.section__divider {
  width: 64px;
  height: 4px;
  background: var(--accent); /* Restored to red */
  margin-top: var(--space-4);
}

.section__header[style*="text-align: center"] .section__divider {
  margin-left: auto;
  margin-right: auto;
}

/* Scroll reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Smoother reveal for project cards — preserve rotation, longer travel */
.project-card.reveal {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow var(--transition-fast),
              border-color var(--transition-fast);
}

.project-card.reveal:nth-child(odd) {
  transform: translateY(40px) rotate(-1.5deg);
}

.project-card.reveal:nth-child(even) {
  transform: translateY(40px) rotate(2deg);
}

.project-card.reveal.visible:nth-child(odd) {
  opacity: 1;
  transform: translateY(0) rotate(-1.5deg);
}

.project-card.reveal.visible:nth-child(even) {
  opacity: 1;
  transform: translateY(0) rotate(2deg);
}


/* ==========================================================================
   8. ABOUT SECTION
   ========================================================================== */
.about__content {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--space-8);
  align-items: start;
}

.about__text p {
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: var(--space-5);
  max-width: 65ch;
}

.about__text p strong {
  color: var(--text-primary);
  font-weight: 600;
}

.about__photo-wrapper {
  position: relative;
}

.about__photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 4px solid var(--border);
  transition: border-color var(--transition-fast);
}

.about__photo:hover {
  border-color: #00ffff; /* Cyan pop */
}

/* Photo accent decoration */
.about__photo-wrapper::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  right: -12px;
  bottom: -12px;
  border: 4px solid var(--accent);
  border-radius: var(--radius-md);
  z-index: -1;
  transition: top var(--transition-base), left var(--transition-base);
}

.about__photo-wrapper:hover::after {
  top: 8px;
  left: 8px;
}

/* Skills / Tech tags */
.about__skills {
  margin-top: var(--space-6);
}

.about__skills-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.skill-tag {
  border: 2px solid #000;
  box-shadow: 2px 2px 0px #000;
  font-weight: bold;
  background: #fff;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  background: var(--accent-muted);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 3px solid #000;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast);
}

.skill-tag:hover {
  border-color: var(--accent);
}

/* CV Button */
.about__cv {
  margin-top: var(--space-6);
}


/* ==========================================================================
   8b. EXPERIENCE / TIMELINE SECTION
   ========================================================================== */
.timeline {
  position: relative;
  padding-left: var(--space-7);
  max-width: var(--content-width);
  isolation: isolate; /* Create stacking context for z-index layering */
}

/* Ghost line — full height, faint, shows the path */
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(0, 0, 0, 0.15);
  z-index: -1;
}

/* Drawn line — grows with scroll via JS */
.timeline::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--border);
  transform-origin: top center;
  transform: scaleY(var(--timeline-progress, 0));
  will-change: transform;
  z-index: -1;
}

.timeline__item {
  position: relative;
  padding-bottom: var(--space-8);
}

.timeline__item:last-child {
  padding-bottom: 0;
}

/* Animated marker — scales in when item is revealed */
.timeline__marker {
  position: absolute;
  left: calc(-1 * var(--space-7) + 2px);
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  background: var(--accent);
  border: 3px solid #000;
  box-shadow: 2px 2px 0px #000;
  transform: scale(0);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2; /* Sit above the timeline lines */
}

.timeline__item.visible .timeline__marker {
  transform: scale(1);
}

/* Card with speech bubble tail */
.timeline__content {
  position: relative;
  background: var(--bg-surface);
  border: 3px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  transition: border-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
}

/* Speech bubble tail — outer (black border) */
.timeline__content::after {
  content: '';
  position: absolute;
  top: 10px;
  left: -16px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 16px 10px 0;
  border-color: transparent #000 transparent transparent;
}

/* Speech bubble tail — inner (white fill) */
.timeline__content::before {
  content: '';
  position: absolute;
  top: 12px;
  left: -11px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 12px 8px 0;
  border-color: transparent #fff transparent transparent;
  z-index: 1;
}

.timeline__item:nth-child(odd) .timeline__content:hover {
  border-color: #00ffff;
  transform: translate(-4px, -4px);
  box-shadow: 8px 8px 0px #000;
}

.timeline__item:nth-child(even) .timeline__content:hover {
  border-color: #ff00ff;
  transform: translate(-4px, -4px);
  box-shadow: 8px 8px 0px #000;
}

/* Comic Panel Header — colored bar bleeds to card edges */
.timeline__header {
  margin: calc(-1 * var(--space-6)) calc(-1 * var(--space-6)) var(--space-3) calc(-1 * var(--space-6));
  padding: var(--space-4) var(--space-6);
  border-bottom: 3px solid #000;
  position: relative;
  overflow: hidden;
}

/* Halftone overlay on header */
.timeline__header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--bg-comic-dots);
  background-size: var(--bg-comic-size);
  opacity: 0.12;
  pointer-events: none;
}

/* Header color cycling */
.timeline__item:nth-child(1) .timeline__header { background-color: #ff0044; }
.timeline__item:nth-child(2) .timeline__header { background-color: #00ffff; }
.timeline__item:nth-child(3) .timeline__header { background-color: #ff00ff; }

.timeline__role {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 2px 2px 0px #000;
  line-height: 1.1;
  margin-bottom: var(--space-2);
  position: relative;
  z-index: 1;
}

/* Cyan header needs dark text for contrast */
.timeline__item:nth-child(2) .timeline__role {
  color: #000;
  text-shadow: 2px 2px 0px #00ffff;
}

.timeline__company {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: #000;
  background-color: #ffea00;
  border: 2px solid #000;
  padding: 2px 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-3);
  transform: rotate(1deg);
  position: relative;
  z-index: 1;
}

.timeline__date {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-4);
}

.timeline__description {
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.7;
  max-width: 65ch;
  font-weight: 500;
}

/* --- Alternating Layout (Desktop) --- */
@media (min-width: 769px) {
  .timeline {
    padding-left: 0;
    max-width: var(--content-width);
    margin-left: auto;
    margin-right: auto;
  }

  /* Center vertical lines */
  .timeline::before,
  .timeline::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .timeline__item {
    width: 50%;
  }

  /* Odd items (1, 3): card on the RIGHT */
  .timeline__item:nth-child(odd) {
    margin-left: 50%;
    padding-left: var(--space-7);
  }

  /* Even items (2): card on the LEFT */
  .timeline__item:nth-child(even) {
    margin-left: 0;
    padding-right: var(--space-7);
  }

  /* Markers: center on the line */
  .timeline__item:nth-child(odd) .timeline__marker {
    left: calc(-1 * var(--space-7) + 2px);
  }

  .timeline__item:nth-child(even) .timeline__marker {
    left: auto;
    right: calc(-1 * var(--space-7) + 2px);
  }

  /* Even items: flip hover direction */
  .timeline__item:nth-child(even) .timeline__content:hover {
    transform: translate(4px, -4px);
    box-shadow: -8px 8px 0px #000;
  }

  /* Even items: flip speech bubble tail to point RIGHT */
  .timeline__item:nth-child(even) .timeline__content::after {
    left: auto;
    right: -16px;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent #000;
  }

  .timeline__item:nth-child(even) .timeline__content::before {
    left: auto;
    right: -11px;
    border-width: 8px 0 8px 12px;
    border-color: transparent transparent transparent #fff;
  }
}


/* ==========================================================================
   8c. SCROLL ARROWS — Section navigation indicators
   ========================================================================== */
.scroll-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: var(--space-7) auto 0;
  color: #000;
  background-color: var(--accent); /* Pop of color */
  border: 4px solid #000; /* Thick solid border */
  border-radius: 9999px; /* Pill/Circle */
  box-shadow: 4px 4px 0px #000; /* Comic drop shadow */
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
  cursor: pointer;
}

.scroll-arrow:hover {
  background-color: #ffea00; /* Change to loud yellow on hover */
  transform: translate(-2px, -2px); /* Pop up slightly on hover */
  box-shadow: 6px 6px 0px #000;
}

.scroll-arrow:active {
  transform: translate(4px, 4px); /* Clack down when clicked */
  box-shadow: 0px 0px 0px #000;
}

.scroll-arrow:focus-visible {
  outline: 4px solid var(--accent);
  outline-offset: 4px;
}

/* Hero arrow is pinned to the bottom of the viewport-height hero so the
   centring leftover sits above it. This keeps the hero→about gap the same
   size as the gaps between the other sections (padding only). */
.hero .scroll-arrow {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--space-7);
  margin: 0 auto;
}

.scroll-arrow svg {
  width: 32px;
  height: 32px;
  stroke-width: 3px; /* Thicker chevron */
}

@keyframes scroll-bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(8px);
  }
}


/* ==========================================================================
   9. PORTFOLIO SECTION
   ========================================================================== */
.portfolio__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: var(--space-6);
}

.project-card {
  position: relative;
  background: var(--bg-surface);
  border: 4px solid var(--border);
  box-shadow: 8px 8px 0px #000; /* Thick black offset shadow */
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.stretched-link::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  content: "";
}

.project-link, .project-card__image-link {
  position: relative;
  z-index: 2;
}

.project-card:nth-child(even) {
  transform: rotate(2deg);
}

.project-card:nth-child(odd) {
  transform: rotate(-1.5deg);
}

.project-card:nth-child(even):hover {
  transform: translate(4px, 4px) rotate(2deg);
  box-shadow: 4px 4px 0px #000;
  border-color: #ff00ff; /* Magenta pop */
}

.project-card:nth-child(odd):hover {
  transform: translate(4px, 4px) rotate(-1.5deg);
  box-shadow: 4px 4px 0px #000;
  border-color: #00ffff; /* Cyan pop */
}

.project-card__image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-bottom: 3px solid var(--border);
  transition: transform var(--transition-slow);
}

.project-card:hover .project-card__image {
  transform: scale(1.03);
}

.project-card__image-wrapper {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 3px solid var(--border);
}

.project-card__image-link {
  display: block;
  width: 100%;
  height: 100%;
}

.project-card__iframe {
  width: 200%;
  height: 200%;
  transform: scale(0.5);
  transform-origin: 0 0;
  border: none;
  pointer-events: none;
  background-color: var(--bg-surface);
  transition: transform var(--transition-slow);
}

.project-card:hover .project-card__iframe {
  transform: scale(0.515);
}

/* Placeholder for projects without a live preview */
.project-card__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  width: 100%;
  height: 100%;
  background: var(--bg-surface);
  color: #000;
  font-family: var(--font-heading);
  font-size: var(--text-base);
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.project-card__placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, #ddd 1px, transparent 1px);
  background-size: 8px 8px;
  opacity: 0.3;
  pointer-events: none;
}

.project-card__placeholder span {
  position: relative;
  z-index: 1;
  background-color: #ffea00; /* Yellow highlight */
  padding: 4px 12px;
  border: 2px solid #000;
  box-shadow: 3px 3px 0px #000;
  transform: rotate(-1.5deg);
}

.project-card__placeholder svg {
  position: relative;
  z-index: 1;
  stroke: #000;
  filter: drop-shadow(4px 4px 0px rgba(0,0,0,0.1));
}

.project-card:hover .project-card__placeholder {
  color: #000;
}

.project-card__body {
  padding: var(--space-6);
  background: var(--bg-surface);
  position: relative;
}

/* Subtle halftone texture on card body */
.project-card__body::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--bg-comic-dots);
  background-size: var(--bg-comic-size);
  opacity: 0.04;
  pointer-events: none;
}

.project-card__type {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  color: #000;
  background-color: #00ffff; /* Cyan pop */
  border: 2px solid #000;
  padding: 2px 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-3);
  transform: rotate(-1deg);
  position: relative;
  z-index: 1;
}

.project-card__title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  text-transform: uppercase;
  color: #000;
  margin-bottom: var(--space-3);
  line-height: 1.1;
}

.project-card__description {
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: var(--space-5);
  font-weight: 500;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.project-tag {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  color: #000;
  padding: 4px 8px;
  background: #fff;
  border: 2px solid #000;
  border-radius: 0; /* Boxy */
  box-shadow: 2px 2px 0px #000;
}

.project-card__links {
  display: flex;
  gap: var(--space-4);
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 2px solid rgba(0, 0, 0, 0.1);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: #000;
  text-transform: uppercase;
  border-bottom: 2px solid #000;
  padding-bottom: 2px;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.project-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.project-link svg {
  width: 18px;
  height: 18px;
  stroke-width: 3px;
}


/* ==========================================================================
   9b. PROJECT DETAIL PAGES
   ========================================================================== */
.project-detail {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-11) var(--space-7) var(--space-10);
}

.project-detail__back {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: #000;
  background-color: #fff;
  border: 2px solid #000;
  box-shadow: 4px 4px 0px #000;
  padding: 8px 16px;
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.project-detail__back:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px #000;
  color: #000;
}

.project-detail__type {
  display: block; /* Force to its own line */
  width: fit-content;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: #000;
  background-color: #00ffff; /* Cyan sticker */
  border: 2px solid #000;
  box-shadow: 3px 3px 0px #000;
  padding: 4px 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: var(--space-4);
  transform: rotate(-1.5deg);
}

.project-detail__title {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 700;
  text-transform: uppercase;
  color: #000;
  text-shadow: 3px 3px 0px #00ffff, -3px -3px 0px #ff00ff;
  line-height: 1.1;
  margin-bottom: var(--space-6);
}

.project-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.project-detail__links {
  display: flex;
  gap: var(--space-5);
  margin-bottom: var(--space-10);
}

.project-detail h2 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  text-transform: uppercase;
  color: #000;
  border-bottom: 4px solid var(--accent); /* Red comic underline */
  display: inline-block;
  padding-bottom: 2px;
  margin-bottom: var(--space-4);
  margin-top: var(--space-6); /* Reduced from space-9 to fix large gap */
}

.project-detail h2:first-of-type {
  margin-top: 0;
}

.project-detail p {
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: var(--space-6);
  max-width: 65ch;
  font-weight: 500;
}

.project-detail ul {
  list-style: none;
  padding: 0;
  margin-bottom: var(--space-7);
}

.project-detail li {
  position: relative;
  padding-left: var(--space-6);
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: var(--space-3);
  font-weight: 500;
}

.project-detail li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 900;
}


/* ==========================================================================
   10. CONTACT / FOOTER
   ========================================================================== */
.contact {
  text-align: center;
  padding: var(--space-10) var(--space-7) var(--space-7);
  max-width: var(--content-width);
  margin: 0 auto;
}

.contact__title {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  letter-spacing: -1px;
}

.contact__text {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-7);
  max-width: 50ch;
  margin-left: auto;
  margin-right: auto;
}

.contact__email {
  font-size: var(--text-lg);
  font-weight: 600;
}

.contact__socials {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-7);
}

/* Footer */
.footer {
  border-top: 4px solid #000;
  padding: var(--space-8) var(--space-7);
  text-align: center;
}

.footer__text {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 1px;
}


/* ==========================================================================
   11. RESPONSIVE DESIGN
   ========================================================================== */

/* Tablet — 768px */
@media (max-width: 768px) {
  :root {
    --nav-height: 48px;
  }

  .nav {
    width: calc(100% - 32px);
    padding: 0 var(--space-5);
    top: 8px;
  }

  .nav__links {
    position: fixed;
    top: 0;
    right: -110%;
    width: 100%;
    max-width: none;
    height: 100vh;
    flex-direction: column;
    justify-content: center;
    background: var(--bg-surface);
    border: 4px solid var(--border);
    box-shadow: var(--shadow-md); /* Consistent design-system shadow on all sides */
    transition: right var(--transition-slow);
    gap: 0;
    padding: 0 var(--space-8);
  }

  .nav__links li {
    width: 100%;
    text-align: center;
    border-bottom: 4px solid var(--border); /* Thick borders */
  }

  .nav__links li:first-child {
    border-top: 4px solid var(--border);
  }

  .nav__links.open {
    right: 0;
  }

  .nav__toggle {
    display: flex;
  }

  .nav__link {
    display: inline-block;
    width: 100%;
    padding: var(--space-5) 0;
    font-size: var(--text-lg);
  }

  .nav__link::after {
    display: none;
  }

  .btn--nav {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 16px 28px;
    font-size: var(--text-sm);
  }

  /* Mobile overlay */
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
    z-index: 999;
  }

  .nav-overlay.visible {
    opacity: 1;
    visibility: visible;
  }

  .hero {
    padding: var(--space-10) var(--space-5) var(--space-8);
  }

  .section {
    padding: var(--space-9) var(--space-5);
  }

  .about__content {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .about__photo-wrapper {
    max-width: 240px;
    order: -1;
    margin: 0 auto;
  }

  .timeline {
    padding-left: var(--space-6);
  }

  .timeline__marker {
    left: calc(-1 * var(--space-6) + 2px);
  }

  .portfolio__grid {
    grid-template-columns: 1fr;
  }

  .contact {
    padding: var(--space-9) var(--space-5) var(--space-6);
  }
}

/* Mobile — 375px */
@media (max-width: 480px) {
  .hero__name {
  font-family: var(--font-heading);
  letter-spacing: 2px;
  text-shadow: 3px 3px 0px #00ffff, -3px -3px 0px #ff00ff;
  color: #000;
    font-size: clamp(2rem, 8vw, 2.5rem);
  }

  .hero__title {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  .hero__actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn {
    width: 100%;
    justify-content: center;
    padding: 12px 24px;
    font-size: var(--text-base);
  }

  .scroll-arrow {
    width: 48px;
    height: 48px;
  }

  .scroll-arrow svg {
    width: 24px;
    height: 24px;
  }
}

/* Large desktop — 1440px+ */
@media (min-width: 1440px) {

  .section,
  .hero {
    padding-left: var(--space-9);
    padding-right: var(--space-9);
  }
}


/* ==========================================================================
   12. REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .timeline__marker {
    transform: scale(1);
  }

  .timeline::after {
    transform: scaleY(1) !important;
  }

  .accent-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 12px;
  background-image: var(--bg-comic-dots);
  background-size: var(--bg-comic-size);
  background-color: var(--accent);
  border-bottom: 4px solid #000;
  z-index: 1001;
}
}


/* ==========================================================================
   13. UTILITIES
   ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

