/* ============================================================
   Imagine Family Homes — /qr digital business card
   Themed off the printed card: deep teal field, gold hairline
   frame, diamond monogram, Marcellus wordmark.
   ============================================================ */

:root {
  --teal-950: #011D29;
  --teal-900: #022531;
  --teal-800: #022D3E;
  --teal-700: #073B4E;
  --teal-600: #0C4A60;

  --gold:        #E4B062;
  --gold-bright: #F4D08C;
  --gold-deep:   #C8954A;

  --cream: #F3ECDD;
  --muted: #9DB3BC;
  --muted-dim: #6E8893;

  --line: rgba(228, 176, 98, 0.22);
  --line-soft: rgba(228, 176, 98, 0.12);
  --panel: rgba(6, 45, 60, 0.55);

  --font-display: "Marcellus", Georgia, "Times New Roman", serif;
  --font-script: "Cormorant Garamond", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--cream);
  line-height: 1.55;
  background: var(--teal-950);
  -webkit-font-smoothing: antialiased;
}

/* Fixed backdrop layer. `background-attachment: fixed` on <body> would leave
   the area past the first viewport unpainted (and is janky on iOS Safari). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 80% at 50% 0%, #0b5266 0%, transparent 58%),
    radial-gradient(90% 70% at 50% 100%, #063546 0%, transparent 60%),
    linear-gradient(170deg, var(--teal-900) 0%, var(--teal-800) 45%, var(--teal-950) 100%);
}

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }

/* Dotted texture + vignette, mirroring the printed card stock */
.veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(rgba(228, 176, 98, 0.055) 1px, transparent 1px);
  background-size: 14px 14px;
  mask-image: radial-gradient(120% 90% at 50% 30%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 30%, #000 30%, transparent 78%);
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background: radial-gradient(120% 120% at 50% 50%, transparent 45%, rgba(1, 21, 30, 0.75) 100%);
}

/* ---------- Layout ---------- */
.stage {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding: clamp(16px, 4vw, 44px) 16px calc(40px + env(safe-area-inset-bottom));
}

.card {
  width: 100%;
  max-width: 440px;
  border-radius: 22px;
  padding: 7px;                                   /* outer gold rule gap */
  background:
    linear-gradient(160deg, rgba(228, 176, 98, 0.42), rgba(228, 176, 98, 0.08) 42%, rgba(228, 176, 98, 0.3));
  box-shadow:
    0 30px 70px -30px rgba(0, 0, 0, 0.75),
    0 2px 0 rgba(255, 255, 255, 0.04) inset;
  animation: rise 0.7s var(--ease) both;
}

.card-frame {
  border-radius: 16px;
  padding: clamp(22px, 6vw, 34px) clamp(18px, 5.5vw, 30px) 22px;
  background:
    radial-gradient(85% 55% at 50% 0%, rgba(20, 96, 118, 0.55) 0%, transparent 62%),
    linear-gradient(175deg, #04384a 0%, #032c3b 52%, #012331 100%);
  border: 1px solid var(--line);
}

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

/* ---------- Identity ---------- */
.identity { text-align: center; }

.mark {
  width: clamp(112px, 32vw, 138px);
  margin: 0 auto 14px;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
  animation: markIn 1s var(--ease) 0.1s both;
}

@keyframes markIn {
  from { opacity: 0; transform: translateY(8px) scale(0.94); }
  to   { opacity: 1; transform: none; }
}

.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  display: block;
  line-height: 1.1;
}

.wm-main {
  display: block;
  font-size: clamp(30px, 9.4vw, 40px);
  letter-spacing: 0.24em;
  text-indent: 0.24em;              /* balances the trailing tracking */
  text-transform: uppercase;
  color: var(--cream);
}

.wm-sub {
  display: block;
  margin-top: 7px;
  font-size: clamp(12.5px, 3.9vw, 16px);
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 15px auto 12px;
  width: 78%;
}

.divider i {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-deep), transparent);
}

.divider span {
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  background: var(--gold-bright);
  box-shadow: 0 0 10px rgba(244, 208, 140, 0.55);
}

.tagline {
  margin: 0;
  font-family: var(--font-script);
  font-style: italic;
  font-size: clamp(19px, 5.6vw, 23px);
  color: var(--gold-bright);
}

.blurb {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

/* ---------- Primary save button ---------- */
.save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
  padding: 15px 20px;
  border-radius: 13px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.02em;
  color: #05202b;
  background: linear-gradient(150deg, var(--gold-bright), var(--gold) 45%, var(--gold-deep));
  box-shadow:
    0 12px 26px -12px rgba(228, 176, 98, 0.75),
    0 1px 0 rgba(255, 255, 255, 0.45) inset;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), filter 0.18s var(--ease);
}

.save-btn svg { width: 20px; height: 20px; fill: currentColor; }

.save-btn:active {
  transform: translateY(1px) scale(0.99);
  filter: brightness(0.97);
}

@media (hover: hover) {
  .save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px -12px rgba(228, 176, 98, 0.85), 0 1px 0 rgba(255, 255, 255, 0.45) inset;
  }
}

.save-hint {
  margin: 9px 0 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted-dim);
}

/* ---------- Quick actions ---------- */
.quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.quick-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 8px;
  border-radius: 12px;
  font-size: clamp(13px, 3.9vw, 14px);
  font-weight: 500;
  white-space: nowrap;
  color: var(--cream);
  background: var(--panel);
  border: 1px solid var(--line-soft);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.15s var(--ease);
}

.quick-btn svg { width: 17px; height: 17px; fill: var(--gold); }

.quick-btn:active { transform: scale(0.985); }

@media (hover: hover) {
  .quick-btn:hover { border-color: var(--line); background: rgba(12, 74, 96, 0.5); }
}

/* ---------- Sections ---------- */
.section-label {
  margin: 26px 0 12px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* ---------- People ---------- */
.person {
  padding: 14px 14px 12px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
}

.person + .person { margin-top: 10px; }

.person-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  transform: rotate(45deg);
  border: 1px solid var(--gold);
  border-radius: 5px;
  background: linear-gradient(145deg, rgba(228, 176, 98, 0.16), transparent);
}

.avatar i {
  transform: rotate(-45deg);
  font-family: var(--font-display);
  font-style: normal;
  font-size: 17px;
  color: var(--gold-bright);
}

.person-id { display: flex; flex-direction: column; min-width: 0; }

.person-name {
  font-family: var(--font-display);
  font-size: clamp(16px, 4.6vw, 18px);
  letter-spacing: 0.03em;
  color: var(--cream);
}

.person-role {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.person-acts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.act {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 4px;
  border-radius: 10px;
  font-size: clamp(12.5px, 3.7vw, 13.5px);
  white-space: nowrap;
  font-weight: 500;
  color: var(--gold-bright);
  background: rgba(228, 176, 98, 0.09);
  border: 1px solid var(--line-soft);
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.15s var(--ease);
}

.act svg { width: 15px; height: 15px; fill: currentColor; }

.act:active { transform: scale(0.97); }

@media (hover: hover) {
  .act:hover { background: rgba(228, 176, 98, 0.17); border-color: var(--line); }
}

/* ---------- Link rows ---------- */
.links { margin-top: 18px; }

.link-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 4px;
  border-top: 1px solid var(--line-soft);
  transition: background 0.18s var(--ease);
}

.links .link-row:last-child { border-bottom: 1px solid var(--line-soft); }

.lr-ico {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(228, 176, 98, 0.1);
  border: 1px solid var(--line-soft);
}

.lr-ico svg { width: 16px; height: 16px; fill: var(--gold); }

.lr-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }

.lr-text b {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-dim);
}

.lr-text em {
  font-style: normal;
  font-size: clamp(12.5px, 3.7vw, 14.5px);
  color: var(--cream);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-row.static .lr-text em { white-space: normal; font-size: 13.5px; color: var(--muted); }

.lr-go { color: var(--gold); font-size: 22px; line-height: 1; opacity: 0.7; }

@media (hover: hover) {
  a.link-row:hover { background: rgba(12, 74, 96, 0.35); }
}

/* Very narrow phones (iPhone SE and friends): buy back horizontal room so the
   email address fits without an ellipsis. */
@media (max-width: 359px) {
  .link-row { gap: 10px; padding: 12px 0; }
  .lr-ico { width: 30px; height: 30px; }
  .lr-text em { font-size: 12px; letter-spacing: -0.01em; }
  .lr-go { font-size: 19px; }
}

/* ---------- Offer CTA ---------- */
.offer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--gold-bright);
  border: 1px solid var(--gold-deep);
  background: linear-gradient(160deg, rgba(228, 176, 98, 0.14), rgba(228, 176, 98, 0.03));
  transition: background 0.2s var(--ease), transform 0.15s var(--ease);
}

.offer span { transition: transform 0.25s var(--ease); }
.offer:active { transform: scale(0.99); }

@media (hover: hover) {
  .offer:hover { background: rgba(228, 176, 98, 0.2); }
  .offer:hover span { transform: translateX(4px); }
}

/* ---------- Footer ---------- */
.card-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
  font-size: 11.5px;
  color: var(--muted-dim);
  letter-spacing: 0.04em;
}

.foot-mark {
  display: block;
  width: 6px;
  height: 6px;
  margin: 0 auto 10px;
  transform: rotate(45deg);
  background: var(--gold-deep);
}

.foot-credit {
  display: block;
  margin-top: 6px;
  color: var(--muted-dim);
  text-decoration: underline;
  text-decoration-color: rgba(228, 176, 98, 0.3);
  text-underline-offset: 3px;
}

/* ---------- QR modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 20, 28, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade 0.25s var(--ease) both;
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 340px;
  padding: 26px 24px 22px;
  border-radius: 18px;
  text-align: center;
  background: linear-gradient(175deg, #04384a, #012331);
  border: 1px solid var(--line);
  box-shadow: 0 30px 70px -25px rgba(0, 0, 0, 0.8);
  animation: pop 0.3s var(--ease) both;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.modal-x {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: 0;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  padding: 6px;
}

.modal-panel h2 {
  margin: 0 0 16px;
  padding: 0 26px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  letter-spacing: 0.06em;
  color: var(--cream);
}

.qr-holder {
  padding: 12px;
  border-radius: 14px;
  background: var(--cream);
  border: 3px solid var(--gold);
  display: inline-block;
  line-height: 0;
}

.qr-holder img { width: 236px; height: 236px; }

.qr-url {
  margin: 14px 0 14px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
}

.copy-btn {
  width: 100%;
  padding: 11px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 500;
  color: var(--cream);
  background: rgba(228, 176, 98, 0.12);
  border: 1px solid var(--line-soft);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  z-index: 60;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  color: #05202b;
  background: linear-gradient(150deg, var(--gold-bright), var(--gold));
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Focus + motion ---------- */
:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
