/*
 * LittleLink - Wabi-Sabi Japanese Aesthetic
 * Inspired by ink on handmade paper
 */

/* Base Settings
–––––––––––––––––––––––––––––––––––––––––––––––––– */
:root {
  /* Ink & Paper palette */
  --bg-primary: #1c1b18;
  --bg-secondary: #242320;
  --bg-elevated: #2d2c28;

  --text-primary: #e8e4dc;
  --text-secondary: #9a958b;
  --text-muted: #6b665c;

  /* Traditional Japanese colors */
  --accent-vermillion: #b85c3c;
  --accent-sage: #7a8b6e;
  --accent-gold: #c4a35a;

  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Typography - Zen poetic aesthetic */
  --font-display: 'Crimson Pro', 'Georgia', serif;
  --font-body: 'Crimson Pro', 'Georgia', serif;

  --container-width: 92%;
  --max-width: 420px;
}

/* Reset & Base
–––––––––––––––––––––––––––––––––––––––––––––––––– */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 300;
  letter-spacing: 0.01em;
  line-height: 1.7;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Container
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.container {
  width: var(--container-width);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xl) 0 var(--space-2xl);

  /* Entrance animation */
  animation: fadeIn 1.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Profile Section
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.profile {
  position: relative;
  text-align: center;
}

.profile .avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  margin: 0 auto var(--space-md);
  display: block;

  /* Soft shadow like ink diffusion */
  box-shadow:
    0 0 0 1px rgba(232, 228, 220, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.4);

  /* Subtle entrance */
  animation: avatarReveal 1s ease-out 0.2s both;
}

@keyframes avatarReveal {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.profile h1 {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin: 0 0 var(--space-xs);
  color: var(--text-primary);

  animation: textReveal 0.8s ease-out 0.4s both;
}

@keyframes textReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profile > p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 340px;
  margin: 0 auto;

  animation: textReveal 0.8s ease-out 0.5s both;
}

/* Tagline with triple dot trigger
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.tagline-wrapper {
  position: relative;
  display: inline-block;
}

.tagline {
  margin: 0;
}

.sub-tagline {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--accent-vermillion);
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
  position: relative;
  top: -0.1em;
  transition: letter-spacing 0.3s ease;
}

.sub-tagline:hover {
  letter-spacing: 0.25em;
}

/* Sub-tagline modal - positioned above like koan modals */

/* Content Container
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.content-container {
  margin-top: 1rem;
}

/* Professional Skills / Koans
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.professional-skills {
  text-align: left;
}

.professional-skills ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.koan {
  cursor: pointer;
  position: relative;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid rgba(154, 149, 139, 0.15);
  transition: all 0.3s ease;
}

.koan:first-child {
  border-top: 1px solid rgba(154, 149, 139, 0.15);
}

.koan:hover {
  padding-left: var(--space-sm);
  border-color: rgba(184, 92, 60, 0.3);
}

.koan .koan-text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.koan:hover .koan-text {
  color: var(--text-primary);
}

.koan .icon {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--text-muted);
  border-radius: 50%;
  transition: all 0.3s ease;
  position: relative;
}

/* Vertical connecting line below each icon (except last) */
.koan:not(:last-child) .icon::after {
  content: '';
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 0;
  background: linear-gradient(
    to bottom,
    var(--accent-vermillion) 0%,
    var(--accent-vermillion) 70%,
    transparent 100%
  );
  transition: height 0.5s ease;
}

/* When koan is clicked, show the connecting line */
.koan.clicked:not(:last-child) .icon::after {
  height: 3rem;
}

/* Pulse animation for first unclicked koan */
@keyframes subtlePulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.4);
    opacity: 0.7;
  }
}

.koan.hint .icon {
  animation: subtlePulse 2s ease-in-out infinite;
  border-color: var(--accent-vermillion);
}

.koan:hover .icon {
  border-color: var(--accent-vermillion);
  transform: scale(1.3);
  animation: none;
}

.koan.clicked .icon {
  background-color: var(--accent-vermillion);
  border-color: var(--accent-vermillion);
  animation: none;
}

/* Explanation Popups
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.explanation {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(8px);
  transition:
    opacity 0.4s ease,
    visibility 0.4s ease,
    transform 0.4s ease;
  position: absolute;
  background-color: var(--bg-elevated);
  padding: var(--space-md);
  border-radius: 4px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(232, 228, 220, 0.05);
  z-index: 600;
  text-align: left;
  width: 300px;
  left: 50%;
  bottom: calc(100% + var(--space-sm));

  /* Decorative accent line */
  border-left: 2px solid var(--accent-vermillion);
}

.explanation p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
}

.explanation p + p {
  margin-top: var(--space-sm);
}

.explanation.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Separator
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.separator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--space-xl) 0 var(--space-lg);
  position: relative;
  height: 24px;
}

.separator::before,
.separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(154, 149, 139, 0.25),
    transparent
  );
}

.separator .wave-svg {
  display: none;
}

.separator span {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 var(--space-md);
}

/* Projects Section
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.projects {
  margin-top: var(--space-lg);
  text-align: center;
  padding-bottom: var(--space-lg);
}

.project {
  padding: var(--space-sm) 0;
}

.project a {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-xs);
  font-size: 1rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.3s ease;
  padding: var(--space-xs) 0;
  position: relative;
}

.project a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--accent-vermillion);
  transition: width 0.3s ease;
}

.project a:hover::after {
  width: 100%;
}

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

.project h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0;
}

.project p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Social Reveal (message + icons)
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.social-reveal {
  margin: var(--space-md) 0 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity 0.6s ease,
    visibility 0.6s ease,
    transform 0.6s ease;
}

.social-reveal.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.connect-message {
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--text-secondary);
  text-align: center;
  margin: 0 0 var(--space-md);
}

/* Social Icons
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.social-icons {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(154, 149, 139, 0.2);
  transition: all 0.3s ease;
}

.social-icons a:hover {
  border-color: var(--accent-vermillion);
  background: rgba(184, 92, 60, 0.1);
  transform: translateY(-2px);
}

.social-icons img {
  width: 20px;
  height: 20px;
  filter: grayscale(100%) brightness(0.7) invert(0.85);
  transition: filter 0.3s ease;
}

.social-icons a:hover img {
  filter: grayscale(0%) brightness(1) invert(0);
}

/* Utility Classes
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.hidden {
  display: none;
}

/* Responsive Design
–––––––––––––––––––––––––––––––––––––––––––––––––– */
@media (max-width: 480px) {
  :root {
    --space-xl: 3rem;
    --space-2xl: 4rem;
  }

  .profile h1 {
    font-size: 1.75rem;
  }

  .profile .avatar {
    width: 96px;
    height: 96px;
  }

  .koan .koan-text {
    font-size: 0.95rem;
  }

  .explanation {
    width: 260px;
    padding: var(--space-sm);
  }
}

@media (max-height: 600px) {
  .container {
    padding-top: var(--space-lg);
    padding-bottom: var(--space-xl);
  }

  .profile .avatar {
    width: 80px;
    height: 80px;
    margin-bottom: var(--space-sm);
  }

  .profile h1 {
    font-size: 1.5rem;
  }

  .profile > p {
    font-size: 0.875rem;
  }

  .social-icons {
    margin: var(--space-lg) 0;
  }

  .projects {
    margin-top: var(--space-md);
  }
}

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