@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap");

:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --text: #1e293b;
  --text-secondary: #475569;
  --muted: #64748b;
  --border: rgba(15, 39, 68, 0.1);
  --border-strong: rgba(15, 39, 68, 0.16);
  --accent: #0066cc;
  --accent-soft: rgba(0, 102, 204, 0.1);
  --accent-hover: #0052a3;
  --accent-gradient: linear-gradient(135deg, #0066cc 0%, #0080e6 100%);
  --link: #0066cc;
  --success: #0066cc;
  --warning-bg: #f0f6fc;
  --warning-border: rgba(0, 102, 204, 0.2);
  --shadow-sm: 0 1px 2px rgba(15, 39, 68, 0.04);
  --shadow-md: 0 4px 24px -4px rgba(15, 39, 68, 0.1), 0 2px 8px -2px rgba(15, 39, 68, 0.05);
  --shadow-lg: 0 20px 50px -12px rgba(15, 39, 68, 0.14);
  --radius: 14px;
  --radius-sm: 10px;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --max: 1120px;
  --nav-h: 64px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220;
    --bg-elevated: #121c2e;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --muted: #64748b;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.14);
    --accent: #60a5fa;
    --accent-soft: rgba(96, 165, 250, 0.12);
    --accent-hover: #3b82f6;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    --link: #60a5fa;
    --warning-bg: #1a2744;
    --warning-border: rgba(96, 165, 250, 0.22);
    --shadow-md: 0 4px 24px -4px rgba(0, 0, 0, 0.45);
  }
  :root:not([data-theme="light"]) pre {
    background: #0f2744 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
  }
  :root:not([data-theme="light"]) th {
    background: rgba(255, 255, 255, 0.04) !important;
  }
}

[data-theme="dark"] {
  --bg: #0b1220;
  --bg-elevated: #121c2e;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --muted: #64748b;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.14);
  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.12);
  --accent-hover: #3b82f6;
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  --link: #60a5fa;
  --warning-bg: #1a2744;
  --warning-border: rgba(96, 165, 250, 0.22);
  --shadow-md: 0 4px 24px -4px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}
[data-theme="dark"] pre {
  background: #0f2744 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}
[data-theme="dark"] th {
  background: rgba(255, 255, 255, 0.04) !important;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 102, 204, 0.07), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(0, 128, 230, 0.04), transparent);
  pointer-events: none;
}
[data-theme="dark"] body::before {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(96, 165, 250, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(59, 130, 246, 0.05), transparent);
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: rgba(0, 102, 204, 0.28);
  text-underline-offset: 0.15em;
  transition: color var(--transition);
}
a:hover {
  color: var(--accent-hover);
  text-decoration-color: var(--accent-hover);
}
[data-theme="dark"] a {
  color: var(--link);
  text-decoration-color: rgba(96, 165, 250, 0.35);
}
[data-theme="dark"] a:hover {
  color: var(--accent-hover);
}

/* —— Nav —— */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 2rem);
  gap: 1.5rem;
  background: color-mix(in srgb, var(--bg-elevated) 82%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}

.topnav .brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}
.topnav .brand:hover {
  color: var(--text);
  text-decoration: none;
}

.topnav .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  gap: 0.05rem;
}

.topnav .brand-mark {
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.topnav .brand-tag {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.topnav .brand::before {
  content: "";
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-gradient);
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.22);
  flex-shrink: 0;
}

.topnav nav {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
  font-weight: 500;
}

.topnav nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  transition: background var(--transition), color var(--transition);
}
.topnav nav a:hover {
  color: var(--text);
  background: var(--accent-soft);
  text-decoration: none;
}
.topnav nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.topnav > .theme-toggle {
  margin-left: 0.5rem;
  flex-shrink: 0;
}
.topnav:not(:has(.topnav-end)) > nav {
  margin-left: auto;
}

.topnav-end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}

.lang-btn {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.38rem 0.62rem;
  border: none;
  background: var(--bg-elevated);
  color: var(--muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.lang-btn:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.lang-btn.is-active {
  background: var(--accent);
  color: var(--bg);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.theme-toggle:hover {
  color: var(--text);
  background: var(--accent-soft);
  border-color: transparent;
}
.theme-toggle .theme-icon {
  display: block;
}
[data-theme="light"] .theme-toggle .theme-icon--sun,
[data-theme="dark"] .theme-toggle .theme-icon--moon {
  display: none;
}

/* —— Layout —— */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2rem) 4rem;
  flex: 1;
  width: 100%;
}

.wrap > h1:first-child,
.page-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 1rem;
}

.wrap > p:first-of-type:not(.hero p),
.lead {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 46rem;
  margin: 0 0 1.75rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.back-link:hover {
  color: var(--text);
}

/* —— Hero (home) —— */
.hero {
  position: relative;
  padding: clamp(2rem, 5vw, 3rem) clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: 2.5rem;
  border-radius: calc(var(--radius) + 4px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: min(420px, 55%);
  height: 100%;
  background: var(--accent-gradient);
  opacity: 0.07;
  mask-image: linear-gradient(to left, black, transparent);
  -webkit-mask-image: linear-gradient(to left, black, transparent);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(0, 102, 204, 0.16);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 0 0 1rem;
  max-width: 14ch;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 38rem;
  margin: 0 0 1.5rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* —— Grid & cards —— */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.card {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.35rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card::before {
  display: none;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.card:hover::before {
  display: none;
}

.card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.card p {
  margin: 0 0 1.25rem;
  color: var(--text-secondary);
  font-size: 0.925rem;
  flex: 1;
  line-height: 1.55;
}

.card .tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.65rem;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  margin-bottom: 0.85rem;
  background: var(--accent-soft);
}

.card-icon.partner { background: rgba(0, 102, 204, 0.1); color: var(--accent); }
.card-icon.extranet { background: rgba(0, 128, 230, 0.1); color: var(--accent-hover); }
.card-icon.events { background: rgba(15, 39, 68, 0.08); color: #0f2744; }
.card-icon.arch { background: rgba(0, 77, 153, 0.1); color: var(--accent-3, #004d99); }

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--accent);
  color: #fff !important;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none !important;
  align-self: flex-start;
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.2);
}
.btn:hover {
  background: var(--accent-hover);
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 102, 204, 0.28);
  text-decoration: none !important;
}

.btn.secondary {
  background: var(--bg-elevated);
  color: var(--text) !important;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn.secondary:hover {
  background: var(--accent-soft);
  color: var(--accent) !important;
  border-color: rgba(0, 102, 204, 0.22);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary) !important;
  box-shadow: none;
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--accent-soft);
  color: var(--accent) !important;
}

/* —— Sections —— */
h2.section {
  margin: 2.75rem 0 1.15rem;
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
h2.section::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* —— Tables —— */
.table-wrap {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--bg-elevated);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: transparent;
  border: none;
  border-radius: 0;
}

th,
td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: color-mix(in srgb, var(--bg) 60%, var(--bg-elevated));
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background var(--transition);
}
tbody tr:hover td {
  background: var(--accent-soft);
}

/* —— Code —— */
code {
  font-family: var(--mono);
  font-size: 0.84em;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.15em 0.45em;
  border-radius: 6px;
  font-weight: 500;
}

pre {
  font-family: var(--mono);
  background: #0f2744;
  color: #e2e8f0;
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.55;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-md);
  margin: 1rem 0;
}
pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-weight: 400;
}

/* —— Notes & detail —— */
.note {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  font-size: 0.9rem;
  margin: 1.25rem 0;
  color: var(--text-secondary);
  line-height: 1.55;
}

.detail-panel {
  margin-top: 0.5rem;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

ul {
  padding-left: 1.25rem;
  color: var(--text-secondary);
}
li {
  margin-bottom: 0.4rem;
}

/* —— Resource list (home) —— */
.resource-grid {
  display: grid;
  gap: 0.65rem;
}

.resource-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 1rem 1.15rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.resource-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.resource-item strong {
  font-weight: 600;
  color: var(--text);
}
.resource-item span:last-child {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* —— Footer —— */
footer.site {
  border-top: 1px solid var(--border);
  padding: 1.75rem clamp(1rem, 4vw, 2rem);
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  background: color-mix(in srgb, var(--bg-elevated) 50%, transparent);
}

footer.site .footer-company {
  color: var(--text-secondary);
  font-weight: 500;
}

footer.site .footer-legal {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.45;
}

/* —— Utilities —— */
.muted {
  color: var(--muted);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.25rem 0;
}

@media (max-width: 640px) {
  .topnav {
    height: auto;
    min-height: var(--nav-h);
    flex-direction: column;
    align-items: flex-start;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
  }
  .topnav-end {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .topnav nav {
    width: 100%;
  }
  .lang-switch {
    align-self: flex-start;
  }
  .hero h1 {
    max-width: none;
  }
}
