/* ============================================================================
 * zLink — Wensity UI (ui.wensity.com) & Layro (layro.dev) Design System
 * Tactile surfaces, double-bezel frames, 2px carved grooves, and gold accents.
 * Built by the OneLyte Association (onelyte.uk)
 * ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500;600&family=Geist:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@700;800&display=swap");

:root,
[data-theme-island="light"] {
  --font-heading: "Cal Sans", "Plus Jakarta Sans", "Geist", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Brand Gold / Amber (Layro & Wensity signature palette) */
  --color-brand-200: #ffe588;
  --color-brand-300: #fdd94e;
  --color-brand-400: #f5c922;
  --color-brand-500: #e6b800;
  --color-brand-600: #a67f00;
  --color-brand-700: #7a5c00;
  --color-brand-950: #211900;
  --color-brand-on: #000000;

  /* Neutral Scale — Light (Warm Technical Paper) */
  --gray-50: #f7f7f7;
  --gray-100: #f2f2f2;
  --gray-200: #ebebeb;
  --gray-300: #e5e5e5;
  --gray-400: #e2e2e2;
  --gray-500: #d4d4d4;
  --gray-600: #b3b3b3;
  --gray-700: #8f8f8f;
  --gray-800: #6e6e6e;
  --gray-900: #525252;
  --gray-1000: #0a0a0a;

  --background: #fafafa;
  --foreground: var(--gray-1000);
  --surface: #ffffff;
  --surface-muted: var(--gray-100);
  --muted: var(--gray-100);
  --muted-foreground: var(--gray-900);
  --border: var(--gray-400);
  --border-strong: var(--gray-500);

  /* Wensity Primitives */
  --primitive-radius: 0.75rem;
  --primitive-radius-control: 0.625rem;
  --primitive-radius-control-sm: 0.5rem;
  --primitive-radius-surface: 1rem;
  --primitive-surface-elevated: #ffffff;
  --primitive-surface-overlay: #ffffff;
  --primitive-edge: rgba(10, 10, 10, 0.11);
  --primitive-catchlight: #ffffff;
  --primitive-groove-shadow: rgba(10, 10, 10, 0.09);
  --primitive-groove-highlight: rgba(255, 255, 255, 0.88);
  --primitive-shadow-drop: 0 1px 1px -0.5px rgba(10, 10, 10, 0.1), 0 2px 4px -1px rgba(10, 10, 10, 0.06);
  --primitive-shadow-raised: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px -12px rgba(0, 0, 0, 0.08);
  --primitive-shadow-overlay: 0 1px 2px rgba(0, 0, 0, 0.06), 0 18px 48px -24px rgba(0, 0, 0, 0.35);
  --primitive-shadow-modal: 0 1px 2px rgba(0, 0, 0, 0.08), 0 24px 64px -28px rgba(0, 0, 0, 0.42);
  --primitive-shadow-recess: inset 0 2px 3px -1px rgba(10, 10, 10, 0.08);
  --primitive-shadow-well: inset 0 1px 2px 0 rgba(10, 10, 10, 0.06);
  --primitive-well: rgba(10, 10, 10, 0.04);
  --primitive-control-solid: #24292d;
  --primitive-control-solid-hover: #2c3237;
  --primitive-control-solid-active: #1e2326;
  --primitive-control-solid-foreground: #ffffff;

  /* Layro Frames & Nested Layers */
  --frame-rim: var(--gray-100);
  --frame-rim-edge: var(--gray-400);
  --frame-inner: var(--surface);
  --frame-inner-edge: var(--gray-400);
  --frame-inner-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  --frame-outer-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 2px 4px rgba(0, 0, 0, 0.05), 0 12px 24px rgba(0, 0, 0, 0.05);

  --layer-outer: var(--gray-50);
  --layer-outer-ring: rgba(0, 0, 0, 0.08);
  --layer-inner: var(--surface);
  --layer-inner-ring: var(--gray-300);
  --layer-inner-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 3px 10px -4px rgba(0, 0, 0, 0.08);
  --layer-well: var(--gray-50);
  --layer-well-ring: rgba(0, 0, 0, 0.06);

  /* Tactile Illustrations & Keycaps */
  --illo-page: var(--surface);
  --illo-edge: var(--gray-500);
  --illo-line: var(--gray-300);
  --illo-knob: var(--surface);
  --key-face-top: var(--surface);
  --key-face-bottom: var(--gray-100);
  --key-side: var(--gray-500);
  --dither-texture-ink: var(--foreground);
  --dither-texture-alpha: 0.09;

  /* Tactile Buttons (Layro CTA) */
  --cta-primary-text: #000000;
  --cta-primary-text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  --cta-primary-face: linear-gradient(180deg, #f2c91f 0%, var(--color-brand-500) 48%, #c79a00 100%);
  --cta-primary-edge: #8f6d00;
  --cta-primary-hover: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.02) 70%);
  --cta-drop: 0 1px 2px rgba(0, 0, 0, 0.14), 0 8px 16px -8px rgba(0, 0, 0, 0.3);
  --cta-press: inset 0 2px 4px rgba(0, 0, 0, 0.2);

  --cta-secondary-text: #0a0a0a;
  --cta-secondary-top: #ffffff;
  --cta-secondary-face: linear-gradient(180deg, #ffffff 0%, #fafafa 60%, #f0f0f0 100%);
  --cta-secondary-rim: rgba(0, 0, 0, 0.06);
  --cta-secondary-edge: rgba(0, 0, 0, 0.13);
  --cta-secondary-drop: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 14px -8px rgba(0, 0, 0, 0.18);
  --cta-secondary-hover: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.035) 100%);

  /* Toolbar / Tabs */
  --tab-tray: var(--gray-200);
  --tab-tray-edge: rgba(0, 0, 0, 0.06);
  --tab-text: var(--gray-900);
  --tab-active: #ffffff;
  --tab-active-shadow: 0 0 0 1px rgba(9, 9, 11, 0.06), 0 1px 2px rgba(9, 9, 11, 0.12);
  --engrave-groove: rgba(9, 9, 11, 0.1);
  --engrave-lit: #ffffff;

  /* Semantic & Legacy compatibility aliases */
  --ring: var(--color-brand-600);
  --brand-text: var(--color-brand-700);
  --tone-success: #047857;
  --tone-warning: #b45309;
  --tone-danger: #dc2626;
  --tone-info: #0369a1;

  --bg: var(--background);
  --bg-soft: var(--surface-muted);
  --bg-elev: var(--surface);
  --text: var(--foreground);
  --text-muted: var(--muted-foreground);
  --text-faint: var(--gray-700);
  --primary: var(--color-brand-500);
  --primary-hover: var(--color-brand-400);
  --primary-soft: rgba(230, 184, 0, 0.14);
  --accent: var(--color-brand-600);
  --success: var(--tone-success);
  --warning: var(--tone-warning);
  --danger: var(--tone-danger);
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: var(--primitive-shadow-raised);
  --shadow-lg: var(--primitive-shadow-modal);
  --maxw: 1120px;

  color-scheme: light;
}

html.dark {
  --gray-50: #0a0a0a;
  --gray-100: #121212;
  --gray-200: #1a1a1a;
  --gray-300: #1f1f1f;
  --gray-400: #242424;
  --gray-500: #2e2e2e;
  --gray-600: #404040;
  --gray-700: #7d7d7d;
  --gray-800: #8f8f8f;
  --gray-900: #a1a1a1;
  --gray-1000: #f5f5f5;

  --background: #050505;
  --foreground: var(--gray-1000);
  --surface: var(--gray-100);
  --surface-muted: var(--gray-200);
  --muted: var(--gray-100);
  --muted-foreground: var(--gray-900);
  --border: var(--gray-400);
  --border-strong: var(--gray-500);

  --primitive-surface-elevated: #121212;
  --primitive-surface-overlay: #161616;
  --primitive-edge: rgba(255, 255, 255, 0.09);
  --primitive-catchlight: rgba(255, 255, 255, 0.14);
  --primitive-groove-shadow: rgba(0, 0, 0, 0.65);
  --primitive-groove-highlight: rgba(255, 255, 255, 0.06);
  --primitive-shadow-drop: 0 1px 1px -0.5px rgba(0, 0, 0, 0.6), 0 2px 4px -1px rgba(0, 0, 0, 0.45);
  --primitive-shadow-raised: inset 0 1px 0 0 rgba(255, 255, 255, 0.05), 0 1px 2px rgba(0, 0, 0, 0.45), 0 8px 24px -12px rgba(0, 0, 0, 0.65);
  --primitive-shadow-overlay: inset 0 1px 0 0 rgba(255, 255, 255, 0.06), 0 2px 4px rgba(0, 0, 0, 0.45), 0 20px 56px -28px rgba(0, 0, 0, 0.78);
  --primitive-shadow-modal: inset 0 1px 0 0 rgba(255, 255, 255, 0.07), 0 4px 8px rgba(0, 0, 0, 0.5), 0 28px 72px -32px rgba(0, 0, 0, 0.85);
  --primitive-shadow-recess: inset 0 2px 3px -1px rgba(0, 0, 0, 0.55);
  --primitive-shadow-well: inset 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --primitive-well: rgba(0, 0, 0, 0.36);
  --primitive-control-solid: #f5f3ee;
  --primitive-control-solid-hover: #ffffff;
  --primitive-control-solid-active: #e8e4da;
  --primitive-control-solid-foreground: #151719;

  --frame-rim: var(--gray-50);
  --frame-rim-edge: var(--gray-400);
  --frame-inner: #0c0c0c;
  --frame-inner-edge: var(--gray-300);
  --frame-inner-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  --frame-outer-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.6), 0 24px 48px -24px rgba(0, 0, 0, 0.75);

  --layer-outer: #0a0a0a;
  --layer-outer-ring: rgba(255, 255, 255, 0.06);
  --layer-inner: var(--gray-100);
  --layer-inner-ring: var(--gray-400);
  --layer-inner-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 3px 10px -4px rgba(0, 0, 0, 0.6);
  --layer-well: #080808;
  --layer-well-ring: rgba(255, 255, 255, 0.05);

  --illo-page: var(--gray-100);
  --illo-edge: var(--gray-400);
  --illo-line: var(--gray-400);
  --illo-knob: var(--gray-1000);
  --key-face-top: var(--gray-200);
  --key-face-bottom: var(--gray-100);
  --key-side: #050505;
  --dither-texture-alpha: 0.11;

  --cta-primary-edge: #4f3c00;
  --cta-drop: 0 1px 2px rgba(0, 0, 0, 0.55), 0 10px 20px -10px rgba(0, 0, 0, 0.8);
  --cta-press: inset 0 2px 4px rgba(0, 0, 0, 0.4);

  --cta-secondary-text: #f5f5f5;
  --cta-secondary-top: rgba(255, 255, 255, 0.09);
  --cta-secondary-face: linear-gradient(180deg, #1d1d1f 0%, #151517 55%, #101012 100%);
  --cta-secondary-rim: rgba(0, 0, 0, 0.45);
  --cta-secondary-edge: rgba(255, 255, 255, 0.11);
  --cta-secondary-drop: 0 1px 2px rgba(0, 0, 0, 0.55), 0 8px 16px -8px rgba(0, 0, 0, 0.7);
  --cta-secondary-hover: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);

  --tab-tray: rgba(255, 255, 255, 0.05);
  --tab-tray-edge: rgba(255, 255, 255, 0.07);
  --tab-text: var(--gray-900);
  --tab-active: var(--gray-300);
  --tab-active-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 0 0 1px rgba(255, 255, 255, 0.08), 0 1px 2px rgba(0, 0, 0, 0.6);
  --engrave-groove: #000000;
  --engrave-lit: rgba(255, 255, 255, 0.06);

  --ring: var(--color-brand-300);
  --brand-text: var(--color-brand-300);
  --tone-success: #34d399;
  --tone-warning: #fbbf24;
  --tone-danger: #f87171;
  --tone-info: #38bdf8;
  --primary-soft: rgba(253, 217, 78, 0.14);

  color-scheme: dark;
}

/* ---------------- Base & Typography ---------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection {
  background-color: var(--color-brand-500);
  color: #000000;
}

a {
  color: var(--brand-text);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: underline;
  text-decoration-color: var(--color-brand-500);
  text-underline-offset: 3px;
}

code,
pre,
.mono {
  font-family: var(--font-mono);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.45em;
  line-height: 1.14;
  letter-spacing: -0.025em;
  color: var(--foreground);
}

h1,
h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.15rem, 4.4vw, 3.35rem);
}

h2 {
  font-size: clamp(1.45rem, 2.6vw, 2.05rem);
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

p {
  margin: 0 0 1em;
}

.muted {
  color: var(--muted-foreground);
}

.small {
  font-size: 13px;
}

.hidden {
  display: none !important;
}

/* ---------------- Layout & Carved Grooves ---------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

.narrow {
  max-width: 760px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Wensity 2px Carved Grooves */
[data-groove="horizontal"],
.layro-engrave-x {
  height: 2px;
  width: 100%;
  border: 0;
  background-image: linear-gradient(
    to bottom,
    var(--primitive-groove-shadow) 0 1px,
    var(--primitive-groove-highlight) 1px 2px
  );
}

[data-groove="vertical"],
.layro-engrave-y {
  width: 2px;
  align-self: stretch;
  background-image: linear-gradient(
    to right,
    var(--primitive-groove-shadow) 0 1px,
    var(--primitive-groove-highlight) 1px 2px
  );
}

/* ---------------- Wensity & Layro Surfaces ---------------- */
.layro-frame {
  --frame-radius: 22px;
  --frame-gap: 6px;
  padding: var(--frame-gap);
  border-radius: var(--frame-radius);
  background: var(--frame-rim);
  box-shadow: inset 0 0 0 1px var(--frame-rim-edge), var(--frame-outer-shadow);
}

.layro-frame-inner {
  border-radius: calc(var(--frame-radius) - var(--frame-gap));
  background: var(--frame-inner);
  box-shadow: 0 0 0 1px var(--frame-inner-edge), var(--frame-inner-shadow);
  padding: 20px;
}

.layro-layer-outer {
  background-color: var(--layer-outer);
  box-shadow: 0 0 0 1px var(--layer-outer-ring);
  border-radius: 18px;
  padding: 6px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.layro-layer-inner {
  background-color: var(--layer-inner);
  box-shadow: 0 0 0 1px var(--layer-inner-ring), var(--layer-inner-shadow);
  border-radius: 12px;
  padding: 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.layro-layer-well {
  background-color: var(--layer-well);
  box-shadow: inset 0 0 0 1px var(--layer-well-ring), var(--primitive-shadow-well);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.layro-dither {
  background-image: radial-gradient(var(--dither-texture-ink) 0.75px, transparent 0.75px);
  background-size: 6px 6px;
  opacity: var(--dither-texture-alpha);
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.layro-tile-primary {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--cta-primary-text);
  text-shadow: var(--cta-primary-text-shadow);
  background: var(--cta-primary-face);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -1px 0 rgba(90, 65, 0, 0.3), 0 0 0 1px var(--cta-primary-edge);
  flex-shrink: 0;
}

/* Inline Hero Icon Chips (Layro Hero style) */
.layro-chip {
  display: inline-grid;
  place-items: center;
  width: 0.92em;
  height: 0.92em;
  border-radius: 0.24em;
  background: var(--illo-page);
  box-shadow: inset 0 1px 0 var(--primitive-catchlight), 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 1px var(--illo-edge);
  vertical-align: -0.1em;
  margin: 0 0.06em;
  color: var(--foreground);
}

.layro-chip svg {
  width: 0.56em;
  height: 0.56em;
  color: var(--color-brand-600);
}

html.dark .layro-chip svg {
  color: var(--color-brand-400);
}

.layro-text-accent {
  background-color: var(--color-brand-500);
  color: var(--color-brand-on);
  border-radius: 0.16em;
  padding: 0.02em 0.18em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Standard Card upgraded to Wensity Tactile Surface */
.card {
  background: var(--layer-inner);
  border: 1px solid var(--layer-inner-ring);
  border-top-color: var(--primitive-catchlight);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 0 0 1px var(--layer-outer-ring), var(--layer-inner-shadow);
  position: relative;
}

/* ---------------- Navbar (Layro Top Shell) ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--background) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--primitive-groove-highlight);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  color: var(--foreground);
  letter-spacing: -0.02em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--cta-primary-face);
  color: #000000;
  display: inline-grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -1px 0 rgba(90, 65, 0, 0.35), 0 0 0 1px var(--cta-primary-edge), 0 2px 5px rgba(0, 0, 0, 0.18);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links > a:not(.btn) {
  color: var(--muted-foreground);
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: 8px;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.nav-links > a:not(.btn):hover {
  color: var(--foreground);
  background: color-mix(in srgb, var(--foreground) 6%, transparent);
  text-decoration: none;
}

/* Layro Theme Switcher Button */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--cta-secondary-edge);
  background: var(--cta-secondary-face);
  color: var(--foreground);
  box-shadow: inset 0 1px 0 var(--cta-secondary-top), 0 1px 2px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
  border-color: var(--border-strong);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle svg {
  width: 15px;
  height: 15px;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

html.dark .theme-toggle svg {
  transform: rotate(180deg);
}

/* ---------------- Tactile Buttons (.btn & .layro-cta) ---------------- */
.btn,
.layro-cta--secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  line-height: 1.1;
  padding: 9px 15px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  color: var(--cta-secondary-text);
  background: var(--cta-secondary-face);
  box-shadow:
    inset 0 1px 0 var(--cta-secondary-top),
    inset 0 -1px 0 var(--cta-secondary-rim),
    0 0 0 1px var(--cta-secondary-edge),
    var(--cta-secondary-drop);
  position: relative;
  isolation: isolate;
  transition: box-shadow 0.16s ease, transform 0.12s ease, opacity 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover,
.layro-cta--secondary:hover {
  text-decoration: none;
  filter: brightness(0.985);
}

html.dark .btn:hover,
html.dark .layro-cta--secondary:hover {
  filter: brightness(1.08);
}

.btn:active,
.layro-cta--secondary:active {
  transform: scale(0.985);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.2),
    0 0 0 1px var(--cta-secondary-edge);
}

.btn:focus-visible,
.layro-cta--secondary:focus-visible,
.layro-cta--primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--ring);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn.primary,
.layro-cta--primary {
  color: var(--cta-primary-text);
  text-shadow: var(--cta-primary-text-shadow);
  background: var(--cta-primary-face);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    inset 0 -1px 0 rgba(90, 65, 0, 0.32),
    0 0 0 1px var(--cta-primary-edge),
    var(--cta-drop);
}

.btn.primary:hover,
.layro-cta--primary:hover {
  filter: brightness(1.03);
  text-decoration: none;
}

.btn.primary:active,
.layro-cta--primary:active {
  transform: scale(0.985);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.28),
    0 0 0 1px var(--cta-primary-edge);
}

.btn.sm {
  padding: 6px 11px;
  font-size: 12.5px;
  border-radius: 8px;
}

.btn.lg {
  padding: 12px 20px;
  font-size: 14.5px;
  border-radius: 11px;
}

.btn.danger {
  color: var(--tone-danger);
}

.btn.danger.solid {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 0 1px #991b1b, var(--cta-drop);
}

/* ---------------- Wensity Inputs & Forms ---------------- */
.input,
select.input,
textarea.input {
  width: 100%;
  background: var(--surface);
  color: var(--foreground);
  border: 1px solid var(--border-strong);
  border-top-color: var(--border);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 14px;
  font-family: inherit;
  box-shadow: var(--primitive-shadow-well), inset 0 1px 0 rgba(0, 0, 0, 0.02);
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

html.dark .input,
html.dark select.input,
html.dark textarea.input {
  background: #0c0c0e;
  border-color: var(--gray-400);
}

.input::placeholder {
  color: var(--gray-700);
}

.input:focus {
  border-color: var(--color-brand-500);
  box-shadow: 0 0 0 2px var(--background), 0 0 0 4px color-mix(in srgb, var(--color-brand-500) 45%, transparent);
}

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--foreground);
  letter-spacing: -0.01em;
}

.field {
  display: flex;
  flex-direction: column;
}

.hint {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 5px;
}

/* ---------------- Hero & Interactive Shortener Frame ---------------- */
.hero {
  padding: 58px 0 42px;
  text-align: center;
  position: relative;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 8px;
  border-radius: 999px;
  background: var(--layer-inner);
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 var(--primitive-catchlight), var(--primitive-shadow-drop);
  color: var(--foreground);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 20px;
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--color-brand-500);
  box-shadow: 0 0 0 3px rgba(230, 184, 0, 0.24);
}

.hero h1 {
  max-width: 780px;
  margin: 0 auto 16px;
}

.hero p.lead {
  font-size: 17px;
  color: var(--muted-foreground);
  max-width: 600px;
  margin: 0 auto 28px;
  text-wrap: balance;
}

.shorten-box {
  max-width: 740px;
  margin: 0 auto;
  text-align: left;
  padding: 6px;
  border-radius: 20px;
  background: var(--frame-rim);
  border: 0;
  box-shadow: inset 0 0 0 1px var(--frame-rim-edge), var(--frame-outer-shadow);
}

.shorten-box-inner {
  background: var(--frame-inner);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 0 0 1px var(--frame-inner-edge), var(--frame-inner-shadow);
}

.shorten-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.shorten-row .input {
  flex: 1 1 280px;
  font-size: 14.5px;
  padding: 11px 14px;
}

.alias-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.alias-prefix {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted-foreground);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  padding: 8px 11px;
  border-radius: 9px;
  white-space: nowrap;
  box-shadow: var(--primitive-shadow-well);
}

.result-card {
  margin-top: 12px;
  padding: 14px;
  border-radius: 11px;
  background: var(--layer-well);
  border: 1px solid var(--color-brand-600);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.result-card .short {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
  color: var(--foreground);
  word-break: break-all;
}

.result-card img.qr {
  width: 76px;
  height: 76px;
  border-radius: 9px;
  background: #ffffff;
  padding: 4px;
  border: 1px solid var(--border-strong);
}

/* ---------------- Layro 3-Step Schematic Cards ---------------- */
.section {
  padding: 48px 0;
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-text);
  font-weight: 600;
}

.feat-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--surface-muted);
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 var(--primitive-catchlight), var(--primitive-shadow-drop);
  color: var(--brand-text);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
}

/* ---------------- Badges, Tags & Alerts ---------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--surface-muted);
  color: var(--muted-foreground);
  border: 1px solid var(--border);
}

.badge.pro {
  background: var(--cta-primary-face);
  color: #000000;
  border-color: var(--cta-primary-edge);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.badge.active {
  background: rgba(4, 120, 87, 0.12);
  color: var(--tone-success);
  border-color: rgba(4, 120, 87, 0.35);
}

.badge.paused,
.badge.expired {
  background: rgba(180, 83, 9, 0.14);
  color: var(--tone-warning);
  border-color: rgba(180, 83, 9, 0.35);
}

.badge.blocked {
  background: rgba(220, 38, 38, 0.14);
  color: var(--tone-danger);
  border-color: rgba(220, 38, 38, 0.35);
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--surface-muted);
  color: var(--muted-foreground);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease;
}

.tag:hover {
  border-color: var(--color-brand-500);
  color: var(--foreground);
}

.alert {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
}

.alert.error {
  border-color: rgba(220, 38, 38, 0.45);
  background: rgba(220, 38, 38, 0.1);
  color: var(--tone-danger);
}

.alert.ok {
  border-color: rgba(4, 120, 87, 0.45);
  background: rgba(4, 120, 87, 0.1);
  color: var(--tone-success);
}

.alert.info {
  border-color: var(--color-brand-600);
  background: var(--primary-soft);
  color: var(--foreground);
}

/* ---------------- Dashboard Shell (Wensity Sidebar & Workspace) ---------------- */
.dash-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 24px;
  padding: 26px 0 60px;
  flex: 1;
}

.dash-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px;
  border-radius: 14px;
  background: var(--layer-outer);
  box-shadow: 0 0 0 1px var(--layer-outer-ring);
  align-self: start;
  position: sticky;
  top: 78px;
}

.dash-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 8px 11px;
  border-radius: 9px;
  color: var(--muted-foreground);
  font-weight: 500;
  font-size: 13.5px;
  transition: background-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.dash-nav a:hover {
  background: color-mix(in srgb, var(--foreground) 5%, transparent);
  color: var(--foreground);
  text-decoration: none;
}

.dash-nav a.on {
  background: var(--tab-active);
  color: var(--foreground);
  font-weight: 600;
  box-shadow: var(--tab-active-shadow);
}

.stat-card {
  padding: 16px 18px;
}

.stat-card .label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

.stat-card .value {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: -0.02em;
}

.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--layer-well);
  box-shadow: inset 0 0 0 1px var(--border);
  overflow: hidden;
  margin-top: 8px;
}

.progress > div {
  height: 100%;
  background: var(--cta-primary-face);
  border-radius: 999px;
}

.link-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 15px 18px;
  transition: border-color 0.14s ease;
}

.link-item:hover {
  border-color: var(--border-strong);
}

.link-item .short {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
  color: var(--foreground);
}

.link-item .dest {
  color: var(--muted-foreground);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 560px;
}

.link-item .meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted-foreground);
}

.link-item .actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---------------- Charts & Analytics ---------------- */
.chart-wrap {
  width: 100%;
  overflow-x: auto;
}

svg.chart {
  width: 100%;
  height: 165px;
  display: block;
}

svg.chart .bar {
  fill: var(--color-brand-500);
  opacity: 0.88;
  transition: opacity 0.12s;
}

svg.chart .bar:hover {
  opacity: 1;
}

svg.chart text {
  fill: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.toplist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.toplist li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  font-size: 13px;
  align-items: center;
}

.toplist .barbg {
  grid-column: 1 / -1;
  height: 5px;
  background: var(--layer-well);
  box-shadow: inset 0 0 0 1px var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.toplist .barbg > div {
  height: 100%;
  background: var(--color-brand-500);
}

/* ---------------- Modals & Toasts ---------------- */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 100;
}

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--layer-inner);
  border: 1px solid var(--border-strong);
  border-top-color: var(--primitive-catchlight);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--primitive-shadow-modal);
}

.modal.wide {
  max-width: 820px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

#toasts {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}

.toast {
  background: var(--layer-inner);
  border: 1px solid var(--border-strong);
  color: var(--foreground);
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: var(--primitive-shadow-overlay);
  font-size: 13px;
  font-weight: 500;
}

.toast.error {
  border-color: var(--tone-danger);
  color: var(--tone-danger);
}

/* ---------------- Pricing & Toggle Tray ---------------- */
.plan-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px;
}

.plan-card.featured {
  border-color: var(--color-brand-500);
  box-shadow: 0 0 0 1px var(--color-brand-500), var(--primitive-shadow-raised);
}

.price {
  font-family: var(--font-heading);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 8px 0 4px;
}

.price span {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--muted-foreground);
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13.5px;
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.check-list li::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 5px;
  background: var(--primary-soft);
  color: var(--brand-text);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Layro Segmented Toolbar Toggle */
.toggle {
  display: inline-flex;
  background: var(--tab-tray);
  box-shadow: inset 0 0 0 1px var(--tab-tray-edge);
  padding: 4px;
  border-radius: 11px;
  gap: 4px;
}

.toggle button {
  background: transparent;
  border: 0;
  color: var(--muted-foreground);
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  transition: background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.toggle button.on {
  background: var(--tab-active);
  color: var(--foreground);
  box-shadow: var(--tab-active-shadow);
}

table.cmp {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.cmp th,
table.cmp td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

table.cmp th {
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------------- Auth & Docs ---------------- */
.auth-wrap {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 44px 16px;
}

.auth-card {
  width: 100%;
  max-width: 430px;
}

pre.code {
  background: var(--layer-well);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--foreground);
  box-shadow: var(--primitive-shadow-well);
}

.kbd {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--layer-well);
  border: 1px solid var(--border);
}

/* ---------------- Footer ---------------- */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--primitive-groove-highlight);
  padding: 28px 0;
  color: var(--muted-foreground);
  font-size: 13px;
  background: var(--layer-outer);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted-foreground);
}

.footer-links a:hover {
  color: var(--foreground);
}

.empty {
  text-align: center;
  padding: 36px 20px;
  color: var(--muted-foreground);
}

.locked {
  position: relative;
  border-style: dashed;
}

@media (max-width: 820px) {
  .dash-layout {
    grid-template-columns: 1fr;
  }
  .dash-nav {
    flex-direction: row;
    overflow-x: auto;
    position: static;
  }
  .link-item {
    grid-template-columns: 1fr;
  }
}
