/* OsmoSync Brand Kit — interactive
   Three themes: primary (gray), light (white), dark (black with glow).
   Toggle via [data-theme] on <body>. */

:root {
  --brand-primary: #6c6c6c;
  --brand-ink: #525252;
  --brand-grey-mid: #858585;
  --brand-grey-soft: #9f9f9f;
  --brand-surface: #e6e6e6;
  --brand-bg: #ffffff;
  --hairline: #e6e8eb;

  --bg: #fafafa;
  --bg-card: #ffffff;
  --text: var(--brand-ink);
  --text-muted: var(--brand-grey-mid);
  --text-faint: var(--brand-grey-soft);
  --border: var(--hairline);
  --accent: var(--brand-primary);
  --mark-color: var(--brand-primary);
  --glow: none;
  --shadow-card: 0 1px 0 rgba(20,22,26,0.04), 0 8px 24px -12px rgba(20,22,26,0.08);
}

[data-theme="primary"] {
  --bg: #fafafa;
  --bg-card: #ffffff;
  --text: #525252;
  --accent: #6c6c6c;
  --mark-color: #6c6c6c;
  --glow: none;
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-card: #ffffff;
  --text: #15171A;
  --text-muted: #4a4d52;
  --text-faint: #7e8186;
  --border: #ececef;
  --accent: #15171A;
  --mark-color: #15171A;
  --glow: none;
}

[data-theme="dark"] {
  --bg: #0a0b0d;
  --bg-card: #14161a;
  --text: #f5f5f7;
  --text-muted: #a8aab0;
  --text-faint: #6e7178;
  --border: #25272c;
  --accent: #ffffff;
  --mark-color: #ffffff;
  --glow: drop-shadow(0 0 8px rgba(255,255,255,0.18)) drop-shadow(0 0 32px rgba(255,255,255,0.12));
  --shadow-card: 0 1px 0 rgba(255,255,255,0.03), 0 12px 36px -12px rgba(0,0,0,0.6);
}

/* ============== base ============== */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 220ms ease, color 220ms ease;
  min-height: 100vh;
}
.container { max-width: 1180px; margin: 0 auto; padding: 64px 32px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============== theme switcher ============== */

.theme-switcher {
  position: fixed; top: 16px; right: 16px; z-index: 50;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px; display: flex; gap: 2px; box-shadow: var(--shadow-card);
}
.theme-switcher button {
  background: transparent; border: 0; padding: 6px 14px; border-radius: 999px;
  font: 500 12px/1 'Poppins', sans-serif; color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: background 160ms ease, color 160ms ease;
}
.theme-switcher button:hover { color: var(--text); }
.theme-switcher button.active { background: var(--text); color: var(--bg-card); }
.theme-switcher .dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
}

/* ============== hero ============== */

header.hero { padding: 96px 0 32px; }
header.hero .eyebrow {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-faint); margin-bottom: 16px;
}
header.hero .lockup-hero {
  display: flex; align-items: center; gap: 24px; margin-bottom: 32px;
}
header.hero .mark-hero { width: 88px; height: 88px; color: var(--mark-color); filter: var(--glow); display: inline-flex; }
header.hero .mark-hero svg { width: 100%; height: 100%; }
header.hero .word-hero {
  font-size: 64px; font-weight: 600; color: var(--accent); letter-spacing: -0.02em; line-height: 1;
}
header.hero .hero-meta {
  color: var(--text-muted); font-size: 15px; max-width: 640px; margin: 0;
}

/* ============== sections ============== */

section { padding: 64px 0; border-top: 1px solid var(--border); }
section .section-eyebrow {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-faint); margin-bottom: 8px;
}
section h2 { font-size: 32px; font-weight: 600; margin: 0 0 8px; color: var(--text); letter-spacing: -0.01em; }
section .section-sub { color: var(--text-muted); font-size: 15px; max-width: 600px; margin: 0 0 32px; }

/* ============== builder layout ============== */

.builder {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; align-items: stretch;
}
.preview-pane, .controls-pane {
  background: var(--bg-card); border-radius: 16px; padding: 32px;
  border: 1px solid var(--border); box-shadow: var(--shadow-card);
}
.preview-pane {
  min-height: 480px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative;
}
.preview-stage {
  flex: 1; width: 100%; display: flex; align-items: center; justify-content: center;
  min-height: 360px; padding: 24px; overflow: hidden;
}
.preview-stage svg {
  color: var(--mark-color); filter: var(--glow);
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  display: block;
}
/* Stronger glow on hero/footer marks too, in dark mode */
.mark-hero svg, .mark-foot svg { filter: var(--glow); }
.preview-meta {
  font-family: ui-monospace, SF Mono, Menlo, monospace; font-size: 11px;
  color: var(--text-faint); margin-top: 8px; letter-spacing: 0.02em;
}

.controls-pane { display: flex; flex-direction: column; gap: 24px; }
.control { display: flex; flex-direction: column; gap: 8px; }
.control label {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted);
  display: flex; justify-content: space-between; align-items: center;
}
.control label output {
  font-family: ui-monospace, monospace; font-weight: 500; color: var(--text);
  background: var(--bg); padding: 2px 8px; border-radius: 4px;
}
.control .hints {
  display: flex; justify-content: space-between; font-size: 10px; color: var(--text-faint);
  font-family: ui-monospace, monospace;
}

input[type="range"] {
  appearance: none; -webkit-appearance: none;
  width: 100%; background: transparent; height: 24px; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px; background: var(--border); border-radius: 2px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px;
  background: var(--accent); border-radius: 50%; margin-top: -7.5px;
  cursor: pointer; transition: transform 100ms ease;
}
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.1); }
input[type="range"]::-moz-range-track { height: 3px; background: var(--border); border-radius: 2px; }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; background: var(--accent); border-radius: 50%; border: 0; cursor: pointer; }

.color-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Background segmented control (None / Light / Dark) */
.bg-row {
  display: inline-flex; gap: 0;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 3px;
}
.bg-btn {
  flex: 1; padding: 8px 16px; min-width: 64px;
  font: 500 13px/1 'Poppins', sans-serif; color: var(--text-muted);
  background: transparent; border: 0; border-radius: 7px; cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.bg-btn:hover { color: var(--text); }
.bg-btn.active {
  background: var(--bg-card); color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.swatch-btn {
  width: 28px; height: 28px; border-radius: 6px; border: 0; cursor: pointer; padding: 0;
  outline: 2px solid transparent; outline-offset: 2px;
  transition: outline-color 120ms ease;
}
.swatch-btn.active { outline-color: var(--accent); }
input[type="color"] {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border);
  padding: 2px; cursor: pointer; background: transparent;
}
input[type="color"]::-webkit-color-swatch { border-radius: 4px; border: 0; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }

.actions { display: flex; gap: 8px; margin-top: 8px; }
.btn-primary, .btn-ghost {
  flex: 1; padding: 12px 18px; font: 500 14px/1 'Poppins', sans-serif;
  border-radius: 10px; cursor: pointer; transition: all 140ms ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary {
  background: var(--accent); color: var(--bg-card); border: 1px solid var(--accent);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.btn-ghost {
  background: transparent; color: var(--text); border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--text-muted); }

/* ============== palette ============== */

.palette { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.swatch {
  border-radius: 12px; padding: 24px 16px; min-height: 140px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform 140ms ease;
  border: 1px solid transparent;
}
.swatch:hover { transform: translateY(-2px); }
.swatch .role { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.65; }
.swatch .hex { font-size: 14px; font-weight: 500; font-family: ui-monospace, monospace; }
.swatch.bordered { border-color: var(--border); }

.downloads-row { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ============== type ============== */

.type-card { background: var(--bg-card); border-radius: 16px; padding: 32px; border: 1px solid var(--border); margin-bottom: 24px; }
.type-row {
  padding: 20px 0; border-bottom: 1px dashed var(--border);
  display: grid; grid-template-columns: 200px 1fr; gap: 32px; align-items: baseline;
}
.type-row:last-child { border-bottom: 0; }
.type-row .meta { color: var(--text-faint); font-family: ui-monospace, monospace; font-size: 11px; }
.display-xl { font-size: 72px; font-weight: 700; line-height: 1.05; letter-spacing: -0.025em; }
.display-lg { font-size: 56px; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; }
.display-md { font-size: 40px; font-weight: 600; line-height: 1.1; letter-spacing: -0.015em; }
.heading-lg { font-size: 32px; font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
.heading-md { font-size: 24px; font-weight: 600; line-height: 1.2; }
.body-lg { font-size: 18px; font-weight: 400; line-height: 1.55; }
.body { font-size: 16px; font-weight: 400; line-height: 1.6; }
.caption { font-size: 12px; font-weight: 500; line-height: 1.4; }
.eyebrow { font-size: 11px; font-weight: 600; line-height: 1.2; text-transform: uppercase; letter-spacing: 0.08em; }

/* ============== footer ============== */

footer { padding: 48px 0; color: var(--text-faint); font-size: 12px; border-top: 1px solid var(--border); }
footer .row-foot { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
footer .lockup-foot { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-weight: 600; }
footer .mark-foot { width: 18px; height: 18px; color: var(--mark-color); filter: var(--glow); display: inline-flex; }
footer .mark-foot svg { width: 100%; height: 100%; }

/* ============== toast ============== */

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg-card); padding: 12px 20px; border-radius: 999px;
  font-size: 13px; font-weight: 500; opacity: 0; pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease; z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============== responsive ============== */

@media (max-width: 880px) {
  .container { padding: 40px 20px; }
  .builder { grid-template-columns: 1fr; }
  .palette { grid-template-columns: 1fr 1fr; }
  header.hero .lockup-hero { gap: 16px; }
  header.hero .word-hero { font-size: 40px; }
  header.hero .mark-hero { width: 56px; height: 56px; }
  section h2 { font-size: 24px; }
  .display-xl { font-size: 48px; }
  .display-lg { font-size: 36px; }
  .display-md { font-size: 28px; }
  .type-row { grid-template-columns: 1fr; gap: 8px; }
  .theme-switcher button span:not(.dot) { display: none; }
}
