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

:root {
  --green: #2BD47D;
  --navy: #1E1452;
  --bg: #ffffff;
  --text: #444444;
  --text-subtle: #737373;
  --link: #1E1452;
  --link-hover: #2BD47D;
  --divider: rgba(30, 20, 82, 0.1);
  --toggle-bg: rgba(30, 20, 82, 0.08);
  --toggle-hover: rgba(30, 20, 82, 0.15);
}

[data-theme="dark"] {
  --green: #2BD47D;
  --navy: #c8c0e8;
  --bg: #0c0b1a;
  --text: #b0adc0;
  --text-subtle: #85829a;
  --link: #c8c0e8;
  --link-hover: #2BD47D;
  --divider: rgba(200, 192, 232, 0.1);
  --toggle-bg: rgba(200, 192, 232, 0.08);
  --toggle-hover: rgba(200, 192, 232, 0.15);
}

html {
  height: 100%;
}

body {
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.theme-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: var(--toggle-bg);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  z-index: 10;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--toggle-hover);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: var(--text);
  transition: fill 0.3s ease;
}

.theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

.logo {
  margin-bottom: 2rem;
}

.logo img {
  width: clamp(200px, 40vw, 360px);
  height: auto;
  display: block;
  margin: 0 auto;
}

.logo .logo-dark {
  display: none;
}

[data-theme="dark"] .logo .logo-light {
  display: none;
}

[data-theme="dark"] .logo .logo-dark {
  display: block;
}

.tagline {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 0.75rem;
}

.stack {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-subtle);
  letter-spacing: 0.08em;
  line-height: 1.6;
  text-wrap: balance;
  margin-bottom: 2.5rem;
}

.divider {
  width: 40px;
  height: 2px;
  background: var(--divider);
  margin: 0 auto 2rem;
}

.social-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
  list-style: none;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--toggle-bg);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.social-links a:hover,
.social-links a:focus-visible {
  background: var(--toggle-hover);
  transform: translateY(-2px);
}

.social-links a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.social-links svg {
  width: 20px;
  height: 20px;
  fill: var(--link);
  transition: fill 0.2s ease;
}

.social-links a:hover svg {
  fill: var(--link-hover);
}

footer {
  padding: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-subtle);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

@media (max-width: 480px) {
  .theme-toggle {
    top: 1rem;
    right: 1rem;
  }
}

/* System dark mode when the visitor hasn't picked a theme (theme.js sets
   data-theme only for a saved choice). Mirrors the [data-theme="dark"] rules
   above, so the right theme paints before any JS runs. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #c8c0e8;
    --bg: #0c0b1a;
    --text: #b0adc0;
    --text-subtle: #85829a;
    --link: #c8c0e8;
    --divider: rgba(200, 192, 232, 0.1);
    --toggle-bg: rgba(200, 192, 232, 0.08);
    --toggle-hover: rgba(200, 192, 232, 0.15);
  }

  :root:not([data-theme="light"]) .theme-toggle .icon-sun,
  :root:not([data-theme="light"]) .logo .logo-light {
    display: none;
  }

  :root:not([data-theme="light"]) .theme-toggle .icon-moon,
  :root:not([data-theme="light"]) .logo .logo-dark {
    display: block;
  }
}

/* On hover the footer heart beats (grows, double beat, back), as on raulpe7eira.tech */
footer .heart {
  display: inline-block;
}

footer:hover .heart {
  animation: heartbeat 0.9s ease-in-out;
}

@keyframes heartbeat {
  0% { transform: scale(1); }
  15% { transform: scale(1.3); }
  30% { transform: scale(1.1); }
  45% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  footer:hover .heart {
    animation: none;
  }
}

/* Privacy shield: a triangle in the bottom-left corner of the window, as on
   raulpe7eira.tech; the counterpart of the theme toggle (top right).
   Green when on the privacy page. */
.privacy-btn {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 56px;
  clip-path: polygon(0 0, 0 100%, 100% 100%);
  background: var(--toggle-bg);
  transition: background-color 0.2s ease;
  z-index: 10;
}

/* faint diagonal edge, in the divider color */
.privacy-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top right, transparent calc(50% - 1.5px), var(--divider) calc(50% - 1.5px), var(--divider) 50%, transparent 50%);
  pointer-events: none;
}

.privacy-btn svg {
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: 18px;
  height: 18px;
  fill: var(--text);
  transition: fill 0.2s ease;
}

.privacy-btn:hover,
.privacy-btn:focus-visible {
  background: var(--toggle-hover);
  outline: none;
}

.privacy-btn:hover svg,
.privacy-btn:focus-visible svg {
  fill: var(--link-hover);
}

.privacy-btn.on {
  background: var(--green);
}

.privacy-btn.on svg,
.privacy-btn.on:hover svg,
.privacy-btn.on:focus-visible svg {
  fill: #1E1452;
}

/* Cookie consent banner (shown by analytics.js until the visitor chooses).
   Accept and Decline look the same: declining is as easy as accepting. */
.consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg);
  border-top: 1px solid var(--divider);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
  font-size: 0.8rem;
  color: var(--text);
  z-index: 20;
}

.consent[hidden] {
  display: none;
}

.consent p {
  max-width: 36rem;
}

.consent a {
  color: var(--link);
}

.consent-actions {
  display: flex;
  gap: 0.5rem;
}

.consent button,
.consent-reset {
  min-width: 5.5rem;
  min-height: 36px;
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--divider);
  border-radius: 999px;
  background: var(--toggle-bg);
  color: var(--link);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.consent button:hover,
.consent-reset:hover {
  background: var(--toggle-hover);
}

.consent button:focus-visible,
.consent-reset:focus-visible,
.consent a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* Privacy page: one left-aligned column (logo, heading, text) centered on
   the page, sitting a little above the middle (optical center) rather than
   at the very top or exactly centered. */
main.privacy {
  padding-bottom: 14vh;
}

.privacy .back {
  display: inline-block;
  margin-bottom: 1.75rem;
}

/* logo.png has transparent padding around the mark (720×720 file, mark at
   x=100, y=191, 519×345); negative margins line the mark up with the text */
.privacy .back img {
  width: 120px;
  height: auto;
  display: block;
  margin: calc(-120px * 191 / 720) 0 calc(-120px * 184 / 720) calc(-120px * 100 / 720);
}

.privacy .back .logo-dark {
  display: none;
}

[data-theme="dark"] .privacy .back .logo-light {
  display: none;
}

[data-theme="dark"] .privacy .back .logo-dark {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .privacy .back .logo-light {
    display: none;
  }

  :root:not([data-theme="light"]) .privacy .back .logo-dark {
    display: block;
  }
}

.privacy-text {
  width: 100%;
  max-width: 40rem;
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.7;
}

.privacy-text h1 {
  color: var(--navy);
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.privacy-text p {
  margin-bottom: 1rem;
}

.privacy-text a {
  color: var(--link);
}

.privacy-text strong {
  color: var(--navy);
}

.privacy-text .consent-reset {
  margin-left: 0.5rem;
}
