/* hemi.hemishthanki.com — Material 3 in the home-page brand palette
   Brand: green rgb(84,121,95) + mist rgb(218,227,218), Oswald for brand type. */

:root {
  --green: #54795F;          /* brand primary, home hero background */
  --mist:  #DAE3DA;          /* brand surface, home quote band */

  --bg: var(--mist);
  --surface: #F5F9F3;
  --surface-high: #EAF1E9;
  --on-surface: #191E19;
  --on-surface-var: #414941;
  --outline: #A3B1A2;
  --outline-dim: #C2CEC1;

  --primary: var(--green);
  --on-primary: #FFFFFF;
  --primary-container: #CDE0CF;
  --on-primary-container: #12271A;

  --topbar-bg: var(--green);
  --on-topbar: var(--mist);

  --online: #256C3C;
  --offline: #BA1A1A;
  --unknown: #8A6E1F;
  --domain-ink: #4A6B54;   /* darker than --primary: keeps 4.5:1 on hovered cards */

  --shadow-1: 0 1px 2px rgba(20, 30, 22, .18), 0 1px 3px 1px rgba(20, 30, 22, .10);
  --shadow-2: 0 2px 6px 2px rgba(20, 30, 22, .12), 0 1px 2px rgba(20, 30, 22, .18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E130F;
    --surface: #181F19;
    --surface-high: #222B23;
    --on-surface: #DFE4DC;
    --on-surface-var: #B4BFB2;
    --outline: #5A6559;
    --outline-dim: #333C34;

    --primary: #A6CBAF;
    --on-primary: #16301F;
    --primary-container: #35513E;
    --on-primary-container: #CDE8D2;

    --topbar-bg: #16211A;
    --on-topbar: var(--mist);

    --online: #7FD99A;
    --offline: #FFB4AB;
    --unknown: #DBC26E;
    --domain-ink: var(--primary);

    --shadow-1: 0 1px 2px rgba(0, 0, 0, .45), 0 1px 3px 1px rgba(0, 0, 0, .25);
    --shadow-2: 0 2px 6px 2px rgba(0, 0, 0, .30), 0 1px 2px rgba(0, 0, 0, .45);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { height: 100%; }

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--on-surface);
  font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

.material-symbols-rounded {
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
  font-size: 24px;
  line-height: 1;
  user-select: none;
  /* Hidden (with layout reserved) until the icon font is confirmed loaded,
     so a blocked Google Fonts request never shows raw ligature words. */
  display: inline-block;
  width: 1em;
  height: 1em;
  overflow: hidden;
  flex: none;
  visibility: hidden;
}
.icons-ready .material-symbols-rounded { visibility: visible; }

/* ---------- Top app bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px clamp(16px, 4vw, 28px);
  background: var(--topbar-bg);
  color: var(--on-topbar);
  box-shadow: var(--shadow-1);
}

.seal {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #FFFFFF;
  flex: none;
}

.topbar-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand {
  font-family: "Oswald", "Roboto", sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: .04em;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-sub {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #FFFFFF; /* 4.9:1 on the light-mode green topbar; mist at .82 was 3.06:1 */
}

.icon-btn {
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--on-topbar);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color .15s;
}
.icon-btn:hover {
  background: rgba(218, 227, 218, .08);
  background: color-mix(in srgb, var(--on-topbar) 8%, transparent);
}
.icon-btn:active {
  background: rgba(218, 227, 218, .12);
  background: color-mix(in srgb, var(--on-topbar) 12%, transparent);
}
.icon-btn[aria-disabled="true"] { opacity: .55; cursor: default; }
.icon-btn[aria-disabled="true"]:hover { background: transparent; }

.icon-btn.spinning .material-symbols-rounded { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Layout ---------- */

main {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 28px) 24px;
}

/* ---------- Hero ---------- */

.hero {
  text-align: center;
  margin-bottom: clamp(28px, 5vw, 48px);
}

.hero-seal {
  width: clamp(96px, 18vw, 132px);
  height: auto;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: var(--shadow-1);
}

.hero h1 {
  font-family: "Oswald", "Roboto", sans-serif;
  font-weight: 700;
  font-size: clamp(30px, 6vw, 44px);
  letter-spacing: .03em;
  line-height: 1.15;
  margin-top: 18px;
}

.lede {
  margin-top: 8px;
  color: var(--on-surface-var);
  font-size: clamp(15px, 2.5vw, 17px);
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
}

.chips {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--outline);
  border-radius: 8px;
  background: var(--surface);
  color: var(--on-surface-var);
  font-size: 14px;
  font-weight: 500;
}
.chip .material-symbols-rounded { font-size: 18px; color: var(--primary); }

/* ---------- Groups ---------- */

.group { margin-bottom: clamp(24px, 4vw, 36px); }

.group h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Oswald", "Roboto", sans-serif;
  font-weight: 500;
  font-size: 20px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--on-surface-var);
  margin-bottom: 14px;
}
.group h2 .material-symbols-rounded { font-size: 22px; color: var(--primary); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

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

/* M3 elevated card: surface + shadow, no outline (never both) */
.card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 14px;
  padding: 18px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s, background-color .15s, transform .15s;
}

.card:hover {
  background: var(--surface-high);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}

.card:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Controls on green surfaces need a light ring — --primary is the exact
   topbar/footer color in light mode (1:1, invisible). */
.icon-btn:focus-visible,
footer a:focus-visible {
  outline: 3px solid var(--on-topbar);
  outline-offset: 2px;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-container);
  color: var(--on-primary-container);
  display: grid;
  place-items: center;
  flex: none;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.card-title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

.card-domain {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--domain-ink);
  overflow-wrap: anywhere;
}

.card-desc {
  margin-top: 3px;
  font-size: 14px;
  color: var(--on-surface-var);
}

.card-open {
  color: var(--on-surface-var);
  font-size: 20px;
  margin-top: 2px;
}

/* ---------- Status ---------- */

.card-status {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface-var);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--outline);
  flex: none;
}

.card-status[data-status="checking"] .status-dot {
  background: var(--unknown);
  animation: pulse 1.1s ease-in-out infinite;
}
.card-status[data-status="online"]  .status-dot { background: var(--online); }
.card-status[data-status="offline"] .status-dot { background: var(--offline); }

.card-status[data-status="online"]  .status-text { color: var(--online); }
.card-status[data-status="offline"] .status-text { color: var(--offline); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* ---------- Footer ---------- */

footer {
  background: var(--topbar-bg);
  color: #FFFFFF; /* 4.9:1 on light-mode green; mist was 3.74:1 at 15px */
  text-align: center;
  padding: 22px 16px;
  font-family: "Oswald", "Roboto", sans-serif;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .04em;
}

footer a {
  color: inherit;
  text-underline-offset: 3px;
}

/* ---------- Motion & small screens ---------- */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr; }
  .brand { font-size: 18px; }
}
