:root {
  --bg: #252525;
  --text: #FFFEF3;
  --easing: cubic-bezier(0.2, 0, 0, 1);
}

/* ========== THEME TOGGLE (top-left) ========== */

.theme-toggle {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  background: transparent;
  border: 1px solid var(--text);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  cursor: pointer;
  transition: opacity 0.2s ease, background-color 0.3s ease, color 0.3s ease;
  z-index: 100;
}

.theme-toggle:hover {
  opacity: 0.7;
}

/* ========== DEFINITION POPUP (top-right) ========== */

.definition-trigger {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 100;
}

.definition-trigger > span {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  color: var(--text);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.definition-trigger > span:hover {
  opacity: 0.7;
}

.definition-popup {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--text);
  color: var(--bg);
  padding: 1rem 1.25rem;
  min-width: 240px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

/* Hover only for devices that support it (not touch) */
@media (hover: hover) {
  .definition-trigger:hover .definition-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

/* Click/tap toggle for all devices */
.definition-trigger.active .definition-popup {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.definition-popup .word {
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.definition-popup .pos {
  font-style: italic;
  opacity: 0.7;
}

.definition-popup .def {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  line-height: 1.5;
  margin-bottom: 0.25rem;
}

.definition-popup .def:last-child {
  margin-bottom: 0;
}

/* ========== INVERTED THEME ========== */

body.inverted {
  background-color: var(--text);
  color: var(--bg);
}

body.inverted .theme-toggle {
  border-color: var(--bg);
  color: var(--bg);
}

body.inverted .definition-trigger > span {
  color: var(--bg);
}

body.inverted .definition-popup {
  background: var(--bg);
  color: var(--text);
}

body.inverted .logo {
  filter: invert(1);
}

body.inverted .cta-primary,
body.inverted .cta-secondary,
body.inverted .footer-contact a,
body.inverted .social-icons a {
  color: var(--bg);
}

body.inverted .cta-primary {
  border-bottom-color: var(--bg);
}

body.inverted .social-icons svg {
  color: var(--bg);
}

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

html,
body {
  height: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ========== MOBILE TAGLINE (top of page) ========== */

.mobile-tagline {
  display: none;
  /* Hidden on desktop */
}

/* ========== MAIN CONTENT ========== */

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
  flex: 1;
  justify-content: center;
  padding: 2rem;
  /* Visual optical centering - slightly higher than geometric center */
  margin-top: -5vh;
  opacity: 0;
  animation: fadeIn 1.2s var(--easing) forwards;
}

.logo {
  width: 200px;
  /* Desktop default */
  height: auto;
  margin-bottom: 3rem;
  display: block;
}

.statement {
  font-family: 'Crimson Text', Georgia, serif;
  font-size: clamp(1.125rem, 3vw, 1.375rem);
  /* ~20-22px */
  line-height: 1.7;
  margin-bottom: 2.5rem;
  font-weight: 400;
  max-width: 600px;
}

.statement em {
  font-style: italic;
}

.cta-primary {
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  padding-bottom: 4px;
  border-bottom: 2px dotted var(--text);
  /* DOTTED underline per V3 */
  transition: opacity 0.2s ease;
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cta-primary:hover {
  opacity: 0.6;
}

.arrow {
  display: inline-block;
  transition: transform 0.3s var(--easing);
}

.cta-primary:hover .arrow {
  transform: translateX(3px);
}

.cta-secondary {
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  margin-top: 0.5rem;
}

.cta-secondary:hover {
  opacity: 1;
}

/* ========== FOOTER ========== */

footer {
  padding: 2.5rem 3rem;
  width: 100%;
  opacity: 0;
  animation: fadeIn 1.2s var(--easing) 0.3s forwards;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-col {
  flex: 1;
}

.footer-address {
  text-align: left;
}

.footer-address p {
  font-size: 0.875rem;
  line-height: 1.6;
}

.footer-contact {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-contact a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
}

.footer-contact a:hover {
  text-decoration: underline;
}

.social-icons {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  justify-content: center;
}

.social-icons a {
  color: var(--text);
  transition: opacity 0.2s ease;
}

.social-icons a:hover {
  opacity: 0.7;
}

.social-icons svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Fix for instagram fill="none" */
.social-icons a[aria-label="Instagram"] svg {
  fill: none;
}

.footer-tagline {
  text-align: right;
}

.footer-tagline p {
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 1rem;
}

.footer-tagline em {
  font-style: italic;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== MOBILE ========== */

@media (max-width: 768px) {

  /* Show tagline at top of footer on mobile */
  .mobile-tagline {
    display: block;
    text-align: center;
    padding: 0 2rem 2rem;
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 0.95rem;
  }

  .mobile-tagline em {
    font-style: italic;
  }

  /* Hide footer tagline on mobile */
  .footer-col.footer-tagline {
    display: none;
  }

  .container {
    padding-top: 3rem;
    /* Push content down for centering */
    margin-top: 0;
    /* Reset desktop centering */
  }

  .logo {
    width: 240px;
    /* LARGER on mobile per brief */
    margin-bottom: 2.5rem;
  }

  .statement {
    font-size: 1.05rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 2rem;
    align-items: center;
  }

  .footer-col {
    width: 100%;
    flex: auto;
  }

  .footer-address,
  .footer-contact {
    text-align: center;
    align-items: center;
  }

  .social-icons {
    justify-content: center;
  }

  .theme-toggle {
    top: 1rem;
    left: 1rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
  }

  .definition-trigger {
    top: 1rem;
    right: 1rem;
  }

  .definition-trigger > span {
    font-size: 0.7rem;
  }

  .definition-popup {
    min-width: 200px;
    padding: 0.875rem 1rem;
  }

  .definition-popup .word {
    font-size: 0.9rem;
  }

  .definition-popup .def {
    font-size: 0.75rem;
  }
}