/* ---- Fonts: Cabin (body) ---- */
@font-face {
  font-family: "Cabin";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/cabin-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Cabin";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/cabin-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Cabin";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/cabin-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Fonts: Oswald (headings) ---- */
@font-face {
  font-family: "Oswald";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/oswald-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Oswald";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/oswald-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Oswald";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/oswald-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Oswald";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/oswald-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Oswald";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/oswald-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0b0d12;
  --surface: #14171f;
  --surface-2: #171b24;
  --surface-hover: #1b2030;
  --border: #242a37;
  --border-strong: #2f3646;
  --text: #eef1f6;
  --muted: #9aa4b5;
  --muted-2: #6c7688;
  --accent: #6d8bff;
  --accent-soft: rgba(109, 139, 255, 0.14);
  --accent-ink: #0b1120;
  --radius: 18px;
  --radius-sm: 11px;
  --maxw: 1120px;

  /* Brand fonts */
  --font-sans:    "Cabin", ui-sans-serif, system-ui, sans-serif;
  --font-heading: "Oswald", "Arial Narrow", ui-sans-serif, sans-serif;

  /* Brand tokens */
  --brand-black:     #000;
  --brand-white:     #fff;
  --brand-grey:      #8a8a8a;
  --brand-grey-soft: #ededed;
}

* { box-sizing: border-box; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: 0.02em;
  font-weight: 600;
}

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(109, 139, 255, 0.10), transparent 55%),
    radial-gradient(900px 500px at 0% 0%, rgba(80, 200, 160, 0.06), transparent 50%),
    var(--bg);
  background-attachment: fixed;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

/* ---- Loading ---- */
.loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
}

/* ---- Sign-in ---- */
.signin {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.signin-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 44px 36px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
/* ---- Sign-in logo + orbit ring ---- */
.logo-wrap {
  position: relative;
  width: 210px;
  height: 210px;
  margin: 0 auto 4px;
}
/* dashed orbit circle */
.logo-wrap::before {
  content: '';
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 1px dashed var(--border-strong);
}
.signin-card .logo {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  /* centred in the 210×210 wrapper */
  left: 73px;
  top: 73px;
}
/* 5 orbit icons at 72° intervals, radius 85px from center (105,105) */
.orbit-icon {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 5px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}
.orbit-icon:nth-child(2) { left:  85px; top:    0; } /* top        -90° */
.orbit-icon:nth-child(3) { left: 166px; top:   59px; } /* upper-right -18° */
.orbit-icon:nth-child(4) { left: 135px; top:  154px; } /* lower-right  54° */
.orbit-icon:nth-child(5) { left:  35px; top:  154px; } /* lower-left  126° */
.orbit-icon:nth-child(6) { left:   4px; top:   59px; } /* upper-left  198° */
.signin-card h1 { margin: 12px 0 6px; font-size: 27px; }
.signin-card p { color: var(--muted); margin: 0 0 26px; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  padding: 8px 15px;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); background: var(--surface-2); }

/* ---- Top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(11, 13, 18, 0.72);
  backdrop-filter: blur(12px);
}
.brand { font-weight: 700; font-size: 16px; letter-spacing: 0.1px; display: flex; align-items: center; }
.brand-mark { width: 22px; height: 22px; border-radius: 5px; margin-right: 8px; vertical-align: middle; display: inline-block; }
.user { display: flex; align-items: center; gap: 16px; }
.user-email { color: var(--muted); font-size: 14px; }

/* ---- Layout ---- */
.grid-wrap { max-width: var(--maxw); margin: 0 auto; padding: 56px 32px 80px; }

.intro { margin: 0 0 32px; }
.intro h1 {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 700;
}
.intro p { margin: 0; color: var(--muted); font-size: 16px; }

/* ---- Grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 22px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 26px 22px;
  text-decoration: none;
  color: inherit;
  min-height: 210px;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s, background 0.18s;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  background: linear-gradient(180deg, var(--surface-hover), var(--surface-2));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--accent-soft);
}

.card-icon {
  width: 68px;
  height: 68px;
  display: block;
  border-radius: 15px;
  flex: none;
}

.card-name {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.card-desc {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.badge {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 3px 11px;
}
.arrow {
  color: var(--accent);
  font-weight: 700;
  font-size: 18px;
  transition: transform 0.18s;
}
.card:hover .arrow { transform: translateX(4px); }

@media (max-width: 768px) {
  /* grid already handled by min() trick; this is a safety fallback */
  .grid { grid-template-columns: 1fr; }

  .grid-wrap { padding: 32px 16px 56px; }

  /* topbar: wrap brand + user onto separate lines if needed, tighten padding */
  .topbar { flex-wrap: wrap; gap: 8px; padding: 14px 16px; }

  /* prevent long email from blowing out the topbar */
  .user-email { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* signin card: less side padding on narrow screens */
  .signin-card { padding: 32px 20px; }

  /* 44px minimum tap targets for buttons (iOS HIG) */
  .btn, .btn-ghost {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}
