:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --ink: #1b2233;
  --ink-soft: #5b6478;
  --line: #e6e9f2;
  --brand: #3a6df0;
  --brand-deep: #2347b8;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 28, 56, .06), 0 8px 24px rgba(20, 28, 56, .06);
  --shadow-hover: 0 4px 10px rgba(20, 28, 56, .10), 0 16px 40px rgba(20, 28, 56, .12);
}

* { box-sizing: border-box; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 50% -120px, #e9f0ff 0%, rgba(233, 240, 255, 0) 70%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 48px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  font-size: 22px;
  line-height: 1;
  color: var(--brand);
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.site-nav {
  display: flex;
  gap: 22px;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.site-nav a:hover { color: var(--brand); }

/* ---------- Hero / Search ---------- */
.portal {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px) 56px;
}

.hero {
  text-align: center;
  padding: clamp(28px, 6vw, 64px) 0 clamp(24px, 4vw, 40px);
}

.hero-title {
  margin: 0 0 10px;
  font-size: clamp(26px, 4.5vw, 40px);
  font-weight: 800;
  letter-spacing: -.025em;
}

.hero-sub {
  margin: 0 0 28px;
  color: var(--ink-soft);
  font-size: clamp(15px, 2vw, 18px);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 640px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 6px 6px 18px;
  box-shadow: var(--shadow);
  transition: box-shadow .18s ease, border-color .18s ease;
}

.search:focus-within {
  border-color: var(--brand);
  box-shadow: var(--shadow-hover);
}

.search-icon {
  font-size: 17px;
  opacity: .55;
  flex: none;
}

.search-input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 17px;
  color: var(--ink);
  padding: 12px 6px;
  min-width: 0;
}

.search-input::placeholder { color: #9aa3b6; }

.search-btn {
  flex: none;
  border: 0;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 26px;
  border-radius: 999px;
  transition: background .15s ease;
}

.search-btn:hover { background: var(--brand-deep); }
.search-btn[disabled] { opacity: .6; cursor: default; }

.search-hint {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: #9aa3b6;
}

/* ---------- Site grid ---------- */
.grid-section { margin-top: 30px; }

.grid-title {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-soft);
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 8px;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .14s ease, box-shadow .14s ease;
}

.tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.tile-icon {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.tile-icon img {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.tile-letter {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  z-index: 0;
}

.tile-label {
  font-size: 12.5px;
  font-weight: 500;
  text-align: center;
  color: var(--ink-soft);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px clamp(16px, 4vw, 48px);
  text-align: center;
  background: var(--surface);
}

.footer-nav {
  display: flex;
  gap: 22px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.footer-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13.5px;
}

.footer-nav a:hover { color: var(--brand); }

.footer-copy {
  margin: 0;
  font-size: 12.5px;
  color: #9aa3b6;
}

/* ---------- Static legal pages ---------- */
.doc {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 48px) 64px;
}

.doc h1 {
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: -.02em;
  margin: 0 0 6px;
}

.doc .doc-updated {
  color: #9aa3b6;
  font-size: 13px;
  margin: 0 0 28px;
}

.doc h2 {
  font-size: 18px;
  margin: 30px 0 10px;
}

.doc p, .doc li {
  color: var(--ink-soft);
  line-height: 1.7;
  font-size: 15px;
}

.doc a { color: var(--brand); }

@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
  .search-btn { padding: 12px 18px; }
}
