:root {
  --black: #101311;
  --black-soft: #181c19;
  --nori: #29372f;
  --nori-light: #35463d;
  --gold: #a78a56;
  --gold-light: #cbb486;
  --ivory: #eee9de;
  --blue-gray: #687886;
  --muted: #aeb5af;
  --line: rgba(203, 180, 134, .42);
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --sans: "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --shadow: 0 24px 70px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--black); }

body {
  margin: 0;
  color: var(--ivory);
  background:
    radial-gradient(circle at 10% 0%, rgba(167, 138, 86, .16), transparent 25rem),
    radial-gradient(circle at 100% 88%, rgba(53, 70, 61, .52), transparent 32rem),
    linear-gradient(150deg, #0e110f 0%, #18221c 52%, #101512 100%);
  font-family: var(--sans);
  line-height: 1.7;
}

a { color: inherit; }

/* 電子名刺 */
.card-page {
  width: min(100% - 30px, 460px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 0 34px;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--gold-light);
  font-size: .62rem;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.card-cover {
  position: relative;
  min-height: 390px;
  margin-top: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--gold-light);
  background:
    radial-gradient(circle at 85% 12%, rgba(167, 138, 86, .15), transparent 12rem),
    linear-gradient(135deg, #0d100e 0%, #171b18 56%, #27352e 100%);
  border: 1px solid rgba(203, 180, 134, .7);
  box-shadow: var(--shadow);
}

.card-cover::before,
.print-card.front::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .26;
  background:
    repeating-linear-gradient(115deg, transparent 0 10px, rgba(255, 255, 255, .04) 10px 11px),
    repeating-linear-gradient(18deg, transparent 0 14px, rgba(0, 0, 0, .08) 14px 15px);
  mix-blend-mode: soft-light;
}

.cover-seal {
  position: relative;
  z-index: 1;
  display: block;
  width: 74px;
  height: 74px;
  margin-bottom: 20px;
  object-fit: contain;
  filter: drop-shadow(0 7px 20px rgba(0, 0, 0, .24));
}

.cover-brand {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--ivory);
  font-family: var(--serif);
  font-size: clamp(1.7rem, 7vw, 2rem);
  font-weight: 500;
  letter-spacing: .1em;
  line-height: 1.18;
  writing-mode: vertical-rl;
  text-orientation: upright;
}

.cover-location {
  position: absolute;
  z-index: 1;
  bottom: 8px;
  margin: 0;
  color: var(--gold-light);
  font-size: .63rem;
  letter-spacing: .16em;
}

.profile-panel {
  position: relative;
  margin-top: 14px;
  padding: 22px 20px 20px;
  color: var(--ivory);
  background: linear-gradient(145deg, rgba(53, 70, 61, .98), rgba(35, 48, 41, .98));
  border: 1px solid rgba(203, 180, 134, .46);
  border-top: 3px solid var(--gold);
  box-shadow: 0 15px 40px rgba(0, 0, 0, .18);
}

.profile-panel .role {
  margin: 0 0 12px;
  color: var(--gold-light);
  font-size: .68rem;
  letter-spacing: .1em;
}

.profile-panel h2 {
  margin: 0;
  color: var(--ivory);
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
}

.profile-panel .address {
  margin: 4px 0 17px;
  color: #c0c6bf;
  font-size: .76rem;
}

.contact-lines {
  display: grid;
  gap: 5px;
  padding-top: 14px;
  border-top: 1px solid rgba(238, 233, 222, .2);
  color: #d5d9d2;
  font-size: .78rem;
}

.contact-line { display: flex; gap: 12px; }

.contact-line dt {
  width: 3.2em;
  color: var(--gold-light);
  font-size: .68rem;
  letter-spacing: .08em;
}

.contact-line dd { margin: 0; word-break: break-word; }
.contact-line a { color: inherit; text-decoration: none; }

.actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-top: 14px;
}

.action {
  min-height: 58px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ivory);
  background: rgba(16, 19, 17, .5);
  border: 1px solid rgba(203, 180, 134, .4);
  border-radius: 2px;
  text-decoration: none;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.action:hover,
.action:focus-visible {
  background: rgba(167, 138, 86, .18);
  border-color: var(--gold-light);
  outline: none;
  transform: translateY(-1px);
}

.action.is-pending {
  color: rgba(238, 233, 222, .48);
  border-color: rgba(238, 233, 222, .18);
  cursor: default;
}

.action b { display: block; font-size: .8rem; font-weight: 600; }
.action span { display: block; color: var(--muted); font-size: .66rem; }
.action .arrow { color: var(--gold-light); font-size: 1rem; }

.save-contact {
  width: 100%;
  min-height: 52px;
  margin-top: 11px;
  padding: 11px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--black);
  background: var(--gold-light);
  border: 1px solid var(--gold-light);
  border-radius: 2px;
  font: inherit;
  cursor: pointer;
}

.save-contact:hover,
.save-contact:focus-visible {
  background: #e1cb99;
  outline: 3px solid rgba(203, 180, 134, .26);
  outline-offset: 2px;
}

.save-contact small { font-size: .63rem; letter-spacing: .1em; }

.message {
  margin: 28px 2px 0;
  padding: 16px 17px 17px;
  color: #d9ded7;
  background: rgba(0, 0, 0, .16);
  border-left: 2px solid var(--gold);
  font-family: var(--serif);
  font-size: .88rem;
}

.url-row {
  margin: 20px 2px 0;
  color: var(--muted);
  font-size: .68rem;
  overflow-wrap: anywhere;
}

.url-row button {
  margin-left: 6px;
  padding: 1px 6px;
  color: var(--gold-light);
  background: transparent;
  border: 1px solid rgba(203, 180, 134, .4);
  border-radius: 2px;
  font: inherit;
  cursor: pointer;
}

.footer-note {
  margin: 30px 0 0;
  color: rgba(238, 233, 222, .42);
  text-align: center;
  font-size: .64rem;
  letter-spacing: .08em;
}

/* 紙名刺の印刷プレビュー：箱の蓋に合わせた縦型 */
.print-page {
  min-height: 100vh;
  padding: 26px;
  color: var(--black);
  background: #dedbd2;
}

.print-heading {
  width: min(100%, 850px);
  margin: 0 auto 20px;
}

.print-heading h1 { margin: 0; font-size: 1.1rem; }
.print-heading p { margin: 4px 0 0; color: #686a64; font-size: .78rem; }

.print-sheet {
  width: min(100%, 850px);
  margin: 0 auto;
  padding: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 28px;
  background: white;
  box-shadow: 0 12px 35px rgba(24, 38, 56, .13);
}

.print-card {
  width: 55mm;
  height: 91mm;
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  padding: 9mm 7mm;
  color: var(--ivory);
  background: var(--black);
  border: .25mm solid rgba(203, 180, 134, .78);
  box-shadow: 0 7px 18px rgba(0, 0, 0, .18);
}

.print-card.front {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 88% 5%, rgba(167, 138, 86, .2), transparent 30mm),
    linear-gradient(145deg, #0c0f0d, #1d2620 60%, #29372f);
}

.print-card.back {
  padding: 8mm 7mm;
  color: var(--ivory);
  background:
    linear-gradient(180deg, rgba(41, 55, 47, .98), rgba(29, 40, 34, .99)),
    var(--nori);
  border-color: rgba(203, 180, 134, .68);
}

.print-card.back::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: -10mm;
  right: -10mm;
  bottom: 17mm;
  height: 22mm;
  background: rgba(104, 120, 134, .22);
  clip-path: polygon(0 45%, 24% 28%, 49% 52%, 73% 30%, 100% 46%, 100% 100%, 0 100%);
}

.print-card.back::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: -10mm;
  right: -10mm;
  bottom: -1mm;
  height: 20mm;
  background: rgba(16, 19, 17, .52);
  clip-path: polygon(0 42%, 20% 25%, 45% 51%, 72% 29%, 100% 48%, 100% 100%, 0 100%);
}

.print-mark {
  position: relative;
  z-index: 1;
  display: block;
  width: 13mm;
  height: 13mm;
  object-fit: contain;
}

.vertical-brand {
  position: relative;
  z-index: 1;
  height: 47mm;
  margin: 6mm 0 0;
  color: var(--ivory);
  font-family: var(--serif);
  font-size: 6.8mm;
  font-weight: 500;
  letter-spacing: .18em;
  line-height: 1.35;
  writing-mode: vertical-rl;
  text-orientation: upright;
}

.print-cover-meta {
  position: absolute;
  z-index: 1;
  bottom: 7mm;
  margin: 0;
  color: var(--gold-light);
  font-size: 2.1mm;
  letter-spacing: .13em;
  text-align: center;
}

.back-label {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--gold-light);
  font-size: 2.1mm;
  letter-spacing: .14em;
}

.back-brand {
  position: relative;
  z-index: 1;
  margin: 2.5mm 0 0;
  color: var(--ivory);
  font-family: var(--serif);
  font-size: 4.4mm;
  letter-spacing: .1em;
}

.print-card.back .print-role {
  position: relative;
  z-index: 1;
  margin: 11mm 0 3mm;
  color: var(--gold-light);
  font-size: 2.25mm;
  letter-spacing: .06em;
}

.print-card.back .print-name {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--ivory);
  font-family: var(--serif);
  font-size: 4.2mm;
}

.print-contact {
  position: relative;
  z-index: 1;
  margin-top: 7mm;
  color: #d5dcd4;
  font-size: 2.2mm;
  line-height: 1.75;
}

.print-contact p { margin: 0; }

.print-contact #print-email {
  margin-top: .8mm;
  color: var(--gold-light);
  overflow-wrap: anywhere;
}

.qr-code {
  position: absolute;
  z-index: 2;
  right: 7mm;
  bottom: 7mm;
  width: 17mm;
  height: 17mm;
  padding: 1.4mm;
  background: var(--ivory);
  border: 2mm solid var(--ivory);
  box-shadow: 0 0 0 .25mm var(--gold-light);
}

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

.back-url {
  position: absolute;
  z-index: 2;
  left: 7mm;
  bottom: 8mm;
  margin: 0;
  color: var(--gold-light);
  font-size: 2.1mm;
  overflow-wrap: anywhere;
}

.print-note {
  width: min(100%, 850px);
  margin: 16px auto 0;
  color: #686a64;
  font-size: .72rem;
}

@media (max-width: 640px) {
  .print-page { padding: 18px; }
  .print-sheet { padding: 20px; }
}

@media print {
  @page { size: A4; margin: 0; }
  body { background: white; }
  .print-page { padding: 0; background: white; }
  .print-heading, .print-note { display: none; }
  .print-sheet {
    width: 210mm;
    min-height: 297mm;
    padding: 25mm;
    display: block;
    box-shadow: none;
  }
  .print-card { margin-bottom: 16mm; }
}
