/* TimeSpan — enterprise static SaaS design system */
:root {
  --ink: #0b1220;
  --ink-soft: #1e293b;
  --mist: #e8eef6;
  --mist-deep: #d5e0ee;
  --paper: #f7f9fc;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --line: rgba(15, 23, 42, 0.1);
  --muted: #64748b;
  --teal: #0d9488;
  --teal-bright: #14b8a6;
  --teal-deep: #0f766e;
  --danger: #b91c1c;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-ui: "Manrope", system-ui, sans-serif;
  --sidebar-w: 248px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--teal-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--teal);
}

h1,
h2,
h3,
.brand {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0;
}

p {
  margin: 0;
}

.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.75rem 1.35rem;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
    border-color 0.25s var(--ease), color 0.25s var(--ease);
  text-decoration: none;
}

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

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

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn-primary:hover {
  background: var(--ink-soft);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  border-color: rgba(15, 23, 42, 0.2);
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.btn-teal {
  background: var(--teal);
  color: #fff;
}

.btn-teal:hover {
  background: var(--teal-deep);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
}

.btn-ghost:hover {
  background: rgba(13, 148, 136, 0.08);
  color: var(--teal-deep);
}

.btn-sm {
  font-size: 0.82rem;
  padding: 0.4rem 0.75rem;
}

.btn-danger {
  background: transparent;
  border-color: rgba(185, 28, 28, 0.35);
  color: var(--danger);
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ========== Landing ========== */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.5rem 0.85rem;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.landing {
  min-height: 100vh;
  background: var(--paper);
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1.25rem, 4vw, 3rem);
  position: relative;
  z-index: 2;
}

.landing-nav--over-hero {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.04em;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark span,
.brand-mark em {
  font-style: normal;
  color: var(--teal);
}

.brand-mark--light {
  color: #fff;
}

.brand-mark--light span {
  color: var(--teal-bright);
}

.btn-on-hero {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

.btn-on-hero:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-on-hero-primary {
  background: #fff;
  color: var(--ink);
}

.btn-on-hero-primary:hover {
  background: var(--mist);
  color: var(--ink);
}

.btn-on-hero-ghost {
  color: rgba(255, 255, 255, 0.85);
}

.btn-on-hero-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      160deg,
      rgba(11, 18, 32, 0.55) 0%,
      rgba(11, 18, 32, 0.72) 45%,
      rgba(11, 18, 32, 0.92) 100%
    ),
    url("/portfolio/timespan/images/TimeSpan_Image.png") center / cover no-repeat;
  transform: scale(1.02);
  animation: hero-drift 18s ease-in-out infinite alternate;
}

@keyframes hero-drift {
  from {
    transform: scale(1.02) translateY(0);
  }
  to {
    transform: scale(1.06) translateY(-1.5%);
  }
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 38rem;
  padding: 6.5rem clamp(1.25rem, 4vw, 3rem) 4.5rem;
}

.hero-brand {
  font-size: clamp(3.4rem, 9vw, 6.5rem);
  font-weight: 700;
  color: #fff;
  margin: 0 0 1rem;
  line-height: 0.95;
}

.hero-brand em {
  font-style: normal;
  color: var(--teal-bright);
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.8vw, 1.7rem);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.hero-sub {
  font-size: 1.05rem;
  color: rgba(226, 232, 240, 0.88);
  max-width: 28rem;
  margin: 0 0 1.75rem;
}

.animate-rise {
  opacity: 0;
  animation: rise-in 0.9s var(--ease) forwards;
}

.delay-1 {
  animation-delay: 0.15s;
}

.delay-2 {
  animation-delay: 0.3s;
}

.delay-3 {
  animation-delay: 0.45s;
}

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

.section {
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.25rem, 4vw, 3rem);
  max-width: 1100px;
  margin: 0 auto;
}

.landing .mls-case {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
}

.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.75rem;
}

.section h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 0.75rem;
}

.section-lead {
  color: var(--muted);
  max-width: 36rem;
  margin-bottom: 2.5rem;
}

.feature-list {
  display: grid;
  gap: 2rem 2.5rem;
}

@media (min-width: 720px) {
  .feature-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-item h3 {
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}

.feature-item p {
  color: var(--muted);
  font-size: 0.95rem;
}

.steps {
  display: grid;
  gap: 1.5rem;
  counter-reset: step;
}

@media (min-width: 720px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step {
  padding-top: 0.5rem;
  border-top: 2px solid var(--teal);
}

.step::before {
  counter-increment: step;
  content: "0" counter(step);
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 0.5rem;
}

.step h3 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.step p {
  color: var(--muted);
  font-size: 0.95rem;
}

.pricing {
  display: grid;
  gap: 2rem 2.5rem;
}

@media (min-width: 800px) {
  .pricing {
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
  }
}

.price-plan {
  padding: 0;
  border: none;
  background: transparent;
}

.price-plan h3 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.price-plan .price {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin: 0.75rem 0;
}

.price-plan ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.price-plan li {
  padding: 0.3rem 0;
  border-top: 1px solid var(--line);
}

.price-plan li:first-child {
  border-top: none;
}

.landing-footer {
  padding: 2.5rem clamp(1.25rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
}

.landing-footer a {
  color: var(--muted);
  text-decoration: none;
}

.landing-footer a:hover {
  color: var(--ink);
}

@media (max-width: 640px) {
  .hero-inner {
    padding-bottom: 3rem;
  }

  .hero-media {
    background:
      linear-gradient(
        180deg,
        rgba(11, 18, 32, 0.7) 0%,
        rgba(11, 18, 32, 0.85) 40%,
        rgba(11, 18, 32, 0.95) 100%
      ),
      url("/portfolio/timespan/images/TimeSpan_Image.png") center / cover no-repeat;
  }
}

/* ========== App shell ========== */
.app-body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(20, 184, 166, 0.1), transparent 50%),
    var(--paper);
}

.app-shell {
  display: grid;
  min-height: 100vh;
}

@media (min-width: 900px) {
  .app-shell {
    grid-template-columns: var(--sidebar-w) 1fr;
  }
}

.sidebar {
  background: var(--surface-solid);
  border-right: 1px solid var(--line);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fade-shell 0.45s var(--ease);
}

@keyframes fade-shell {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.guest-chip {
  display: inline-flex;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teal-deep);
  background: rgba(13, 148, 136, 0.1);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.side-nav a {
  display: block;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.side-nav a:hover {
  background: rgba(15, 23, 42, 0.04);
}

.side-nav a.is-active {
  background: rgba(13, 148, 136, 0.12);
  color: var(--teal-deep);
}

.sidebar-foot {
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.5rem 0.85rem;
}

.app-main {
  padding: clamp(1.25rem, 3vw, 2rem);
  animation: fade-shell 0.5s var(--ease);
}

.view-panel[hidden] {
  display: none !important;
}

.view-panel.is-visible {
  animation: rise-in 0.4s var(--ease);
}

.panel-header {
  margin-bottom: 1.5rem;
}

.panel-header h1 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin-bottom: 0.35rem;
}

.map-block {
  margin-bottom: 1.75rem;
}

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

.map-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
}

#map {
  height: 280px;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--mist);
}

.people-block {
  margin-bottom: 1.25rem;
}

.person-row {
  display: grid;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 720px) {
  .person-row {
    grid-template-columns: 1fr 1.4fr 0.7fr 0.7fr auto;
    align-items: end;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field select {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  color: var(--ink);
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(13, 148, 136, 0.35);
  border-color: var(--teal);
}

.field-actions {
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
}

.planner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.25rem 0;
}

.results-box {
  margin-top: 1rem;
  padding: 1.15rem 1.25rem;
  border-left: 3px solid var(--teal);
  background: rgba(13, 148, 136, 0.06);
}

.results-box.is-error {
  border-left-color: var(--danger);
  background: rgba(185, 28, 28, 0.06);
}

.result-range {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0.4rem 0;
}

.local-lines {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.local-lines li {
  margin: 0.2rem 0;
}

.member-row,
.history-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.member-row > div:first-child,
.history-row > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.row-actions {
  display: flex;
  gap: 0.25rem;
}

.empty-state {
  color: var(--muted);
  padding: 1rem 0;
}

.team-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

@media (min-width: 720px) {
  .team-form {
    grid-template-columns: 1fr 1.2fr 0.7fr 0.7fr auto;
    align-items: end;
  }
}

.settings-form {
  max-width: 28rem;
  display: grid;
  gap: 1rem;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.status-msg {
  margin-top: 1rem;
  color: var(--teal-deep);
  font-weight: 600;
  font-size: 0.92rem;
}

.mobile-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}

@media (min-width: 900px) {
  .mobile-nav {
    display: none;
  }
}

.mobile-nav a {
  flex: 0 0 auto;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.mobile-nav a.is-active {
  border-color: var(--teal);
  color: var(--teal-deep);
  background: rgba(13, 148, 136, 0.1);
}

@media (max-width: 899px) {
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.75rem;
  }

  .side-nav {
    display: none;
  }

  .sidebar-foot {
    display: none;
  }
}

/* Leaflet tweaks */
.leaflet-container {
  font-family: var(--font-ui);
}
