/* ============================================
   hames. — personal site
   White · Pink · Purple palette
   ============================================ */

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

:root {
  --white: #faf8f5;
  --text: #2d1b3d;
  --text-muted: #7a6b8a;
  --purple: #7c5cbf;
  --purple-light: #a68ad4;
  --purple-ghost: #f0ebf8;
  --pink: #e8a0bf;
  --pink-light: #f5c4d8;
  --pink-ghost: #fdf0f5;
  --border: #e8e0ee;

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Source Serif 4', Georgia, serif;

  --max-width: 680px;
  --nav-height: 60px;
  --radius: 18px;
  --radius-sm: 12px;
  --transition: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 0.2s ease;
  --shadow-cartoon: 0 4px 0 var(--border);
  --shadow-cartoon-hover: 0 6px 0 var(--purple-ghost);

  scroll-behavior: smooth;
}

/* ----- Base ----- */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--white);
  overflow-x: hidden;
  position: relative;
}

/* Dot pattern overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--purple-light) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  opacity: 0.55;
}

/* Blob wrapper for the second blob (via JS or extra element in HTML) - 
   we'll add via a div in index.html */

.section,
.footer {
  position: relative;
  z-index: 1;
}

::selection {
  background: var(--pink-light);
  color: var(--text);
}

a {
  color: var(--purple);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--pink);
}

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

/* ----- Typography ----- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

/* ----- Navigation ----- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(250, 248, 245, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: transform var(--transition-fast);
}

.nav--hidden {
  transform: translateY(-100%);
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 1.5rem;
}

.nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--pink);
  transition: all var(--transition-fast);
  transform: translateX(-50%);
  border-radius: 1px;
}

.nav__link:hover {
  color: var(--purple);
}

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

.nav__link--active {
  color: var(--purple);
}

.nav__divider {
  color: var(--border);
  font-size: 0.75rem;
}

/* ----- Sections ----- */
.section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 5rem 1.5rem;
}

.section__content {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.section__title {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
}

.section__subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2.5rem;
}

/* ----- Hero ----- */
.hero {
  padding-top: calc(var(--nav-height) + 4rem);
  min-height: 100vh;
}

.hero__greeting {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.hero__name {
  font-size: 4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 2rem;
  line-height: 1.1;
}

.hero__bio {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hero__bio p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text);
  opacity: 0.85;
}

/* ----- Writings ----- */

.writings__list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.writing-card {
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-cartoon);
}

.writing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--purple-light), var(--pink));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--transition);
}

.writing-card:hover {
  border-color: var(--purple-light);
  transform: translateY(-3px) translateX(3px);
  box-shadow: var(--shadow-cartoon-hover);
}

.writing-card:hover::before {
  transform: scaleY(1);
}

.writing-card__title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.writing-card__date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.writing-card__excerpt {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.writing-card__header {
  cursor: pointer;
}

.writing-card__toggle {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--purple-light);
  transition: all var(--transition-fast);
  letter-spacing: 0.02em;
}

.writing-card:hover .writing-card__toggle {
  color: var(--purple);
}

.writing-card__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease, padding 0.4s ease;
  opacity: 0;
  padding: 0 0 0 0;
  border-top: 1px solid transparent;
}

.writing-card--expanded .writing-card__body {
  max-height: 20000px;
  opacity: 1;
  padding: 1.25rem 0 0 0;
  border-top-color: var(--border);
  margin-top: 1rem;
}

.writing-card--expanded {
  cursor: default;
}

.writing-card--expanded:hover {
  transform: translateX(0);
}

.writing-card__chapter-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--purple);
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 600;
}

.writing-card__paragraph {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 0.75rem;
  opacity: 0.9;
}

.writing-card__dialogue {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 0.75rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--pink-light);
  opacity: 0.9;
}

.writing-card__scene {
  font-size: 0.8rem;
  font-family: var(--font-body);
  color: var(--purple-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  margin-top: 1rem;
  font-weight: 500;
}

.writing-card__scene:first-child {
  margin-top: 0;
}

.writing-card__break {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem auto;
  max-width: 60px;
  opacity: 0.5;
}

/* ----- Background Blobs (organic, animated) ----- */
.bg-blob {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  animation: blobMorph 13s ease-in-out infinite;
}

.bg-blob--tl {
  top: -220px;
  left: -200px;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle at 35% 40%, rgba(232, 160, 191, 0.55) 0%, rgba(232, 160, 191, 0.2) 45%, transparent 70%);
  border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
  animation-duration: 12s;
}

.bg-blob--br {
  bottom: -200px;
  right: -170px;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle at 60% 50%, rgba(124, 92, 191, 0.45) 0%, rgba(124, 92, 191, 0.15) 45%, transparent 70%);
  border-radius: 42% 58% 65% 35% / 45% 55% 40% 60%;
  animation-duration: 14s;
  animation-delay: -3s;
}

.bg-blob--mid {
  top: 38%;
  left: 62%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle at 50% 50%, rgba(232, 160, 191, 0.4) 0%, rgba(232, 160, 191, 0.14) 50%, transparent 70%);
  border-radius: 50% 50% 40% 60% / 60% 40% 60% 40%;
  animation-duration: 10s;
  animation-delay: -6s;
}

.bg-blob--accent {
  bottom: 12%;
  left: -90px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle at 50% 50%, rgba(124, 92, 191, 0.38) 0%, rgba(124, 92, 191, 0.12) 50%, transparent 70%);
  border-radius: 55% 45% 60% 40% / 40% 60% 40% 60%;
  animation-duration: 11s;
  animation-delay: -1.5s;
}

@keyframes blobMorph {
  0%, 100% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
  }
  25% {
    transform: translate(22px, -26px) scale(1.05) rotate(8deg);
    border-radius: 45% 55% 40% 60% / 50% 45% 55% 50%;
  }
  50% {
    transform: translate(-18px, 24px) scale(0.96) rotate(-6deg);
    border-radius: 55% 45% 65% 35% / 40% 60% 45% 55%;
  }
  75% {
    transform: translate(14px, 14px) scale(1.03) rotate(4deg);
    border-radius: 50% 50% 45% 55% / 55% 40% 60% 45%;
  }
}

/* ----- Floating Decorative Circles ----- */
.float-circle {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  border: 3px solid var(--purple-light);
  opacity: 0.55;
}

.float-circle--1 {
  top: 15%;
  right: 8%;
  width: 64px;
  height: 64px;
  background: rgba(232, 160, 191, 0.35);
  border-color: var(--pink);
  animation: floatDrift 13s ease-in-out infinite;
}

.float-circle--2 {
  bottom: 25%;
  left: 5%;
  width: 42px;
  height: 42px;
  background: rgba(166, 138, 212, 0.3);
  border-color: var(--pink-light);
  animation: floatDrift 16s ease-in-out infinite reverse;
}

.float-circle--3 {
  top: 55%;
  right: 12%;
  width: 26px;
  height: 26px;
  background: rgba(232, 160, 191, 0.4);
  border-color: var(--purple-light);
  animation: floatDrift 12s ease-in-out infinite 3s;
}

@keyframes floatDrift {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(8px, -12px); }
  50% { transform: translate(-4px, -20px); }
  75% { transform: translate(10px, -8px); }
}

/* ----- Section Wave Divider ----- */
.section-wave {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 40px;
  overflow: hidden;
  margin-top: -2px;
}

.section-wave svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ----- Secret Section ----- */
.secret {
  margin-top: 4rem;
}

.secret__divider {
  text-align: center;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.secret__divider::before,
.secret__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.secret__divider-icon {
  font-size: 1.2rem;
  color: var(--purple-light);
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

.secret__unlock {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}

.secret__hint {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.8;
  color: var(--text);
  opacity: 0.8;
  margin-bottom: 1.5rem;
  position: relative;
}

.secret__hint::before {
  content: '"';
  font-size: 2rem;
  color: var(--pink);
  position: absolute;
  top: -0.5rem;
  left: -0.75rem;
  opacity: 0.5;
  font-family: var(--font-heading);
}

.secret__input-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.secret__input {
  flex: 1;
  max-width: 340px;
  padding: 0.85rem 1.25rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.8);
  transition: all var(--transition-fast);
  outline: none;
}

.secret__input::placeholder {
  color: #c4b8d0;
  font-style: italic;
}

.secret__input:focus {
  border-color: var(--purple-light);
  box-shadow: 0 0 0 3px var(--purple-ghost);
}

.secret__input--shake {
  animation: shake 0.4s ease;
  border-color: var(--pink) !important;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.secret__btn {
  width: 48px;
  height: 48px;
  border: 2px solid var(--purple);
  border-radius: var(--radius-sm);
  background: var(--purple);
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--purple) 70%, black);
}

.secret__btn:hover {
  background: var(--purple-light);
  border-color: var(--purple-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--purple) 70%, black);
}

.secret__btn:active {
  transform: translateY(2px) scale(0.95);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--purple) 70%, black);
}

.secret__error {
  font-size: 0.9rem;
  color: var(--pink);
  margin-top: 0.75rem;
  min-height: 1.5rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.secret__error--visible {
  opacity: 1;
}

.secret__content {
  max-width: 480px;
  margin: 0 auto;
  animation: fadeReveal 0.8s ease forwards;
}

@keyframes fadeReveal {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.secret__content-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.secret__content-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.secret__content-body p {
  font-size: 1rem;
  line-height: 1.8;
  opacity: 0.85;
}

/* ----- Music Section ----- */
.music {
}

.music__player {
  max-width: 560px;
  margin: 0 auto;
}

.music__embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-cartoon);
  transition: all var(--transition);
}

.music__embed:hover {
  box-shadow: var(--shadow-cartoon-hover);
  transform: translateY(-2px);
}

.music__embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ----- Footer ----- */
.footer {
  padding: 3rem 1.5rem;
  text-align: center;
}

.footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
  opacity: 0.6;
  font-family: var(--font-heading);
  font-style: italic;
}

/* ----- Utility ----- */
.hidden {
  display: none !important;
}

/* ----- Animations ----- */
[data-animate] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

[data-animate].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ----- Cursor Follower (desktop only) ----- */
@media (hover: hover) {
  .cursor-follower {
    position: fixed;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--pink);
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: multiply;
    opacity: 0.4;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
  }

  .cursor-follower--active {
    width: 24px;
    height: 24px;
    opacity: 0.6;
  }
}

/* ----- Scrollbar ----- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--purple-light);
}

/* ----- Responsive ----- */
@media (max-width: 600px) {
  .hero__name {
    font-size: 2.75rem;
  }

  .section__title {
    font-size: 1.75rem;
  }

  .hero__bio p {
    font-size: 1rem;
  }

  .secret__hint {
    font-size: 0.95rem;
  }

  .secret__input {
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
  }

  .secret__btn {
    width: 44px;
    height: 44px;
  }

  .nav__inner {
    gap: 0.25rem;
  }

  .nav__link {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-animate] {
    opacity: 1;
    transform: none;
  }
}
