/* ========================
   Tendril Terminal — Design System
   Aurelia Intelligence Corporation
   ======================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,500;1,400&family=Instrument+Serif:ital@0;1&display=swap');

/* ========================
   CSS Variables / Theming
   ======================== */
:root {
  /* Backgrounds */
  --bg-void: #0c1214;
  --bg-card: #131e1f;
  --bg-card-gradient: linear-gradient(165deg, #151f21, #0f1819);
  --bg-inset: #0e1816;
  --bg-elevated: #172322;

  /* Teal — Primary Accent */
  --teal-bright: #5aaa82;
  --teal-mid: #4a8a72;
  --teal-muted: #3a6a52;
  --teal-dim: #2a4a38;
  --teal-ghost: #1a2e24;

  /* Glow colors */
  --glow-teal: rgba(74, 138, 114, 0.12);
  --glow-teal-strong: rgba(90, 170, 130, 0.2);
  --glow-gold: rgba(138, 122, 82, 0.08);

  /* Neutrals — Salt & Stone */
  --text-primary: #c8d4cc;
  --text-secondary: #a8c4b4;
  --text-muted: #7a9a8a;
  --text-dim: #5a7a6a;
  --text-ghost: #4a6a5a;
  --text-buried: #3a5a4a;
  --text-almost-gone: #2a3a32;

  /* Borders */
  --border-default: #1e2e28;
  --border-hover: #2a4a3a;
  --border-active: #3a6a52;
  --border-faint: #1a2822;
  --border-inset: #1a2420;

  /* Status Colors */
  --status-confirmed-bg: #1a2e24;
  --status-confirmed-text: #5aaa82;
  --status-confirmed-border: #2a4a36;
  --status-pending-bg: #2a2218;
  --status-pending-text: #c49a5a;
  --status-pending-border: #4a3a22;
  --status-hot: #c47a4a;

  /* Gold Trace — Aurelia's Ghost */
  --gold-trace: #8a7a52;

  /* Error */
  --color-error: #c47a4a;

  /* Layout */
  --max-width: 1200px;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --spacing-xl: 4rem;
  --radius: 12px;

  /* Fonts */
  --font-mono: 'IBM Plex Mono', 'Fira Code', 'Courier New', monospace;
  --font-serif: 'Instrument Serif', serif;
}

/* ========================
   Reset & Base
   ======================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scrollbar-color: var(--text-almost-gone) var(--bg-void);
}

body {
  font-family: var(--font-mono);
  background-color: var(--bg-void);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 13px;
  font-weight: 400;
  position: relative;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(20, 40, 35, 0.6) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(14, 30, 25, 0.4) 0%, transparent 60%);
}

/* Noise Texture Overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

a {
  color: var(--teal-bright);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--teal-mid);
  text-decoration: none;
}

/* ========================
   Atmospheric Background Glows
   ======================== */
.atmosphere-glow {
  opacity: 0;
  will-change: opacity;
}

/* ========================
   Layout
   ======================== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--spacing-lg);
  flex: 1;
  position: relative;
  z-index: 1;
}

/* ========================
   Header
   ======================== */
.site-header {
  background: linear-gradient(180deg, rgba(12, 18, 20, 0.9) 0%, rgba(12, 18, 20, 0.4) 70%, transparent 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: none;
  padding: var(--spacing-md) var(--spacing-lg);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Header tide line */
.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 5%;
  right: 5%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(74, 138, 114, 0.15), rgba(74, 138, 114, 0.25), rgba(74, 138, 114, 0.15), transparent);
  /* The animated leaf chain (.bloom-band) is now the divider; hide this flat
     hairline. It returns only as the prefers-reduced-motion fallback. */
  opacity: 0;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--teal-bright);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(90, 170, 130, 0.15);
  transition: text-shadow 0.4s ease, color 0.3s ease;
}

.logo:hover {
  text-decoration: none;
  color: var(--teal-bright);
  text-shadow: 0 0 25px rgba(90, 170, 130, 0.3);
}

.nav-links {
  display: flex;
  gap: var(--spacing-md);
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.5px;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.nav-links a:hover {
  color: var(--teal-bright);
  text-shadow: 0 0 12px rgba(90, 170, 130, 0.2);
}

.logout-form {
  display: inline;
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}

.btn-link:hover {
  color: var(--teal-bright);
  text-decoration: none;
}

/* ========================
   Footer
   ======================== */
.site-footer {
  background-color: transparent;
  border-top: none;
  padding: var(--spacing-lg);
  margin-top: auto;
  position: relative;
  z-index: 1;
}

/* Footer tide line */
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 5%;
  right: 5%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(74, 138, 114, 0.12), rgba(74, 138, 114, 0.2), rgba(74, 138, 114, 0.12), transparent);
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.footer-container p {
  color: var(--text-buried);
  font-size: 11px;
}

.footer-links {
  display: flex;
  gap: var(--spacing-md);
  list-style: none;
}

.footer-links a {
  color: var(--text-buried);
  font-size: 11px;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--text-muted);
}

.aurelia-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-trace);
  text-decoration: none;
  opacity: 0.7;
  font-size: 11px;
  letter-spacing: 0.5px;
  transition: opacity 0.6s ease, filter 0.6s ease;
}

.aurelia-mark:hover {
  opacity: 1;
  filter: drop-shadow(0 0 12px rgba(138, 122, 82, 0.3));
}

.aurelia-logo {
  height: 28px;
  width: auto;
  display: block;
}

/* ========================
   Buttons
   ======================== */
.btn {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 8px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  border: none;
  font-size: 13px;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  transition: all 0.35s ease;
  position: relative;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(165deg, #2a5a44, #1e4a36);
  color: var(--teal-bright);
  border: 1px solid #3a6a4e;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.3),
    0 0 0 0 rgba(74, 138, 114, 0);
}

.btn-primary:hover {
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(74, 138, 114, 0.15),
    inset 0 1px 0 rgba(90, 170, 130, 0.15);
  border-color: var(--teal-mid);
  background: linear-gradient(165deg, #306848, #245a40);
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-hover);
}

.btn-secondary:hover {
  background: #1a2a22;
  color: var(--teal-bright);
  border-color: var(--teal-muted);
  box-shadow: 0 0 20px rgba(74, 138, 114, 0.08);
}

.btn-small {
  padding: 0.25rem 0.75rem;
  font-size: 11px;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-hover);
  color: var(--teal-bright);
}

.btn-outline:hover {
  background: rgba(26, 46, 36, 0.6);
  border-color: var(--teal-muted);
  box-shadow: 0 0 20px rgba(74, 138, 114, 0.1);
}

/* ========================
   OAuth Buttons
   ======================== */
.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}

.btn-oauth {
  padding: var(--spacing-md);
  border: 1px solid var(--border-default);
  background-color: var(--bg-inset);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.35s ease;
  text-align: center;
  display: block;
}

.btn-oauth:hover {
  border-color: var(--border-hover);
  background-color: var(--teal-ghost);
  box-shadow: 0 0 20px rgba(74, 138, 114, 0.06);
  transform: translateY(-1px);
}

/* ========================
   Forms
   ======================== */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 400;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-ghost);
  transition: color 0.3s ease;
}

.form-group:focus-within label {
  color: var(--teal-mid);
}

.form-group input {
  width: 100%;
  padding: 10px var(--spacing-md);
  border: 1px solid var(--border-inset);
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font-mono);
  background: var(--bg-inset);
  color: var(--text-primary);
  transition: all 0.4s ease;
}

.form-group input::placeholder {
  color: var(--text-buried);
}

.form-group input:focus {
  outline: none;
  border-color: var(--border-active);
  box-shadow:
    0 0 0 3px rgba(74, 138, 114, 0.1),
    0 0 20px rgba(74, 138, 114, 0.06);
  background: rgba(14, 24, 22, 0.8);
}

.input-error {
  border-color: var(--status-hot) !important;
  box-shadow:
    0 0 0 3px rgba(196, 122, 74, 0.1),
    0 0 16px rgba(196, 122, 74, 0.05) !important;
}

.form-error {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-error);
  background: rgba(196, 122, 74, 0.08);
  border: 1px solid rgba(196, 122, 74, 0.25);
  border-radius: 8px;
  padding: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-md);
  line-height: 1.6;
}

.form-notice {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--teal-bright);
  background: rgba(74, 138, 114, 0.08);
  border: 1px solid rgba(74, 138, 114, 0.25);
  border-radius: 8px;
  padding: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-md);
  line-height: 1.6;
}

.transactions {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
}
.transactions th,
.transactions td {
  text-align: left;
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid rgba(74, 138, 114, 0.15);
}
.transactions th {
  font-weight: 500;
  color: var(--text-buried);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
}
.transactions .tx-id {
  font-size: 11px;
  color: var(--text-buried);
  word-break: break-all;
}

.pw-wrap {
  position: relative;
}
.pw-wrap input {
  padding-right: 3.5rem;
}
.pw-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s ease, background 0.2s ease;
}
.pw-toggle:hover,
.pw-toggle:focus {
  outline: none;
  color: var(--teal-bright);
  background: rgba(74, 138, 114, 0.08);
}

.divider {
  display: flex;
  align-items: center;
  margin: var(--spacing-lg) 0;
  color: var(--text-buried);
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #4a8a7218, #4a8a7228, #4a8a7218, transparent);
}

.divider span {
  padding: 0 var(--spacing-md);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* ========================
   Auth Form
   ======================== */
.auth-form {
  max-width: 420px;
  margin: var(--spacing-xl) auto;
  padding: var(--spacing-lg) calc(var(--spacing-lg) + 0.5rem);
  background: var(--bg-card-gradient);
  border-radius: var(--radius);
  border: 1px solid var(--border-default);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 60px rgba(74, 138, 114, 0.03);
  transition: border-color 0.6s ease, box-shadow 0.6s ease;
}

.auth-form:hover {
  border-color: var(--border-hover);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(74, 138, 114, 0.05);
}

/* Top edge highlight — brighter */
.auth-form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(74, 138, 114, 0.35) 30%, rgba(90, 170, 130, 0.45) 50%, rgba(74, 138, 114, 0.35) 70%, transparent 95%);
  z-index: 2;
}

/* Bottom tide line */
.auth-form::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(74, 138, 114, 0.15), transparent);
}

.auth-form h1 {
  margin-bottom: var(--spacing-lg);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.auth-form .btn-primary {
  width: 100%;
  padding: 12px var(--spacing-md);
}

/* "or" divider between password login and social login */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin: var(--spacing-lg) 0;
  color: var(--text-dim);
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-default);
}

/* Social-login button — full width, distinct from the teal primary action */
.auth-form .btn-oauth {
  display: block;
  width: 100%;
  padding: 12px var(--spacing-md);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-hover);
}

.auth-form .btn-oauth:hover {
  color: var(--teal-bright);
  border-color: var(--teal-muted);
  box-shadow: 0 0 20px rgba(74, 138, 114, 0.08);
}

.auth-footer {
  margin-top: var(--spacing-lg);
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
}

.auth-footer a {
  color: var(--teal-bright);
}

/* ========================
   Hero Section
   ======================== */
.hero {
  text-align: center;
  padding: var(--spacing-xl) 0;
  padding-top: 8rem;
  position: relative;
}

.hero-greeting {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-ghost);
  margin-bottom: var(--spacing-md);
  font-family: var(--font-mono);
  font-weight: 400;
  opacity: 0;
  animation: fadeSlideUp 0.8s ease-out 0.2s forwards;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: 56px;
  font-weight: 400;
  font-style: italic;
  color: var(--teal-bright);
  margin-bottom: var(--spacing-lg);
  line-height: 1.15;
  text-shadow:
    0 0 40px rgba(90, 170, 130, 0.15),
    0 0 80px rgba(74, 138, 114, 0.06);
  opacity: 0;
  animation: heroReveal 1s ease-out 0.4s forwards;
}

@keyframes heroReveal {
  from {
    opacity: 0;
    transform: translateY(16px);
    text-shadow: 0 0 40px rgba(90, 170, 130, 0), 0 0 80px rgba(74, 138, 114, 0);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    text-shadow: 0 0 40px rgba(90, 170, 130, 0.15), 0 0 80px rgba(74, 138, 114, 0.06);
  }
}

.hero p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: var(--spacing-lg);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.9;
  opacity: 0;
  animation: fadeSlideUp 0.8s ease-out 0.7s forwards;
}

.hero .btn {
  opacity: 0;
  animation: fadeSlideUp 0.8s ease-out 0.9s forwards;
}

.hero-actions {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

/* ========================
   Terminal / Home
   ======================== */
.terminal {
  max-width: 720px;
  margin: 0 auto;
  padding-top: var(--spacing-lg);
}

.terminal-greeting {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-ghost);
  margin-bottom: var(--spacing-md);
}

.terminal-line {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin: var(--spacing-sm) 0;
}

.terminal-line .prompt {
  color: var(--teal-mid);
  margin-right: 0.5rem;
  user-select: none;
}

.terminal-notice {
  color: var(--teal-bright);
}

.home-actions {
  margin-top: var(--spacing-lg);
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.btn-large {
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: 14px;
}

/* ========================
   Section Markers
   ======================== */
.section-marker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--spacing-md);
}

.section-marker::before {
  content: '';
  display: block;
  width: 3px;
  height: 18px;
  background: linear-gradient(to bottom, var(--teal-bright), var(--teal-muted));
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(90, 170, 130, 0.2);
}

.section-marker h2 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  margin: 0;
}

/* ========================
   Dashboard
   ======================== */
.dashboard {
  position: relative;
}

.dashboard-greeting {
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 400;
  font-style: italic;
  color: var(--teal-bright);
  margin-bottom: calc(var(--spacing-lg) + 0.5rem);
  line-height: 1.2;
  text-shadow:
    0 0 30px rgba(90, 170, 130, 0.12),
    0 0 60px rgba(74, 138, 114, 0.04);
}

.dashboard-greeting span {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-style: normal;
  display: block;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: none;
}

/* ========================
   App launch tiles
   ======================== */
.launch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--spacing-md);
}

/* Square by design — aspect-ratio keeps the tiles square at every width. */
.launch-tile {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  text-align: center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  background: var(--bg-inset);
  color: var(--text-primary);
  font-family: var(--font-mono);
  transition: all 0.35s ease;
}

.launch-tile:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: var(--teal-muted);
  background: var(--teal-ghost);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.35),
    0 0 30px rgba(74, 138, 114, 0.12);
}

/* Unpaid: same footprint, visibly inert — no hover lift, no pointer. */
.launch-tile-locked,
.launch-tile-locked:hover {
  opacity: 0.45;
  transform: none;
  cursor: default;
  border-color: var(--border-default);
  background: var(--bg-inset);
  box-shadow: none;
}

.launch-unlock {
  margin-top: var(--spacing-md);
}

.launch-tile-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--teal-bright);
  letter-spacing: 0.5px;
}

.launch-tile-blurb {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

.launch-tile-action {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.launch-tile:not(.launch-tile-locked):hover .launch-tile-action {
  color: var(--teal-bright);
}

/* ========================
   Cards
   ======================== */
.card {
  background: var(--bg-card-gradient);
  border-radius: var(--radius);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  border: 1px solid var(--border-default);
  position: relative;
  overflow: hidden;
  transition: border-color 0.6s ease, box-shadow 0.6s ease, transform 0.4s ease;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.25),
    0 0 40px rgba(74, 138, 114, 0.02);
}

/* Top edge highlight */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(74, 138, 114, 0.3) 30%, rgba(90, 170, 130, 0.4) 50%, rgba(74, 138, 114, 0.3) 70%, transparent 95%);
  z-index: 1;
}

/* Bottom tide line */
.card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(74, 138, 114, 0.12), transparent);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.35),
    0 0 50px rgba(74, 138, 114, 0.05);
  transform: translateY(-1px);
}

.card h2 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
}

.placeholder {
  color: var(--text-dim);
  font-style: italic;
  font-size: 12px;
}

.dashboard-links {
  list-style: none;
}

.dashboard-links li {
  padding: var(--spacing-sm) 0;
  position: relative;
}

.dashboard-links li + li {
  border-top: none;
}

/* Tide line separator for dashboard links */
.dashboard-links li + li::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #4a8a7218, #4a8a7228, #4a8a7218, transparent);
}

.dashboard-links li:last-child {
  border-bottom: none;
}

.dashboard-links a {
  color: var(--text-muted);
  font-size: 13px;
  transition: color 0.3s ease, padding-left 0.3s ease;
  display: inline-block;
}

.dashboard-links a:hover {
  color: var(--teal-bright);
  padding-left: 4px;
}

/* ========================
   Status Badges
   ======================== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}

.badge-confirmed {
  background: var(--status-confirmed-bg);
  color: var(--status-confirmed-text);
  border: 1px solid var(--status-confirmed-border);
  box-shadow: 0 0 8px rgba(90, 170, 130, 0.08);
}

.badge-pending {
  background: var(--status-pending-bg);
  color: var(--status-pending-text);
  border: 1px solid var(--status-pending-border);
  box-shadow: 0 0 8px rgba(196, 154, 90, 0.06);
}

/* ========================
   Error Pages
   ======================== */
.error-page {
  text-align: center;
  padding: var(--spacing-xl) 0;
  padding-top: 8rem;
}

.error-page h1 {
  font-family: var(--font-serif);
  font-size: 80px;
  font-weight: 400;
  font-style: italic;
  color: var(--teal-dim);
  margin-bottom: var(--spacing-md);
  text-shadow: 0 0 40px rgba(42, 74, 56, 0.3);
  opacity: 0;
  animation: heroReveal 1s ease-out 0.3s forwards;
}

.error-page p {
  color: var(--text-muted);
  margin-bottom: var(--spacing-lg);
  font-size: 14px;
  line-height: 1.8;
}

.error-details {
  text-align: left;
  margin: var(--spacing-lg) auto;
  max-width: 600px;
  background: var(--bg-inset);
  padding: var(--spacing-md);
  border-radius: var(--radius);
  border: 1px solid var(--border-inset);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.error-details summary {
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.error-details pre {
  overflow-x: auto;
  font-size: 12px;
  color: var(--status-hot);
  margin-top: var(--spacing-sm);
  font-family: var(--font-mono);
}

/* ========================
   Search Bar
   ======================== */
.search-bar {
  position: relative;
  margin-bottom: var(--spacing-lg);
}

.search-bar input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--border-default);
  border-radius: 20px;
  background: var(--bg-inset);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  transition: all 0.4s ease;
}

.search-bar input::placeholder {
  color: var(--text-buried);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--border-active);
  box-shadow:
    0 0 0 3px rgba(74, 138, 114, 0.08),
    0 0 24px rgba(74, 138, 114, 0.06);
}

/* ========================
   Header-Line Bloom (leaf chain that is the header's bottom divider)
   ======================== */
/* The band straddles the header's bottom edge; its vertical centre sits on
   the divider baseline, and leaves are anchored there. Lives inside the
   sticky header so it rides along on scroll. */
.bloom-band {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  transform: translateY(50%);
  pointer-events: none;
  z-index: 1;
}

.bloom-band svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* Motifs: start at scale 0, opacity 0; unfurl with an elastic ease.
   --x / --y anchor the motif on the divider baseline; --rot leans it;
   --scale gives per-motif size variation; --delay (distance from centre)
   makes the chain grow from the middle out. */
.bloom-band .motif {
  opacity: 0;
  transform-box: fill-box;
  transform: translate(var(--x, 0px), var(--y, 0px))
             rotate(var(--rot, 0deg))
             scale(0);
  transition:
    opacity 0.6s ease var(--delay, 0s),
    transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) var(--delay, 0s);
}
.bloom-band.bloomed .motif {
  opacity: 1;
  transform: translate(var(--x, 0px), var(--y, 0px))
             rotate(var(--rot, 0deg))
             scale(var(--scale, 1));
}

/* Leaves unfurl from their stem/base (local origin = top-centre of the
   motif's box); flowers pop from their own centre. */
.bloom-band .motif-leaf    { transform-origin: 50% 0%; }
.bloom-band .motif-jasmine { transform-origin: 50% 50%; }

/* Hovering the header gives the divider a gentle shimmer. */
.bloom-band.pulse {
  filter: brightness(1.15);
  transition: filter 0.7s ease;
}

@media (prefers-reduced-motion: reduce) {
  /* Fall back to the plain hairline divider, no animated leaves. */
  .bloom-band { display: none; }
  .site-header::after { opacity: 1; }
}

/* ========================
   Animations
   ======================== */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tidalGlow {
  0%, 100% { opacity: 0.03; }
  50% { opacity: 0.08; }
}

@keyframes breathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Staggered entrance animations */
.animate-in {
  opacity: 0;
  animation: fadeSlideUp 0.6s ease-out forwards;
}

.animate-in:nth-child(1) { animation-delay: 0.15s; }
.animate-in:nth-child(2) { animation-delay: 0.3s; }
.animate-in:nth-child(3) { animation-delay: 0.45s; }
.animate-in:nth-child(4) { animation-delay: 0.6s; }
.animate-in:nth-child(5) { animation-delay: 0.75s; }

/* ========================
   Flash Messages
   ======================== */
.flash {
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 8px;
  margin-bottom: var(--spacing-md);
  font-size: 12px;
  border: 1px solid;
}

.flash-success {
  background: var(--status-confirmed-bg);
  color: var(--status-confirmed-text);
  border-color: var(--status-confirmed-border);
  box-shadow: 0 0 16px rgba(90, 170, 130, 0.06);
}

.flash-error {
  background: var(--status-pending-bg);
  color: var(--status-hot);
  border-color: var(--status-pending-border);
}

/* ========================
   End of Day Marker
   ======================== */
.end-marker {
  text-align: center;
  padding: var(--spacing-lg) 0;
  position: relative;
}

.end-marker span {
  color: var(--text-buried);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
  padding: 0 var(--spacing-md);
}

.end-marker::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #4a8a7218, #4a8a7228, #4a8a7218, transparent);
}

/* ========================
   Account Sub-Nav
   ======================== */
.account-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}

.account-nav-link {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-default);
  background: var(--bg-inset);
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.5px;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.account-nav-link:hover {
  border-color: var(--border-hover);
  color: var(--teal-bright);
}

.account-nav-link.is-active {
  border-color: var(--teal-muted);
  background: var(--teal-ghost);
  color: var(--teal-bright);
  box-shadow: 0 0 16px rgba(74, 138, 114, 0.08);
}

/* ========================
   Connected Apps
   ======================== */
.connected-apps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.app-tile {
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  background: var(--bg-inset);
  padding: var(--spacing-md);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.app-tile:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 20px rgba(74, 138, 114, 0.05);
}

.app-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
}

.app-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.app-txns {
  list-style: none;
  margin: var(--spacing-md) 0 var(--spacing-sm);
}

.app-txn {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: 6px 0;
  font-size: 12px;
  color: var(--text-muted);
}

.app-txn + .app-txn {
  border-top: 1px solid rgba(74, 138, 114, 0.1);
}

.app-txn-date {
  color: var(--text-dim);
  min-width: 92px;
}

.app-txn-amount {
  color: var(--text-primary);
  flex: 1;
}

.app-tile-btn {
  margin-top: var(--spacing-sm);
}

/* ========================
   Responsive
   ======================== */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: var(--spacing-md);
  }

  .footer-container {
    flex-direction: column;
    text-align: center;
  }

  .hero {
    padding-top: 5rem;
  }

  .hero h1 {
    font-size: 38px;
  }

  .dashboard-greeting {
    font-size: 36px;
  }

  .error-page {
    padding-top: 5rem;
  }

  .error-page h1 {
    font-size: 52px;
  }

  .card:hover {
    transform: none;
  }

  .btn:hover {
    transform: none;
  }
}

/* ========================
   Reduced Motion
   ======================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .animate-in {
    opacity: 1;
  }

  .hero-greeting,
  .hero h1,
  .hero p,
  .hero .btn {
    opacity: 1;
  }
}