/* Crewmoor — Digital business card (/f) */
:root {
  --navy: #102d49;
  --navy-hover: #0b2238;
  --teal: #16a6af;
  --teal-soft: rgba(22, 166, 175, 0.1);
  --white: #ffffff;
  --ink: #102d49;
  --muted: #55667a;      /* 5.9:1 on white */
  --subtle: #7b8a99;     /* decorative only */
  --line: #e5e9ee;
  --line-strong: #d3dae2;
  --tile: #f3f6f8;
  --canvas: #f6f8fa;
  --radius: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* ── Layout ─────────────────────────────────────────────── */
.card {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding:
    max(28px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Header ─────────────────────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.brand {
  display: inline-flex;
  border-radius: 8px;
  margin-bottom: 22px;
  min-height: 32px;
  align-items: center;
}
.brand__logo {
  display: block;
  height: 30px;
  width: auto;
  max-width: 180px;
}
.brand.is-missing { display: none; }

.hero__name {
  margin: 0;
  font-size: 1.5rem;          /* 24px */
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.022em;
  color: var(--navy);
}
.hero__title {
  margin: 6px 0 0;
  font-size: 0.9375rem;       /* 15px */
  font-weight: 500;
  color: var(--muted);
}
.hero__location {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 10px 0 0;
  padding: 4px 10px 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8125rem;       /* 13px */
  font-weight: 500;
  color: var(--muted);
}
.hero__location svg { color: var(--teal); flex: none; }

/* ── Section label ─────────────────────────────────────── */
.section-label {
  margin: 0 0 10px;
  font-size: 0.6875rem;       /* 11px */
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Link cards ─────────────────────────────────────────── */
.links__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.link {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr 20px;
  align-items: center;
  gap: 14px;
  height: 68px;
  padding: 0 16px 0 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16, 45, 73, 0.04);
  transition:
    border-color 180ms var(--ease),
    box-shadow 180ms var(--ease),
    transform 180ms var(--ease),
    background-color 180ms var(--ease);
}

.link__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--tile);
  color: var(--navy);
  transition: background-color 180ms var(--ease), color 180ms var(--ease);
}
.link__icon svg { width: 20px; height: 20px; }

.link__text { min-width: 0; }
.link__title {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--navy);
}
.link__sub {
  display: block;
  margin-top: 1px;
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link__arrow {
  color: var(--subtle);
  transition: color 180ms var(--ease), transform 180ms var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .link:hover {
    border-color: rgba(22, 166, 175, 0.45);
    box-shadow: 0 6px 18px -8px rgba(16, 45, 73, 0.18);
    transform: translateY(-1px);
  }
  .link:hover .link__icon { background: var(--teal-soft); color: var(--teal); }
  .link:hover .link__arrow { color: var(--teal); transform: translate(2px, -2px); }
}
.link:active {
  transform: scale(0.985);
  background: #fafbfc;
  border-color: var(--line-strong);
  transition-duration: 80ms;
}

/* ── Contact ────────────────────────────────────────────── */
.contact__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.contact__row:empty { display: none; }
.contact__row > :only-child,
.contact__row > .split { grid-column: 1 / -1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  user-select: none;
  transition:
    background-color 160ms var(--ease),
    border-color 160ms var(--ease),
    color 160ms var(--ease),
    transform 120ms var(--ease);
}
.btn svg { flex: none; }
.btn:active { transform: scale(0.98); }

.btn--primary {
  width: 100%;
  background: var(--navy);
  color: var(--white);
  border: 1px solid var(--navy);
}
@media (hover: hover) { .btn--primary:hover { background: var(--navy-hover); } }

.btn--secondary {
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--line);
  min-width: 0;
  padding: 0 12px;
  gap: 7px;
}
.btn--secondary svg { color: var(--teal); }
@media (hover: hover) {
  .btn--secondary:hover { border-color: rgba(22, 166, 175, 0.45); background: #fbfdfd; }
}
.btn--secondary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Email: link + copy button joined as one control */
.split {
  display: flex;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 160ms var(--ease);
}
@media (hover: hover) { .split:hover { border-color: rgba(22, 166, 175, 0.45); } }
.split .btn--secondary { flex: 1; border: 0; border-radius: 0; }
.split__copy {
  flex: none;
  width: 44px;
  display: grid;
  place-items: center;
  background: var(--white);
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  transition: color 160ms var(--ease), background-color 160ms var(--ease);
}
@media (hover: hover) { .split__copy:hover { color: var(--teal); background: #fbfdfd; } }
.split__copy:active { background: var(--tile); }
.split :focus-visible { outline-offset: -2px; }

/* ── Footer ─────────────────────────────────────────────── */
.foot {
  display: flex;
  justify-content: center;
  padding-top: 4px;
  font-size: 0.75rem;
  color: var(--subtle);
}
.foot a {
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--muted);
  transition: color 160ms var(--ease);
}
@media (hover: hover) { .foot a:hover { color: var(--teal); } }

/* ── Toast ─────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--navy);
  color: var(--white);
  font-size: 0.8125rem;
  font-weight: 500;
  box-shadow: 0 8px 24px -8px rgba(16, 45, 73, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ── Entrance ───────────────────────────────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.hero,
.links__list > li,
.contact,
.foot {
  animation: rise 420ms var(--ease) both;
}
.links__list > li:nth-child(1) { animation-delay: 60ms; }
.links__list > li:nth-child(2) { animation-delay: 100ms; }
.links__list > li:nth-child(3) { animation-delay: 140ms; }
.contact { animation-delay: 180ms; }
.foot { animation-delay: 220ms; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .link:hover, .link:active, .btn:active { transform: none; }
}

/* ── Larger screens: framed card on a quiet canvas ──────── */
@media (min-width: 640px) and (min-height: 640px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: var(--canvas);
  }
  .card {
    padding: 40px 32px 28px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(16, 45, 73, 0.04), 0 24px 48px -24px rgba(16, 45, 73, 0.14);
  }
}

/* Narrow phones: stack contact actions so labels never truncate */
@media (max-width: 374px) {
  .contact__row { grid-template-columns: minmax(0, 1fr); }
}

/* Very small phones (≤340px) */
@media (max-width: 340px) {
  .card { gap: 20px; }
  .hero__name { font-size: 1.375rem; }
  .link { gap: 12px; padding: 0 12px; }
}
