/**
 * index.css — Copper Tally home (soft fintech dashboard)
 */

:root {
  --ct-bg: #EEF1F6;
  --ct-surface: #FFFFFF;
  --ct-ink: #0F172A;
  --ct-muted: #64748B;
  --ct-accent: #0D9488;
  --ct-accent-hover: #0F766E;
  --ct-accent-soft: #CCFBF1;
  --ct-border: #E2E8F0;
  --ct-max: 1200px;
  --ct-radius: 16px;
  --ct-radius-sm: 10px;
  --ct-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --ct-shadow-hover: 0 12px 40px rgba(15, 23, 42, 0.1);
  --ct-font: 'Plus Jakarta Sans', system-ui, sans-serif;
}

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

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
  max-width: 100%;
}

body.ct-body {
  font-family: var(--ct-font);
  background: var(--ct-bg);
  color: var(--ct-ink);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  -webkit-font-smoothing: antialiased;
}

body.ct-body--home {
  background:
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(13, 148, 136, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
    var(--ct-bg);
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.ct-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.ct-card-link:focus-visible {
  outline: 3px solid var(--ct-accent);
  outline-offset: 2px;
  border-radius: var(--ct-radius-sm);
}

/* —— Header —— */
.ct-header {
  position: sticky;
  top: 0;
  z-index: 200;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ct-border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.ct-header__row {
  max-width: var(--ct-max);
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.ct-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  margin-right: auto;
}

.ct-brand__name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ct-ink);
  letter-spacing: -0.02em;
}

.ct-nav {
  display: flex;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.ct-nav a {
  text-decoration: none;
  color: var(--ct-muted);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}

.ct-nav a:hover {
  color: var(--ct-ink);
  background: var(--ct-bg);
}

.ct-nav a[aria-current="page"] {
  color: var(--ct-accent);
  background: var(--ct-accent-soft);
}

.ct-header__date {
  font-size: 0.75rem;
  color: var(--ct-muted);
  white-space: nowrap;
}

.ct-header__actions {
  display: flex;
  gap: 0.35rem;
}

.ct-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--ct-border);
  border-radius: var(--ct-radius-sm);
  background: var(--ct-surface);
  color: var(--ct-ink);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ct-icon-btn:hover {
  border-color: var(--ct-accent);
  box-shadow: var(--ct-shadow);
}

.ct-menu-btn { display: none; }

.ct-menu-btn__bar {
  display: block;
  width: 1rem;
  height: 2px;
  background: var(--ct-ink);
  box-shadow: 0 5px 0 var(--ct-ink), 0 -5px 0 var(--ct-ink);
}

.ct-chip-row {
  max-width: var(--ct-max);
  margin: 0 auto;
  padding: 0 1.25rem 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ct-chip {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--ct-bg);
  color: var(--ct-muted);
  border: 1px solid var(--ct-border);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ct-search-drawer {
  display: none;
  max-width: var(--ct-max);
  margin: 0 auto;
  padding: 0 1.25rem 0.65rem;
}

.ct-search-drawer.is-open { display: block; }

.ct-search {
  display: flex;
  align-items: center;
  background: var(--ct-bg);
  border: 1px solid var(--ct-border);
  border-radius: 999px;
  padding: 0.2rem 0.25rem 0.2rem 1rem;
  max-width: 420px;
}

.ct-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  outline: none;
  min-width: 0;
}

.ct-search button {
  border: none;
  background: var(--ct-accent);
  color: #fff;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* —— Main —— */
.ct-main {
  max-width: var(--ct-max);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
  width: 100%;
  min-width: 0;
  overflow-x: clip;
}

/* —— Hero banner card —— */
.ct-hero-wrap { margin-bottom: 0.75rem; }

.ct-hero {
  position: relative;
  border-radius: calc(var(--ct-radius) + 4px);
  overflow: hidden;
  min-height: 280px;
  background: var(--ct-surface);
  box-shadow: var(--ct-shadow);
  display: grid;
  grid-template-columns: 1fr;
}

.ct-hero__media {
  position: absolute;
  inset: 0;
}

.ct-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ct-hero__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(15, 23, 42, 0.88) 0%, rgba(15, 23, 42, 0.45) 55%, transparent 100%);
}

.ct-hero__body {
  position: relative;
  z-index: 1;
  padding: 2rem 1.75rem;
  max-width: 36rem;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 280px;
}

.ct-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--ct-accent);
  color: #fff;
  margin-bottom: 0.65rem;
}

.ct-hero__title {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.65rem;
}

.ct-hero__dek {
  font-size: 0.92rem;
  line-height: 1.55;
  opacity: 0.88;
  margin-bottom: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ct-meta {
  font-size: 0.75rem;
  opacity: 0.75;
}

.ct-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: #fff;
  color: var(--ct-ink);
  font-size: 0.78rem;
  font-weight: 700;
}

/* —— Layout —— */
.ct-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
  min-width: 0;
  max-width: 100%;
}

.ct-layout > * { min-width: 0; }

.ct-panel {
  background: var(--ct-surface);
  border-radius: var(--ct-radius);
  padding: 1.15rem 1.15rem 1.25rem;
  box-shadow: var(--ct-shadow);
  margin-bottom: 1.25rem;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

.ct-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ct-panel__head h2 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ct-panel__link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ct-accent);
  text-decoration: none;
}

.ct-panel__link:hover { text-decoration: underline; }

/* Card grid */
.ct-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.ct-card {
  border: 1px solid var(--ct-border);
  border-radius: var(--ct-radius-sm);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.ct-card:hover {
  box-shadow: var(--ct-shadow-hover);
  transform: translateY(-2px);
}

.ct-card__img {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--ct-bg);
}

.ct-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ct-card__body {
  padding: 0.75rem 0.85rem;
}

.ct-card__tag {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ct-accent);
  margin-bottom: 0.25rem;
}

.ct-card__title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Horizontal scroll (contained — does not scroll the page) */
.ct-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  overscroll-behavior-x: contain;
}

.ct-scroll__track {
  display: flex;
  gap: 0.85rem;
  padding-bottom: 0.25rem;
}

.ct-scroll-card {
  flex: 0 0 240px;
  border: 1px solid var(--ct-border);
  border-radius: var(--ct-radius-sm);
  overflow: hidden;
  background: var(--ct-surface);
  transition: box-shadow 0.2s;
}

.ct-scroll-card:hover { box-shadow: var(--ct-shadow-hover); }

.ct-scroll-card img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}

.ct-scroll-card__body { padding: 0.75rem; }

.ct-scroll-card h3 {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.32;
  margin: 0.25rem 0;
}

.ct-scroll-card p {
  font-size: 0.75rem;
  color: var(--ct-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Mini list */
.ct-mini-list { list-style: none; }

.ct-mini-list li {
  border-radius: var(--ct-radius-sm);
  transition: background 0.15s;
}

.ct-mini-list li + li { margin-top: 0.35rem; }

.ct-mini-list a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  text-decoration: none;
  border-radius: var(--ct-radius-sm);
}

.ct-mini-list a:hover { background: var(--ct-bg); }

.ct-mini-list__tag {
  flex-shrink: 0;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ct-accent);
  padding: 0.2rem 0.45rem;
  background: var(--ct-accent-soft);
  border-radius: 6px;
}

.ct-mini-list__title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
}

/* Widgets */
.ct-widget {
  background: var(--ct-surface);
  border-radius: var(--ct-radius);
  padding: 1rem;
  box-shadow: var(--ct-shadow);
  margin-bottom: 1rem;
  border: 1px solid var(--ct-border);
}

.ct-widget__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ct-muted);
  margin-bottom: 0.65rem;
}

.ct-widget__title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0.25rem 0;
}

.ct-widget__img {
  border-radius: var(--ct-radius-sm);
  overflow: hidden;
  margin-bottom: 0.65rem;
}

.ct-widget__img img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }

.ct-widget--feed .ct-feed { list-style: none; }

.ct-widget--feed .ct-feed li + li {
  border-top: 1px solid var(--ct-border);
}

.ct-widget--feed .ct-feed a {
  display: block;
  padding: 0.55rem 0;
  font-size: 0.78rem;
  line-height: 1.4;
  text-decoration: none;
}

.ct-widget--feed .ct-feed a:hover { color: var(--ct-accent); }

.ct-widget--feed time {
  display: block;
  font-size: 0.65rem;
  color: var(--ct-muted);
  margin-bottom: 0.15rem;
}

/* Feature band */
.ct-feature-wrap { margin-bottom: 1rem; }

.ct-feature {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 0;
  background: var(--ct-surface);
  border-radius: var(--ct-radius);
  overflow: hidden;
  box-shadow: var(--ct-shadow);
  border: 1px solid var(--ct-border);
}

.ct-feature__copy {
  padding: 1.5rem 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ct-feature__title {
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0.35rem 0 0.65rem;
}

.ct-feature__dek {
  font-size: 0.88rem;
  color: var(--ct-muted);
  line-height: 1.55;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ct-feature__img img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
}

/* Tabs */
.ct-panel--tabs { padding-top: 1rem; }

.ct-tab-bar {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--ct-border);
}

.ct-tab-bar__btn {
  border: none;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  color: var(--ct-muted);
  cursor: pointer;
}

.ct-tab-bar__btn.is-active {
  background: var(--ct-accent-soft);
  color: var(--ct-accent-hover);
}

.ct-tab-panel[hidden] { display: none; }

.ct-queue { list-style: none; }

.ct-queue-item + .ct-queue-item { margin-top: 0.5rem; }

.ct-queue-item .ct-card-link {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem;
  border-radius: var(--ct-radius-sm);
  border: 1px solid var(--ct-border);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ct-queue-item .ct-card-link:hover {
  border-color: var(--ct-accent);
  box-shadow: var(--ct-shadow);
}

.ct-queue-num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--ct-accent-soft);
  color: var(--ct-accent-hover);
  font-size: 0.75rem;
  font-weight: 700;
}

.ct-queue-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.32;
}

.ct-stack { display: flex; flex-direction: column; gap: 0.5rem; }

.ct-stack-item .ct-card-link {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem;
  border-radius: var(--ct-radius-sm);
  background: var(--ct-bg);
  transition: background 0.15s;
}

.ct-stack-item .ct-card-link:hover { background: var(--ct-accent-soft); }

.ct-stack-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.ct-stack-thumb img { width: 100%; height: 100%; object-fit: cover; }

.ct-stack-item h3 {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Onboard grid */
.ct-onboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.ct-onboard-card {
  padding: 1rem;
  border-radius: var(--ct-radius-sm);
  border: 1px solid var(--ct-border);
  background: var(--ct-bg);
  transition: box-shadow 0.2s, transform 0.2s;
}

.ct-onboard-card:hover {
  box-shadow: var(--ct-shadow);
  transform: translateY(-2px);
}

.ct-onboard-card h3 {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.32;
  margin: 0.25rem 0 0.35rem;
}

.ct-onboard-card p {
  font-size: 0.75rem;
  color: var(--ct-muted);
  line-height: 1.45;
}

/* Search */
.ct-search-panel {
  max-width: var(--ct-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.ct-search-hit {
  background: var(--ct-surface);
  border-radius: var(--ct-radius-sm);
  border: 1px solid var(--ct-border);
  margin-bottom: 0.65rem;
  box-shadow: var(--ct-shadow);
}

.ct-search-hit .ct-card-link {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 0.75rem;
  padding: 0.65rem;
}

.ct-search-hit img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.ct-empty {
  text-align: center;
  padding: 2rem;
  color: var(--ct-muted);
}

/* Footer */
.ct-footer {
  background: var(--ct-surface);
  border-top: 1px solid var(--ct-border);
  margin-top: auto;
  flex-shrink: 0;
}

.ct-footer__inner {
  max-width: var(--ct-max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: start;
}

.ct-footer__brand p {
  font-size: 0.875rem;
  color: var(--ct-muted);
  margin-top: 0.5rem;
  max-width: 28rem;
}

.ct-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.ct-footer__nav a {
  color: var(--ct-ink);
  text-decoration: none;
}

.ct-footer__nav a:hover { color: var(--ct-accent); }

.ct-footer__legal {
  max-width: var(--ct-max);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--ct-border);
  font-size: 0.68rem;
  color: var(--ct-muted);
  text-align: center;
}

.ct-footer__sep { opacity: 0.5; }

/* —— Responsive —— */
@media (max-width: 1024px) {
  .ct-layout { grid-template-columns: 1fr; }
  .ct-feature { grid-template-columns: 1fr; }
  .ct-onboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .ct-menu-btn { display: flex; }
  .ct-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    padding: 0.5rem 0;
  }
  .ct-nav.is-open { display: flex; }
  .ct-header__row { flex-wrap: wrap; }
  .ct-header__date {
    order: 3;
    width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .ct-header,
  .ct-chip-row,
  .ct-search-drawer {
    max-width: 100%;
    overflow-x: clip;
  }
  .ct-search {
    max-width: 100%;
    width: 100%;
  }
  .ct-card-grid { grid-template-columns: 1fr; }
  .ct-hero__body { padding: 1.25rem; min-height: 240px; }
  .ct-footer__inner { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .ct-card:hover, .ct-onboard-card:hover { transform: none; }
}
