:root {
  color-scheme: light;
  --bg: #f6f5f3;
  --bg-grad-1: #ff762532;
  --bg-grad-2: #f6f5f3;
  --brand-soft: rgba(255, 118, 37, 0.14);

  --surface: #ffffff;
  --surface-2: #fde3d2;

  --border: #ffe0d1;
  --border-strong: #ffc5aa;

  --text: #3d2118;
  --text-muted: #8f6f63;

  --primary: #ff7625;
  --swift-games-color: #ff8a4c;
  --primary-600: #e96518;
  --primary-700: #d9570d;
  --primary-50: #fff0e8;

  --on-primary: #ffffff;

  --correct: #ff7625;
  --present: #ffad7a;
  --absent: #9b8c85;
  --danger: #d94f4f;

  --shadow-sm: 0 1px 2px rgba(61, 33, 24, 0.05);
  --shadow-md: 0 10px 30px -12px rgba(255, 118, 37, 0.18);
  --shadow-lg: 0 30px 60px -20px rgba(255, 118, 37, 0.25);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --swift: #4154f1;

}

:root[data-theme="dark"] {
    --bg: #0e1228;
    --bg-grad-1: #141b3d;
    --bg-grad-2: #0d1330;

    --surface: #171d3a;
    --surface-2: #1c2446;

    --border: #27305a;
    --border-strong: #39457d;

    --text: #edf0ff;
    --text-muted: #a0a8d0;

    --primary: #6b7cff;
    --primary-600: #5b6dfc;
    --primary-700: #4b5eef;
    --primary-50: #1a2146;

    --on-primary: #ffffff;

    --absent: #4d5575;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(
      900px 500px at 80% -10%,
      var(--brand-soft),
      transparent 70%
    ),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { letter-spacing: -0.02em; margin: 0; }
.mono { font-family: "JetBrains Mono", "SF Mono", Menlo, monospace; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }


/* navbar */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.nav {
  --logo-height: 52px;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: color-mix(in oklab, var(--surface) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 66px;
}

.nav a {
  text-decoration: none;
  color: var(--navbar-link);
}

.navbar__logo-wrap {
  height: var(--logo-height);
  width: var(--logo-height);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navbar-logo-bg);
  border-radius: 8px;
  padding: 6px;
  overflow: hidden;
}

.navbar__logo {
  height: var(--logo-height);
  width: var(--logo-height);
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

.navbar__stack {
  height: var(--logo-height);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.navbar__site-name {
  flex: 0 0 65%;
  display: flex;
  align-items: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navbar-text);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navbar__brand-line {
  flex: 0 0 30%;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  color: var(--navbar-muted);
  line-height: 1;
  white-space: nowrap;
}

.navbar__brand-logo-wrap {
  height: 16px;
  width: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navbar-logo-bg);
  border-radius: 4px;
  padding: 2px;
  overflow: hidden;
}

.navbar__brand-logo {
  height: 12px;
  width: 12px;
  flex-shrink: 0;
  object-fit: contain;
}

.navbar__brand-name {
  font-weight: 600;
  text-decoration: underline;
}

.navbar__brand-name::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0%;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transition: width 1s ease;
}
.navbar__brand-name:hover::after {
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 3px;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
}
.lang-toggle .lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border: 0;
  border-radius: 999px;
  padding: 6px 11px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .2s ease, box-shadow .2s ease, color .2s ease;
}
.lang-toggle .lang-btn:hover { color: var(--text); }
.lang-toggle .lang-btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 10px 30px -18px rgba(13,16,32,.25);
}
.lang-toggle .flag {
  display: block;
  flex: none;
  width: 20px;
  height: 14px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08);
}
.lang-toggle button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 19px;
}

.swift-hub-badge-name {color: var(--swift);}
.swift-hub-badge:hover {font-weight: bold;}

.logo .dot {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #ffb070);
  box-shadow: 0 6px 16px -6px var(--brand);
}
.nav-spacer {
  flex: 1;
}
.seg {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}
.seg button {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  width: 42px;
  height: 32px;
  padding: 5px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.15s;
}
.seg button.active {
  background: var(--brand);
  color: #fff;
}
.seg img {
  display: block;
  width: 24px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.icon-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  width: 40px;
  height: 38px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
}
.theme-toggle { position: relative; overflow: hidden; display: grid; place-items: center; }
.theme-toggle svg { position: absolute; transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s; }
.theme-toggle .moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }
[data-theme="dark"] .theme-toggle .sun { opacity: 0; transform: rotate(90deg) scale(0.5); }
[data-theme="dark"] .theme-toggle .moon { opacity: 1; transform: rotate(0) scale(1); }
.icon-btn:hover {
  border-color: var(--brand);
}
.tools-back-wrap {
  padding-top: 18px;
}
.tools-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.tools-back span[aria-hidden="true"] {
  color: var(--brand);
  font-size: 20px;
  line-height: 1;
  transition: transform 0.15s;
}
.tools-back:hover {
  color: var(--text);
}
.tools-back:hover span[aria-hidden="true"] {
  transform: translateX(-3px);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  -webkit-backdrop-filter:saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  background: color-mix(in oklab, var(--bg) 75%, transparent);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--primary); color: var(--on-primary);
  display: grid; place-items: center; font-weight: 800; box-shadow: var(--shadow-sm);
}
.brand-name span { color: var(--swift); }
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-muted); font-size: 14px; font-weight: 500;
}
.back-link:hover { color: var(--text); }
.back-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--primary-50); color: var(--primary);
  display: grid; place-items: center;
}

.brand-logo {
  height: 40px;
  width: auto;
  display: block;
}

.brand-name span { color: var(--swift); }

.brand-name-swift span { color: var(--swift); }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 20px 0 20px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 12px; font-weight: 500;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }
.hero h1 {
  font-size: clamp(34px, 5vw, 60px); font-weight: 800;
  margin-top: 18px; line-height: 1.05;
}
.hero h1 .accent { color: var(--swift); }
.hero p { color: var(--text-muted); max-width: 560px; margin: 14px auto 0; font-size: 17px; }

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

/* Previous Grid
.grid { display: grid; gap: 18px; padding: 16px 0 30px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
*/

.grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    padding: 16px 0 30px;
}

/* Added flex and max-width */

.card {
  flex: 1 1 260px;
  max-width: 350px; /* or whatever fits your design */
  position: relative; overflow: hidden;
  background: var(--startbg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  display: block;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;

  background: var(--accent);

  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}


.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card:hover::before { opacity: 1; }
.card > * { position: relative; }
.card-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.card h3 { margin-top: 14px; font-size: 19px; font-weight: 700; }
.card p { margin: 6px 0 0; color: var(--text-muted); font-size: 14px; }
.card-cta { margin-top: 18px; color: var(--primary); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.card:hover .card-cta .arrow { transform: translateX(3px); }
.card-cta .arrow { transition: transform .2s ease; }
.card.placeholder { border-style: dashed; background: transparent; display: grid; place-items: center; text-align: center; color: var(--text-muted); min-height: 160px; }

.card-badge {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: var(--primary); color: var(--on-primary);
  border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  box-shadow: 0 4px 12px -4px color-mix(in oklab, var(--primary) 60%, transparent);
}

@media (max-width: 600px) {
  .nav-inner { height: auto; min-height: 66px; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
  .nav-inner .nav-spacer { display: none; }
  .nav-inner > .swift-brand-container { flex-basis: 100%; }
  .nav-inner > .seg { margin-left: auto; }
}

/* ---------- Footer ---------- */
.foot { padding: 12px 0; text-align: center; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); }
.swift-network-credit a {color: var(--swift); font-weight: bold;}