:root {
  --bg: #e7edf3;
  --card: #fbfcfd;
  --ink: #172033;
  --muted: #5c6b80;
  --navy: #1b3a5f;
  --navy-deep: #142c49;
  --stamp: #8d2f2f;
  --line: #d5deea;
  --chip: #e7eef8;
  --shadow: 0 16px 40px rgba(23, 32, 51, 0.08);
  --sans: "IBM Plex Sans", "Noto Sans JP", "Noto Sans SC", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Noto Sans JP", "Noto Sans SC", monospace;
  --serif: "IBM Plex Serif", "Noto Sans JP", "Noto Sans SC", Georgia, serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  position: relative;
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.02rem;
  line-height: 1.5;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(27, 58, 95, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 58, 95, 0.05) 1px, transparent 1px);
  background-size: 100% 4.75rem, 14.285% 100%;
  background-position: 0 0, 0 0;
}

.watermark {
  position: fixed;
  right: 4vw;
  top: 8vh;
  z-index: 0;
  margin: 0;
  color: rgba(27, 58, 95, 0.05);
  font-family: var(--serif);
  font-size: clamp(6rem, 16vw, 12rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 0.8;
  pointer-events: none;
  user-select: none;
}

.wordmark {
  position: absolute;
  top: 1.15rem;
  left: 1.25rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  color: var(--navy);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1.2;
  text-transform: uppercase;
}

.plug {
  width: 1.65rem;
  height: auto;
  flex: none;
  color: currentColor;
}

.page {
  position: relative;
  z-index: 1;
  width: min(40rem, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 3.35rem 0 2.6rem;
}

.masthead { text-align: center; }

.mark {
  width: 3rem;
  height: auto;
  color: var(--navy);
}

h1 {
  margin: 0.45rem 0 0;
  color: var(--navy);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1.2;
  text-transform: uppercase;
}

.tagline {
  margin: 0.85rem auto 0;
  max-width: 100%;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.15rem, 4.4vw, 1.55rem);
  font-weight: 500;
  line-height: 1.35;
}

.tagline-line {
  display: inline-block;
  white-space: nowrap;
}

.lang-switch {
  display: inline-flex;
  margin-top: 1rem;
  padding: 0.18rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 252, 253, 0.8);
}

.lang {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.4rem 0.72rem;
  cursor: pointer;
}

.lang.is-on {
  background: var(--navy);
  color: #fbfcfd;
}

html[lang="ja"] {
  --sans: "Noto Sans JP", "IBM Plex Sans", "Hiragino Sans", sans-serif;
}

html[lang="zh-Hans"] {
  --sans: "Noto Sans SC", "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
}

html[lang="ja"] h1,
html[lang="zh-Hans"] h1,
html[lang="ja"] .stamp,
html[lang="zh-Hans"] .stamp,
html[lang="ja"] .kicker,
html[lang="zh-Hans"] .kicker {
  letter-spacing: 0.08em;
  text-transform: none;
}

.panel,
.invite {
  margin-top: 1.35rem;
  padding: 1.15rem 1.15rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.field { display: block; }

.field-label,
legend,
.check span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

fieldset {
  margin: 0.95rem 0 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

legend { padding: 0; }

.select-wrap { display: block; position: relative; }

.select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0.85rem;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid var(--navy);
  border-bottom: 1.5px solid var(--navy);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

select {
  width: 100%;
  margin-top: 0.4rem;
  min-height: 2.8rem;
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  appearance: none;
}

select:focus {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.segments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.segment { position: relative; }

.segment input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.segment span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.segment input:checked + span {
  border-color: var(--navy);
  background: var(--navy);
  color: #fbfcfd;
}

.segment input:focus-visible + span {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1rem;
  cursor: pointer;
}

.check input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--navy);
}

.check span {
  letter-spacing: 0.01em;
  text-transform: none;
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--ink);
}

.primary {
  display: block;
  width: 100%;
  min-height: 3rem;
  margin-top: 1rem;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: #fbfcfd;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.primary:hover { background: var(--navy-deep); }

.hint {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.invite {
  position: relative;
  border-left: 4px solid var(--navy);
  padding-right: 5.5rem;
}

.invite[data-tone="suspicious"] { border-left-color: #8a6232; }
.invite[data-tone="absurd"] { border-left-color: var(--stamp); }

.stamp {
  position: absolute;
  top: 0.95rem;
  right: 0.85rem;
  margin: 0;
  padding: 0.12rem 0.35rem;
  border: 2px solid var(--stamp);
  color: var(--stamp);
  font-family: var(--serif);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
  transform: rotate(-8deg);
}

.kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.invite-meta {
  margin: 0.35rem 0 0;
  color: var(--navy);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.4;
}

html[lang="ja"] .invite-meta,
html[lang="zh-Hans"] .invite-meta {
  font-family: var(--sans);
}

.excuse {
  margin: 0.9rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.28rem, 3.6vw, 1.55rem);
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.excuse.is-memo {
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 400;
  line-height: 1.55;
  white-space: pre-wrap;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.05rem;
}

.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.ghost:hover { border-color: var(--navy); color: var(--navy); }

.copy-status {
  margin: 0.6rem 0 0;
  min-height: 0;
  color: var(--navy);
  font-size: 0.92rem;
}

.copy-status:empty { display: none; }

.site-footer {
  margin-top: 1.8rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.site-footer a {
  color: var(--navy);
  text-underline-offset: 0.15em;
}

.site-footer a:hover { color: var(--navy-deep); }

:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}

@media (max-width: 720px) {
  .watermark { display: none; }
  .wordmark { top: 0.85rem; left: 0.85rem; }
  .page { padding-top: 2.85rem; }
  .invite { padding-right: 1.05rem; }
  .stamp {
    position: static;
    display: inline-block;
    margin-bottom: 0.55rem;
    transform: none;
  }
  .tagline-line { white-space: normal; }
}

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

[hidden] {
  display: none !important;
}
