:root {
  --paper: #e9e1d2;
  --paper-light: #f1eadc;
  --ink: #142631;
  --blue: #416a78;
  --blue-deep: #0f4b60;
  --amber: #d98209;
  --sage: #7f8f7b;
  --rule: rgba(20, 38, 49, 0.72);
  --paper-texture: url("./assets/paper-texture.png");
}

* {
  box-sizing: border-box;
}

html {
  background: #071017;
}

body {
  margin: 0;
  background: #071017;
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

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

.site-shell {
  width: min(100%, 390px);
  min-height: 100svh;
  margin: 0 auto;
  container-type: inline-size;
}

.profile-sheet {
  width: 100%;
  height: 844px;
  overflow: hidden;
  border: 1px solid rgba(233, 225, 210, 0.22);
  background-color: var(--paper);
  background-image: var(--paper-texture);
  background-size: 512px 512px;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.42);
}

.hero {
  position: relative;
  height: 270px;
  overflow: hidden;
  border-bottom: 1px solid var(--ink);
  background-color: var(--paper-light);
  background-image: var(--paper-texture);
  background-size: 512px 512px;
}

.registration-tab {
  position: absolute;
  z-index: 5;
  top: 39px;
  left: 0;
  width: 10px;
  height: 72px;
  background: var(--amber);
}

.portrait {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  width: 58.5%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 38%;
  filter: saturate(0.82) sepia(0.08) contrast(1.03);
}

.hero::after {
  position: absolute;
  z-index: 2;
  background: rgba(233, 225, 210, 0.05);
  content: "";
  inset: 0;
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 4;
  height: 100%;
  padding: 18px 20px;
}

.utility-row {
  display: grid;
  width: 40%;
  color: var(--blue);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 7px;
  font-weight: 650;
  letter-spacing: 0.025em;
  gap: 2px;
}

.utility-row span:last-child {
  display: block;
}

.hero h1 {
  width: 39%;
  margin: 21px 0 0;
  color: var(--ink);
  font-size: clamp(45px, 12.9vw, 50px);
  font-weight: 950;
  letter-spacing: -0.055em;
  line-height: 0.92;
  white-space: nowrap;
}

.role {
  position: relative;
  z-index: 4;
  width: 40%;
  margin: 14px 0 0;
  color: var(--blue);
  font-size: clamp(13.5px, 3.75vw, 14.5px);
  font-weight: 850;
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
}

.technical-rule {
  width: 38%;
  margin-top: 25px;
  border-top: 1px solid rgba(65, 106, 120, 0.72);
}

.hero-meta {
  width: 40%;
  margin: 20px 0 0;
  color: var(--sage);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 7.5px;
  font-weight: 600;
  line-height: 1.55;
}

.hero-meta div {
  display: flex;
}

.hero-meta dt,
.hero-meta dd {
  margin: 0;
}

.hero-meta dt {
  min-width: 50px;
}

.hero-status {
  position: absolute;
  z-index: 5;
  top: 18px;
  right: 19px;
  display: grid;
  color: var(--paper-light);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 7px;
  line-height: 1.55;
  text-align: right;
}

.hero-status strong {
  color: var(--amber);
  font-weight: 800;
}

.about-section {
  height: 145px;
  padding: 12px 22px 10px;
  background-color: var(--paper-light);
  background-image: var(--paper-texture);
  background-size: 512px 512px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-heading h2,
.section-heading p {
  margin: 0;
}

.section-heading h2 {
  display: flex;
  font-size: 21px;
  font-weight: 850;
  letter-spacing: -0.04em;
  align-items: center;
}

.section-heading h2 span {
  display: block;
  width: 7px;
  height: 18px;
  margin-right: 9px;
  background: var(--sage);
}

.section-heading p {
  color: var(--sage);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 6px;
  letter-spacing: 0.03em;
}

.about-copy {
  padding: 6px 10px 0;
}

.about-copy p {
  margin: 0;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.35;
}

.about-copy p + p {
  margin-top: 3px;
  padding-top: 3px;
  border-top: 1px dotted rgba(20, 38, 49, 0.46);
}

.focus-section {
  height: 181px;
  padding: 11px 22px 10px;
  color: var(--paper-light);
  background-color: var(--blue-deep);
  background-image: var(--paper-texture);
  background-size: 512px 512px;
  background-blend-mode: multiply;
}

.focus-heading h2 {
  color: var(--paper-light);
}

.focus-heading h2 span {
  background: var(--paper-light);
}

.focus-table {
  margin-top: 7px;
  border: 1px solid rgba(241, 234, 220, 0.72);
}

.focus-row {
  display: grid;
  height: 43px;
  grid-template-columns: 58px 135px 1fr;
  align-items: stretch;
}

.focus-row + .focus-row {
  border-top: 1px solid rgba(241, 234, 220, 0.52);
}

.focus-row > * {
  display: flex;
  margin: 0;
  align-items: center;
}

.focus-number {
  padding-left: 11px;
  border-right: 1px solid rgba(241, 234, 220, 0.58);
  color: var(--amber);
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: 25px;
  font-weight: 800;
  line-height: 1;
}

.focus-row h3 {
  padding-left: 17px;
  border-right: 1px solid rgba(241, 234, 220, 0.58);
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -0.06em;
  white-space: nowrap;
}

.focus-row > p:last-child {
  padding-left: 15px;
  font-size: 12px;
  font-weight: 620;
  line-height: 1.35;
}

.connect-section {
  display: grid;
  height: 225px;
  padding: 17px 20px 11px 23px;
  color: var(--ink);
  background-color: #ff9d0a;
  background-image: var(--paper-texture);
  background-size: 512px 512px;
  background-blend-mode: multiply;
  grid-template-columns: 46% 54%;
}

.connect-copy {
  padding-right: 14px;
  border-right: 1px solid rgba(20, 38, 49, 0.6);
}

.connect-copy h2,
.connect-copy h3,
.connect-copy p,
.connect-copy ul {
  margin: 0;
}

.connect-copy h2 {
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 1.12;
}

.connect-rule {
  width: 100%;
  margin: 10px 0 8px;
  border-top: 1px solid rgba(20, 38, 49, 0.78);
}

.connect-copy h3 {
  font-size: 12px;
  font-weight: 800;
}

.connect-copy ul {
  margin-top: 5px;
  padding: 0;
  list-style: none;
}

.connect-copy li {
  position: relative;
  padding-left: 12px;
  font-size: 9px;
  font-weight: 650;
  line-height: 1.42;
  white-space: normal;
}

.connect-copy li::before {
  position: absolute;
  top: 0.62em;
  left: 1px;
  width: 4px;
  height: 4px;
  background: var(--ink);
  content: "";
}

.scan-note {
  margin-top: 9px !important;
  padding-left: 12px;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.4;
}

.qr-column {
  padding-left: 18px;
}

.qr-button {
  display: block;
  width: 100%;
  height: 177px;
  overflow: hidden;
  padding: 7px;
  border: 0;
  border-radius: 4px;
  background: #f5f1e8;
  cursor: pointer;
}

.qr-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-button:focus-visible,
.modal-close:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.qr-column > p {
  margin: 6px 0 0;
  padding-top: 5px;
  border-top: 1px solid rgba(20, 38, 49, 0.65);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 7px;
  letter-spacing: 0.03em;
}

.sheet-footer {
  display: flex;
  height: 22px;
  padding: 0 22px;
  color: var(--paper-light);
  background: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 6px;
  letter-spacing: 0.03em;
  align-items: center;
  justify-content: space-between;
}

.sheet-footer p {
  margin: 0;
}

.sheet-footer span {
  color: var(--amber);
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  display: grid;
  padding: 18px;
  background: rgba(7, 16, 23, 0.86);
  inset: 0;
  place-items: center;
  backdrop-filter: blur(10px);
}

.modal-backdrop[hidden] {
  display: none;
}

.qr-modal {
  width: min(410px, 100%);
  max-height: calc(100svh - 36px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--ink);
  background-color: var(--paper-light);
  background-image: var(--paper-texture);
  background-size: 512px 512px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}

.modal-heading {
  display: flex;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--ink);
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-heading p {
  margin: 0 0 5px;
  color: var(--blue);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 9px;
}

.modal-heading h2 {
  margin: 0;
  font-size: 21px;
}

.modal-close {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--ink);
  background: var(--amber);
  color: var(--ink);
  cursor: pointer;
}

.modal-description {
  margin: 14px 0;
  font-size: 13px;
  line-height: 1.6;
}

.modal-qr {
  display: block;
  width: min(310px, 100%);
  height: auto;
  margin: 0 auto;
  background: white;
}

.modal-note {
  margin: 11px 0 0;
  color: var(--blue);
  font-size: 11px;
  text-align: center;
}

@media (min-width: 720px) {
  .site-shell {
    margin-top: 24px;
    margin-bottom: 24px;
  }
}

@media (max-width: 389px) {
  .profile-sheet {
    min-height: 100svh;
  }

  .hero h1 {
    font-size: 13.1vw;
  }

  .role {
    font-size: 5.64vw;
  }

  .focus-row {
    grid-template-columns: 15vw 34.6vw 1fr;
  }

  .focus-row h3 {
    padding-left: 4vw;
    font-size: 5.55vw;
  }

  .focus-row > p:last-child {
    padding-left: 3.2vw;
    font-size: 3.05vw;
  }

  .connect-copy h2 {
    font-size: 6.4vw;
  }

  .connect-copy li {
    font-size: 2.3vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
