/* One purple palette, with a dark variant that follows the system setting. */
:root {
  color-scheme: light dark;
  --bg: #f6f5f7;
  --bg-elev: #ffffff;
  --bg-subtle: #f1eff4;
  --text: #302b3a;
  --text-muted: #5b5465;
  --text-faint: #726b7f;
  --accent: #7042bc;
  --accent-soft: #ece3fa;
  --border: #e6e3ea;
  --glow: rgba(120, 80, 200, 0.16);
  --shadow: 0 1px 2px rgba(48, 43, 58, 0.05), 0 20px 48px -24px rgba(72, 40, 130, 0.32);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, "New York", "Iowan Old Style", Charter, "Bitstream Charter", Georgia, Cambria, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #19181d;
    --bg-elev: #222126;
    --bg-subtle: #2a2830;
    --text: #f1edf8;
    --text-muted: #c0b5cf;
    --text-faint: #948aa3;
    --accent: #bba0f7;
    --accent-soft: #392b50;
    --border: #35323b;
    --glow: rgba(187, 160, 247, 0.11);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 24px 56px -28px rgba(0, 0, 0, 0.7);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding:
    max(1rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  background-color: var(--bg);
  background-image: radial-gradient(56rem 36rem at 50% -10rem, var(--glow), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

.card {
  width: 100%;
  max-width: 33rem;
  padding: clamp(1.5rem, 6vw, 3rem);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 1.75rem;
  box-shadow: var(--shadow);
  animation: rise 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.mark {
  display: block;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1.75rem;
}

.hello {
  margin: 0 0 0.25rem;
  color: var(--text-muted);
}

.wave {
  display: inline-block;
  transform-origin: 70% 75%;
  animation: wave 1.6s ease-in-out 0.7s both;
}

.hello:hover .wave {
  animation: wave-again 1.6s ease-in-out both;
}

h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 10vw, 3.25rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.intro {
  margin: 1.25rem 0 2rem;
  color: var(--text-muted);
}

.links {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 1.125rem;
  overflow: hidden;
}

.links li {
  display: flex;
  align-items: center;
}

.links li + li {
  border-top: 1px solid var(--border);
}

.row-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 4rem;
  padding: 0.75rem 1rem 0.75rem 0.875rem;
  color: inherit;
  text-decoration: none;
  transition: background-color 150ms ease;
}

.row-link-email {
  padding-right: 0.5rem;
}

.row-link:hover {
  background: var(--bg-subtle);
}

.row-link:active {
  background: var(--accent-soft);
}

.icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: var(--accent-soft);
  color: var(--accent);
}

.icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.label {
  color: var(--text-faint);
  font-size: 0.8125rem;
}

.value {
  font-size: 1rem;
  font-weight: 550;
  overflow-wrap: anywhere;
}

.trail {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  color: var(--text-faint);
  transition: transform 150ms ease, color 150ms ease;
}

.row-link:hover .trail {
  color: var(--accent);
}

.row-link:hover .trail-out {
  transform: translate(2px, -2px);
}

.row-link:hover .trail-down {
  transform: translateY(2px);
}

.copy {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-right: 0.5rem;
  padding: 0;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.copy[hidden] {
  display: none;
}

.copy:hover {
  background: var(--bg-subtle);
  color: var(--accent);
}

.copy svg {
  width: 1.25rem;
  height: 1.25rem;
}

.copy .check-icon,
.copy.is-copied .copy-icon {
  display: none;
}

.copy.is-copied .check-icon {
  display: block;
}

.copy.is-copied {
  color: var(--accent);
}

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

.copy:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

footer {
  color: var(--text-faint);
  font-size: 0.8125rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* The 404 page reuses the card with a single link. */
.home-link {
  color: var(--accent);
  font-weight: 550;
  text-decoration: none;
}

.home-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

@media (max-width: 359px) {
  .icon {
    display: none;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10% { transform: rotate(16deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}

/* A second copy of the keyframes lets hovering replay the wave. */
@keyframes wave-again {
  0%, 60%, 100% { transform: rotate(0); }
  10% { transform: rotate(16deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .wave,
  .hello:hover .wave {
    animation: none;
  }

  .row-link,
  .trail,
  .copy {
    transition: none;
  }
}
