* {
  box-sizing: border-box;
}

:root {
  --bg: #090a0c;
  --panel: rgba(24, 26, 31, 0.9);
  --panel-strong: rgba(38, 42, 49, 0.96);
  --panel-soft: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f5f5f2;
  --muted: #b8b6b0;
  --blue-glow: rgba(64, 126, 214, 0.34);
  --amber-glow: rgba(235, 148, 48, 0.22);
  --shadow-xl: 0 26px 60px rgba(0, 0, 0, 0.42);
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at top left, rgba(70, 120, 190, 0.18), transparent 32%),
    radial-gradient(circle at 85% 18%, rgba(230, 152, 58, 0.16), transparent 28%),
    linear-gradient(180deg, #101215 0%, #0b0c0f 42%, #060709 100%);
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  display: flex;
  flex-direction: column;
  color: var(--text);
  overflow: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.02), transparent 28%, rgba(255, 255, 255, 0.015) 70%, transparent 100%);
  mix-blend-mode: screen;
  opacity: 0.7;
}

body::after {
  background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.24) 66%, rgba(0, 0, 0, 0.5) 100%);
}

.page-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(18px);
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 14s ease-in-out infinite alternate;
}

.orb-one {
  top: 72px;
  left: -70px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(72, 132, 216, 0.32), rgba(72, 132, 216, 0));
}

.orb-two {
  right: -36px;
  top: 210px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(242, 159, 56, 0.24), rgba(242, 159, 56, 0));
  animation-duration: 11s;
}

.page-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.85));
}

.brand-watermark {
  position: fixed;
  right: 18px;
  top: 92px;
  width: min(23vw, 150px);
  opacity: 0.08;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.3));
  pointer-events: none;
  z-index: 0;
}

main {
  flex: 1;
  overflow-y: auto;
  padding-top: 18px;
  padding-bottom: 112px;
  background-color: transparent;
  position: relative;
  min-height: 0;
  z-index: 1;
}

/* TOP FADE */
main::before {
  content: "";
  position: fixed;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);

  width: 120%;
  height: 160px;

  background: linear-gradient(
    to bottom,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,0) 100%
  );

  filter: blur(8px);
  pointer-events: none;
  z-index: 1000; /* under header (1000), above content */
}

/* BOTTOM FADE */
main::after {
  content: "";
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);

  width: 120%;
  height: 90px;

  background: linear-gradient(
    to top,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,0) 100%
  );

  filter: blur(8px);
  pointer-events: none;
  z-index: 1000; /* under footer (1000), above content */
}


footer {
  position: fixed;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: min(90%, 720px);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(45, 49, 56, 0.96), rgba(19, 21, 24, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(14px);
  padding: 10px 14px;
  z-index: 9999;
  animation: footerFloatIn 420ms ease both;
}

footer nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
}

.footer-action {
  min-width: 124px;
  font-size: clamp(15px, 3vw, 20px);
  color: white;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 220ms ease, background 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.footer-action img {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
}

.footer-action:hover,
.footer-action:focus-visible {
  transform: translateY(-3px) scale(1.03);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.28);
}

.list-section {
  position: relative;
  margin: 0 12px 16px;
  padding: 16px 14px 14px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(31, 34, 39, 0.86), rgba(16, 17, 20, 0.92));
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: sectionRise 520ms cubic-bezier(.2,.9,.25,1) both;
}

.list-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 34%, transparent 68%, rgba(255, 255, 255, 0.02));
  pointer-events: none;
}

.app-purpose {
  position: relative;
  margin: 0 12px 18px;
  padding: 22px 18px 18px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(74, 124, 204, 0.24), transparent 34%),
    linear-gradient(145deg, rgba(34, 38, 43, 0.96), rgba(16, 17, 20, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-xl);
  color: rgb(236, 234, 232);
  overflow: hidden;
  animation: heroRise 620ms cubic-bezier(.2,.9,.25,1) both;
}

.app-purpose::after {
  content: "";
  position: absolute;
  inset: auto -30px -80px auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(241, 157, 62, 0.2), transparent 70%);
  pointer-events: none;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #d9d5cd;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.app-purpose h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.app-purpose p {
  margin: 0;
  font-size: 14px;
  color: rgb(220, 219, 217);
}

.hero-copy {
  max-width: 720px;
  font-size: 15px;
  line-height: 1.6;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.hero-tags span {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ede9e2;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.app-purpose .policy-links {
  margin-top: 16px;
  font-size: 13px;
}

.app-purpose .policy-links a {
  color: rgb(162, 203, 255);
  text-decoration: none;
}

.app-purpose .policy-links a:hover {
  color: rgb(201, 224, 255);
}

.section-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 12px;
}

.list-section a2 {
  margin-left: 4px;
  font-size: 22px;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  font-weight: 700;
  color: rgb(236, 234, 232);
  letter-spacing: -0.02em;
}

.list-group {
  list-style: none;
  position: relative;
  z-index: 1;
  padding: 8px;
  padding-bottom: 0;
  margin-top: 0;
  background: linear-gradient(180deg, rgba(9, 10, 12, 0.55), rgba(20, 21, 25, 0.62));
  border-radius: 22px;
}

.list-group li {
  position: relative;
  background-color: transparent;
  font-size: 1.1rem;
  border-radius: 20px;
  overflow: visible;
  margin-bottom: 8px;
  touch-action: pan-y;
  animation: rowSlideIn 480ms cubic-bezier(.2,.9,.25,1) both;
  animation-delay: var(--item-delay, 0ms);
}

.swipe-track {
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  padding-left: 14px;
  padding-right: 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: background-color 220ms ease, box-shadow 220ms ease;
}

.swipe-actions {
  position: absolute;
  top: 8px;
  right: 10px;
  bottom: 8px;
  width: 130px;
  display: flex;
  gap: 6px;
  z-index: 3;
  pointer-events: none;
  transform: translateX(112%);
  opacity: 0;
  transition: transform 250ms cubic-bezier(.2,.9,.25,1), opacity 180ms ease;
}

.swipe-btn {
  flex: 1;
  border: 0;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  font-size: 12px;
  text-transform: uppercase;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.26);
}

.swipe-btn.archive {
  background: linear-gradient(145deg, #305f99, #23426a);
}

.swipe-btn.delete {
  background: linear-gradient(145deg, #a63a3a, #742626);
}

.project-item.swiped .swipe-actions {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.project-item.swipe-bounce .swipe-actions {
  animation: actionsSettle 320ms cubic-bezier(.23,1.25,.32,1) both;
}

.project-item .swipe-btn:active {
  filter: brightness(1.1);
}

.list-group li:last-child {
  margin-bottom: 0;
}

.list-group li:hover .swipe-track {
  background-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.list-group li.clicked .swipe-track {
  background-color: rgba(0, 0, 0, 0.4);
}

.list-group li ul {
  color: rgb(236, 234, 232);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding-left: 0;
  padding-top: 9px;
  padding-bottom: 2px;
}

.list-group li ol {
  color: rgb(166, 163, 158);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding-left: 0;
  padding-bottom: 10px;
  border-bottom: 0;
}

/* Contract status colors */
.project-item.red {
  color: #ff4d4d;
  font-weight: 600;
}

.project-item.blue {
  color: #4da6ff;
  font-weight: 600;
}

.project-item.normal {
  color: #ffffff;
}

.project-item.archived {
  color: #ff9b3d;
  font-weight: 700;
}

/* ===========================
   POPUP FORM (MODAL)
   =========================== */

#form-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.87);
  backdrop-filter: blur(1px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

#form-container {
  position: relative;
  width: min(560px, 100%);
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(33, 36, 41, 0.98), rgba(17, 19, 22, 0.99));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.52);
  transform: translateY(14px) scale(0.97);
  opacity: 0;
  transition: transform 270ms cubic-bezier(.2,.9,.25,1), opacity 220ms ease;
}

#form-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

#form-overlay.is-visible #form-container {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.form-header h2 {
  margin: 0;
  color: #f6f6f6;
}

#form-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

#contract-form {
  display: grid;
  gap: 10px;
}

#contract-form input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

#contract-form input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.form-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #686868, #404040);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 220ms ease, box-shadow 220ms ease, filter 220ms ease;
}

.form-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.28);
  filter: brightness(1.05);
}

@keyframes footerFloatIn {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes heroRise {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
  70% {
    transform: translateY(-2px) scale(1.006);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sectionRise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rowSlideIn {
  from {
    opacity: 0;
    transform: translateY(9px) scale(0.985);
  }
  68% {
    transform: translateY(-1px) scale(1.01);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes actionsSettle {
  0% {
    transform: translateX(112%);
  }
  62% {
    transform: translateX(-4px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes orbFloat {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(12px, 18px, 0) scale(1.06);
  }
}

@media (max-width: 640px) {
  footer {
    width: calc(100% - 22px);
  }

  .app-purpose,
  .list-section {
    margin-left: 11px;
    margin-right: 11px;
  }

  .app-purpose {
    padding: 18px 14px 16px;
  }

  .hero-tags {
    gap: 8px;
  }

  .hero-tags span {
    font-size: 12px;
    padding: 7px 10px;
  }

  .footer-action {
    min-width: 108px;
    font-size: 16px;
    padding: 8px 12px;
  }

  .swipe-actions {
    width: 122px;
  }

  .brand-watermark {
    width: 104px;
    top: 84px;
    right: 10px;
  }
}

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