*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root,
[data-theme="sky"] {
  --sky: #00aef0;
  --sky-deep: #0090c8;
  --sky-soft: #e8f7fd;
  --navy: #0c2f4a;
  --ink: #14324a;
  --muted: #4d6478;
  --white: #ffffff;
  --paper: #f4fafd;
  --line: rgba(12, 47, 74, 0.12);
  --shadow: 0 24px 60px rgba(0, 80, 120, 0.18);
  --radius: 1.25rem;
  --font-display: "Bricolage Grotesque", Georgia, serif;
  --font-body: "Figtree", system-ui, sans-serif;
  --pad: clamp(1rem, 3.5vw, 2rem);
  --atmos-a: rgba(0, 174, 240, 0.35);
  --atmos-b: rgba(0, 144, 200, 0.22);
  --atmos-grad: linear-gradient(135deg, #dff3fb 0%, #f7fcff 42%, #c8ebf8 100%);
  --photo-split: linear-gradient(90deg, #ffffff 0 48%, var(--sky) 48% 100%);
}

[data-theme="ocean"] {
  --sky: #2f7de1;
  --sky-deep: #1d5fba;
  --navy: #0b2748;
  --ink: #123153;
  --muted: #4a617a;
  --paper: #f2f6fc;
  --line: rgba(11, 39, 72, 0.12);
  --shadow: 0 24px 60px rgba(20, 70, 140, 0.2);
  --atmos-a: rgba(47, 125, 225, 0.32);
  --atmos-b: rgba(29, 95, 186, 0.2);
  --atmos-grad: linear-gradient(135deg, #d9e8ff 0%, #f5f8ff 45%, #b9d4ff 100%);
  --photo-split: linear-gradient(90deg, #ffffff 0 48%, var(--sky) 48% 100%);
}

[data-theme="slate"] {
  --sky: #6b7c8f;
  --sky-deep: #4f5f70;
  --navy: #1c2733;
  --ink: #243140;
  --muted: #5a6a7a;
  --paper: #f4f6f8;
  --line: rgba(28, 39, 51, 0.12);
  --shadow: 0 24px 60px rgba(30, 40, 50, 0.18);
  --atmos-a: rgba(107, 124, 143, 0.28);
  --atmos-b: rgba(79, 95, 112, 0.18);
  --atmos-grad: linear-gradient(135deg, #e8edf2 0%, #f7f8fa 45%, #d5dde5 100%);
  --photo-split: linear-gradient(90deg, #ffffff 0 48%, #8fa0b0 48% 100%);
}

[data-theme="ember"] {
  --sky: #e0893a;
  --sky-deep: #c46a18;
  --navy: #3a2414;
  --ink: #402818;
  --muted: #7a5a42;
  --paper: #fff8f2;
  --line: rgba(58, 36, 20, 0.12);
  --shadow: 0 24px 60px rgba(180, 90, 30, 0.16);
  --atmos-a: rgba(224, 137, 58, 0.3);
  --atmos-b: rgba(196, 106, 24, 0.18);
  --atmos-grad: linear-gradient(135deg, #ffe8d9 0%, #fffaf6 45%, #f5c9a0 100%);
  --photo-split: linear-gradient(90deg, #ffffff 0 48%, var(--sky) 48% 100%);
}

[data-theme="forest"] {
  --sky: #2f9a6a;
  --sky-deep: #1f7a52;
  --navy: #123528;
  --ink: #18382c;
  --muted: #4d6b5d;
  --paper: #f3faf6;
  --line: rgba(18, 53, 40, 0.12);
  --shadow: 0 24px 60px rgba(30, 100, 70, 0.16);
  --atmos-a: rgba(47, 154, 106, 0.3);
  --atmos-b: rgba(31, 122, 82, 0.18);
  --atmos-grad: linear-gradient(135deg, #dff5e8 0%, #f6fcf8 45%, #b7e5cb 100%);
  --photo-split: linear-gradient(90deg, #ffffff 0 48%, var(--sky) 48% 100%);
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 12% 18%, var(--atmos-a), transparent 60%),
    radial-gradient(ellipse 55% 45% at 88% 12%, var(--atmos-b), transparent 55%),
    var(--atmos-grad);
  animation: drift 18s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.04) translate(-1.5%, 1%); }
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  margin-inline: auto;
  min-height: 100dvh;
  padding:
    calc(var(--pad) + env(safe-area-inset-top, 0px))
    calc(var(--pad) + env(safe-area-inset-right, 0px))
    calc(var(--pad) + env(safe-area-inset-bottom, 0px))
    calc(var(--pad) + env(safe-area-inset-left, 0px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(1rem, 2.5vw, 1.75rem);
}

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  animation: rise 0.7s ease both;
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  letter-spacing: -0.03em;
  color: var(--navy);
  text-decoration: none;
}

.brand:hover {
  color: var(--sky-deep);
}

.tag {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.stage {
  display: block;
  width: min(720px, 100%);
  margin-inline: auto;
}

.resume-head {
  display: grid;
  grid-template-columns: var(--photo-desktop, 168px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: center;
}

.portrait-frame {
  width: var(--photo-desktop, 168px);
  height: var(--photo-desktop, 168px);
  border-radius: var(--photo-radius, 1rem);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--photo-split);
  flex-shrink: 0;
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: var(--photo-fit, cover);
  object-position: var(--photo-pos, center top);
  display: block;
  cursor: default;
  user-select: none;
  -webkit-user-drag: none;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: clamp(1rem, 2vw, 1.35rem);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 0.15rem);
  box-shadow: 0 16px 40px rgba(12, 47, 74, 0.1);
  backdrop-filter: blur(10px);
  animation: rise 0.85s 0.08s ease both;
}

.identity {
  min-width: 0;
}

.eyebrow {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--sky-deep);
  margin-bottom: 0.25rem;
}

.identity h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: var(--navy);
}

.role {
  margin-top: 0.45rem;
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 600;
  color: var(--ink);
}

.place {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.company {
  margin-top: 0.3rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.company a {
  color: var(--sky-deep);
  text-decoration: none;
}

.company a:hover {
  text-decoration: underline;
}

.messaging-row:not([hidden]) {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.btn-msg {
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  gap: 0.4rem;
  min-height: 2.6rem;
  padding-inline: 0.55rem;
}

.btn-msg svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.btn-msg:hover {
  border-color: var(--sky);
  color: var(--sky-deep);
  transform: translateY(-1px);
}

.social-row:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-start;
}

.social-link {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 0.85rem;
  display: inline-grid;
  place-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.social-link svg {
  width: 1.1rem;
  height: 1.1rem;
}

.social-link:hover {
  transform: translateY(-1px);
  border-color: var(--sky);
}

.wallet-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  align-items: center;
}

.wallet-badge {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 2.85rem;
}

.wallet-badge img {
  width: min(100%, 180px);
  height: auto;
  display: block;
}

.wallet-badge:disabled {
  opacity: 0.6;
  cursor: wait;
}

.wallet-badge:hover {
  transform: translateY(-1px);
}

.facts {
  list-style: none;
  display: grid;
  gap: 0.55rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding-block: 0.9rem;
}

.facts a {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.75rem;
  align-items: baseline;
  text-decoration: none;
  color: inherit;
  padding: 0.35rem 0.2rem;
  border-radius: 0.4rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.facts a:hover {
  background: rgba(0, 174, 240, 0.08);
}

.fact-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.fact-value {
  font-weight: 600;
  color: var(--navy);
  word-break: break-word;
}

.actions-qr {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.25rem;
  align-items: end;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.85rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 10px 24px rgba(12, 47, 74, 0.22);
}

.btn-primary:hover {
  background: #0a2540;
  transform: translateY(-1px);
}

.btn-wallet {
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--line);
}

.btn-wallet:hover {
  border-color: var(--sky);
  color: var(--sky-deep);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--sky-deep);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: rgba(0, 174, 240, 0.1);
}

.wallet-icon {
  display: inline-flex;
}

.hint {
  min-height: 1.25rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.hint.is-error {
  color: #b42318;
}

.hint.is-ok {
  color: #027a48;
}

.qr-block {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  padding: 0.85rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(12, 47, 74, 0.08);
  animation: rise 0.9s 0.24s ease both;
}

.qr-image {
  width: 148px;
  height: 148px;
  display: block;
  border-radius: 0.4rem;
  image-rendering: pixelated;
}

.qr-caption {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  max-width: 10rem;
}

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  animation: rise 0.7s 0.3s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  :root {
    --pad: 1rem;
  }

  .atmosphere {
    background:
      radial-gradient(ellipse 90% 50% at 50% -10%, var(--atmos-a), transparent 70%),
      linear-gradient(180deg, #eaf7fc 0%, var(--paper) 42%, #e4f3fa 100%);
    animation: none;
  }

  .shell {
    gap: 0.85rem;
    padding-inline: 0.85rem;
    max-width: 28rem;
  }

  .top {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.15rem;
    padding-top: 0.15rem;
  }

  .brand {
    font-size: 1.15rem;
  }

  .tag {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
  }

  .stage {
    width: 100%;
  }

  .panel {
    gap: 1rem;
    padding: 1rem 0.9rem 1.1rem;
    border-radius: 1.2rem;
  }

  .resume-head {
    grid-template-columns: var(--photo-mobile, 92px) minmax(0, 1fr);
    gap: 0.85rem;
    align-items: center;
  }

  .portrait-frame {
    width: var(--photo-mobile, 92px);
    height: var(--photo-mobile, 92px);
    border-radius: var(--photo-radius, 0.9rem);
    box-shadow: 0 10px 22px rgba(12, 47, 74, 0.14);
  }

  .identity {
    text-align: left;
  }

  .eyebrow {
    margin-bottom: 0.15rem;
    font-size: 0.78rem;
  }

  .identity h1 {
    font-size: clamp(1.35rem, 6.5vw, 1.75rem);
    line-height: 1.08;
  }

  .role {
    margin-top: 0.3rem;
    font-size: 0.92rem;
  }

  .place,
  .company {
    font-size: 0.84rem;
  }

  .facts {
    gap: 0.35rem;
    border: 0;
    padding: 0;
  }

  .facts a {
    grid-template-columns: 1fr;
    gap: 0.12rem;
    padding: 0.7rem 0.8rem;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--line);
    border-radius: 0.9rem;
  }

  .facts a:hover {
    background: rgba(0, 174, 240, 0.06);
  }

  .fact-label {
    font-size: 0.68rem;
  }

  .fact-value {
    font-size: 0.98rem;
  }

  .actions-qr {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .actions {
    gap: 0.55rem;
  }

  .btn {
    min-height: 3rem;
    font-size: 0.92rem;
  }

  .messaging-row:not([hidden]) {
    grid-template-columns: 1fr;
  }

  .wallet-row {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .social-row:not([hidden]) {
    justify-content: flex-start;
  }

  .btn-row {
    grid-template-columns: 1fr 1fr;
  }

  .qr-block {
    justify-self: stretch;
    width: 100%;
    grid-template-columns: auto 1fr;
    align-items: center;
    justify-items: start;
    gap: 0.85rem;
    padding: 0.75rem 0.9rem;
    border-radius: 1rem;
  }

  .qr-image {
    width: 84px;
    height: 84px;
  }

  .qr-caption {
    text-align: left;
    max-width: none;
    font-size: 0.7rem;
    line-height: 1.35;
  }

  .hint {
    text-align: center;
  }

  .foot {
    font-size: 0.78rem;
    padding-bottom: 0.35rem;
  }
}

@media (max-width: 380px) {
  .btn-row {
    grid-template-columns: 1fr;
  }

  .resume-head {
    gap: 0.7rem;
  }

  .identity h1 {
    font-size: clamp(1.2rem, 6vw, 1.55rem);
  }

  .social-row:not([hidden]) {
    justify-content: center;
  }

  .qr-block {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .qr-caption {
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Unlock modal */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.modal-open {
  overflow: hidden;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 47, 74, 0.45);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 22rem;
  padding: 1.5rem 1.25rem 1.25rem;
  border-radius: 1rem;
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 0.55rem;
  right: 0.7rem;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--navy);
  margin-bottom: 0.35rem;
}

.modal-copy {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.unlock-form {
  display: grid;
  gap: 0.65rem;
}

.unlock-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.7rem 0.8rem;
  font: inherit;
}

.unlock-submit {
  appearance: none;
  border: 0;
  border-radius: 999px;
  min-height: 2.7rem;
  background: var(--navy);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.unlock-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.unlock-error {
  color: #b42318;
  font-size: 0.88rem;
}

.unlock-error[hidden] {
  display: none;
}
