@layer theme, base, components, utilities;
/*
 * NCA Portal in SiteSeer's look (from ss-monorepo apps/main-platform/app/globals.css "App surface — SiteSeer look"):
 * a soft blue-grey page with a faint brand wash and grid at the top, white cards with a hairline and a long soft shadow,
 * mono eyebrows, pill buttons and tabs, mono table headers, and glass panels that float over maps (as Visualize's do).
 * The colours are the tokens and --ss-* triplets in packages/ui/src/globals.css; the type is Geist (apps/siteworld/src/index.css).
 * Everything sits in the components layer, so a utility on an element still wins.
 */
@layer components {
  /* the page behind the content: SiteSeer's app band (a brand wash and a fading 72 px grid) */
  .tl-band,
  .app-band {
    /* the grid below is drawn inside the band: without these it covered the page under the nearest positioned
       parent and took the clicks meant for the filters and tables there (an "absolute" utility still wins) */
    position: relative;
    isolation: isolate;
    background:
      radial-gradient(70% 120% at 85% -10%, rgb(var(--ss-brand) / 0.12), transparent 60%),
      radial-gradient(50% 90% at 5% -20%, rgb(var(--ss-sky) / 0.18), transparent 70%);
  }
  .dark .tl-band,
  .dark .app-band {
    background:
      radial-gradient(70% 120% at 85% -10%, rgb(var(--ss-brand) / 0.2), transparent 60%),
      radial-gradient(50% 90% at 5% -20%, rgb(var(--ss-brand) / 0.1), transparent 70%);
  }
  .tl-band::after,
  .app-band::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
      linear-gradient(to right, rgb(var(--ss-ink) / 0.045) 1px, transparent 1px),
      linear-gradient(to bottom, rgb(var(--ss-ink) / 0.045) 1px, transparent 1px);
    background-size: 72px 72px;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
    mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  }
  .app-surface { background-color: rgb(var(--ss-bg)); }

  /* cards: 18 px, hairline, long soft shadow; a card inside a card stays flat */
  .ss-card {
    border: 1px solid rgb(var(--ss-line) / 0.9);
    border-radius: 18px;
    background-color: rgb(var(--ss-panel));
    box-shadow: var(--ss-shadow);
  }
  .ss-card .ss-card { box-shadow: none; border-radius: 14px; }
  a.ss-card:hover, button.ss-card:hover { box-shadow: var(--ss-shadow-lift); border-color: rgb(var(--ss-brand) / 0.35); }

  /* the mono eyebrow over a title or a figure */
  .ss-eyebrow {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgb(var(--ss-mute));
  }

  /* panels that float over a map: frosted glass, as in SiteSeer's Visualize viewer */
  .ss-glass {
    border: 1px solid rgb(var(--ss-line) / 0.75);
    border-radius: 20px;
    background-color: rgb(var(--ss-panel) / 0.93);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    backdrop-filter: blur(16px) saturate(150%);
    box-shadow: 0 2px 6px rgb(14 20 51 / 0.06), 0 24px 48px -24px rgb(14 20 51 / 0.45);
  }
  .dark .ss-glass { background-color: rgb(var(--ss-panel) / 0.82); }
  /* a card inside a floating panel is the panel's own section, not a card on a card */
  .ss-glass .ss-card { box-shadow: none; border-color: transparent; background-color: transparent; border-radius: 0; }
  .ss-glass-dark {
    border: 1px solid rgb(255 255 255 / 0.12);
    border-radius: 16px;
    background-color: rgb(7 10 28 / 0.72);
    color: #fff;
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
  }

  /* tables in the portal pages: mono header row, soft row hover */
  .app-surface table thead th {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgb(var(--ss-mute));
  }
  .app-surface table thead:is([class*="bg-muted"]) { background-color: rgb(var(--ss-soft) / 0.55); }
  .app-surface table tbody tr { transition: background-color 0.2s var(--ss-ease); }
  .app-surface table tbody tr:hover { background-color: rgb(var(--ss-brand) / 0.035); }

  /* page titles: lighter and tighter, the website's display voice */
  .app-surface :is(h1, h2):is(.font-semibold, .font-bold) { font-weight: 500; letter-spacing: -0.03em; }

  /* side bars that scroll: a thin bar that shows on hover */
  .rail-scroll { scrollbar-width: thin; scrollbar-color: transparent transparent; }
  .rail-scroll:hover { scrollbar-color: rgb(var(--ss-ink) / 0.22) transparent; }
  .rail-scroll::-webkit-scrollbar { width: 6px; }
  .rail-scroll::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
  .rail-scroll:hover::-webkit-scrollbar-thumb { background: rgb(var(--ss-ink) / 0.22); }

  /* rise-in for cards as a page opens */
  @media (prefers-reduced-motion: no-preference) {
    .ss-rise > * { animation: ss-rise 0.5s var(--ss-ease) both; }
    .ss-rise > *:nth-child(2) { animation-delay: 40ms; }
    .ss-rise > *:nth-child(3) { animation-delay: 80ms; }
    .ss-rise > *:nth-child(4) { animation-delay: 120ms; }
  }
}
@keyframes ss-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
::selection { background: rgb(var(--ss-brand)); color: #fff; }

/* Unlayered on purpose, as in SiteSeer's main platform: inside a portal page every bordered white panel becomes a SiteSeer
   card (18 px, hairline, soft shadow) even where a page still writes `rounded-lg border bg-card`; one inside another stays flat. */
.app-surface :is(.rounded-md, .rounded-lg, .rounded-xl, .rounded-2xl).border:is(.bg-card, .bg-white):not(.ss-flat) {
  border-radius: 18px;
  border-color: rgb(var(--ss-line) / 0.9);
  box-shadow: var(--ss-shadow);
}
.app-surface :is(.rounded-md, .rounded-lg, .rounded-xl, .rounded-2xl).border:is(.bg-card, .bg-white) :is(.rounded-md, .rounded-lg, .rounded-xl, .rounded-2xl).border:is(.bg-card, .bg-white),
.app-surface .ss-card :is(.rounded-md, .rounded-lg, .rounded-xl, .rounded-2xl).border:is(.bg-card, .bg-white) {
  box-shadow: none;
  border-radius: 14px;
}
.app-surface :is(input, select, textarea):is(.rounded-md, .rounded):not([type="checkbox"]):not([type="radio"]):not([type="range"]) { border-radius: 12px; }

/* The sign-in and registration pages came from Tilisi's landing (.tl): the same layout in SiteSeer's colours and Geist. */
@layer components {
  :root .tl {
    --tl-green: #2b44e0;
    --tl-green-deep: #1c2c9a;
    --tl-forest: #0e1433;
    --tl-lime: #9fb0ff;
    --tl-concrete: #5c647e;
    --tl-ink: #0e1433;
    --tl-mist: #f4f5f8;
    --tl-line: #dee2ed;
    font-family: var(--font-sans);
    font-weight: 400;
  }
  :root .tl :is(h1, h2) { letter-spacing: -0.03em; font-weight: 400; }
}
@layer components {
  :root .tl .tl-input { border-radius: 12px; border-color: rgb(var(--ss-line)); font-family: var(--font-sans); }
  :root .tl .tl-input:focus { border-color: rgb(var(--ss-brand) / 0.6); box-shadow: 0 0 0 4px rgb(var(--ss-brand) / 0.12); }
  :root .tl .tl-btn { border-radius: 999px; font-family: var(--font-sans); }
  :root .tl .tl-btn-green { box-shadow: 0 10px 24px -14px rgb(var(--ss-brand) / 0.9); }
}
