:root {
  --bg: #faf8f3;
  --fg: #14130f;
  --fg-muted: #6b675f;
  --rule: #d9d4c8;
  --hover: #1a1814;
  --ghost: #b4ad9f;
  --sheet-bg: #ffffff;
  --sheet-fg: #14130f;
  --sheet-rule: #e6e1d4;
  --sheet-backdrop: rgba(20, 19, 15, 0.32);
  --font-display: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0d0b;
    --fg: #f3efe6;
    --fg-muted: #8a857a;
    --rule: #2a2823;
    --hover: #ffffff;
    --ghost: #4a473f;
    --sheet-bg: #1a1816;
    --sheet-fg: #f3efe6;
    --sheet-rule: #2a2823;
    --sheet-backdrop: rgba(0, 0, 0, 0.55);
  }
}

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

html,
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
}

body {
  display: flex;
}

.page {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 5rem) clamp(1.5rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "name"
    "links"
    "foot";
  gap: clamp(2.5rem, 6vw, 4rem);
  align-content: start;
  min-height: 100dvh;
}

@media (min-width: 760px) {
  .page {
    grid-template-columns: 1.05fr 1fr;
    grid-template-areas:
      "name links"
      "foot foot";
    gap: clamp(3rem, 6vw, 6rem) clamp(3rem, 8vw, 7rem);
    align-content: center;
    padding-block: clamp(3rem, 8vw, 6rem);
  }
}

/* ---------------------------------------------------------------- name */

.name {
  grid-area: name;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.name__display {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.8rem, 8.5vw, 5.75rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
  display: flex;
  flex-direction: column;
}

.name__line {
  display: block;
  white-space: nowrap;
}

.name__line:nth-child(2) {
  font-style: italic;
  font-weight: 400;
  color: var(--fg-muted);
}

.name__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--fg-muted);
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}

.name__rule {
  display: block;
  width: 2.5rem;
  height: 1px;
  background: var(--rule);
}

.name__location {
  font-feature-settings: "ss01";
}

/* --------------------------------------------------------------- links */

.links {
  grid-area: links;
  align-self: center;
  width: 100%;
}

.links__list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.links__item {
  border-top: 1px solid var(--rule);
}

.links__item:last-child {
  border-bottom: 1px solid var(--rule);
}

.links__row {
  display: grid;
  grid-template-columns: minmax(5.5rem, auto) 1fr auto;
  align-items: baseline;
  gap: 1rem;
  width: 100%;
  padding: 0.78rem 0.25rem 0.78rem 0;
  background: none;
  border: 0;
  font: inherit;
  color: var(--fg);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: color 240ms var(--ease), transform 240ms var(--ease);
}

.links__row:hover,
.links__row:focus-visible {
  color: var(--hover);
  outline: none;
}

.links__label {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  font-weight: 400;
  font-variation-settings: "opsz" 48;
  letter-spacing: -0.005em;
}

.links__handle {
  color: var(--fg-muted);
  font-size: 0.82rem;
  letter-spacing: 0.005em;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 240ms var(--ease);
}

.links__row:hover .links__handle,
.links__row:focus-visible .links__handle {
  color: var(--fg);
}

.links__arrow {
  display: inline-block;
  color: var(--fg-muted);
  font-size: 0.95rem;
  transition: transform 280ms var(--ease), color 240ms var(--ease);
  min-width: 1.25rem;
  text-align: right;
}

.links__row:hover .links__arrow,
.links__row:focus-visible .links__arrow {
  transform: translateX(6px);
  color: var(--fg);
}

.links__item--vcard .links__label,
.links__row--ghost .links__label {
  color: var(--ghost);
  font-style: italic;
}

.links__row--ghost:hover .links__label,
.links__row--ghost:focus-visible .links__label {
  color: var(--fg);
}

/* ----------------------------------------------------------------- foot */

.foot {
  grid-area: foot;
  color: var(--fg-muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (min-width: 760px) {
  .foot {
    text-align: right;
  }
}

/* ---------------------------------------------------------- action sheet */

.sheet {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--sheet-fg);
  margin: auto;
  max-width: 26rem;
  width: calc(100% - 2rem);
}

.sheet::backdrop {
  background: var(--sheet-backdrop);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.sheet[open] {
  animation: sheet-in 240ms var(--ease) both;
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.sheet__inner {
  background: var(--sheet-bg);
  border: 1px solid var(--sheet-rule);
  border-radius: 14px;
  padding: 1.5rem 1.5rem 1rem;
  box-shadow: 0 18px 60px -20px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sheet__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.sheet__value {
  color: var(--fg-muted);
  font-size: 0.95rem;
  word-break: break-all;
  margin-bottom: 0.25rem;
}

.sheet__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.25rem;
}

.sheet__btn {
  border: 1px solid var(--sheet-rule);
  background: transparent;
  color: var(--sheet-fg);
  font: inherit;
  font-weight: 500;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 180ms var(--ease), color 180ms var(--ease);
}

.sheet__btn:hover,
.sheet__btn:focus-visible {
  background: var(--sheet-fg);
  color: var(--sheet-bg);
  outline: none;
}

.sheet__btn[data-sheet="primary"] {
  background: var(--sheet-fg);
  color: var(--sheet-bg);
}

.sheet__btn[data-sheet="primary"]:hover,
.sheet__btn[data-sheet="primary"]:focus-visible {
  opacity: 0.88;
}

.sheet__cancel {
  margin-top: 0.4rem;
  border: 0;
  background: transparent;
  color: var(--fg-muted);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.6rem;
  cursor: pointer;
  align-self: center;
}

.sheet__cancel:hover {
  color: var(--sheet-fg);
}

/* ----------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%) translateY(1rem);
  background: var(--sheet-bg);
  color: var(--sheet-fg);
  border: 1px solid var(--sheet-rule);
  border-radius: 999px;
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease), transform 220ms var(--ease);
  z-index: 10;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ------------------------------------------------------------ animations */

@media (prefers-reduced-motion: no-preference) {
  .name__line,
  .name__meta,
  .links__item,
  .foot {
    opacity: 0;
    transform: translateY(8px);
    animation: rise 700ms var(--ease) forwards;
    animation-delay: calc(120ms + var(--i, 0) * 55ms);
  }
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

::selection {
  background: var(--fg);
  color: var(--bg);
}
