/* samantm.com, the switchboard card.
   Brand: deep ink, Persian cobalt, the Khatam star, Geist with a Newsreader
   italic accent. Fonts are self-hosted and cut to the weights used, so the
   page makes no third-party requests. Mobile first: the card is built to be
   opened on a phone and handed across a table. */

@font-face {
  font-family: 'Geist';
  src: url('fonts/geist-400-600.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('fonts/newsreader-italic-420.woff2') format('woff2');
  font-weight: 400 500;
  font-style: italic;
  font-display: swap;
}

:root {
  --accent: #3F87D6;
  --accent-soft: rgba(63, 135, 214, 0.16);
  --bg: #0C1322;
  --bg-elev: #141B2C;
  --bg-soft: #18202F;
  --edge: rgba(240, 237, 227, 0.10);
  --text: #F0EDE3;
  --text-soft: #C4C2BC;
  --text-muted: #8A8B8E;
  --copper: #E07A3C;
  --font-sans: 'Geist', 'Helvetica Neue', Arial, system-ui, sans-serif;
  --font-serif: 'Newsreader', Georgia, serif;
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --khatam: polygon(50% 10.4%, 61.6% 22%, 78% 22%, 78% 38.4%, 89.6% 50%, 78% 61.6%, 78% 78%, 61.6% 78%, 50% 89.6%, 38.4% 78%, 22% 78%, 22% 61.6%, 10.4% 50%, 22% 38.4%, 22% 22%, 38.4% 22%);
}
@media (prefers-color-scheme: light) {
  :root {
    --accent: #1F5293;
    --accent-soft: rgba(31, 82, 147, 0.12);
    --bg: #F4F2EC;
    --bg-elev: #FFFFFF;
    --bg-soft: #ECE9E1;
    --edge: rgba(12, 19, 34, 0.12);
    --text: #0C1322;
    --text-soft: #2E3344;
    --text-muted: #5F636D;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: max(28px, env(safe-area-inset-top)) 18px max(96px, calc(env(safe-area-inset-bottom) + 88px));
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--accent); color: var(--bg); }
h1, h2, p, ul { margin: 0; padding: 0; }
a { color: inherit; }
svg { display: block; }
.vh {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 300;
  padding: 10px 14px; border-radius: 8px;
  background: var(--accent); color: #fff; text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.card {
  width: 100%;
  max-width: 440px;
  margin: auto 0;
  text-align: center;
}

/* -- portrait in the Khatam frame -------------------------------------- */
.portrait {
  position: relative;
  width: 148px;
  height: 148px;
  margin: 0 auto 18px;
}
.portrait .frame-bg,
.portrait .photo-mask { position: absolute; inset: 0; clip-path: var(--khatam); }
.portrait .frame-bg { background: var(--bg-elev); }
.portrait img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  transform: scale(0.78); transform-origin: 50% 78%;
}
.khatam-shimmer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.khatam-shimmer path { fill: none; stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; }
.khatam-shimmer .base { stroke-width: 0.6; opacity: 0.25; }
.khatam-shimmer .shine { stroke-width: 1.4; filter: drop-shadow(0 0 0.8px var(--accent)); }
@media (prefers-reduced-motion: reduce) { .khatam-shimmer .shine { display: none; } }

/* -- name and line ------------------------------------------------------ */
h1 {
  font-size: clamp(28px, 7.4vw, 34px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.role { margin-top: 6px; font-size: 15.5px; color: var(--text-soft); }
.line {
  margin: 10px auto 0;
  max-width: 340px;
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.4;
  color: var(--text);
  text-wrap: balance;
}
.line em { font-style: italic; font-weight: 420; }

.papi-wordmark {
  display: inline-flex; align-items: baseline; white-space: nowrap;
  text-decoration: none; vertical-align: baseline;
}
.papi-wordmark .papi { font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.papi-wordmark .labs { font-weight: 500; color: var(--text-soft); }
.papi-wordmark .papi-iwan { width: 0.5em; height: 0.5em; margin: 0 0.08em -0.02em 0.06em; align-self: baseline; }
.papi-wordmark:hover .papi { color: var(--accent); }

/* -- panels ------------------------------------------------------------- */
.panel { margin-top: 28px; text-align: start; }
.panel-title {
  margin: 0 2px 10px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Three keys in a row: the switchboard itself. */
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.key {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 84px;
  padding: 14px 6px 12px;
  border-radius: 14px;
  border: 1px solid var(--edge);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.key svg {
  width: 24px; height: 24px;
  fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.key svg .fill { fill: var(--accent); stroke: none; }
.key:hover { border-color: var(--accent); transform: translateY(-2px); }
.key:active { transform: scale(0.97); }
.key-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.key-primary svg { stroke: #fff; }
.key-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.address { margin-top: 10px; text-align: center; font-size: 14.5px; color: var(--text-muted); }
.address a { color: var(--text-soft); text-decoration-color: var(--edge); text-underline-offset: 3px; }
.address a:hover { color: var(--accent); }

.lines { list-style: none; display: grid; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--edge);
  background: var(--bg-elev);
  text-decoration: none;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.row:hover { border-color: var(--accent); transform: translateY(-2px); }
.row-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row-label { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.row-sub { font-size: 14px; line-height: 1.45; color: var(--text-muted); text-wrap: pretty; }
.row-arrow { flex-shrink: 0; font-size: 18px; color: var(--text-muted); transition: color 0.2s var(--ease), transform 0.2s var(--ease); }
.row:hover .row-arrow { color: var(--accent); transform: translateX(3px); }

/* -- footer ------------------------------------------------------------- */
.foot { margin-top: 30px; display: grid; gap: 6px; }
.tribute { font-family: var(--font-serif); font-style: italic; font-size: 14px; color: var(--text-muted); }
.lion-sun { font-style: normal; margin-inline-end: 4px; }
.tribute [lang="fa"] { font-style: normal; }
.quiet { font-size: 12.5px; color: var(--text-muted); }

/* -- share: QR for someone across the table ------------------------------ */
.share-trigger {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 50;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 16px 11px 14px;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: var(--bg-elev);
  color: var(--text);
  font: 500 14.5px/1 var(--font-sans);
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.share-trigger svg {
  width: 20px; height: 20px;
  fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.share-trigger:hover { border-color: var(--accent); }
.share-trigger:active { transform: scale(0.96); }

.share {
  width: 100%; max-width: none; height: 100%; max-height: none;
  margin: 0; padding: 28px 20px;
  border: 0;
  background: rgba(12, 19, 34, 0.97);
  color: #fff;
  text-align: center;
}
.share[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.share::backdrop { background: transparent; }
.share h2 { margin-bottom: 20px; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.share .qr {
  width: min(78vw, 56vh); max-width: 420px; height: auto;
  padding: 16px; border-radius: 18px; background: #fff;
  image-rendering: pixelated;
}
.share-url { margin-top: 18px; font-size: 16px; font-weight: 500; letter-spacing: 0.03em; }
.share-link {
  margin-top: 16px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: #fff;
  font: 500 15px/1 var(--font-sans);
  cursor: pointer;
}
.share-link:hover { border-color: #fff; }
.share-status { margin-top: 10px; min-height: 1.4em; font-size: 14px; color: rgba(255, 255, 255, 0.7); }
.share-close {
  position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px;
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08); color: #fff; cursor: pointer;
}
.share-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

@media (prefers-reduced-motion: reduce) {
  .key, .row, .row-arrow, .share-trigger { transition: none; }
  .key:hover, .row:hover { transform: none; }
}
