/* ==========================================================================
   AIBit IT-Solutions — design system
   Tokens, reset, typography and the component primitives shared by the
   public site and the CMS dashboard.
   Palette is derived from the company logo: deep navy field, cyan circuitry.
   ========================================================================== */

/* --- Fonts ------------------------------------------------------------- */
@font-face {
  font-family: 'InterVar';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-wght-normal.260c81a4759b.woff2") format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'GroteskVar';
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url("../fonts/space-grotesk-latin-wght-normal.87c506d88b9f.woff2") format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

/* --- Tokens ------------------------------------------------------------ */
:root {
  /* Surfaces — darkest to lightest */
  --bg:          #050d1f;
  --bg-2:        #071127;
  --bg-3:        #0a1730;
  --surface:     rgba(255, 255, 255, 0.038);
  --surface-2:   rgba(255, 255, 255, 0.062);
  --surface-3:   rgba(255, 255, 255, 0.086);
  --glass:       rgba(8, 19, 42, 0.72);

  /* Lines */
  --line:        rgba(120, 180, 255, 0.145);
  --line-2:      rgba(120, 180, 255, 0.10);
  --line-hot:    rgba(53, 214, 245, 0.46);

  /* Ink */
  --ink:         #eaf2fd;
  --ink-2:       #b7c9e0;
  --ink-3:       #8fa6c2;
  --ink-4:       #6b809c;

  /* Brand accents */
  --cyan:        #35d6f5;
  --cyan-dim:    #1ba9c6;
  --blue:        #4a8fe7;
  --violet:      #8b7cf6;
  --emerald:     #34d399;
  --amber:       #fbbf24;
  --rose:        #fb7185;
  --red:         #f87171;

  /* Semantic */
  --success:     var(--emerald);
  --warn:        var(--amber);
  --danger:      var(--red);
  --info:        var(--cyan);

  /* Gradients */
  --grad-brand:  linear-gradient(102deg, var(--cyan) 0%, var(--blue) 100%);
  --grad-text:   linear-gradient(102deg, #ffffff 4%, var(--cyan) 52%, var(--blue) 98%);
  --grad-panel:  linear-gradient(158deg, rgba(53, 214, 245, 0.10), rgba(255, 255, 255, 0.02));
  --grad-mesh:
    radial-gradient(920px 480px at 10% -8%,  rgba(53, 214, 245, 0.17), transparent 62%),
    radial-gradient(780px 440px at 94%  2%,  rgba(74, 143, 231, 0.19), transparent 60%),
    radial-gradient(900px 640px at 50% 106%, rgba(139, 124, 246, 0.10), transparent 66%);

  /* Type */
  --font-sans:    'InterVar', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'GroteskVar', var(--font-sans);
  --font-mono:    ui-monospace, 'SFMono-Regular', 'JetBrains Mono', Menlo, Consolas, monospace;

  /* Scale — fluid, clamped */
  --t-xs:   0.75rem;
  --t-sm:   0.828rem;
  --t-base: 0.938rem;
  --t-md:   1.02rem;
  --t-lg:   clamp(1.1rem,  0.4vw + 1rem,    1.24rem);
  --t-xl:   clamp(1.32rem, 0.9vw + 1.05rem, 1.6rem);
  --t-2xl:  clamp(1.6rem,  1.6vw + 1.1rem,  2.2rem);
  --t-3xl:  clamp(2rem,    2.6vw + 1.2rem,  3rem);
  --t-4xl:  clamp(2.4rem,  4.4vw + 1.1rem,  4.1rem);

  /* Space */
  --gap-1: 4px;  --gap-2: 8px;  --gap-3: 12px; --gap-4: 16px;
  --gap-5: 22px; --gap-6: 30px; --gap-7: 42px; --gap-8: 60px;
  --section-y: clamp(56px, 8vw, 116px);

  /* Radii */
  --r-sm: 8px;  --r-md: 12px; --r-lg: 18px;
  --r-xl: 24px; --r-2xl: 32px; --r-pill: 999px;

  /* Shadow */
  --sh-sm:   0 2px 8px rgba(0, 0, 0, 0.28);
  --sh-md:   0 12px 30px rgba(0, 0, 0, 0.36);
  --sh-lg:   0 24px 60px rgba(0, 0, 0, 0.46);
  --sh-glow: 0 10px 34px rgba(53, 214, 245, 0.28);

  /* Motion */
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast:  0.16s;
  --dur:       0.28s;
  --dur-slow:  0.55s;

  /* Layout */
  --shell:      1200px;
  --shell-wide: 1380px;
  --shell-text: 46rem;
  --header-h:   68px;

  --z-header: 100;
  --z-drawer: 200;
  --z-modal:  300;
  --z-toast:  400;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  tab-size: 2;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--t-base);
  line-height: 1.68;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.025em;
  color: #fff;
  text-wrap: balance;
}
h1 { font-size: var(--t-4xl); letter-spacing: -0.035em; }
h2 { font-size: var(--t-3xl); letter-spacing: -0.03em; }
h3 { font-size: var(--t-xl); }
h4 { font-size: var(--t-lg); }
h5, h6 { font-size: var(--t-md); }

p { margin: 0 0 1.1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--cyan); text-decoration: none; transition: color var(--dur-fast) var(--ease); }
a:hover { color: #7ce6ff; }

img, svg, video, canvas { display: block; max-width: 100%; }
img, video { height: auto; }

ul, ol { margin: 0 0 1.1em; padding-left: 1.35em; }
li { margin-bottom: 0.35em; }

hr { border: 0; border-top: 1px solid var(--line); margin: var(--gap-6) 0; }

code, pre, kbd, samp { font-family: var(--font-mono); font-size: 0.88em; }
code {
  padding: 0.15em 0.42em;
  border-radius: var(--r-sm);
  background: rgba(53, 214, 245, 0.10);
  border: 1px solid var(--line-2);
  color: #9fe9ff;
}
pre {
  margin: 0 0 1.2em;
  padding: var(--gap-5);
  overflow-x: auto;
  border-radius: var(--r-lg);
  background: #030a17;
  border: 1px solid var(--line);
  line-height: 1.62;
}
pre code { padding: 0; background: none; border: 0; color: #d5e6f7; }

blockquote {
  margin: 0 0 1.2em;
  padding: var(--gap-4) var(--gap-5);
  border-left: 3px solid var(--cyan);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: rgba(53, 214, 245, 0.06);
  color: var(--ink-2);
}
blockquote p:last-child { margin-bottom: 0; }

table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
th { font-weight: 600; color: #fff; background: var(--surface); white-space: nowrap; }
td { color: var(--ink-2); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

::selection { background: rgba(53, 214, 245, 0.32); color: #fff; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Scrollbar — Firefox then WebKit */
* { scrollbar-width: thin; scrollbar-color: rgba(120, 180, 255, 0.28) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(120, 180, 255, 0.22);
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(53, 214, 245, 0.42); background-clip: content-box; }

/* --- Layout ------------------------------------------------------------ */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 28px);
}
.shell--wide { max-width: var(--shell-wide); }
.shell--text { max-width: var(--shell-text); }

.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: clamp(36px, 5vw, 64px); }
.section--flush-top { padding-top: 0; }

.stack     { display: flex; flex-direction: column; gap: var(--gap-4); }
.row       { display: flex; align-items: center; gap: var(--gap-3); flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--nowrap  { flex-wrap: nowrap; }
.spacer    { flex: 1 1 auto; }

.grid { display: grid; gap: var(--gap-4); }
.grid--auto  { grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }
.grid--auto-sm { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.grid--auto-lg { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* Two-column page splits (content + sidebar, form + summary, …).
   These exist as classes rather than inline `style="grid-template-columns:…"`
   because an inline declaration cannot be overridden by a media query, so the
   pages that used inline splits stayed two-up on phones and overflowed. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(26px, 4vw, 50px);
  align-items: start;
}
.split--center       { align-items: center; }
.split--sidebar      { grid-template-columns: minmax(0, 1fr) minmax(0, 300px); }
.split--docs         { grid-template-columns: minmax(0, 250px) minmax(0, 1fr); }
.split--lead-left    { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.split--lead-left-sm { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.split--lead-right   { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }

@media (max-width: 900px) {
  .split,
  .split--sidebar,
  .split--docs,
  .split--lead-left,
  .split--lead-left-sm,
  .split--lead-right { grid-template-columns: minmax(0, 1fr); }
  /* A sidebar that follows its content on desktop belongs below it on mobile,
     which is already the DOM order — except the docs nav, which leads. */
  .split--docs > :first-child { order: -1; }
}

/* --- Type utilities ---------------------------------------------------- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--gap-3);
  font-family: var(--font-sans);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cyan);
}
.kicker::before {
  content: '';
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(53, 214, 245, 0.07);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
}

.lead {
  font-size: var(--t-lg);
  line-height: 1.72;
  color: var(--ink-2);
  max-width: 62ch;
}
.muted     { color: var(--ink-3); }
.muted-2   { color: var(--ink-4); }
.small     { font-size: var(--t-sm); }
.tiny      { font-size: var(--t-xs); }
.mono      { font-family: var(--font-mono); }
.bold      { font-weight: 700; }
.center    { text-align: center; }
.center-x  { margin-inline: auto; }
.nowrap    { white-space: nowrap; }
.uppercase { text-transform: uppercase; letter-spacing: 0.08em; }

.gradient-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.accent-text { color: var(--cyan); }

.section-head { max-width: 60ch; margin-bottom: var(--gap-6); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head p { color: var(--ink-3); font-size: var(--t-md); margin-bottom: 0; }

.clamp-1, .clamp-2, .clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.clamp-1 { -webkit-line-clamp: 1; line-clamp: 1; }
.clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; line-clamp: 3; }

/* --- Icons ------------------------------------------------------------- */
.icon { flex: 0 0 auto; vertical-align: middle; }

.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Never let a flex parent squeeze the tile. Without this the tile shrinks
     to fit a long text sibling while the SVG inside keeps its fixed size, so
     the glyph spills out over the neighbouring text. That was the cause of the
     "overlapping icons" in the mega menu, service cards and value grids. */
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(53, 214, 245, 0.20), rgba(74, 143, 231, 0.12));
  color: var(--cyan);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.icon-tile--sm { width: 34px; height: 34px; border-radius: 10px; }
.icon-tile--lg { width: 58px; height: 58px; border-radius: 18px; }

.icon-tile[data-accent='blue']    { color: var(--blue);    background: linear-gradient(150deg, rgba(74, 143, 231, 0.22),  rgba(53, 214, 245, 0.10)); }
.icon-tile[data-accent='violet']  { color: var(--violet);  background: linear-gradient(150deg, rgba(139, 124, 246, 0.22), rgba(74, 143, 231, 0.10)); }
.icon-tile[data-accent='emerald'] { color: var(--emerald); background: linear-gradient(150deg, rgba(52, 211, 153, 0.20),  rgba(53, 214, 245, 0.10)); }
.icon-tile[data-accent='amber']   { color: var(--amber);   background: linear-gradient(150deg, rgba(251, 191, 36, 0.20),  rgba(251, 113, 133, 0.08)); }
.icon-tile[data-accent='rose']    { color: var(--rose);    background: linear-gradient(150deg, rgba(251, 113, 133, 0.20), rgba(139, 124, 246, 0.10)); }

/* --- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: var(--t-sm);
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease);
}
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.5; pointer-events: none; }

.btn--primary {
  background: var(--grad-brand);
  color: #041020;
  box-shadow: var(--sh-glow);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(53, 214, 245, 0.4); color: #041020; }

.btn--ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}
.btn--ghost:hover { border-color: var(--line-hot); color: var(--cyan); transform: translateY(-2px); }

.btn--outline { border-color: var(--line-hot); color: var(--cyan); background: transparent; }
.btn--outline:hover { background: rgba(53, 214, 245, 0.10); transform: translateY(-2px); }

.btn--subtle { background: var(--surface); color: var(--ink-2); }
.btn--subtle:hover { background: var(--surface-2); color: var(--ink); }

.btn--danger { background: rgba(248, 113, 113, 0.14); border-color: rgba(248, 113, 113, 0.36); color: #ffb1b1; }
.btn--danger:hover { background: rgba(248, 113, 113, 0.24); color: #fff; }

.btn--link { padding: 0; background: none; color: var(--cyan); border-radius: 0; }
.btn--link:hover { color: #7ce6ff; }

.btn--sm  { padding: 8px 15px;  font-size: var(--t-xs); gap: 6px; }
.btn--lg  { padding: 15px 30px; font-size: var(--t-md); }
.btn--block { width: 100%; }
.btn--icon { padding: 9px; width: 38px; height: 38px; }

/* Arrow nudge on hover */
.btn .icon-arrow { transition: transform var(--dur) var(--ease); }
.btn:hover .icon-arrow { transform: translateX(3px); }

/* --- Badges & pills ---------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--t-xs);
  font-weight: 650;
  line-height: 1.6;
  color: var(--ink-2);
  white-space: nowrap;
}
.badge--cyan    { color: var(--cyan);    border-color: rgba(53, 214, 245, 0.34);  background: rgba(53, 214, 245, 0.10); }
.badge--blue    { color: var(--blue);    border-color: rgba(74, 143, 231, 0.34);  background: rgba(74, 143, 231, 0.10); }
.badge--violet  { color: var(--violet);  border-color: rgba(139, 124, 246, 0.34); background: rgba(139, 124, 246, 0.10); }
.badge--success { color: var(--emerald); border-color: rgba(52, 211, 153, 0.34);  background: rgba(52, 211, 153, 0.10); }
.badge--emerald { color: var(--emerald); border-color: rgba(52, 211, 153, 0.34);  background: rgba(52, 211, 153, 0.10); }
.badge--warn    { color: var(--amber);   border-color: rgba(251, 191, 36, 0.34);  background: rgba(251, 191, 36, 0.10); }
.badge--amber   { color: var(--amber);   border-color: rgba(251, 191, 36, 0.34);  background: rgba(251, 191, 36, 0.10); }
.badge--danger  { color: var(--red);     border-color: rgba(248, 113, 113, 0.34); background: rgba(248, 113, 113, 0.10); }
.badge--rose    { color: var(--rose);    border-color: rgba(251, 113, 133, 0.34); background: rgba(251, 113, 133, 0.10); }
.badge--info    { color: var(--cyan);    border-color: rgba(53, 214, 245, 0.34);  background: rgba(53, 214, 245, 0.10); }
.badge--muted   { color: var(--ink-3); }

.badge--dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

/* --- Cards ------------------------------------------------------------- */
.card {
  position: relative;
  padding: var(--gap-5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease),
              background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card--hover:hover {
  transform: translateY(-5px);
  border-color: var(--line-hot);
  background: var(--surface-2);
  box-shadow: var(--sh-md), 0 0 0 1px rgba(53, 214, 245, 0.10);
}
.card--glass {
  background: var(--grad-panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.card--flush { padding: 0; overflow: hidden; }
.card--lg { padding: var(--gap-6); border-radius: var(--r-xl); }

.card__title { margin-bottom: 6px; font-size: var(--t-md); font-weight: 700; color: #fff; }
.card__text  { margin: 0; font-size: var(--t-sm); line-height: 1.68; color: var(--ink-3); }
.card__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-3); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease); }
.card--hover:hover .card__media img { transform: scale(1.05); }
.card__body  { padding: var(--gap-5); }
.card__foot  {
  display: flex; align-items: center; gap: var(--gap-3);
  padding-top: var(--gap-4); margin-top: var(--gap-4);
  border-top: 1px solid var(--line-2);
  font-size: var(--t-xs); color: var(--ink-4);
}

/* Animated gradient border for featured cards */
.card--featured { border-color: transparent; background-clip: padding-box; }
.card--featured::before {
  content: '';
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(120deg, var(--cyan), var(--blue), var(--violet), var(--cyan));
  background-size: 300% 300%;
  animation: border-flow 8s linear infinite;
  opacity: 0.55;
}
@keyframes border-flow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* Sheen sweep on hover */
.sheen { position: relative; overflow: hidden; }
.sheen::after {
  content: '';
  position: absolute;
  top: 0; left: -70%;
  width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.09), transparent);
  transform: skewX(-18deg);
  transition: left 0.65s var(--ease);
  pointer-events: none;
}
.sheen:hover::after { left: 130%; }

/* --- Panels & surfaces -------------------------------------------------- */
.panel {
  padding: var(--gap-6);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--grad-panel);
}
.panel--flat { background: var(--surface); }

.note {
  padding: var(--gap-4) var(--gap-5);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: rgba(53, 214, 245, 0.06);
  font-size: var(--t-sm);
  color: var(--ink-2);
}
.note--warn    { border-left-color: var(--amber);   background: rgba(251, 191, 36, 0.07); }
.note--danger  { border-left-color: var(--red);     background: rgba(248, 113, 113, 0.07); }
.note--success { border-left-color: var(--emerald); background: rgba(52, 211, 153, 0.07); }

/* --- Stars ------------------------------------------------------------- */
.stars { display: inline-flex; align-items: center; gap: 2px; }
.stars .star { display: inline-flex; line-height: 0; }
.star.is-on  { color: var(--amber); }
.star.is-on svg { fill: currentColor; }
.star.is-off { color: rgba(255, 255, 255, 0.18); }

/* --- Forms ------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: var(--gap-4); }
.field__label {
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--ink-2);
}
.field__label .req { color: var(--rose); margin-left: 2px; }
.field__hint  { font-size: var(--t-xs); color: var(--ink-4); line-height: 1.55; }
.field__error { font-size: var(--t-xs); color: #ffb1b1; }

.input, .select, .textarea,
input[type='text'], input[type='email'], input[type='url'], input[type='tel'],
input[type='number'], input[type='password'], input[type='search'],
input[type='date'], input[type='datetime-local'], select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(3, 10, 23, 0.6);
  color: var(--ink);
  font-size: var(--t-sm);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}
textarea { resize: vertical; min-height: 96px; line-height: 1.65; }

input::placeholder, textarea::placeholder { color: var(--ink-4); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--line-hot);
  background: rgba(3, 10, 23, 0.85);
  box-shadow: 0 0 0 3px rgba(53, 214, 245, 0.13);
}

select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238fa6c2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
select option { background: var(--bg-2); color: var(--ink); }

input[type='color'] { padding: 4px; height: 42px; cursor: pointer; }
input[type='file'] {
  padding: 9px;
  font-size: var(--t-xs);
  color: var(--ink-3);
  cursor: pointer;
}
input[type='file']::file-selector-button {
  margin-right: 12px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--t-xs);
  font-weight: 600;
  cursor: pointer;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--t-sm);
  color: var(--ink-2);
  cursor: pointer;
  line-height: 1.55;
}
.check input[type='checkbox'], .check input[type='radio'] {
  flex: 0 0 auto;
  width: 17px; height: 17px;
  margin: 2px 0 0;
  accent-color: var(--cyan);
  cursor: pointer;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 9px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.check-grid li { margin: 0; }
.check-grid label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: var(--t-sm);
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.check-grid label:hover { border-color: var(--line-hot); background: var(--surface-2); }
.check-grid input { accent-color: var(--cyan); width: 16px; height: 16px; }
.check-grid input:checked + span,
.check-grid label:has(input:checked) { color: var(--cyan); }
.check-grid label:has(input:checked) { border-color: var(--line-hot); background: rgba(53, 214, 245, 0.08); }

.field--error input, .field--error textarea, .field--error select {
  border-color: rgba(248, 113, 113, 0.6);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 0 var(--gap-4);
}
.form-grid .field--full { grid-column: 1 / -1; }

.honeypot { position: absolute !important; left: -9999px !important; opacity: 0; height: 0; }

/* --- Alerts / messages -------------------------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: var(--t-sm);
  color: var(--ink-2);
}
.alert--success { border-color: rgba(52, 211, 153, 0.35);  background: rgba(52, 211, 153, 0.09);  color: #a9f0d4; }
.alert--error,
.alert--danger  { border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.09); color: #ffc2c2; }
.alert--warning { border-color: rgba(251, 191, 36, 0.35);  background: rgba(251, 191, 36, 0.09);  color: #ffe0a3; }
.alert--info    { border-color: rgba(53, 214, 245, 0.35);  background: rgba(53, 214, 245, 0.09);  color: #b3ecfa; }

/* --- Tabs & filters ---------------------------------------------------- */
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  list-style: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--dur-fast) var(--ease);
}
.chip:hover { border-color: var(--line-hot); color: var(--ink); }
.chip.is-active {
  border-color: transparent;
  background: var(--grad-brand);
  color: #041020;
  box-shadow: 0 4px 14px rgba(53, 214, 245, 0.24);
}
.chip__count {
  padding: 1px 7px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.68rem;
}

/* Horizontal scroll container for chips on mobile */
.scroll-x {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x > * { flex-wrap: nowrap; }

/* --- Pagination -------------------------------------------------------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: var(--gap-7);
}
.pager a, .pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--ink-2);
  transition: all var(--dur-fast) var(--ease);
}
.pager a:hover { border-color: var(--line-hot); color: var(--cyan); }
.pager .is-current {
  border-color: transparent;
  background: var(--grad-brand);
  color: #041020;
}
.pager .is-gap { border: 0; background: none; min-width: 20px; color: var(--ink-4); }

/* --- Breadcrumbs ------------------------------------------------------- */
.crumbs { font-size: var(--t-xs); color: var(--ink-4); }
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.crumbs li { display: flex; align-items: center; gap: 7px; margin: 0; }
.crumbs li + li::before { content: '/'; color: rgba(120, 180, 255, 0.3); }
.crumbs a { color: var(--ink-4); }
.crumbs a:hover { color: var(--cyan); }
.crumbs [aria-current='page'] { color: var(--ink-2); }

/* --- Avatars ----------------------------------------------------------- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(53, 214, 245, 0.22), rgba(74, 143, 231, 0.14));
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: var(--t-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 32px; height: 32px; font-size: var(--t-xs); }
.avatar--lg { width: 62px; height: 62px; font-size: var(--t-md); }
.avatar--xl { width: 96px; height: 96px; font-size: var(--t-xl); }

/* --- Progress ---------------------------------------------------------- */
.meter {
  height: 7px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.meter__fill {
  height: 100%;
  border-radius: inherit;
  background: var(--grad-brand);
  transition: width 0.8s var(--ease);
}
.meter__fill--amber { background: linear-gradient(90deg, var(--amber), #f59e0b); }

/* --- Dividers ---------------------------------------------------------- */
.rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

/* --- Skip link --------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  z-index: calc(var(--z-header) + 10);
  padding: 10px 18px;
  border-radius: var(--r-md);
  background: var(--cyan);
  color: #041020;
  font-weight: 700;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 12px; color: #041020; }

/* --- Screen-reader only ------------------------------------------------ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Empty state ------------------------------------------------------- */
.empty {
  padding: var(--gap-8) var(--gap-5);
  border: 1px dashed var(--line);
  border-radius: var(--r-xl);
  background: rgba(255, 255, 255, 0.015);
  text-align: center;
  color: var(--ink-3);
}
.empty .icon-tile { margin: 0 auto var(--gap-4); }
.empty h3 { font-size: var(--t-lg); margin-bottom: 6px; }
.empty p { font-size: var(--t-sm); max-width: 46ch; margin-inline: auto; }

/* --- Motion primitives -------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-visible { opacity: 1; transform: none; }
[data-reveal='left']  { transform: translateX(-26px); }
[data-reveal='right'] { transform: translateX(26px); }
[data-reveal='scale'] { transform: scale(0.95); }
[data-reveal='fade']  { transform: none; }

@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-11px); }
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(53, 214, 245, 0.5); }
  70%  { box-shadow: 0 0 0 12px rgba(53, 214, 245, 0); }
  100% { box-shadow: 0 0 0 0 rgba(53, 214, 245, 0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.float { animation: float-y 6s var(--ease) infinite; }
.pulse { animation: pulse-ring 2.4s infinite; }

/* --- Reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* --- Print -------------------------------------------------------------- */
@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .btn, .no-print, canvas { display: none !important; }
  a { color: #000; text-decoration: underline; }
}
