:root {
  color-scheme: dark;
  --black: #050505;
  --ivory: #f0ede7;
  --copper: #a96850;
  --line: rgba(240, 237, 231, .1);
  --foil-image: url("./assets/brand/copper-foil-brushed.webp");
  --safe-top: max(.85rem, env(safe-area-inset-top));
  --safe-bottom: max(.85rem, env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }

html { background: var(--black); scroll-behavior: smooth; }

body {
  min-width: 20rem;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: #050505;
  color: var(--ivory);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.redirect-fallback {
  display: grid;
  min-height: 100vh;
  place-content: center;
  gap: .8rem;
  color: #aaa6a0;
  font-size: .8rem;
  text-align: center;
}

.redirect-fallback p { margin: 0; }
.redirect-fallback a { color: #d8b09e; }

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% -10%, rgba(255,255,255,.035), transparent 35rem),
    linear-gradient(145deg, #060606, #030303);
}

.utility-bar {
  position: relative;
  z-index: 20;
  display: none;
  width: min(100% - 1.5rem, 30rem);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 auto;
  padding: var(--safe-top) 0 .55rem;
  color: #77736d;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.is-owner .utility-bar { display: flex; }
.connection-state { display: flex; align-items: center; gap: .5rem; }
.connection-dot { width: .38rem; height: .38rem; border-radius: 50%; background: #8e8a84; }
.connection-state.is-offline .connection-dot { background: var(--copper); }

.utility-button {
  display: inline-flex;
  min-height: 2.35rem;
  align-items: center;
  gap: .5rem;
  padding: .55rem .78rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #090909;
  color: #b2aea8;
  cursor: pointer;
}

.utility-button svg { width: .95rem; height: .95rem; fill: none; stroke: currentColor; stroke-width: 1.5; }

.card-shell {
  display: grid;
  width: min(100% - 1.5rem, 30rem);
  grid-template-columns: minmax(0, 1fr);
  gap: .75rem;
  margin: 0 auto;
  padding: .65rem 0 1.2rem;
}

.identity-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 5vw, 2.25rem);
  border: 1px solid rgba(240,237,231,.11);
  border-radius: 1.45rem;
  background: linear-gradient(155deg, #0d0d0d, #070707 62%, #090807);
  box-shadow: inset 0 1px rgba(255,255,255,.025), 0 1.6rem 5rem rgba(0,0,0,.4);
}

.identity-panel::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255,255,255,.025), transparent 30%);
}

.identity-panel > * { position: relative; z-index: 1; }

.brand-lockup { width: min(12.5rem, 58%); margin: 0 0 clamp(2.2rem, 6vh, 3.7rem); }
.brand-lockup img { display: block; width: 100%; height: auto; }

.eyebrow {
  margin: 0 0 .75rem;
  color: #93614d;
  font-size: .55rem;
  font-weight: 650;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.identity-copy h1 {
  margin: 0;
  color: #efebe5;
  font-size: clamp(1.95rem, 8.5vw, 2.65rem);
  font-weight: 300;
  letter-spacing: -.052em;
  line-height: 1;
}

.identity-copy h1 strong { color: #f2efe9; font-weight: 590; }

.role {
  margin: .95rem 0 0;
  color: #aaa6a0;
  font-size: .88rem;
  font-weight: 400;
  line-height: 1.55;
}

.service-area {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  margin: 1.35rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: #77736d;
  font-size: .63rem;
  font-weight: 430;
  line-height: 1.55;
}

.service-area svg {
  width: .9rem;
  height: .9rem;
  flex: 0 0 auto;
  margin-top: .05rem;
  fill: none;
  stroke: #77736d;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.45;
}

.brand-promise {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  margin: clamp(1.65rem, 4.5vw, 2.2rem) 0 .8rem;
  color: #9a958e;
  font-size: clamp(.57rem, 2.45vw, .68rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: .012em;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
}

.brand-promise::before,
.brand-promise::after {
  width: min(1.35rem, 4vw);
  height: 1px;
  flex: 0 0 auto;
  background: rgba(240,237,231,.12);
  content: "";
}

.primary-actions { display: grid; gap: .62rem; margin-top: 0; }
.share-actions { display: grid; grid-template-columns: minmax(0, 1fr) 3.45rem; gap: .62rem; }
.share-actions .button { width: 100%; }
.button-qr { padding-inline: 0; }
.button-qr svg { width: 1.2rem; height: 1.2rem; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.button {
  position: relative;
  display: inline-flex;
  overflow: hidden;
  min-height: 3.45rem;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  padding: .88rem 1rem;
  border: 1px solid transparent;
  border-radius: .86rem;
  text-decoration: none;
  cursor: pointer;
  font-size: .77rem;
  font-weight: 650;
  letter-spacing: .015em;
  transition: border-color 140ms ease, box-shadow 140ms ease, filter 100ms ease;
}

.button:active { filter: brightness(.94); }
.button > * { position: relative; z-index: 1; }

.button svg {
  width: 1.08rem;
  height: 1.08rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.button-copper {
  border-color: rgba(255,229,214,.22);
  background-color: #ad684d;
  background-image: linear-gradient(100deg, rgba(255,235,221,.04), rgba(42,17,10,.14)), var(--foil-image);
  background-position: center;
  background-size: 100% 100%, cover;
  color: #160c09;
  box-shadow: inset 0 1px rgba(255,245,238,.28), inset 0 -1px rgba(64,25,14,.25), 0 .7rem 2rem rgba(84,42,28,.18);
  text-shadow: 0 1px rgba(255,241,231,.18);
}

.button-copper::after {
  position: absolute;
  top: -25%;
  bottom: -25%;
  left: -34%;
  width: 22%;
  content: "";
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,248,242,.22), transparent);
  transform: skewX(-18deg);
  animation: copper-glint 8.5s cubic-bezier(.25,.7,.3,1) 850ms infinite both;
}

@keyframes copper-glint {
  0% { opacity: 0; transform: translateX(0) skewX(-18deg); }
  2% { opacity: .12; }
  7% { opacity: .58; }
  15%, 100% { opacity: 0; transform: translateX(660%) skewX(-18deg); }
}

.button-dark { border-color: var(--line); background: rgba(255,255,255,.018); color: #d4d0ca; }

.action-assurance {
  margin: .55rem 0 0;
  color: #8a8680;
  font-size: .5rem;
  font-weight: 500;
  letter-spacing: .035em;
  text-align: center;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 1.15rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.quick-actions a {
  display: flex;
  min-height: 3.75rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .38rem;
  color: #8a8680;
  text-decoration: none;
  font-size: .54rem;
  font-weight: 590;
  letter-spacing: .055em;
}

.quick-actions a + a { border-left: 1px solid var(--line); }

.quick-actions svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: #9a9690;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.45;
}

.network-panel { margin-top: 1.2rem; }

.section-label {
  margin: 0 0 .7rem;
  color: #55514c;
  font-size: .49rem;
  font-weight: 650;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.network-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; }

.network-links a {
  display: flex;
  min-width: 0;
  min-height: 2.65rem;
  align-items: center;
  justify-content: center;
  gap: .38rem;
  color: #8d8983;
  text-decoration: none;
}

.network-links svg {
  width: .88rem;
  height: .88rem;
  flex: 0 0 auto;
  fill: none;
  stroke: #77736d;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.45;
}

.network-links strong {
  overflow: hidden;
  font-size: .56rem;
  font-weight: 580;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.short-url {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: .7rem 0 0;
  padding: .75rem 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: #96928c;
  cursor: pointer;
  font-size: .63rem;
  font-weight: 500;
  text-align: left;
}

.short-url span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.short-url small { display: block; margin-bottom: .18rem; color: #4e4b47; font-size: .45rem; font-weight: 650; letter-spacing: .13em; text-transform: uppercase; }
.short-url > strong { flex: 0 0 auto; color: #77736d; font-size: .49rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; }

.professional-details { margin-top: .3rem; }

.professional-details summary {
  padding: .78rem 0 .15rem;
  color: #65615d;
  cursor: pointer;
  font-size: .58rem;
  font-weight: 540;
  letter-spacing: .035em;
  list-style: none;
}

.professional-details summary::-webkit-details-marker { display: none; }
.professional-details summary::after { float: right; content: "+"; color: #696560; font-size: .85rem; font-weight: 350; }
.professional-details[open] summary::after { content: "−"; }

.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; padding: .95rem 0 .2rem; }

.details-grid p {
  margin: 0;
  color: #88847e;
  font-size: .64rem;
  font-weight: 390;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.details-grid p span {
  display: block;
  margin-bottom: .22rem;
  color: #8a8680;
  font-size: .48rem;
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.details-grid a { text-decoration: none; }
.qr-panel { display: none; }

.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .25rem .75rem;
  color: #8a8680;
  text-align: center;
}

.privacy-note svg { width: .85rem; height: .85rem; flex: 0 0 auto; fill: none; stroke: #8a8680; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.privacy-note p { margin: 0; font-size: .53rem; line-height: 1.45; }
.privacy-note strong { color: #aaa6a0; font-weight: 620; }
.site-footer { display: none; }

.toast {
  position: fixed;
  z-index: 80;
  right: 1rem;
  bottom: calc(var(--safe-bottom) + .5rem);
  left: 1rem;
  max-width: 27rem;
  margin: auto;
  padding: .85rem 1rem;
  border: 1px solid rgba(240,237,231,.14);
  border-radius: .8rem;
  background: rgba(12,12,12,.97);
  color: #dcd8d2;
  box-shadow: 0 1rem 3rem rgba(0,0,0,.55);
  font-size: .69rem;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(.5rem);
  transition: opacity 150ms ease, transform 150ms ease;
}

.toast.is-visible { opacity: 1; transform: translateY(0); }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
:focus-visible { outline: 1px solid #b7826b; outline-offset: .2rem; }

@media (hover: hover) {
  .button-copper:hover { box-shadow: inset 0 1px rgba(255,245,238,.3), inset 0 -1px rgba(64,25,14,.25), 0 .8rem 2.2rem rgba(84,42,28,.23); }
  .button-dark:hover { border-color: rgba(240,237,231,.2); background: rgba(255,255,255,.035); }
  .quick-actions a:hover, .network-links a:hover, .short-url:hover { color: #c4c0ba; }
  .quick-actions a:hover svg, .network-links a:hover svg { stroke: #aaa6a0; }
}

@media (min-width: 50rem) and (min-height: 48rem) {
  body:not(.is-owner):not(.is-presenting) .card-shell { min-height: 100svh; align-content: center; padding-top: 1.25rem; padding-bottom: 1.25rem; }
}

@media (max-width: 30rem) {
  .card-shell, .utility-bar { width: min(100% - .9rem, 30rem); }
  .identity-panel { padding: 1.35rem; border-radius: 1.2rem; }
  .brand-lockup { width: min(11.5rem, 58%); margin-bottom: 2.2rem; }
}

@media (max-width: 22rem) {
  .details-grid { grid-template-columns: 1fr; }
  .network-links strong { font-size: .51rem; }
}

body.is-presenting { height: 100vh; height: 100svh; overflow: hidden; background: #050505; }
body.is-presenting .ambient { background: #050505; }
body.is-presenting .utility-bar,
body.is-presenting .identity-panel,
body.is-presenting .privacy-note,
body.is-presenting .site-footer { display: none; }

body.is-presenting .card-shell { display: block; width: 100%; height: 100vh; height: 100svh; padding: 0; }

body.is-presenting .qr-panel {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + .25rem) 1rem calc(var(--safe-bottom) + .25rem);
}

.presentation-brand { display: flex; flex-direction: column; align-items: center; gap: .45rem; margin-bottom: clamp(.65rem, 2svh, 1rem); }
.presentation-brand picture { display: block; width: 10.25rem; }
.presentation-brand img { display: block; width: 100%; height: auto; }
.presentation-brand > span { color: #6f6b65; font-size: .5rem; font-weight: 620; letter-spacing: .16em; text-transform: uppercase; }
.qr-heading { text-align: center; }
.qr-heading .eyebrow { display: none; }
.qr-heading h2 { margin: 0; color: #eae6e0; font-size: clamp(1.35rem, 5.5vw, 1.85rem); font-weight: 390; letter-spacing: -.035em; }
.qr-heading > p:last-child { display: none; }

.qr-tabs {
  display: grid;
  width: min(100%, 24rem);
  grid-template-columns: 1fr 1fr;
  gap: .28rem;
  margin: clamp(.65rem, 1.8svh, 1rem) 0;
  padding: .25rem;
  border: 1px solid var(--line);
  border-radius: .78rem;
  background: #090909;
}

.qr-tab {
  height: 3rem;
  min-height: 3rem;
  padding: .48rem .35rem;
  border: 0;
  border-radius: .58rem;
  background: transparent;
  color: #68645f;
  cursor: pointer;
  font-size: .62rem;
  font-weight: 620;
  line-height: 1.2;
}

.qr-tab span { display: block; margin-top: .18rem; color: inherit; font-size: .46rem; font-weight: 470; letter-spacing: .025em; white-space: nowrap; }
.qr-tab.is-active { background: #e8e4dd; color: #141414; box-shadow: none; }

.qr-frame {
  width: min(78vw, 44svh, 22rem);
  margin: 0 auto;
  padding: .42rem;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 1.05rem;
  background: #101010;
  box-shadow: 0 1.5rem 4.2rem rgba(0,0,0,.5);
}

.qr-surface { padding: clamp(.55rem, 2vw, .72rem); border-radius: .72rem; background: #fff; }
.qr-surface img { display: block; width: 100%; height: auto; border-radius: .22rem; }

.qr-caption {
  display: flex;
  width: min(100%, 23rem);
  height: 2.55rem;
  max-width: 23rem;
  flex-direction: column;
  justify-content: flex-start;
  margin: clamp(.55rem, 1.5svh, .85rem) auto 0;
  color: #6d6963;
  font-size: .61rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
}

.qr-caption strong { display: block; margin-bottom: .08rem; color: #aaa6a0; font-weight: 620; }

.presentation-actions {
  display: grid;
  width: min(100%, 24rem);
  grid-template-columns: 1fr 1fr;
  gap: .55rem;
  margin-top: clamp(.6rem, 1.6svh, .9rem);
}

.presentation-actions .button { min-height: 3rem; padding: .65rem .6rem; font-size: .67rem; }

@media (max-height: 48rem) {
  .presentation-brand { margin-bottom: .35rem; }
  .presentation-brand picture { width: 8.15rem; }
  .qr-heading h2 { font-size: 1.15rem; }
  .qr-tabs { margin: .4rem 0; }
  .qr-frame { width: min(64vw, 40svh, 17rem); }
  .qr-caption { margin-top: .35rem; }
  .presentation-actions { margin-top: .4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .button-copper::after { animation: none; opacity: 0; }
}
