/* ==========================================================================
   Groupsync — Design system
   Type:  Sora (display) + Inter (UI/body)
   Palette: neutral ink/paper base + a fixed status language
            (To Do / In Progress / Done) that repeats from the marketing
            page into the real product, plus a user-selectable accent.
   Motion: one orchestrated load sequence on the hero, scroll reveals as
            sections enter view, and small hover/press feedback on
            anything interactive. Nothing animates just to animate.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Base neutrals — light (default) */
  --ink: #171A23;
  --ink-soft: #4A4F5E;
  --paper: #EEF0EA;
  --paper-raised: #F9FAF6;
  --line: #D7DACF;
  --line-strong: #B9BEAE;

  /* Fixed status language — same three colors used on the marketing
     hero board and inside the real dashboard, so the product feels
     familiar the moment someone logs in. */
  --status-todo: #7C86A0;
  --status-progress: #C98A2C;
  --status-done: #3F8F63;
  --status-todo-bg: #E4E6EE;
  --status-progress-bg: #F3E4C8;
  --status-done-bg: #DCEEE2;

  /* User-selectable accent — overridden by js/theme.js per person */
  --accent: #5B5FEF;
  --accent-ink: #FFFFFF;
  --accent-soft: #E4E4FB;

  --radius-s: 4px;
  --radius-m: 8px;
  --shadow-panel: 0 1px 0 var(--line);

  --font-display: 'Sora', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;

  --ease-out: cubic-bezier(.16,1,.3,1);
  --dur-s: .18s;
  --dur-m: .4s;

  color-scheme: light;
}

html[data-theme="dark"] {
  --ink: #EDEFE8;
  --ink-soft: #A9AEB8;
  --paper: #14161D;
  --paper-raised: #1B1E27;
  --line: #2B2F3A;
  --line-strong: #3B4050;

  --status-todo-bg: #232739;
  --status-progress-bg: #332818;
  --status-done-bg: #17301F;

  --accent-soft: #262A45;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}

p { max-width: 62ch; color: var(--ink-soft); }

a { color: inherit; }

img, svg { max-width: 100%; display: block; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

/* Focus visibility — kept simple and visible everywhere */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
[data-reveal].is-visible { opacity: 1; transform: none; }
[data-reveal="left"] { transform: translateY(0) translateX(-16px); }
[data-reveal="left"].is-visible { transform: none; }
[data-reveal="scale"] { transform: translateY(10px) scale(.97); }
[data-reveal="scale"].is-visible { transform: none; }

/* ---------- Hero ambient motion ---------- */
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-16px, 14px) scale(1.05); }
}
.hero-blob {
  position: absolute;
  width: 420px; height: 420px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .35;
  background: conic-gradient(from 120deg, var(--status-todo), var(--status-progress), var(--status-done), var(--status-todo));
  animation: drift 14s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}
header.hero { position: relative; overflow: hidden; }
header.hero .wrap { position: relative; z-index: 1; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  overflow: hidden;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 11px 20px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: transform var(--dur-s) var(--ease-out), opacity var(--dur-s) ease, box-shadow var(--dur-s) ease, border-color var(--dur-s) ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--accent) 60%, transparent); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  justify-content: center;
  border: 1px solid var(--line-strong);
  background: var(--paper-raised);
  color: var(--ink);
  border-radius: var(--radius-s);
  transition: border-color var(--dur-s) ease, transform var(--dur-m) var(--ease-out);
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }

/* ripple feedback, spawned by js/animations.js on click */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: .35;
  transform: scale(0);
  animation: ripple .55s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* sun/moon morph */
.btn-icon svg { transition: transform .5s var(--ease-out), opacity .3s ease; }
.btn-icon .icon-sun, .btn-icon .icon-moon { position: absolute; }
.btn-icon .icon-moon { opacity: 0; transform: rotate(-90deg) scale(.6); }
html[data-theme="dark"] .btn-icon .icon-sun { opacity: 0; transform: rotate(90deg) scale(.6); }
html[data-theme="dark"] .btn-icon .icon-moon { opacity: 1; transform: none; }
.btn-icon.theme-toggle { position: relative; }

/* ---------- Top navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  width: 26px; height: 26px; border-radius: 6px;
  background: linear-gradient(135deg, var(--status-todo), var(--status-progress) 50%, var(--status-done));
  background-size: 200% 200%;
  flex: none;
  transition: transform var(--dur-m) var(--ease-out);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.08); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a { position: relative; text-decoration: none; color: var(--ink-soft); font-weight: 500; font-size: .95rem; padding-bottom: 3px; }
.nav-links a::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: 0; height: 1.5px;
  background: var(--accent); transition: right var(--dur-m) var(--ease-out);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { right: 0; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- App shell (dashboard / settings / profile) ---------- */
.app-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.app-sidebar {
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.app-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.app-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-s);
  text-decoration: none; color: var(--ink-soft); font-size: .93rem; font-weight: 500;
}
.app-nav a:hover { background: var(--paper-raised); color: var(--ink); }
.app-nav a.is-active { background: var(--accent-soft); color: var(--ink); }
.app-nav .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .5; }

.app-main { padding: 28px 32px 60px; }
.app-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 26px; gap: 16px; flex-wrap: wrap;
}
.app-topbar .eyebrow-plain { color: var(--ink-soft); font-size: .9rem; margin: 0 0 4px; }

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { border-right: none; border-bottom: 1px solid var(--line); flex-direction: row; align-items: center; justify-content: space-between; }
  .app-nav { flex-direction: row; overflow-x: auto; }
}

/* ---------- Hero ---------- */
.hero { padding: 72px 0 88px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 4vw, 3.1rem); max-width: 15ch; }
.hero .lede { font-size: 1.08rem; }
.hero-cta { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

/* the one orchestrated load sequence */
@keyframes hero-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero-in { opacity: 0; animation: hero-in .7s var(--ease-out) forwards; }
.hero-in-1 { animation-delay: .05s; }
.hero-in-2 { animation-delay: .16s; }
.hero-in-3 { animation-delay: .27s; }
.hero-in-4 { animation-delay: .4s; }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
}

/* ---- Hero board mockup: the product itself, not a stock illustration ---- */
.board-mock {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 16px;
  box-shadow: var(--shadow-panel);
  transition: transform .25s var(--ease-out);
  transform-style: preserve-3d;
  will-change: transform;
}
.board-mock-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 4px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.board-mock-head .dots { display: flex; gap: 6px; }
.board-mock-head .dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); display: block; }
.board-mock-head .progress-pill {
  font-size: .78rem; font-weight: 600; color: var(--status-done);
  background: var(--status-done-bg); padding: 4px 10px; border-radius: 999px;
}
.board-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.board-col h4 { font-size: .78rem; text-transform: none; margin: 0 0 8px; color: var(--ink-soft); font-weight: 600; }
.card-task {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--c, var(--status-todo));
  border-radius: var(--radius-s);
  padding: 10px 10px;
  margin-bottom: 8px;
  font-size: .82rem;
  opacity: 0;
  transform: translateY(6px);
  animation: card-in .5s ease forwards;
}
.card-task .meta { color: var(--ink-soft); font-size: .74rem; margin-top: 5px; display: flex; align-items: center; gap: 5px; }
@keyframes card-in { to { opacity: 1; transform: none; } }

/* ---------- Sections ---------- */
section { padding: 64px 0; }
.section-head { max-width: 56ch; margin-bottom: 34px; }
.section-head h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }

.problem-block { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
@media (max-width: 820px) { .problem-block { grid-template-columns: 1fr; } }

/* Feature list — a real list with meaning-bearing structure, not a
   uniform SaaS card grid. Each row is one module from the system. */
.feature-list { border-top: 1px solid var(--line); }
.feature-row {
  position: relative;
  display: grid; grid-template-columns: 210px 1fr; gap: 24px;
  padding: 22px 0 22px 16px; margin-left: -16px;
  border-bottom: 1px solid var(--line);
  transition: padding-left var(--dur-m) var(--ease-out), background var(--dur-m) ease;
}
.feature-row:hover { padding-left: 26px; background: var(--paper-raised); }
.feature-row::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--c, var(--accent)); transform: scaleY(0); transform-origin: top;
  transition: transform var(--dur-m) var(--ease-out);
}
.feature-row:hover::before { transform: scaleY(1); }
.feature-row .module {
  font-family: var(--font-display); font-weight: 600; font-size: 1.02rem;
  display: flex; align-items: center; gap: 10px;
}
.feature-row .module .swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; transition: transform var(--dur-m) var(--ease-out); }
.feature-row:hover .module .swatch { transform: scale(1.3); }
.feature-row h3 { font-size: 1rem; margin-bottom: 4px; }
@media (max-width: 640px) { .feature-row { grid-template-columns: 1fr; gap: 6px; } }

/* Preview tiles linking to the real pages */
.preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .preview-grid { grid-template-columns: 1fr; } }
.preview-tile {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper-raised);
  display: block;
  transition: transform var(--dur-m) var(--ease-out), border-color var(--dur-s) ease, box-shadow var(--dur-m) var(--ease-out);
}
.preview-tile .frame { padding: 16px; height: 148px; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.preview-tile .frame-bar { height: 6px; width: 40%; border-radius: 3px; background: var(--line-strong); transition: width var(--dur-m) var(--ease-out); }
.preview-tile .label { padding: 14px 16px; border-top: 1px solid var(--line); }
.preview-tile .label strong { display: block; font-family: var(--font-display); font-size: .98rem; }
.preview-tile .label span { color: var(--ink-soft); font-size: .85rem; }
.preview-tile:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 14px 30px -14px rgba(0,0,0,.25);
}
.preview-tile:hover .frame-bar { width: 60%; }
.preview-tile:hover .frame-bar:nth-child(2) { width: 90%; }
.preview-tile:hover .frame-bar:nth-child(3) { width: 45%; }

/* Tech chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  border: 1px solid var(--line-strong);
  padding: 7px 14px; border-radius: 999px; font-size: .85rem; color: var(--ink-soft);
}

/* Users */
.user-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .user-grid { grid-template-columns: 1fr; } }
.user-card { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 22px; background: var(--paper-raised); }
.user-card ul { margin: 12px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: .92rem; }
.user-card li { margin-bottom: 6px; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--ink-soft); font-size: .85rem; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---------- Dashboard board ---------- */
.status-summary { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.status-card { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 18px; min-width: 140px; background: var(--paper-raised); transition: transform var(--dur-m) var(--ease-out); }
.status-card:hover { transform: translateY(-2px); }
.status-card .num { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; }
.status-card .lbl { font-size: .82rem; color: var(--ink-soft); }

.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .board { grid-template-columns: 1fr; } }
.board-column { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; }
.board-column-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.board-column-head .tag { font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.tag-todo { color: var(--status-todo); background: var(--status-todo-bg); }
.tag-progress { color: var(--status-progress); background: var(--status-progress-bg); }
.tag-done { color: var(--status-done); background: var(--status-done-bg); }

.task-card {
  background: var(--paper); border: 1px solid var(--line);
  border-left: 3px solid var(--c);
  border-radius: var(--radius-s); padding: 12px; margin-bottom: 10px;
  transition: transform var(--dur-s) var(--ease-out), box-shadow var(--dur-s) ease;
}
.task-card:hover { transform: translateX(3px); box-shadow: -3px 0 0 var(--c); }
.task-card .title { font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.task-card .meta { display: flex; align-items: center; justify-content: space-between; font-size: .78rem; color: var(--ink-soft); }
.avatar-chip {
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; font-size: .68rem; font-weight: 700;
}

/* ---------- Settings ---------- */
.settings-block { max-width: 640px; }
.settings-panel { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 22px 24px; margin-bottom: 20px; background: var(--paper-raised); }
.settings-panel h3 { font-size: 1.02rem; margin-bottom: 4px; }
.settings-panel .desc { color: var(--ink-soft); font-size: .88rem; margin-bottom: 18px; }

.mode-switcher { display: flex; gap: 10px; }
.mode-option {
  flex: 1; border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  padding: 14px; cursor: pointer; background: var(--paper); text-align: left;
  transition: border-color var(--dur-s) ease, box-shadow var(--dur-m) var(--ease-out), transform var(--dur-s) var(--ease-out);
}
.mode-option:hover { transform: translateY(-2px); }
.mode-option.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.mode-option strong { display: block; font-family: var(--font-display); font-size: .95rem; margin-bottom: 2px; }
.mode-option span { font-size: .8rem; color: var(--ink-soft); }
.mode-preview { width: 100%; height: 34px; border-radius: 4px; margin-bottom: 10px; border: 1px solid var(--line); }
.mode-preview.light { background: #F3F4EE; }
.mode-preview.dark { background: #14161D; }

.accent-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.accent-swatch {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; position: relative;
  transition: transform var(--dur-s) var(--ease-out), border-color var(--dur-s) ease;
}
.accent-swatch:hover { transform: scale(1.12); }
.accent-swatch.is-selected { border-color: var(--ink); animation: pop .35s var(--ease-out); }
.accent-swatch.is-selected::after {
  content: ''; position: absolute; inset: 6px; border-radius: 50%; border: 2px solid var(--paper-raised);
}
@keyframes pop { 0% { transform: scale(.8); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-s);
  border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font: inherit;
}

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: var(--radius-s);
  font-size: .88rem; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Profile ---------- */
.profile-head { display: flex; gap: 20px; align-items: center; margin-bottom: 30px; }
.avatar-big {
  width: 68px; height: 68px; border-radius: 50%; background: var(--accent);
  color: var(--accent-ink); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; flex: none;
}
.profile-stats { display: flex; gap: 14px; margin: 22px 0 30px; flex-wrap: wrap; }
.profile-stat { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 20px; background: var(--paper-raised); }
.profile-stat .num { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; }
.profile-stat .lbl { font-size: .8rem; color: var(--ink-soft); }
.ws-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.ws-list li { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.ws-list .role { color: var(--ink-soft); font-size: .82rem; }