/* ============================================================
   Emancia Brand Portal — Coastal Pop design tokens
   (ported from emancia.eu globals.css; light theme = primary)
   ============================================================ */
:root {
  --primary: #0B6B8E;
  --primary-deep: #084C66;
  --secondary: #2DA8C2;
  --accent: #FF6A2C;
  --accent-soft: #FF8442;
  --text: #0B2630;
  --text-muted: #4B5D66;
  --bg: #F4F8FB;
  --bg-soft: #E9F2F7;
  --bg-card: #FFFFFF;

  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;

  --font-display: 'Outfit';
  --font-body: 'Mulish';
  --font-mono: 'Martian Mono';

  --ring: color-mix(in srgb, var(--primary) 22%, transparent);
  --hairline: color-mix(in srgb, var(--text) 10%, transparent);
  --shadow: 0 18px 50px -22px rgba(8, 76, 102, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body), system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--font-display), system-ui, sans-serif; font-weight: 800; line-height: 1.05; margin: 0; }
::selection { background: var(--accent); color: #fff; }
a { color: inherit; }

.mono { font-family: var(--font-mono), ui-monospace, monospace; }

/* ---------- ambient orbs ---------- */
.orb { position: fixed; border-radius: 50%; filter: blur(70px); z-index: 0; pointer-events: none; }
.orb-a { width: 540px; height: 540px; background: var(--primary); opacity: .15; top: -160px; right: -120px; }
.orb-b { width: 460px; height: 460px; background: var(--secondary); opacity: .14; top: 38%; left: -180px; }
.orb-c { width: 420px; height: 420px; background: var(--accent); opacity: .10; bottom: -160px; right: 6%; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 64px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.brand-logo { height: 30px; display: block; }
.site-nav { display: flex; gap: 26px; font-family: var(--font-display); font-weight: 600; font-size: .95rem; }
.site-nav a { text-decoration: none; color: var(--text-muted); transition: color .2s; }
.site-nav a:hover { color: var(--primary); }

/* ---------- layout ---------- */
main { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 64px); }

.hero { padding: clamp(56px, 9vw, 110px) 0 clamp(40px, 6vw, 72px); max-width: 760px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, var(--bg-card));
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
  padding: 7px 14px; border-radius: 999px; margin-bottom: 22px;
}
.point-lumineux { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 70% { box-shadow: 0 0 0 12px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -.02em; }
.lede { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--text-muted); margin-top: 22px; line-height: 1.6; }
.hero-actions { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }

.btn-primary, .btn-ghost {
  font-family: var(--font-display); font-weight: 600; font-size: .98rem;
  padding: 13px 26px; border-radius: 999px; cursor: pointer; text-decoration: none; border: 1px solid transparent; transition: transform .18s, box-shadow .18s, background .18s;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 12px 28px -10px var(--accent); }
.btn-primary:hover { transform: translateY(-2px); background: var(--accent-soft); }
.btn-ghost { background: color-mix(in srgb, var(--bg-card) 60%, transparent); border-color: var(--hairline); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- block ---------- */
.block { padding: clamp(40px, 7vw, 84px) 0; border-top: 1px solid var(--hairline); }
.block-head { max-width: 640px; margin-bottom: 36px; }
.kicker { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.block-head h2 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); margin-top: 12px; letter-spacing: -.01em; }
.block-head p { color: var(--text-muted); margin-top: 12px; line-height: 1.55; }
.group-title { font-size: 1rem; font-family: var(--font-display); font-weight: 700; color: var(--text); margin: 30px 0 16px; }
.group-title-muted { color: var(--text-muted); margin-top: 44px; }

/* ---------- copy-format switch ---------- */
.format-switch { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.format-switch-label { font-size: .82rem; color: var(--text-muted); margin-right: 4px; }
.fmt, .pfmt, .pack-fmt-switch .pfmt {
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .04em;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--hairline); background: var(--bg-card); color: var(--text-muted); transition: all .16s;
}
.fmt:hover, .pfmt:hover { border-color: var(--primary); color: var(--primary); }
.fmt.active, .pfmt.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- swatch grid ---------- */
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.swatch {
  position: relative; display: block; width: 100%; text-align: left; padding: 0;
  border-radius: var(--radius-md); overflow: hidden; cursor: pointer;
  background: var(--bg-card); border: 1px solid var(--hairline); box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s; font: inherit; color: inherit;
}
.swatch:hover { transform: translateY(-3px); box-shadow: 0 24px 60px -24px rgba(8,76,102,.5); }
/* full-bleed colour, clipped by the card radius — no inner rectangle, no inset ring.
   A single bottom hairline keeps light colours distinct from the footer. */
.swatch-color { display: block; height: 108px; width: 100%; box-shadow: inset 0 -1px 0 var(--hairline); }
.swatch-body { display: block; padding: 13px 15px 15px; }
.swatch-name { display: block; font-family: var(--font-display); font-weight: 700; font-size: .95rem; line-height: 1.2; }
.swatch-role { display: block; font-size: .72rem; color: var(--text-muted); margin-top: 2px; }
.swatch-code { display: block; margin-top: 11px; }
.swatch-code code { display: block; font-family: var(--font-mono); font-size: .76rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* copy affordance floats over the colour, frosted so it reads on any hue */
.swatch-copy-ic {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px;
  display: grid; place-items: center; border-radius: 9px; color: var(--text);
  background: color-mix(in srgb, var(--bg-card) 78%, transparent); backdrop-filter: blur(5px);
  box-shadow: 0 4px 14px -5px rgba(8,38,48,.45); opacity: 0; transform: translateY(-4px);
  transition: opacity .16s, transform .16s;
}
.swatch:hover .swatch-copy-ic { opacity: 1; transform: translateY(0); }
.swatch:active { transform: translateY(-1px); }

/* ---------- studio ---------- */
.studio { display: grid; grid-template-columns: 1.15fr 1fr; gap: 26px; align-items: start; }
.studio-stage { position: sticky; top: 96px; }
.stage-canvas {
  border-radius: var(--radius-lg); border: 1px solid var(--hairline); box-shadow: var(--shadow);
  min-height: 360px; display: grid; place-items: center; padding: 48px; overflow: hidden;
  background: #fff;
}
/* checkerboard shown only in transparent mode */
.stage-canvas[data-bg-mode="transparent"] {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e3ebf0 25%, transparent 25%),
    linear-gradient(-45deg, #e3ebf0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e3ebf0 75%),
    linear-gradient(-45deg, transparent 75%, #e3ebf0 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}
.stage-logo { width: 100%; max-width: 520px; display: grid; place-items: center; }
.stage-logo svg { width: 100%; height: auto; display: block; }
.stage-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; color: var(--text-muted); font-size: .85rem; }
.stage-meta .mono { font-size: .78rem; }

.studio-controls { display: flex; flex-direction: column; gap: 22px; }
.ctrl { background: var(--bg-card); border: 1px solid var(--hairline); border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow); }
.ctrl-label { display: block; font-family: var(--font-display); font-weight: 700; font-size: .9rem; margin-bottom: 12px; }
.ctrl-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ctrl-label-row .ctrl-label { margin-bottom: 0; }

.form-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.form-tab {
  flex: 1 1 auto; font-family: var(--font-display); font-weight: 600; font-size: .82rem;
  padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap;
  border: 1px solid var(--hairline); background: var(--bg); color: var(--text-muted); transition: all .16s;
}
.form-tab:hover { border-color: var(--primary); color: var(--primary); }
.form-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.swatch-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.mini-swatch { width: 30px; height: 30px; border-radius: 9px; cursor: pointer; border: 2px solid transparent; box-shadow: inset 0 0 0 1px var(--hairline); transition: transform .14s; }
.mini-swatch:hover { transform: scale(1.12); }
.mini-swatch.active { border-color: var(--text); }
.mini-swatch[data-val="transparent"] {
  background-image: linear-gradient(45deg,#cfd9df 25%,transparent 25%),linear-gradient(-45deg,#cfd9df 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#cfd9df 75%),linear-gradient(-45deg,transparent 75%,#cfd9df 75%);
  background-size: 10px 10px; background-position: 0 0,0 5px,5px -5px,-5px 0; background-color: #fff;
}

.color-input { display: flex; align-items: center; gap: 10px; }
.color-input input[type="color"] { width: 44px; height: 38px; padding: 0; border: 1px solid var(--hairline); border-radius: 10px; background: none; cursor: pointer; }
.color-input input[type="color"]::-webkit-color-swatch { border: none; border-radius: 8px; }
.color-input input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.color-input input[type="text"] {
  flex: 1; font-family: var(--font-mono); font-size: .88rem; text-transform: uppercase;
  padding: 9px 12px; border-radius: 10px; border: 1px solid var(--hairline); background: var(--bg); color: var(--text);
}
.color-input input[type="text"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }

.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--text-muted); cursor: pointer; }
.toggle input { accent-color: var(--primary); width: 15px; height: 15px; }

input[type="range"] { width: 100%; accent-color: var(--primary); }

.ctrl-hint { font-size: .78rem; color: var(--text-muted); margin: -6px 0 12px; line-height: 1.45; }
.dl-current { color: var(--primary); }
.downloads .dl-row { display: flex; gap: 10px; }
.btn-dl {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--font-display); font-weight: 700; font-size: .92rem;
  padding: 12px 8px; border-radius: var(--radius-sm); cursor: pointer; transition: all .16s;
  border: 1px solid var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--bg-card)); color: var(--primary);
}
.btn-dl svg { flex: none; }
.btn-dl:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }

.dl-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--text-muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; font-family: var(--font-mono); }
.dl-divider::before, .dl-divider::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }

.pack-fmt-switch { display: flex; gap: 8px; margin-bottom: 12px; }
.pack-fmt-switch .pfmt { flex: 1; text-align: center; }
.btn-pack {
  width: 100%; font-family: var(--font-display); font-weight: 700; font-size: .95rem;
  padding: 13px; border-radius: var(--radius-sm); cursor: pointer; border: none;
  background: var(--accent); color: #fff; box-shadow: 0 12px 26px -12px var(--accent); transition: all .16s;
}
.btn-pack:hover { background: var(--accent-soft); transform: translateY(-2px); }

/* size use-case anchors */
.size-anchors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.size-anchors button {
  display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer;
  padding: 9px 4px; border-radius: 10px; border: 1px solid var(--hairline); background: var(--bg); color: var(--text-muted); transition: all .15s;
}
.size-anchors button strong { font-family: var(--font-mono); font-size: .82rem; color: var(--text); }
.size-anchors button small { font-size: .62rem; line-height: 1.1; text-align: center; }
.size-anchors button:hover { border-color: var(--primary); color: var(--primary); }
.size-anchors button:hover strong { color: var(--primary); }
.size-anchors button.active { background: color-mix(in srgb, var(--primary) 10%, var(--bg-card)); border-color: var(--primary); color: var(--primary); }
.size-anchors button.active strong { color: var(--primary); }

/* ---------- footer ---------- */
.site-footer { position: relative; z-index: 1; max-width: 1180px; margin: 40px auto 0; padding: 30px clamp(20px,5vw,64px) 60px; border-top: 1px solid var(--hairline); display: flex; align-items: center; gap: 14px; color: var(--text-muted); font-size: .85rem; }
.footer-mark { height: 26px; opacity: .8; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(28px);
  background: var(--text); color: var(--bg-card); font-family: var(--font-display); font-weight: 600; font-size: .9rem;
  padding: 12px 22px; border-radius: 999px; box-shadow: var(--shadow); z-index: 40;
  opacity: 0; pointer-events: none; transition: opacity .22s, transform .22s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .studio { grid-template-columns: 1fr; }
  .studio-stage { position: static; }
  .site-nav { gap: 18px; }
}
@media (max-width: 520px) {
  .brand-logo { height: 26px; }
  .swatch-grid { grid-template-columns: 1fr 1fr; }
}
