/* Nicecard demo — design tokens and shared primitives.
   Taken from the Claude Design "Web Platform" and "Invitation Templates" files.
   One deliberate light, paper-stationery look: every surface paints its own color. */

:root {
  --cream: #fffcf5;
  --panel: #fdf6e4;
  --panel-2: #fcf4dd;
  --blush: #fbede9;
  --blush-line: #f2c6bc;
  --coral: #de7f71;
  --rose-line: #e8a39a;
  --ink: #3a3128;
  --ink-2: #4f4338;
  --brand: #7a4033;
  --brand-deep: #5c2c22;
  --action: #a6443a;
  --mute: #7a6653;
  --mute-2: #6b5b4b;
  --line: rgba(58, 49, 40, 0.09);
  --line-2: rgba(58, 49, 40, 0.16);
  --ok-bg: #e4eedf;
  --ok-fg: #3f5c36;
  --device: #221f1c;
  --canvas-ground: #efe7da;

  --f-script: 'Dancing Script', 'Noto Serif SC', cursive;
  --f-serif: 'Cormorant Garamond', 'Noto Serif SC', Georgia, serif;
  --f-sans: 'Jost', 'Noto Sans SC', 'PingFang SC', system-ui, sans-serif;
  --f-hand: 'Parisienne', 'Noto Serif SC', cursive;

  --r-sm: 10px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --shadow-device: 0 34px 70px -24px rgba(34, 31, 28, 0.5);
  --shadow-pop: 0 18px 40px -18px rgba(58, 49, 40, 0.35);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Chinese UI: serif roles fall to Noto Serif SC first so CJK glyphs never mix two serifs mid-line. */
:root[data-lang='zh'] {
  --f-serif: 'Noto Serif SC', 'Cormorant Garamond', serif;
  --f-sans: 'Noto Sans SC', 'Jost', 'PingFang SC', system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--brand-deep);
}

h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

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

.nc-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.nc-scroll::-webkit-scrollbar-thumb {
  background: rgba(58, 49, 40, 0.16);
  border-radius: 6px;
}

.nc-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ───── Type roles ───── */

.nc-script-title {
  font-family: var(--f-script);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.1;
  color: var(--brand);
}

.nc-serif {
  font-family: var(--f-serif);
}

.nc-label {
  font-family: var(--f-sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}

.nc-meta {
  font-size: 12.5px;
  color: var(--mute);
}

/* ───── Buttons ───── */

.nc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 160ms var(--ease), color 160ms, border-color 160ms, transform 160ms;
}

.nc-btn:hover {
  background: rgba(58, 49, 40, 0.05);
}

.nc-btn:active {
  transform: translateY(1px);
}

.nc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nc-btn--dark {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--cream);
}

.nc-btn--dark:hover {
  background: #2a231c;
}

.nc-btn--action {
  border-color: var(--action);
  background: var(--action);
  color: var(--cream);
}

.nc-btn--action:hover {
  background: #8f3a31;
}

.nc-btn--lg {
  padding: 13px 26px;
  font-size: 15px;
}

.nc-btn--sm {
  padding: 8px 14px;
  font-size: 12.5px;
}

.nc-pill {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(58, 49, 40, 0.12);
  background: var(--panel);
  color: var(--mute-2);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.nc-pill[aria-pressed='true'] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--cream);
}

.nc-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.nc-chip--ok {
  background: var(--ok-bg);
  color: var(--ok-fg);
}

.nc-chip--blush {
  background: var(--blush);
  color: #8a4e40;
}

/* ───── Form fields ───── */

.nc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nc-field > span {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
}

.nc-input,
.nc-textarea,
.nc-select {
  width: 100%;
  background: var(--panel);
  border: 1px solid rgba(58, 49, 40, 0.1);
  border-radius: var(--r);
  padding: 12px 15px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}

.nc-textarea {
  line-height: 1.7;
  resize: vertical;
}

.nc-input:focus,
.nc-textarea:focus,
.nc-select:focus {
  border-color: var(--rose-line);
  box-shadow: 0 0 0 3px rgba(222, 127, 113, 0.18);
}

/* ───── Device frame ───── */

.nc-phone {
  position: relative;
  width: 390px;
  max-width: 100%;
  height: 800px;
  border: 9px solid var(--device);
  border-radius: 42px;
  overflow: hidden;
  box-shadow: var(--shadow-device);
  background: var(--cream);
}

/* ───── Language switch (NC.LangSwitch) ───── */

.nc-lang {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgba(58, 49, 40, 0.12);
  background: var(--panel);
}

.nc-lang button {
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--mute-2);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.nc-lang button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--cream);
}

.nc-lang--dark {
  border-color: rgba(246, 242, 234, 0.25);
  background: rgba(246, 242, 234, 0.08);
}

.nc-lang--dark button {
  color: #c8bfb0;
}

.nc-lang--dark button[aria-pressed='true'] {
  background: #f6f2ea;
  color: #1a1a18;
}

/* ───── Toast ───── */

.nc-toaster {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.nc-toast {
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-size: 13px;
  box-shadow: var(--shadow-pop);
  animation: nc-rise 220ms var(--ease);
}

@keyframes nc-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
