:root {
  color-scheme: light;
  --cream: #f3eee5;
  --cream-deep: #e8dece;
  --ivory: #fffdf8;
  --paper: #fbf8f1;
  --forest: #203b34;
  --forest-deep: #142a26;
  --ink: #173b3b;
  --muted: #71817d;
  --gold: #c7a45f;
  --gold-soft: #e7d7b8;
  --gold-faint: rgba(199, 164, 95, 0.2);
  --turquoise: #08c6cf;
  --turquoise-deep: #08aebc;
  --line: rgba(32, 59, 52, 0.13);
  --shadow: 0 34px 90px rgba(38, 47, 40, 0.15);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  overflow-x: clip;
  background: var(--cream);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 2%, rgba(8, 198, 207, 0.13), transparent 25rem),
    radial-gradient(circle at 5% 97%, rgba(199, 164, 95, 0.13), transparent 28rem),
    var(--cream);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before,
body::after {
  position: fixed;
  z-index: 0;
  border: 1px solid rgba(199, 164, 95, 0.18);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

body::before {
  top: -22rem;
  right: -19rem;
  width: 44rem;
  height: 44rem;
  box-shadow: 0 0 0 22px rgba(199, 164, 95, 0.035), 0 0 0 64px rgba(8, 198, 207, 0.025);
}

body::after {
  bottom: -15rem;
  left: -12rem;
  width: 30rem;
  height: 30rem;
  border-color: rgba(8, 198, 207, 0.11);
}

button,
a { -webkit-tap-highlight-color: transparent; }

button { font: inherit; }

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.intro-active { overflow: hidden; }

.card-intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--forest-deep);
  opacity: 1;
  transition: opacity 430ms ease, visibility 430ms ease;
}

.card-intro[hidden] { display: none; }

.card-intro::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 50% 50%, rgba(8, 198, 207, 0.16), transparent 24%),
    radial-gradient(circle at 50% 50%, rgba(199, 164, 95, 0.08), transparent 48%);
  transform: scale(0.7);
  animation: intro-atmosphere 1.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.card-intro.is-leaving { visibility: hidden; opacity: 0; }

.card-intro__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.card-intro__core {
  position: relative;
  display: grid;
  width: 118px;
  aspect-ratio: 1;
  place-items: center;
  opacity: 0;
  transform: scale(0.58) rotate(-18deg);
  animation: intro-core 1.65s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.card-intro__core img {
  position: relative;
  z-index: 2;
  width: 78px;
  height: 78px;
}

.card-intro__ring {
  position: absolute;
  border: 1px solid rgba(199, 164, 95, 0.32);
  border-radius: 50%;
}

.card-intro__ring--outer {
  inset: -32px;
  animation: intro-ring 1.65s ease-out both;
}

.card-intro__ring--inner {
  inset: -8px;
  border-color: rgba(8, 198, 207, 0.32);
  animation: intro-ring 1.4s ease-out 120ms both reverse;
}

.card-intro__readout {
  position: absolute;
  bottom: max(11%, 62px);
  left: 50%;
  display: grid;
  margin: 0;
  justify-items: center;
  transform: translateX(-50%);
  text-align: center;
  text-transform: uppercase;
  animation: intro-readout 1.65s ease both;
}

.card-intro__readout span {
  color: rgba(231, 215, 184, 0.48);
  font: 600 0.46rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.3em;
}

.card-intro__readout strong {
  min-width: 190px;
  margin-top: 9px;
  color: rgba(255, 253, 248, 0.86);
  font-size: 0.61rem;
  letter-spacing: 0.14em;
}

.page-shell {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  padding: max(22px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  place-items: center;
  opacity: 0;
  transform: translateY(12px) scale(0.99);
  transition: opacity 580ms ease, transform 580ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.card-ready .page-shell { opacity: 1; transform: none; }

.digital-card {
  position: relative;
  width: min(100%, 820px);
  overflow: hidden;
  border: 1px solid rgba(199, 164, 95, 0.48);
  border-radius: 38px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.digital-card::before,
.digital-card::after {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.digital-card::before {
  top: -240px;
  right: -170px;
  width: 480px;
  aspect-ratio: 1;
  border: 1px solid rgba(199, 164, 95, 0.25);
  box-shadow: 0 0 0 22px rgba(199, 164, 95, 0.04), 0 0 0 58px rgba(8, 198, 207, 0.025);
}

.digital-card::after {
  top: 152px;
  right: 82px;
  width: 190px;
  aspect-ratio: 1;
  border: 1px solid rgba(8, 198, 207, 0.1);
}

.card-header,
.identity,
.primary-actions,
.contact-grid,
.qr-section,
.card-footer {
  position: relative;
  z-index: 1;
}

.card-header {
  display: flex;
  min-height: 78px;
  padding: 19px clamp(24px, 5vw, 46px);
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gold-faint);
}

.card-brand { display: block; width: 156px; }
.card-brand img { display: block; width: 100%; height: auto; }

.card-index {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--forest);
  font: 700 0.49rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.card-index i,
.card-footer i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--turquoise);
  box-shadow: 0 0 0 4px rgba(8, 198, 207, 0.11);
}

.identity {
  display: grid;
  min-height: 278px;
  padding: clamp(34px, 5vw, 50px) clamp(26px, 7vw, 58px) 34px;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: clamp(30px, 6vw, 70px);
  align-items: center;
}

.eyebrow {
  display: flex;
  margin: 0 0 14px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font: 650 0.52rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
  content: "";
}

.eyebrow span { color: var(--forest); }

h1 {
  margin: 0;
  color: var(--forest);
  font-family: Iowan Old Style, Palatino Linotype, Book Antiqua, Georgia, serif;
  font-size: clamp(4rem, 10vw, 6.5rem);
  font-weight: 500;
  line-height: 0.82;
  letter-spacing: -0.07em;
}

.role {
  margin: 20px 0 0;
  color: var(--forest);
  font-size: clamp(0.9rem, 2vw, 1.04rem);
  font-weight: 720;
  line-height: 1.45;
}

.role span { margin: 0 5px; color: var(--gold); }

.identity-note {
  max-width: 410px;
  margin: 12px 0 0;
  color: var(--muted);
  font-family: Iowan Old Style, Palatino Linotype, Book Antiqua, Georgia, serif;
  font-size: 0.84rem;
  font-style: italic;
  line-height: 1.6;
}

.identity-mark {
  position: relative;
  display: grid;
  width: 184px;
  aspect-ratio: 1;
  place-items: center;
  justify-self: end;
  border: 1px solid rgba(199, 164, 95, 0.42);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(8, 198, 207, 0.1), rgba(255, 253, 248, 0.8) 54%);
  box-shadow: inset 0 0 0 10px rgba(199, 164, 95, 0.035);
}

.identity-mark::before,
.identity-mark::after,
.identity-orbit {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.identity-mark::before { inset: 24%; border: 1px solid rgba(8, 198, 207, 0.16); }

.identity-mark::after {
  top: -13%;
  left: 50%;
  width: 1px;
  height: 126%;
  border-radius: 0;
  background: linear-gradient(transparent, rgba(199, 164, 95, 0.25), transparent);
}

.identity-orbit--outer { inset: 9%; border: 1px solid rgba(199, 164, 95, 0.22); }

.identity-orbit--inner {
  inset: 18%;
  border: 1px dashed rgba(8, 198, 207, 0.24);
  animation: mark-orbit 28s linear infinite;
}

.identity-mark img {
  position: relative;
  z-index: 2;
  width: 82px;
  height: 82px;
  filter: drop-shadow(0 9px 16px rgba(32, 59, 52, 0.14));
}

.identity-mark > i {
  position: absolute;
  z-index: 3;
  width: 7px;
  height: 7px;
  border: 2px solid var(--ivory);
  border-radius: 50%;
  background: var(--turquoise);
  box-shadow: 0 0 0 1px rgba(8, 198, 207, 0.34);
}

.identity-mark > i:nth-of-type(1) { top: 14%; right: 18%; }
.identity-mark > i:nth-of-type(2) { bottom: 11%; left: 24%; background: var(--gold); }

.primary-actions {
  display: grid;
  padding: 0 clamp(26px, 7vw, 58px) 20px;
  grid-template-columns: minmax(0, 1fr) 172px;
  gap: 12px;
}

.save-button,
.share-button {
  position: relative;
  display: flex;
  min-height: 62px;
  align-items: center;
  border-radius: 17px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.save-button {
  padding: 7px 16px 7px 8px;
  gap: 13px;
  overflow: hidden;
  color: #fff;
  border: 1px solid var(--forest);
  background: linear-gradient(115deg, var(--forest-deep), var(--forest));
  box-shadow: 0 14px 28px rgba(32, 59, 52, 0.19);
}

.save-button::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(var(--turquoise), var(--gold));
  content: "";
}

.button-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(231, 215, 184, 0.34);
  border-radius: 12px;
  color: var(--gold-soft);
  background: rgba(255, 255, 255, 0.06);
}

.save-button strong,
.save-button small { display: block; }
.save-button strong { font-family: Iowan Old Style, Palatino Linotype, Book Antiqua, Georgia, serif; font-size: 0.96rem; }

.save-button small {
  margin-top: 3px;
  color: rgba(255, 253, 248, 0.62);
  font-size: 0.61rem;
  font-weight: 520;
}

.button-arrow { margin-left: auto; opacity: 0.65; }

.share-button {
  padding: 0 16px;
  justify-content: center;
  gap: 9px;
  color: var(--forest);
  border: 1px solid rgba(199, 164, 95, 0.55);
  background: linear-gradient(180deg, #fffefa, #faf5eb);
  font-size: 0.76rem;
  font-weight: 740;
  box-shadow: inset 0 0 0 3px rgba(199, 164, 95, 0.055);
}

.save-button:hover { box-shadow: 0 18px 34px rgba(32, 59, 52, 0.26); }
.share-button:hover { border-color: var(--gold); background: #fffdf7; }

.contact-grid {
  display: grid;
  margin: 0 clamp(26px, 7vw, 58px);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.contact-grid a {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 92px;
  padding: 14px 10px 12px;
  justify-items: center;
  align-content: center;
  gap: 8px;
  color: var(--forest);
  border: 1px solid rgba(199, 164, 95, 0.36);
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.8), rgba(247, 240, 227, 0.58));
  text-align: center;
  text-decoration: none;
  transition: color 170ms ease, border-color 170ms ease, transform 170ms ease, background 170ms ease;
}

.contact-grid a::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
  content: "";
  transform: translateX(-50%);
}

.contact-grid a:hover {
  color: var(--turquoise-deep);
  border-color: rgba(8, 198, 207, 0.45);
  background: #fffefa;
  transform: translateY(-2px);
}

.contact-icon {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border: 1px solid rgba(199, 164, 95, 0.28);
  border-radius: 50%;
  color: var(--forest);
  background: var(--ivory);
  box-shadow: 0 7px 15px rgba(32, 59, 52, 0.07);
}

.contact-icon svg { width: 16px; height: 16px; }
.contact-grid strong,
.contact-grid small { display: block; }
.contact-grid strong { font-size: 0.69rem; }
.contact-grid small { margin-top: 3px; color: var(--muted); font-size: 0.53rem; line-height: 1.2; }
.contact-arrow { display: none; }

.qr-section {
  position: relative;
  display: flex;
  min-height: 138px;
  margin: 20px clamp(26px, 7vw, 58px) 0;
  padding: 20px 22px;
  overflow: hidden;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid rgba(199, 164, 95, 0.5);
  border-radius: 22px;
  background: linear-gradient(120deg, #f2e8d8, #fbf7ef 58%, #f0e4d1);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.38);
}

.qr-section::before,
.qr-section::after {
  position: absolute;
  border: 1px solid rgba(199, 164, 95, 0.3);
  border-radius: 50%;
  content: "";
}

.qr-section::before { top: -94px; right: 74px; width: 178px; height: 178px; }
.qr-section::after { top: -78px; right: 90px; width: 144px; height: 144px; border-color: rgba(8, 198, 207, 0.15); }

.qr-copy { position: relative; z-index: 1; }

.qr-copy > span {
  color: var(--turquoise-deep);
  font: 700 0.46rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.21em;
  text-transform: uppercase;
}

.qr-copy h2 {
  max-width: 360px;
  margin: 10px 0 6px;
  color: var(--forest);
  font-family: Iowan Old Style, Palatino Linotype, Book Antiqua, Georgia, serif;
  font-size: clamp(1.34rem, 3vw, 1.72rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.qr-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.5;
}

.qr-copy p strong { color: var(--forest); }

.qr-frame {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  padding: 6px;
  border: 1px solid rgba(199, 164, 95, 0.55);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 25px rgba(32, 59, 52, 0.14);
}

.qr-code {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 12px;
}

.qr-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 4px solid #fff;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(32, 59, 52, 0.18);
  transform: translate(-50%, -50%);
}

.qr-logo img { display: block; width: 100%; height: 100%; }

.card-footer {
  display: flex;
  min-height: 66px;
  padding: 16px clamp(26px, 7vw, 58px);
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font: 650 0.48rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card-footer span { display: inline-flex; align-items: center; gap: 9px; }
.card-footer a { color: var(--forest); text-decoration: none; }

.status {
  position: absolute;
  right: 0;
  bottom: 5px;
  left: 0;
  min-height: 1em;
  margin: 0;
  color: var(--forest);
  font-size: 0.62rem;
  text-align: center;
  pointer-events: none;
}

.save-button:active,
.share-button:active,
.contact-grid a:active { transform: scale(0.985); }

.save-button:focus-visible,
.share-button:focus-visible,
.contact-grid a:focus-visible,
.card-brand:focus-visible,
.card-footer a:focus-visible {
  outline: 3px solid rgba(8, 198, 207, 0.25);
  outline-offset: 3px;
}

@keyframes intro-atmosphere {
  0% { opacity: 0; transform: scale(0.55); }
  32% { opacity: 1; }
  74% { opacity: 0.7; transform: scale(1.08); }
  100% { opacity: 0.28; transform: scale(1.34); }
}

@keyframes intro-core {
  0%, 42% { opacity: 0; transform: scale(0.3) rotate(-24deg); }
  68% { opacity: 1; transform: scale(1.08) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes intro-ring {
  0%, 38% { opacity: 0; transform: scale(0.2) rotate(-28deg); }
  70% { opacity: 0.8; }
  100% { opacity: 0.25; transform: scale(1.15) rotate(35deg); }
}

@keyframes intro-readout {
  0%, 48% { opacity: 0; transform: translate(-50%, 8px); }
  72%, 100% { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes mark-orbit { to { transform: rotate(360deg); } }

@media (max-width: 680px) {
  .page-shell {
    min-height: 100svh;
    padding: max(7px, env(safe-area-inset-top)) max(7px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
    place-items: center;
  }

  .digital-card {
    width: min(100%, 420px);
    border-radius: 27px;
  }

  .digital-card::before {
    top: -236px;
    right: -212px;
    width: 430px;
  }

  .digital-card::after {
    top: 104px;
    right: 20px;
    width: 112px;
  }

  .card-header {
    min-height: 58px;
    padding: 12px 18px;
  }

  .card-brand { width: 130px; }
  .card-index { font-size: 0.4rem; letter-spacing: 0.15em; }

  .identity {
    min-height: 150px;
    padding: 22px 20px 18px;
    grid-template-columns: minmax(0, 1fr) 84px;
    gap: 8px;
  }

  .eyebrow { margin-bottom: 9px; gap: 7px; font-size: 0.42rem; letter-spacing: 0.09em; }
  .eyebrow::before { width: 14px; }
  h1 { font-size: clamp(3.35rem, 18vw, 4.35rem); }
  .role { margin-top: 13px; font-size: 0.76rem; }
  .identity-note { display: none; }

  .identity-mark {
    width: 82px;
    margin-right: -3px;
  }

  .identity-mark img { width: 44px; height: 44px; }
  .identity-mark > i { width: 6px; height: 6px; }

  .primary-actions {
    padding: 0 18px 14px;
    grid-template-columns: minmax(0, 1fr) 104px;
    gap: 8px;
  }

  .save-button,
  .share-button { min-height: 56px; border-radius: 15px; }

  .save-button { padding: 6px 11px 6px 7px; gap: 10px; }
  .button-icon { width: 42px; height: 42px; }
  .save-button strong { font-size: 0.86rem; }
  .save-button small { font-size: 0.55rem; }
  .share-button { min-width: 0; padding: 0 8px; gap: 6px; font-size: 0.63rem; }
  .share-button svg { width: 17px; }

  .contact-grid {
    margin: 0 18px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .contact-grid a {
    min-height: 74px;
    padding: 11px 3px 8px;
    gap: 6px;
    border-radius: 13px;
  }

  .contact-icon { width: 31px; height: 31px; }
  .contact-icon svg { width: 14px; height: 14px; }
  .contact-grid strong { font-size: 0.58rem; }
  .contact-grid small { display: none; }

  .qr-section {
    min-height: 116px;
    margin: 14px 18px 0;
    padding: 14px 15px;
    gap: 12px;
    border-radius: 18px;
  }

  .qr-section::before { right: 54px; }
  .qr-section::after { right: 70px; }
  .qr-copy > span { font-size: 0.4rem; }
  .qr-copy h2 { max-width: 190px; margin: 8px 0 4px; font-size: 1.12rem; }
  .qr-copy p { max-width: 180px; font-size: 0.54rem; }
  .qr-code { width: 82px; height: 82px; }
  .qr-frame { padding: 5px; border-radius: 15px; }
  .qr-logo { width: 28px; height: 28px; border-width: 3px; }

  .card-footer {
    min-height: 43px;
    padding: 10px 18px;
    font-size: 0.4rem;
  }

  .status { bottom: 2px; font-size: 0.54rem; }
}

@media (max-width: 370px) {
  .card-index { display: none; }
  .identity { padding-inline: 17px; grid-template-columns: minmax(0, 1fr) 75px; }
  .identity-mark { width: 76px; }
  .primary-actions { padding-inline: 15px; grid-template-columns: minmax(0, 1fr) 94px; }
  .contact-grid { margin-inline: 15px; gap: 4px; }
  .contact-grid strong { font-size: 0.54rem; }
  .qr-section { margin-inline: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition: none !important;
  }

  .card-intro { display: none; }
  .page-shell { opacity: 1; transform: none; }
}
