/* monomo brand foundation — strict black & white v1.2
   ================================================
   canonical source: monomo-brand-system/monomo-brand-system.md
   import this BEFORE any page-specific CSS. */

:root {
  /* ——— strict black & white palette ——— */
  --ink: #000000;
  --selenium: #8a8078;
  --cream: #faf7f2; /* decorative lines on dark backgrounds only */
  --light: #ffffff;

  /* ——— derived roles ——— */
  --text-primary: #000000;
  --text-secondary: #8a8078;
  --bg-page: #ffffff;
  --bg-surface: #f0f0f0;
  --bg-subtle: #e8e8e8;
  --bg-inverse: #000000;
  --border-default: #dddddd;
  --border-focus: #8a8078;
  --nav-bg: #ffffff;
  --modal-bg: #ffffff;

  /* dark sections */
  --dark-text-primary: #ffffff;
  --dark-text-secondary: #8a8078;
  --dark-bg-surface: #1a1a1a;
  --dark-border: #2a2a2a;

  /* ——— system colors (functional UI only) ——— */
  --success: #4a7a3e;
  --success-bg: #e8f0e4;
  --warning: #b08830;
  --warning-bg: #f5eddf;
  --error: #9b3b30;
  --error-bg: #f5e6e4;
  --info: #4a6a8a;
  --info-bg: #e8ebf0;

  /* client segment badges (shared visits/dashboard utility) */
  --segment-new-bg: var(--cream);
  --segment-new-text: #666666;
  --segment-returning-bg: #efefef;
  --segment-returning-text: #4f4f4f;
  --segment-regular-bg: #e5e5e5;
  --segment-regular-text: #3d3d3d;
  --segment-vip-bg: #dbdbdb;
  --segment-vip-text: #2d2d2d;

  /* dashboard operational tokens */
  --dash-shadow-card: none;
  --dash-shadow-card-hover: none;
  --dash-shadow-soft: none;
  --dash-radius-sm: 0;
  --dash-radius-md: 0;
  --dash-radius-lg: 0;
  --dash-border-soft: var(--border-default);
  --dash-border-strong: var(--ink);
  --dash-surface: var(--light);
  --dash-surface-strong: var(--bg-surface);
  --dash-surface-cream: var(--bg-surface);
  --status-booked: #5f5f5f;
  --status-started: #4f4f4f;
  --status-ended: #6f6f6f;
  --status-processing: #7d7d7d;
  --status-uploading: #8d8d8d;
  --status-delivered: #2f2f2f;
  --status-failed: #141414;
  --white-room: var(--bg-page);
  --black-room: var(--bg-inverse);
  --black-room-text: #ffffff;
  --black-room-muted: rgba(255, 255, 255, 0.82);
  --black-room-border: rgba(255, 255, 255, 0.22);
  --black-room-card: #0f0f0f;
  --status-active: var(--ink);
  --status-alert: var(--error);
  --badge-ended-bg: var(--bg-surface);
  --badge-ended-text: var(--ink);
  --badge-processing-bg: var(--bg-subtle);
  --badge-processing-text: var(--ink);
  --badge-uploading-bg: var(--bg-subtle);
  --badge-uploading-text: var(--ink);

  /* ——— typography ——— */
  --font: 'Manrope', ui-sans-serif, system-ui, sans-serif;
  --weight-regular: 400;
  --weight-semi: 600;
  --text-display: 96px;
  --text-h1: 56px;
  --text-h2: 36px;
  --text-h3: 24px;
  --text-body-lg: 18px;
  --text-body: 16px;
  --text-body-sm: 14px;
  --text-caption: 12px;
  --text-ui-label: 12px;
  --text-button: 14px;
  --text-eyebrow: 12px;
  --text-micro: 11px;
  --text-heading: clamp(1.75rem, 4vw, 2.25rem);
  --text-title: clamp(2.25rem, 5vw, 3.5rem);
  --tracking-display: -0.04em;
  --tracking-heading: -0.03em;
  --tracking-h3: -0.02em;
  --tracking-ui: 0.08em;
  --tracking-button: 0.04em;

  /* ——— spacing (8px base) ——— */
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-2xl: 64px;
  --space-3xl: 96px;
  --space-4xl: 128px;
  --space-section: clamp(40px, 6vw, 80px);

  /* ——— shape ——— */
  --radius-input: 8px;
  --radius-pill: 9999px;
  --radius-card: 0;
  --radius-photo: 0;
  --touch-min: 44px;

  /* ——— layout ——— */
  --max-width: 1200px;
  --grid-cols: 12;
  --grid-gutter: 24px;
  --content-width: 600px;
  --content-width-narrow: 440px;

  /* ——— nav ——— */
  --nav-height: 80px;
  --nav-height-mobile: 56px;

  /* ——— motion ——— */
  --transition: 400ms ease;

  /* ——— z-index hierarchy ——— */
  --z-content: 1;
  --z-nav: 10;
  --z-dropdown: 20;
  --z-modal-overlay: 30;
  --z-modal: 40;
  --z-cookie: 50;

  /* ——— DEPRECATED aliases (remove after full migration) ——— */
  --paper: var(--cream);
  --black: var(--ink);
  --white: var(--light);
  --bg-card: var(--bg-surface);
  --dark-bg-card: var(--dark-bg-surface);
  --input-border: var(--border-default);
  --muted: var(--selenium);
  --dark-bg: var(--bg-inverse);
  --dark-text: var(--dark-text-primary);
  --dark-muted: var(--dark-text-secondary);
  --border: var(--border-default);
  --bg: var(--bg-page);
  --text: var(--text-primary);
  --text-muted: var(--text-secondary);
  --surface: var(--bg-surface);
  --font-sans: var(--font);
  --border-light: var(--border-default);
  --border-medium: var(--border-default);
  --muted-light: var(--selenium);
  --page-gutter: var(--space-md);
  --space-section-mobile: var(--space-md);
}

/* ============================================
   global resets
   ============================================ */

html {
  scroll-behavior: smooth;
}

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

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

h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
figure,
blockquote,
form {
  margin: 0;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
}

body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--ink);
  font-family: var(--font);
  font-weight: var(--weight-regular);
  line-height: 1.65;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

/* display headings — radical typographic contrast */
h1,
h2 {
  font-family: var(--font);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-heading);
  text-wrap: balance;
}

h3 {
  font-family: var(--font);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-h3);
  text-wrap: balance;
}

/* iOS: prevent auto-zoom on input focus */
input,
select,
textarea {
  font-size: 16px;
  font-family: var(--font);
}

/* links inherit color by default */
a {
  color: var(--ink);
  text-decoration: none;
}

/* brand mark in page headers */
.brand-mark {
  display: block;
  margin: 0 auto 8px;
}

/* ============================================
   ui-label / eyebrow
   ============================================ */

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--selenium);
  margin: 0 0 8px;
  line-height: 1;
}

.dark-section .eyebrow {
  color: var(--dark-text-secondary);
}

/* ============================================
   dark section
   ============================================ */

.dark-section {
  background: var(--bg-inverse);
  color: var(--dark-text-primary);
}

.dark-section a {
  color: var(--dark-text-primary);
}

/* ============================================
   pill button system — inversion gesture
   ============================================ */

.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 14px 32px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--light);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 44px;
}
.btn-pill:hover {
  background: var(--light);
  color: var(--ink);
  border-color: var(--ink);
}
.btn-pill:active {
  transform: scale(0.97);
}
.btn-pill:focus-visible {
  outline: 1.5px solid var(--selenium);
  outline-offset: 4px;
}
.btn-pill:focus:not(:focus-visible) {
  outline: none;
}
.btn-pill:disabled,
.btn-pill[disabled] {
  background: var(--bg-surface);
  color: var(--selenium);
  border-color: var(--bg-surface);
  cursor: not-allowed;
  pointer-events: none;
}
.btn-pill.loading {
  color: transparent;
  position: relative;
  pointer-events: none;
}
.btn-pill.loading::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid transparent;
  border-top-color: var(--light);
  border-radius: 50%;
  animation: btn-spin 0.8s linear infinite;
}
@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

/* on dark backgrounds */
.btn-pill-light {
  background: var(--light);
  color: var(--ink);
  border-color: var(--light);
}
.btn-pill-light:hover {
  background: var(--ink);
  color: var(--light);
  border-color: var(--light);
}
.btn-pill-light.loading::after {
  border-top-color: var(--ink);
}

/* sizes */
.btn-pill-sm {
  font-size: 12px;
  padding: 10px 24px;
  min-height: 44px;
}
.btn-pill-lg {
  font-size: 16px;
  padding: 18px 40px;
}

/* legacy variant aliases (preserve for existing pages) */
.btn-pill-primary {
  background: var(--ink);
  color: var(--light);
  border-color: var(--ink);
}
.btn-pill-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-pill-outline-light {
  background: transparent;
  color: var(--dark-text-primary);
  border-color: var(--dark-text-primary);
}

/* legacy hover — INVERSION (desktop only) */
@media (hover: hover) and (pointer: fine) {
  .btn-pill-primary:hover {
    background: var(--light);
    color: var(--ink);
    border-color: var(--ink);
  }
  .btn-pill-outline:hover {
    background: var(--ink);
    color: var(--light);
    border-color: var(--ink);
  }
  .btn-pill-outline-light:hover {
    background: var(--light);
    color: var(--ink);
    border-color: var(--light);
  }
}

/* legacy disabled class */
.btn-pill.disabled {
  background: var(--bg-surface);
  color: var(--selenium);
  border-color: var(--bg-surface);
  cursor: not-allowed;
  pointer-events: none;
}

/* legacy loading state */
.btn-pill.is-loading {
  color: transparent;
  pointer-events: none;
  position: relative;
}
.btn-pill.is-loading::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid transparent;
  border-top-color: var(--light);
  border-radius: 50%;
  animation: btn-spin 0.8s linear infinite;
}
.btn-pill-outline.is-loading::after {
  border-top-color: var(--ink);
}

/* full width */
.btn-pill-block {
  width: 100%;
}

/* ============================================
   secondary link style
   ============================================ */

.link-secondary {
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--selenium);
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: all var(--transition);
}
.link-secondary:hover {
  text-decoration: none;
}
.link-secondary-light {
  color: var(--light);
  text-decoration-color: var(--selenium);
}
.link-secondary-light:hover {
  text-decoration: none;
}

/* ============================================
   form inputs — subtle-round shape
   ============================================ */

.input-brand {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-input);
  min-height: var(--touch-min);
  font-size: 16px;
  font-family: var(--font);
  font-weight: var(--weight-regular);
  background: var(--light);
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
  transition: all var(--transition);
}

.input-brand:focus-visible {
  outline: none;
  border-color: var(--selenium);
  box-shadow: 0 0 0 3px rgba(138, 128, 120, 0.15);
}

.input-brand:focus-visible {
  box-shadow: 0 0 0 3px rgba(138, 128, 120, 0.15);
}

.input-brand::placeholder {
  color: var(--selenium);
}

/* filled state */
.input-brand:not(:placeholder-shown) {
  border-color: var(--ink);
}

/* dark variant */
.dark-section .input-brand {
  background: transparent;
  color: var(--dark-text-primary);
  border-color: var(--dark-border);
}

.dark-section .input-brand:focus-visible {
  border-color: var(--dark-text-primary);
}

.dark-section .btn-pill:focus-visible {
  outline-color: var(--selenium);
}

.dark-section .input-brand:focus-visible {
  box-shadow: 0 0 0 3px rgba(138, 128, 120, 0.15);
}

.dark-section .input-brand::placeholder {
  color: var(--dark-text-secondary);
}

/* label — ui-label style */
.input-label {
  display: block;
  font-size: var(--text-ui-label);
  font-weight: var(--weight-semi);
  color: var(--selenium);
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-ui);
}

.dark-section .input-label {
  color: var(--dark-text-secondary);
}

/* select */
select.input-brand {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238A8078' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

/* ============================================
   page header (dark, centered)
   ============================================ */

.page-header {
  background: var(--bg-inverse);
  color: var(--dark-text-primary);
  text-align: center;
  padding: max(48px, calc(24px + env(safe-area-inset-top))) var(--space-md) clamp(36px, 6vw, 48px);
}

.page-header .brand-mark {
  fill: var(--dark-text-primary);
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-heading);
  margin: 0;
  line-height: 0.92;
}

.page-header .tagline {
  color: var(--dark-text-secondary);
  font-size: var(--text-body-sm);
  margin: 12px 0 0;
  font-weight: var(--weight-regular);
  letter-spacing: 0;
}

@media (max-width: 440px) {
  .page-header {
    padding: max(34px, calc(16px + env(safe-area-inset-top))) var(--space-md) 30px;
  }
  .page-header .brand-mark {
    width: 32px;
    height: auto;
    margin-bottom: 12px;
  }
  .page-header h1 {
    font-size: var(--text-h2);
  }
  .page-header .tagline {
    margin-top: 6px;
    font-size: var(--text-body-sm);
  }
}

/* ============================================
   page footer (dark, minimal)
   ============================================ */

.page-footer {
  background: var(--bg-inverse);
  color: var(--selenium);
  text-align: center;
  padding: 40px var(--space-md);
  padding-bottom: max(40px, calc(20px + env(safe-area-inset-bottom)));
  border-top: 1px solid var(--dark-border);
  font-size: var(--text-caption);
  font-weight: var(--weight-regular);
  letter-spacing: 0;
}

.page-footer a {
  color: var(--selenium);
  text-decoration: none;
}

@media (hover: hover) {
  .page-footer a:hover {
    color: var(--dark-text-primary);
    transition: color var(--transition);
  }
}

/* ============================================
   page content area
   ============================================ */

.page-content {
  padding: var(--space-lg) var(--space-md);
  padding-bottom: max(var(--space-lg), calc(var(--space-lg) + env(safe-area-inset-bottom)));
  max-width: var(--content-width);
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  background: var(--bg-page);
}

@media (min-width: 768px) {
  .page-content {
    padding: clamp(40px, 5vh, 64px) var(--space-md);
    padding-bottom: clamp(40px, 5vh, 64px);
  }
}

@media (max-width: 440px) {
  .page-content {
    padding: var(--space-md) var(--space-md) max(24px, calc(14px + env(safe-area-inset-bottom)));
  }
}

@media (max-width: 440px) {
  .page-footer {
    padding: 20px var(--space-md);
    padding-bottom: max(20px, calc(12px + env(safe-area-inset-bottom)));
  }
}

/* ============================================
   notice/message component
   ============================================ */

.notice {
  padding: 16px 20px;
  border-radius: var(--radius-input);
  background: var(--bg-surface);
  border: none;
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: 1.5;
  margin-bottom: var(--space-md);
}

.notice-strong {
  border: 1.5px solid var(--ink);
}

/* ============================================
   utility: action link spacing
   ============================================ */

.action-link {
  margin-top: var(--space-sm);
}

/* ============================================
   inline notice (form validation, alerts)
   ============================================ */

.notice-inline {
  padding: 12px 16px;
  border-radius: var(--radius-input);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  font-size: var(--text-body);
  text-align: center;
  animation: notice-in var(--transition);
}

@keyframes notice-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .notice-inline {
    animation: none;
  }
}

/* ============================================
   utilities
   ============================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.body-no-scroll {
  overflow: hidden;
}

/* ============================================
   retina / HiDPI refinements
   ============================================ */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .input-brand {
    border-width: 0.5px;
  }

  .notice-inline {
    border-width: 0.5px;
  }

  .page-footer {
    border-top-width: 0.5px;
  }
}
