/*
  Nocturne design system — shared foundation for gzarruk.com and its subpages.
  Quiet, compact, dark blue-grey UI; Inter type; a single blurple accent used
  as line/glow, never a flood. Tokens and component classes recreated from the
  design handoff (design_handoff_gzarruk_site/README.md).

  Pages add only their page-specific layout/components in a local <style>.
*/

:root {
  /* Core colors */
  --color-bg: #161826;
  --color-surface: #232532;
  --color-text: #e9e9ed;
  --color-accent: #9184d9;
  --color-divider: color-mix(in srgb, #e9e9ed 16%, transparent);

  /* Accent ramp */
  --color-accent-100: #f5f4ff;
  --color-accent-300: #d2cefd;
  --color-accent-500: #968ae0;
  --color-accent-700: #5d5294;
  --color-accent-900: #2b2741;

  /* Neutral ramp */
  --color-neutral-100: #f3f5fe;
  --color-neutral-300: #cfd3e5;
  --color-neutral-400: #b2b6ca;
  --color-neutral-500: #9397ab;
  --color-neutral-700: #595d6c;
  --color-neutral-800: #3f424d;
  --color-neutral-900: #292b31;

  /* Type */
  --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  /* Shadows (elevation rings) */
  --shadow-sm: 0 0 0 1px #3f424d;
  --shadow-md: 0 0 0 1px #595d6c, 0 6px 18px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 0 0 1px #9397ab, 0 16px 40px rgba(0, 0, 0, 0.65);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--color-text);
  /* Lit ground: accent-tinted radial bloom top-right + black fall-off bottom-left */
  background:
    radial-gradient(1200px 720px at 90% -180px, color-mix(in srgb, var(--color-accent-900) 72%, transparent), transparent 60%),
    radial-gradient(1000px 820px at -12% 108%, color-mix(in srgb, black 30%, transparent), transparent 55%),
    var(--color-bg);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 500; /* Nocturne: never bold past 500 */
  line-height: 1.2;
  margin: 0;
}

a { color: var(--color-accent); }
a:hover { color: var(--color-accent-300); }

/* Accent focus ring instead of browser default */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ---- Kicker: accent dash + uppercase label ---- */

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-accent);
}
.kicker::before {
  content: "";
  flex: none;
  width: 40px;
  height: 1px;
  background: var(--color-accent);
}
.kicker-sm { gap: 10px; letter-spacing: 0.06em; }
.kicker-sm::before { width: 28px; }

/* Fading section rule */
.rule-fade {
  height: 1px;
  background: linear-gradient(to right,
    transparent,
    var(--color-divider) 48px,
    var(--color-divider) calc(100% - 48px),
    transparent);
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 13px;
  line-height: 1;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
.btn i { font-size: 15px; }

.btn-primary {
  background: var(--color-accent);
  color: var(--color-bg);
}
.btn-primary:hover { background: var(--color-accent-300); color: var(--color-bg); }

.btn-secondary {
  background: color-mix(in srgb, var(--color-surface) 70%, transparent);
  border-color: var(--color-divider);
  color: var(--color-text);
}
.btn-secondary:hover {
  border-color: color-mix(in srgb, var(--color-accent) 60%, transparent);
  background: color-mix(in srgb, var(--color-accent) 9%, transparent);
}

.btn-ghost {
  background: transparent;
  color: var(--color-accent);
}
.btn-ghost:hover {
  color: var(--color-accent-300);
  background: color-mix(in srgb, var(--color-accent) 9%, transparent);
}

.btn-icon { width: 34px; min-width: 34px; padding: 0; }

/* ---- Tags ---- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 6px;
}
.tag-accent {
  background: color-mix(in srgb, var(--color-accent) 24%, transparent);
  color: var(--color-accent-100);
}
.tag-neutral {
  background: color-mix(in srgb, var(--color-neutral-500) 22%, transparent);
  color: var(--color-neutral-100);
}

/* ---- Forms ---- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field > label {
  font-size: 12px;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
}

.input {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
  width: 100%;
  min-height: 38px;
  padding: 9px 11px;
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-surface) 60%, transparent);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
  color-scheme: dark;
}
.input::placeholder { color: color-mix(in srgb, var(--color-text) 38%, transparent); }
.input:hover { border-color: color-mix(in srgb, var(--color-text) 26%, transparent); }
.input:focus,
.input:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 22%, transparent);
}

textarea.input { min-height: 110px; resize: vertical; }

select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 256 256'%3E%3Cpath fill='%239397ab' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80A8 8 0 0 1 53.66 90.34L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
}
select.input option { background: var(--color-surface); color: var(--color-text); }

/* ---- Cards ---- */

.card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
}
.elev-sm { box-shadow: var(--shadow-sm); }

.card-kicker {
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 48%, transparent);
}
.card-title {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--color-text);
}
.card-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: color-mix(in srgb, var(--color-text) 66%, transparent);
}

/* ---- Segmented control ---- */

.seg {
  display: inline-flex;
  align-items: stretch;
  background: transparent;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.seg-opt {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-left: 1px solid var(--color-divider);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 12.5px;
  line-height: 1;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
.seg-opt:first-child { border-left: 0; }
.seg-opt:hover { background: color-mix(in srgb, var(--color-text) 5%, transparent); }
.seg-opt input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.seg-opt:has(input:checked) {
  color: var(--color-accent);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}
.seg-opt:has(input:focus-visible) {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

/* ---- Misc ---- */

.muted { color: color-mix(in srgb, var(--color-text) 60%, transparent); }
.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
