/* Shared styles for button animation pages */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Spacing Variables */
:root {
  /* Base Spacing Scale */
  --spacing-xs: 0.25rem; /* 4px */
  --spacing-sm: 0.5rem; /* 8px */
  --spacing-md: 0.75rem; /* 12px */
  --spacing-lg: 1rem; /* 16px */
  --spacing-xl: 1.5rem; /* 24px */
  --spacing-2xl: 2rem; /* 32px */
  --spacing-3xl: 2.5rem; /* 40px */
  --spacing-4xl: 3.75rem; /* 60px */
  --spacing-5xl: 5rem; /* 80px */

  /* Component-Specific Spacing (Desktop) */
  --content-padding: var(--spacing-4xl); /* 60px */
  --content-gap: var(--spacing-5xl); /* 80px */
  --content-block-gap: var(--spacing-sm); /* 8px */
  /* counter variables removed — counter is now fixed center, JS-driven */
  --button-padding-bottom: 0;
  --nav-top: 1.25rem; /* 20px */
  --nav-padding: var(--spacing-md) 1.25rem; /* 12px 20px */
  --nav-gap: var(--spacing-md); /* 12px */
  --email-btn-padding: var(--spacing-sm) var(--spacing-md); /* 8px 12px */
  --email-btn-gap: var(--spacing-sm); /* 8px */
  --content-right-top: 0;
  --content-email-top: 0;
  --content-right-left: 0;

  /* Mobile Overrides (768px) */
  @media (max-width: 768px) {
    --content-padding: var(--spacing-3xl); /* 40px */
    --content-gap: var(--spacing-xl); /* 24px */
    /* counter variables removed */
    --button-padding-bottom: var(--spacing-3xl); /* 40px */
    --content-right-top: 26.25rem; /* 420px */
    --content-email-top: 36.25rem; /* 580px - increased to prevent overlap with roles */
    --content-right-left: var(--content-padding); /* 40px */
  }

  /* Small Mobile Overrides (480px) */
  @media (max-width: 480px) {
    --content-padding: 1.875rem; /* 30px */
    --content-gap: 1.25rem; /* 20px */
    /* counter variables removed */
    --button-padding-bottom: 1.875rem; /* 30px */
    --content-right-top: 23.75rem; /* 380px */
    --content-email-top: 31rem; /* 560px - moved down for better spacing */
    --content-right-left: var(--content-padding); /* 30px */
  }
}

html, body {
  width: 100%;
  height: 100%;
  font-family: 'Source Code Pro', monospace;
  background: #ffffff;
  transition: background-color 0.4s ease;
}

body.dark {
  background: #1F1F1F;
}

.nav {
  position: fixed;
  top: var(--nav-top);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--nav-gap);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: var(--nav-padding);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.nav a {
  color: #333;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 0.375rem var(--spacing-md);
  border-radius: 4px;
  transition: background 0.2s ease;
}

.nav a:hover {
  background: rgba(0, 0, 0, 0.05);
}

.nav a.active {
  background: #333;
  color: white;
}

.button-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
  position: relative;
}

.button-body,
.button-top {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
}

.button-body img,
.button-top img {
  max-width: 600px;
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  pointer-events: none;
}

.button-top {
  cursor: pointer;
  transition: transform 0.1s ease;
  transform: translateY(-20%); /* Gap proportional to button top height */
}

.button-top:hover {
  transform: translateY(-20%) scale(1.02);
}

.button-top:active {
  transform: translateY(-20%) scale(0.98);
}

/* Prevent text selection during interaction */
.button-container {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Counter Display — random position, flash on press, number only */
.counter-display {
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

/* Show when .visible class is added (via JS on press) */
.counter-display.visible {
  opacity: 0.35;
}

.counter-value {
  font-size: 14px;
  font-weight: 400;
  color: #333;
  font-variant-numeric: tabular-nums;
}

body.dark .counter-value {
  color: #ffffff;
}

/* Content Section */
.content-section {
  position: fixed;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 5;
  padding: var(--content-padding);
  display: none;
  flex-direction: column;
  gap: var(--content-gap);
  color: #ffffff;
}

.content-left {
  top: 0;
  left: 0;
}

.content-right {
  top: 0;
  right: 0;
  text-align: right;
}

body.dark .content-section {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  display: flex;
  color: #ffffff !important;
}

.content-block {
  display: flex;
  flex-direction: column;
  gap: var(--content-block-gap);
}

body.dark .content-section h1 {
  font-size: 36px;
  font-weight: 700;
  margin: 0;
  color: #ffffff !important;
}

/* Hide mobile line break on desktop */
.content-section h1 .mobile-break {
  display: none;
}

/* Show mobile line break on tablets and smaller */
@media (max-width: 768px) {
  .content-section h1 .mobile-break {
    display: inline;
  }
}

body.dark .content-section .tagline {
  font-size: 18px;
  margin: 0;
  color: #ffffff !important;
}

body.dark .content-section .current-role,
body.dark .content-section .past-role {
  font-size: 16px;
  margin: 0;
  color: #ffffff !important;
  line-height: 1.6;
}

.content-right .content-block {
  align-items: flex-end;
}

body.dark .content-section .block-philosophy p {
  font-size: 16px;
  margin: 0;
  color: #ffffff !important;
  line-height: 1.6;
}

.party-cat {
  display: inline-block;
  vertical-align: middle;
  max-width: 24px;
  height: auto;
  margin-left: var(--spacing-xs);
}

/* Email Copy Block */
body.dark .content-section .email-title {
  font-size: 14px;
  margin: 0 0 var(--spacing-sm) 0;
  color: rgba(255, 255, 255, 0.7) !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.email-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--email-btn-gap);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: var(--email-btn-padding);
  font-family: 'Source Code Pro', monospace;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 4px;
  width: fit-content;
  max-width: 100%;
}

.email-copy-btn:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.05);
}

.email-copy-btn:active {
  transform: scale(0.98);
}

.email-copy-btn.copied {
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.1);
}

.email-text {
  color: #ffffff;
}

.copy-icon {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s ease;
}

.email-copy-btn:hover .copy-icon {
  color: rgba(255, 255, 255, 1);
}

body.dark .content-section a {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.5);
  transition: text-decoration-color 0.2s ease;
}

body.dark .content-section a:hover {
  text-decoration-color: rgba(255, 255, 255, 0.9);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .content-section {
    padding: var(--content-padding);
    gap: var(--content-gap);
  }

  .content-section h1 {
    font-size: 25px;
  }

  .content-section .tagline {
    font-size: 13px;
  }

  .content-section .current-role,
  .content-section .past-role,
  .content-section .block-interests p {
    font-size: 11px;
  }

  /* Position button above counter on mobile */
  .button-container {
    align-items: flex-end;
    padding-bottom: var(--button-padding-bottom);
  }

  /* Reorganize mobile layout: intro -> interests -> roles -> email -> button -> counter */
  /* All blocks aligned to left on mobile */
  
  /* Ensure content-left is left-aligned */
  .content-left {
    text-align: left;
  }

  /* Position roles block after interests block, aligned to left */
  /* All repositioned blocks use the same positioning pattern */
  .content-right {
    position: fixed;
    top: var(--content-right-top);
    left: var(--content-right-left);
    right: auto;
    text-align: left;
    padding: 0;
    width: calc(100% - calc(var(--content-padding) * 2));
    z-index: 6;
  }

  .content-right .content-block {
    align-items: flex-start;
    text-align: left;
  }

  /* Position email block after roles block, aligned to left */
  /* Uses same positioning pattern as content-right */
  .content-left .block-email {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-sm);
    position: fixed;
    top: var(--content-email-top);
    left: var(--content-right-left);
    right: auto;
    width: calc(100% - calc(var(--content-padding) * 2));
    z-index: 6;
    text-align: left;
  }

  body.dark .content-section .email-title {
    margin: 0;
  }
}

@media (max-width: 480px) {
  .content-section {
    padding: var(--content-padding);
    gap: var(--content-gap);
  }

  .content-section h1 {
    font-size: 21px;
  }

  .content-section .tagline {
    font-size: 11px;
  }

  .content-section .current-role,
  .content-section .past-role,
  .content-section .block-interests p {
    font-size: 10px;
    image.png    line-height: 1.5;
  }

  /* Position button above counter on mobile */
  .button-container {
    align-items: flex-end;
    padding-bottom: var(--button-padding-bottom);
  }

  /* Reorganize mobile layout: intro -> interests -> roles -> email -> button -> counter */
  /* All blocks aligned to left on mobile */
  
  /* Ensure content-left is left-aligned */
  .content-left {
    text-align: left;
  }

  /* Position roles block after interests block, aligned to left */
  /* All repositioned blocks use the same positioning pattern */
  .content-right {
    position: fixed;
    top: var(--content-right-top);
    left: var(--content-right-left);
    right: auto;
    text-align: left;
    padding: 0;
    width: calc(100% - calc(var(--content-padding) * 2));
    z-index: 6;
  }

  .content-right .content-block {
    align-items: flex-start;
    text-align: left;
  }

  /* Position email block after roles block, aligned to left */
  /* Uses same positioning pattern as content-right */
  .content-left .block-email {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-sm);
    position: fixed;
    top: var(--content-email-top);
    left: var(--content-right-left);
    right: auto;
    width: calc(100% - calc(var(--content-padding) * 2));
    z-index: 6;
    text-align: left;
  }
}
