/* ============================================
   Mia Nelson-Hebert — Custom Theme Overrides
   Desert twilight · whimsical · tactile
   ============================================ */

/* --- Animated gradient background --- */
@keyframes twilight-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

body {
  background: linear-gradient(
    135deg,
    var(--background-color),
    #f5dcc0,
    #f0d0a8,
    #fae4c8,
    #f5d8b8,
    var(--background-color)
  ) !important;
  background-size: 400% 400% !important;
  animation: twilight-shift 20s ease infinite;
}

.dark body,
body.dark {
  background: linear-gradient(
    135deg,
    var(--background-color),
    #2d1e14,
    #1e1812,
    #2a1c10,
    var(--background-color)
  ) !important;
  background-size: 400% 400% !important;
  animation: twilight-shift 20s ease infinite;
}

html.dark {
  background: #1c1410 !important;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6,
.navbar-brand {
  font-family: 'Space Grotesk', sans-serif !important;
}

body,
p,
li,
a,
.card-text,
.secondary-font {
  font-family: 'DM Sans', -apple-system, sans-serif !important;
}

/* --- Handwritten accent font --- */
#hero .lead,
.hero-subtitle,
#about h2,
#projects h2,
#contact h2 {
  font-family: 'Caveat', cursive !important;
  font-weight: 600;
  font-size: 1.6em;
}

/* Nav bar */
.navbar .nav-link {
  font-family: 'DM Sans', sans-serif !important;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  font-weight: 500;
  transition: transform 0.2s ease;
}

.navbar .nav-link:hover {
  transform: rotate(-2deg) scale(1.05);
}

.navbar-brand {
  text-transform: lowercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

/* --- Hero section — floating doodles in the gap --- */
#hero {
  position: relative;
  overflow: hidden;
}


#hero .container::before,
#hero .container::after {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  opacity: 0.3;
  animation: gentle-float 6s ease-in-out infinite;
}

/* --- ASCII landscape background --- */
#ascii-landscape {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ascii-critter {
  position: absolute;
  font-family: 'Courier New', monospace !important;
  line-height: 1.15;
  white-space: pre;
  pointer-events: none;
  opacity: 0;
  animation: critter-appear 1s ease forwards, critter-float 8s ease-in-out infinite;
}

@keyframes critter-appear {
  to { opacity: var(--critter-opacity, 0.18); }
}

@keyframes critter-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(calc(var(--float-distance, -6px))); }
}

@keyframes critter-twinkle {
  0%, 100% { opacity: var(--critter-opacity, 0.18); }
  50% { opacity: calc(var(--critter-opacity, 0.18) * 1.8); }
}

/* Hero ASCII character — between image and text */
.ascii-art {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  font-family: 'Courier New', monospace !important;
  font-size: 11px;
  line-height: 1.2;
  color: var(--primary-color, #d4864a);
  opacity: 0.3;
  white-space: pre;
  animation: gentle-float 6s ease-in-out infinite;
}

.hero-ascii {
  right: 34%;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 991px) {
  .ascii-art, #ascii-landscape { display: none; }
}

/* --- Hero section — alignment --- */
#hero .row {
  align-items: center;
}

#hero .content {
  padding-right: 0 !important;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#hero .content .row {
  justify-content: flex-end;
}

#hero h1 {
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow: 1px 2px 0 rgba(212, 134, 74, 0.08);
}

#hero .lead {
  font-style: italic;
}

/* --- Typewriter effect on hero subtitle --- */
.typewriter-text {
  overflow: hidden;
  border-right: 2px solid var(--primary-color, #d4864a);
  white-space: nowrap;
  animation:
    typing 3s steps(30, end) forwards,
    blink-caret 0.75s step-end infinite;
  width: 0;
  display: inline-block;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--primary-color, #d4864a); }
}

/* --- Profile image — gentle float with organic blobs --- */
#hero .image,
#hero .hero-image {
  position: relative;
}

#hero .image {
  padding-top: 0 !important;
}

#hero .image::before,
#hero .image::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 42% 58% 62% 38% / 45% 55% 45% 55%;
  animation: blob-morph 8s ease-in-out infinite;
}

#hero .image::before {
  top: -15%;
  left: -20%;
  width: 130%;
  height: 130%;
  background: rgba(212, 134, 74, 0.12);
}

#hero .image::after {
  top: -10%;
  right: -18%;
  width: 110%;
  height: 120%;
  background: rgba(232, 170, 106, 0.1);
  border-radius: 55% 45% 38% 62% / 52% 40% 60% 48%;
  animation-delay: -4s;
  animation-direction: reverse;
}

@keyframes blob-morph {
  0%, 100% { border-radius: 42% 58% 62% 38% / 45% 55% 45% 55%; }
  33% { border-radius: 55% 45% 38% 62% / 52% 40% 60% 48%; }
  66% { border-radius: 38% 62% 55% 45% / 60% 48% 52% 40%; }
}

.hero-image img,
img[src*="profile"] {
  animation: gentle-float 6s ease-in-out infinite;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(45, 31, 61, 0.15);
}

#about img {
  animation: gentle-float 6s ease-in-out infinite;
  border-radius: 8px;
  box-shadow: 3px 5px 20px rgba(45, 31, 61, 0.12);
}

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

/* --- Paper + linen texture overlay --- */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* Linen crosshatch thread texture */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.018;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(45, 31, 61, 0.3) 3px,
      rgba(45, 31, 61, 0.3) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 3px,
      rgba(45, 31, 61, 0.3) 3px,
      rgba(45, 31, 61, 0.3) 4px
    );
}

/* --- Section headings — letterpress effect --- */
#about h2,
#projects h2,
#contact h2 {
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4),
    0 -1px 0 rgba(45, 31, 61, 0.08);
}

/* --- Cards — thick craft paper feel --- */
.card {
  border: none;
  border-radius: 4px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow:
    2px 3px 8px rgba(45, 31, 61, 0.08),
    0 1px 0 rgba(212, 134, 74, 0.1);
  background-image:
    linear-gradient(
      135deg,
      rgba(255,255,255,0.6) 0%,
      rgba(255,255,255,0.3) 100%
    ) !important;
  position: relative;
  overflow: visible;
}

/* Deckled/torn edge on cards via clip-path */
.card::before {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 5%;
  right: 5%;
  height: 6px;
  background: inherit;
  filter: blur(1px);
  opacity: 0.5;
  border-radius: 0 0 4px 4px;
}

/* Washi tape accent on top of cards */
.card::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(-1deg);
  width: 60px;
  height: 14px;
  background: rgba(212, 134, 74, 0.2);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.card:nth-child(3n+1) {
  transform: rotate(-1.2deg);
}

.card:nth-child(3n+1)::after {
  background: rgba(200, 140, 80, 0.2);
  transform: translateX(-50%) rotate(2deg);
}

.card:nth-child(3n+2) {
  transform: rotate(0.8deg);
}

.card:nth-child(3n+2)::after {
  background: rgba(58, 158, 143, 0.2);
  transform: translateX(-50%) rotate(-3deg);
}

.card:nth-child(3n) {
  transform: rotate(-0.4deg);
}

.card:hover {
  transform: rotate(0deg) translateY(-6px) !important;
  box-shadow:
    4px 8px 24px rgba(45, 31, 61, 0.12),
    0 2px 0 rgba(212, 134, 74, 0.08);
}

/* --- Gallery — mounted print on cardstock --- */
.gallery img,
#gallery img {
  border: 4px solid rgba(253, 246, 240, 0.9);
  border-radius: 1px;
  padding: 6px;
  background: #fdf3e8;
  box-shadow:
    2px 3px 12px rgba(45, 31, 61, 0.1),
    inset 0 0 20px rgba(45, 31, 61, 0.03);
}

/* --- Badges — stamped/embossed feel --- */
.badge {
  font-family: 'DM Sans', sans-serif !important;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.7em;
  border: 1px solid rgba(212, 134, 74, 0.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}

/* --- Smooth scrolling --- */
html {
  scroll-behavior: smooth;
}

/* --- Links — coral underline on hover --- */
a:hover {
  text-decoration-color: #3a9e8f !important;
}

/* --- Social icons — wobble on hover --- */
.hero-socialLinks a,
footer a[aria-label] {
  display: inline-block;
  transition: transform 0.3s ease;
}

.hero-socialLinks a:hover,
footer a[aria-label]:hover {
  animation: wobble 0.4s ease;
}

@keyframes wobble {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  50% { transform: rotate(6deg); }
  75% { transform: rotate(-4deg); }
  100% { transform: rotate(0deg); }
}

/* --- Sparkle accents on section headings --- */
#about h2::before,
#projects h2::before,
#contact h2::before {
  content: "✦ ";
  font-size: 0.6em;
  opacity: 0.35;
  vertical-align: middle;
}

#about h2::after,
#projects h2::after,
#contact h2::after {
  content: " ✦";
  font-size: 0.6em;
  opacity: 0.35;
  vertical-align: middle;
}

/* --- Wavy section divider — stitched seam --- */
#about::before,
#projects::before,
#contact::before {
  content: "";
  display: block;
  width: 80%;
  max-width: 600px;
  height: 1px;
  margin: 0 auto 2rem;
  border-top: 2px dashed rgba(212, 134, 74, 0.2);
}

/* --- Footer --- */
footer {
  font-size: 0.9rem;
}

/* --- Navbar — frosted felt --- */
#profileHeader nav {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(253, 246, 240, 0.7) !important;
}

.dark #profileHeader nav {
  background: rgba(26, 20, 40, 0.75) !important;
}
