/* afesokh.com — private-banking stationery: ink navy, ivory stock, gold hairlines. */

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/assets/fonts/cormorant-garamond-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/assets/fonts/cormorant-garamond-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Jost';
  src: url('/assets/fonts/jost-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Jost';
  src: url('/assets/fonts/jost-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

:root {
  --ink: #0e1b2c;
  --ink-soft: #1d2d45;
  --ivory: #f7f3ec;
  --paper: #fcfaf6;
  --gold: #b89a5e;          /* decorative only */
  --gold-text: #7a5f2c;     /* AA on ivory */
  --gold-light: #d9c69b;
  --muted: #59616e;
  --hairline: rgba(14, 27, 44, 0.12);

  --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --sans: 'Jost', 'Avenir Next', 'Segoe UI', sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

[hidden] { display: none !important; }

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Shared identity ---------- */

.portrait img {
  border-radius: 50%;
  outline: 1px solid var(--gold);
  outline-offset: 5px;
}

.name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1.05;
}

.role {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* ---------- Profile page (/) ---------- */

.page-profile {
  background-color: var(--ivory);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.7), transparent 60%),
    repeating-linear-gradient(90deg, rgba(14, 27, 44, 0.012) 0 1px, transparent 1px 4px);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.band {
  height: 176px;
  background:
    url('/assets/guilloche.svg') 0 0 / 700px 100% repeat-x,
    linear-gradient(180deg, var(--ink) 0%, var(--ink-soft) 100%);
  border-bottom: 1px solid var(--gold);
  box-shadow: 0 1px 0 rgba(184, 154, 94, 0.35), 0 4px 0 -2px var(--ivory), 0 5px 0 -2px rgba(184, 154, 94, 0.5);
}

.profile {
  flex: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 0 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.profile .portrait {
  margin-top: -76px;
  padding: 6px;
  border-radius: 50%;
  background: var(--ivory);
  box-shadow: 0 14px 30px -18px rgba(14, 27, 44, 0.55);
}

.profile .name {
  margin-top: 28px;
  font-size: clamp(2.15rem, 9vw, 2.75rem);
}

.profile .role {
  margin-top: 12px;
  color: var(--gold-text);
}

.org {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  font-style: normal;
  color: var(--muted);
}

.rule {
  position: relative;
  width: 100%;
  max-width: 260px;
  height: 1px;
  margin: 30px 0 26px;
  background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold) 80%, transparent);
}
.rule span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  background: var(--ivory);
  border: 1px solid var(--gold);
  transform: translate(-50%, -50%) rotate(45deg);
}

.contacts {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 3px;
}
.contacts li + li { border-top: 1px solid var(--hairline); }

.contacts a {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 12px 18px;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.contacts a:hover { background-color: rgba(184, 154, 94, 0.07); }
.contacts a:focus-visible {
  outline: 2px solid var(--gold-text);
  outline-offset: -2px;
}

.contact-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--gold-light);
  border-radius: 50%;
  color: var(--gold-text);
}
.contact-icon .icon { width: 17px; height: 17px; }

.contact-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.contact-label {
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact-value {
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  margin-top: 28px;
  padding: 14px 24px;
  background: var(--ink);
  color: var(--ivory);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  outline: 1px solid rgba(184, 154, 94, 0.75);
  outline-offset: -6px;
  box-shadow: 0 10px 24px -14px rgba(14, 27, 44, 0.8);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.save:hover { background: var(--ink-soft); transform: translateY(-1px); }
.save:active { transform: translateY(0); box-shadow: 0 4px 12px -8px rgba(14, 27, 44, 0.8); }
.save:focus-visible { outline: 2px solid var(--gold-text); outline-offset: 3px; }
.save .icon { color: var(--gold-light); }

.hint {
  margin: 12px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.colophon {
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  text-align: center;
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--gold-text);
}

/* Staggered entrance */
@media (prefers-reduced-motion: no-preference) {
  .profile > *,
  .card > * {
    animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .profile > :nth-child(2), .card > :nth-child(2) { animation-delay: 0.08s; }
  .profile > :nth-child(3), .card > :nth-child(3) { animation-delay: 0.16s; }
  .profile > :nth-child(4) { animation-delay: 0.24s; }
  .profile > :nth-child(5) { animation-delay: 0.32s; }
  .profile > :nth-child(6) { animation-delay: 0.4s; }
  .profile > :nth-child(n + 7) { animation-delay: 0.48s; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Card page (/card) ---------- */

.page-card {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: radial-gradient(ellipse at 50% 45%, var(--ink-soft) 0%, var(--ink) 70%);
  background-color: var(--ink);
  color: var(--ivory);
}

/* Engraved bands: a viewport-wide window onto a track one tile (700px) wider,
   so translating the track by exactly one tile loops without a seam. */
.engraving {
  position: fixed;
  left: 0;
  right: 0;
  height: 220px;
  overflow: hidden;
  pointer-events: none;
}
.engraving--top { top: 0; }
.engraving--bottom { bottom: 0; transform: scaleY(-1); }

.engraving-track {
  width: calc(100% + 700px);
  height: 100%;
  background: url('/assets/guilloche.svg') 0 0 / 700px 100% repeat-x;
}

.card {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 460px;
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 18px;
  align-self: stretch;
  justify-content: center;
}
.portrait--small img { outline-offset: 4px; }

.name--card {
  font-size: clamp(1.7rem, 7.5vw, 2.1rem);
  color: var(--paper);
}
.role--card {
  margin-top: 6px;
  font-size: 0.64rem;
  color: var(--gold-light);
}

.qr {
  position: relative;
  margin: 0;
  width: min(78vw, 360px);
  padding: 14px 14px 16px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 0 0 1px var(--gold), 0 0 0 7px var(--ink), 0 0 0 8px rgba(184, 154, 94, 0.45), 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}
.qr svg { display: block; width: 100%; height: auto; }
.qr figcaption {
  margin-top: 6px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
}

.card-url {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: 0.1em;
  color: var(--gold-light);
}

/* Add to Home Screen: deliberately quiet, since other people see this page. */
.install {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: -8px;
}
.install-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--gold-light);
  font: 500 0.66rem/1 var(--sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1px solid rgba(217, 198, 155, 0.35);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.install-button:hover { border-color: var(--gold-light); color: var(--paper); }
.install-button:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }
.install-button .icon { width: 16px; height: 16px; }

.install-hint {
  margin: 0;
  padding: 6px 12px;
  background: rgba(14, 27, 44, 0.92);
  border-radius: 2px;
  font-size: 0.8rem;
  color: var(--ivory);
  text-align: center;
}
.install-hint .icon {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  color: var(--gold-light);
}
.install-hint strong { font-weight: 500; color: var(--paper); }

@media (max-height: 620px) {
  .card { gap: 18px; }
  .qr { width: min(64vw, 300px); }
}

/* Card motion. The QR modules themselves never move after the entrance, so
   scanning is unaffected; everything here is off under reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  /* Engraving wipes in left-to-right, then drifts; bands move in opposite directions. */
  .engraving {
    animation: engrave 1.8s cubic-bezier(0.5, 0, 0.2, 1) 0.1s both;
  }
  .engraving--bottom { animation-delay: 0.35s; }
  .engraving-track {
    animation: drift 60s linear infinite;
    will-change: transform;
  }
  .engraving--bottom .engraving-track { animation-direction: reverse; }

  /* QR panel rises, then its gold frame sends out a single ring. */
  .card > .qr {
    animation: qr-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.25s both;
  }
  .qr::after {
    content: '';
    position: absolute;
    inset: -8px;
    border: 1px solid var(--gold);
    border-radius: 10px;
    pointer-events: none;
    animation: ring 1.6s ease-out 1.2s both;
  }

  /* Gold-foil glint across the name every few seconds. */
  @supports ((background-clip: text) or (-webkit-background-clip: text)) {
    .name--card {
      background: linear-gradient(105deg, var(--paper) 0 42%, #e9d6a6 47%, #fffaf0 50%, #e9d6a6 53%, var(--paper) 58% 100%);
      background-size: 260% 100%;
      background-position: 100% 0;
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
      animation: glint 7s ease-in-out 2s infinite;
    }
  }
}

@keyframes engrave {
  from { clip-path: inset(0 100% 0 0); opacity: 0.2; }
  to { clip-path: inset(0 0 0 0); opacity: 1; }
}
@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(-700px); }
}
@keyframes qr-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes ring {
  0% { opacity: 0; transform: scale(0.98); }
  15% { opacity: 0.9; }
  100% { opacity: 0; transform: scale(1.07); }
}
@keyframes glint {
  0%, 72% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
