/* ==========================================================================
   Banana Club — Application Portal
   ========================================================================== */

:root {
  --ink:        #111111;
  --ink-soft:   #5F6368;
  --bg:         #F8F6F1;
  --surface:    #FFFFFF;
  --line:       #E7E2D8;
  --line-strong:#D8D1C2;
  --accent:     #F4C430;
  --beige:      #F1EDE3;

  --radius:     14px;
  --radius-sm:  10px;
  --shadow:     0 1px 2px rgba(17, 17, 17, .04);
  --shadow-lift:0 10px 28px rgba(17, 17, 17, .09);
  --ease:       cubic-bezier(.2, .7, .3, 1);
  --speed:      180ms;

  --container:  1240px;
  --gutter:     24px;
}

*, *::before, *::after { box-sizing: border-box; }

/* `display: grid` on .app-grid / .state would otherwise beat the UA rule. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Focus ---------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: top var(--speed) var(--ease);
}
.skip-link:focus { top: 16px; }

/* Header --------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(248, 246, 241, .86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

/* Wordmark already reads "Banana Club" — no repeated text beside it. */
.brand-logo {
  height: 28px;
  width: auto;
  flex: none;
}

.brand-divider {
  flex: none;
  width: 1px;
  height: 22px;
  background: var(--line-strong);
}

.brand-sub {
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: .01em;
  white-space: nowrap;
}

.profile {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.profile:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }

.profile-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--beige);
  color: var(--ink);
}
.profile-avatar svg { width: 18px; height: 18px; }

/* Search --------------------------------------------------------------- */

.search {
  position: relative;
  margin-bottom: 28px;
  max-width: 540px;
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  pointer-events: none;
}
.search-icon svg { width: 20px; height: 20px; }

.search-input {
  width: 100%;
  height: 58px;
  padding: 0 20px 0 52px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.search-input::placeholder { color: #9AA0A6; }
.search-input:hover { border-color: var(--line-strong); }
.search-input:focus,
.search-input:focus-visible {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(244, 196, 48, .28);
}
.search-input::-webkit-search-cancel-button { cursor: pointer; }

/* Applications --------------------------------------------------------- */

.apps { padding-block: 48px 80px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink);
}

.result-count {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

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

/* Card ----------------------------------------------------------------- */

.app-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition:
    transform var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease),
    border-color var(--speed) var(--ease);
}

.app-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lift);
}

.app-logo {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 13px;
  overflow: hidden;
}
.app-logo img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

/* Only the initial-letter fallback needs a tile behind it. */
.app-logo.is-fallback {
  background: var(--beige);
  border: 1px solid var(--line);
}

.app-logo-fallback {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink);
}

.app-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.app-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-name {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.app-desc {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.app-arrow {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  transition:
    transform var(--speed) var(--ease),
    background-color var(--speed) var(--ease),
    border-color var(--speed) var(--ease);
}
.app-arrow svg { width: 15px; height: 15px; }

.app-card:hover .app-arrow,
.app-card:focus-visible .app-arrow {
  transform: translateX(4px);
  background: var(--accent);
  border-color: var(--accent);
}

/* Card without a usable link */
.app-card.is-disabled {
  cursor: default;
  background: #FCFBF8;
}
.app-card.is-disabled:hover {
  transform: none;
  box-shadow: var(--shadow);
  border-color: var(--line);
}

.app-flag {
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--beige);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
}

/* States --------------------------------------------------------------- */

.state {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 4px;
  padding: 64px 24px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.state-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--beige);
  color: var(--ink-soft);
}
.state-icon svg { width: 22px; height: 22px; }

.state-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.state-text {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.state-text code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  background: var(--beige);
  padding: 1px 6px;
  border-radius: 5px;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-block: 32px;
}

.footer-brand {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .14em;
}

.footer-tags {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: .02em;
}

/* Responsive ----------------------------------------------------------- */

@media (min-width: 1600px) {
  :root { --container: 1400px; }
}

@media (max-width: 640px) {
  :root { --gutter: 18px; }

  .header-inner { min-height: 64px; }
  .brand { gap: 10px; }
  .brand-logo { height: 22px; }
  .brand-sub { font-size: 12px; }
  .profile { padding: 6px; }
  .profile-label { display: none; }

  .search-input { height: 54px; }

  .apps { padding-block: 44px 64px; }
  .app-grid { grid-template-columns: 1fr; gap: 16px; }

  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .brand-divider, .brand-sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
