/* Crystal design system. Warm paper, ink typography, prism accents. */

:root {
  --paper: #fcfbfa;
  --surface: #ffffff;
  --surface-2: #f9f8f6;
  --ink: #1e1f21;
  --ink-2: #4c4f54;
  --muted: #80838a;
  --line: #e5e4e1;
  --line-2: #efedea;
  --accent: #f06a6a;
  --accent-hover: #e35555;
  --accent-soft: #feeceb;
  --iris: #4f46e5;
  --iris-soft: #eef0ff;
  --cyan: #0891b2;
  --green: #0f9d6e;
  --green-soft: #e6f7f0;
  --amber: #d97706;
  --amber-soft: #fdf3e3;
  --red: #dc2626;
  --red-soft: #fdecec;
  --prism: linear-gradient(115deg, #f06a6a 0%, #8b5cf6 55%, #22d3ee 100%);
  --chip-bg: #f1efec;
  --nav-hover: #f3f1ee;
  --inverse-bg: #1e1f21;
  --inverse-fg: #ffffff;
  --header-bg: rgba(255, 255, 255, .82);
  --select-bg: #ffdcd6;
  --today-bg: #fffaf8;
  --today-ring: #f6c5bb;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(30, 31, 33, .05), 0 1px 6px rgba(30, 31, 33, .04);
  --shadow-md: 0 2px 6px rgba(30, 31, 33, .06), 0 12px 32px rgba(30, 31, 33, .09);
  --shadow-lg: 0 4px 12px rgba(30, 31, 33, .08), 0 24px 64px rgba(30, 31, 33, .16);
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
}

[data-theme="dark"] {
  --paper: #0b0e14;
  --surface: #141821;
  --surface-2: #10141c;
  --ink: #e9edf5;
  --ink-2: #b7bfcc;
  --muted: #7e8798;
  --line: #262d3b;
  --line-2: #1c222e;
  --accent: #f06a6a;
  --accent-hover: #f47f7f;
  --accent-soft: rgba(240, 106, 106, .14);
  --iris: #a5b4fc;
  --iris-soft: rgba(99, 102, 241, .17);
  --cyan: #67e8f9;
  --green: #34d399;
  --green-soft: rgba(16, 185, 129, .16);
  --amber: #fbbf24;
  --amber-soft: rgba(217, 119, 6, .18);
  --red: #f87171;
  --red-soft: rgba(220, 38, 38, .2);
  --chip-bg: #1d2330;
  --nav-hover: rgba(255, 255, 255, .08);
  --inverse-bg: #ffffff;
  --inverse-fg: #0b0e14;
  --header-bg: rgba(11, 14, 20, .75);
  --select-bg: #3b3f8f;
  --today-bg: #161b28;
  --today-ring: #3a4166;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 1px 6px rgba(0, 0, 0, .3);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, .45), 0 12px 32px rgba(0, 0, 0, .5);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, .5), 0 24px 64px rgba(0, 0, 0, .6);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--select-bg); }

h1, h2, h3.display { font-family: var(--font-display); font-weight: 560; letter-spacing: -.015em; line-height: 1.12; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px; }
.wrap-narrow { max-width: 880px; margin: 0 auto; padding: 0 28px; }

/* ------------------------------------------------------------- header */

.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--header-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-2);
}
.site-header .bar { display: flex; align-items: center; gap: 26px; height: 66px; }
.logo { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.logo .gem { width: 22px; height: 22px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav-links a {
  padding: 7px 13px; border-radius: 99px; font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--nav-hover); color: var(--ink); }
.nav-links a.active { background: var(--inverse-bg); color: var(--inverse-fg); }
.nav-cta { display: flex; align-items: center; gap: 10px; margin-left: 10px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 14px 5px 6px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: 13.5px; font-weight: 600; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em; box-shadow: inset 0 0 0 1.5px rgba(127, 127, 127, .35); }

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 99px; font-size: 14.5px; font-weight: 600;
  transition: transform .12s ease, box-shadow .15s, background .15s, opacity .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-md); }
.btn-prism { background: var(--prism); color: #fff; box-shadow: 0 4px 18px rgba(240, 106, 106, .35); }
.btn-prism:hover { filter: brightness(1.06); box-shadow: 0 6px 24px rgba(240, 106, 106, .45); }
.btn-ghost { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.btn-ghost:hover { border-color: var(--muted); background: var(--surface-2); }
.btn-soft { background: var(--iris-soft); color: var(--iris); }
.btn-soft:hover { background: #e3e6ff; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 15px 30px; font-size: 16px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* -------------------------------------------------------------- forms */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 14.5px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--iris); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
textarea.input { resize: vertical; min-height: 80px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.hint { font-size: 12.5px; color: var(--muted); }

/* -------------------------------------------------------------- cards */

.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 24px; }
.card-hover { transition: transform .18s ease, box-shadow .18s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-iris { background: var(--iris-soft); color: var(--iris); }
.badge-ink { background: var(--chip-bg); color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---------------------------------------------------------- marketing */

.hero { padding: 92px 0 70px; text-align: center; position: relative; overflow: hidden; }
.hero .eyebrow, .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.hero h1 { font-size: clamp(44px, 6.4vw, 76px); margin: 26px auto 20px; max-width: 15ch; }
.hero h1 .prism-text, .prism-text {
  background: var(--prism); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-style: italic; font-weight: 600;
}
.hero .sub { font-size: 18.5px; color: var(--ink-2); max-width: 56ch; margin: 0 auto 34px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-glow {
  position: absolute; inset: auto; top: -180px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 500px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(139, 92, 246, .14), rgba(34, 211, 238, .07), transparent 70%);
  pointer-events: none;
}

.section { padding: 76px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); margin: 14px 0 12px; }
.section-head p { color: var(--ink-2); font-size: 16.5px; }

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .grid-4, .grid-2 { grid-template-columns: 1fr; } .field-row { flex-direction: column; gap: 0; } }

.feature-card { padding: 28px 26px; }
.feature-card .icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 18px;
  background: var(--iris-soft); color: var(--iris);
}
.feature-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; letter-spacing: -.01em; }
.feature-card p { font-size: 14px; color: var(--ink-2); }
.feature-card .link { display: inline-flex; align-items: center; gap: 5px; margin-top: 14px; font-size: 13.5px; font-weight: 650; color: var(--iris); }

.band { background: #14161f; color: #f4f2ec; border-radius: 24px; padding: 64px 48px; position: relative; overflow: hidden; }
.band h2 { font-size: clamp(28px, 3.6vw, 40px); }
.band p { color: #b9bec9; }
.band .prism-text { font-style: italic; }

.footer { border-top: 1px solid var(--line); padding: 44px 0 60px; margin-top: 40px; color: var(--muted); font-size: 13.5px; }
.footer .cols { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer a:hover { color: var(--ink); }
.footer .flist { display: flex; flex-direction: column; gap: 8px; }
.footer h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin-bottom: 12px; }

/* ------------------------------------------------------------ app UI */

.page-title { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 34px 0 6px; }
.page-title h1 { font-size: 34px; }
.page-sub { color: var(--muted); font-size: 14.5px; margin-bottom: 26px; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar .spacer { flex: 1; }

.seg { display: inline-flex; background: var(--chip-bg); border-radius: 99px; padding: 3px; }
.seg button { padding: 7px 16px; border-radius: 99px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs button { padding: 11px 16px; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.active { color: var(--ink); border-color: var(--ink); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--surface-2); }

.stat { padding: 20px 22px; }
.stat .num { font-family: var(--font-display); font-size: 34px; font-weight: 600; line-height: 1.1; }
.stat .lbl { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 3px; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 10px; }

/* ------------------------------------------------------- schedule views */

.sched-grid { display: grid; gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.sched-grid > div { background: var(--surface); }
.sched-head { padding: 10px 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2) !important; }
.sched-cell { min-height: 74px; padding: 8px; }
.sched-cell.today { background: var(--today-bg); box-shadow: inset 0 0 0 1.5px var(--today-ring); }
.sched-cell.dim { background: var(--surface-2); }
.member-cell { display: flex; align-items: center; gap: 10px; padding: 12px; font-weight: 600; font-size: 13.5px; }
.member-cell .sub { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }

.shift-chip {
  border-radius: 8px; padding: 5px 9px; font-size: 12px; font-weight: 600; color: #fff;
  margin-bottom: 5px; cursor: pointer; line-height: 1.35; position: relative;
  transition: filter .12s, transform .12s;
}
.shift-chip:hover { filter: brightness(1.08); transform: translateY(-1px); }
.shift-chip .lbl { opacity: .85; font-weight: 500; font-size: 11px; }
.shift-chip.draft { opacity: .65; background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.14) 0 6px, transparent 6px 12px); outline: 1.5px dashed rgba(255,255,255,.7); outline-offset: -1.5px; }

.cal-daynum { font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 5px; }
.mini-months { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .mini-months { grid-template-columns: repeat(2, 1fr); } }
.mini-month { padding: 16px; cursor: pointer; }
.mini-month h4 { font-size: 14px; margin-bottom: 10px; }
.mini-month .mgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.mini-month .mgrid span { aspect-ratio: 1; border-radius: 4px; background: var(--line-2); font-size: 0; }

.timeline { position: relative; border-left: 1px solid var(--line); }
.time-row { display: flex; border-bottom: 1px solid var(--line-2); }
.time-label { width: 64px; flex-shrink: 0; font-size: 11.5px; color: var(--muted); padding: 4px 10px 0 0; text-align: right; }

/* -------------------------------------------------------------- slots */

.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 9px; }
.slot {
  padding: 10px 6px; text-align: center; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 14px; font-weight: 600; cursor: pointer; transition: all .13s;
}
.slot:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.slot.selected { background: var(--accent); border-color: var(--accent); color: #fff; }
.slot.full { opacity: .35; cursor: not-allowed; text-decoration: line-through; }

.day-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.day-pill {
  min-width: 74px; padding: 10px 8px; text-align: center; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); cursor: pointer; transition: all .13s; flex-shrink: 0;
}
.day-pill:hover { border-color: var(--muted); }
.day-pill.selected { background: var(--accent); border-color: var(--accent); color: #fff; }
.day-pill .dow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; opacity: .65; }
.day-pill .dnum { font-size: 19px; font-weight: 700; }
.day-pill.closed { opacity: .4; cursor: not-allowed; }

.type-card { padding: 22px; cursor: pointer; border: 1.5px solid var(--line-2); position: relative; }
.type-card:hover { border-color: var(--muted); }
.type-card.selected { border-color: var(--ink); box-shadow: var(--shadow-md); }
.type-card .swatch { width: 34px; height: 34px; border-radius: 10px; margin-bottom: 14px; }
.type-card h3 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.type-card .meta { font-size: 12.5px; color: var(--muted); font-weight: 600; margin: 4px 0 8px; }
.type-card p { font-size: 13.5px; color: var(--ink-2); }

.steps { display: flex; gap: 8px; align-items: center; margin-bottom: 30px; font-size: 13px; font-weight: 600; color: var(--muted); flex-wrap: wrap; }
.steps .stp { display: flex; align-items: center; gap: 7px; }
.steps .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--chip-bg); font-size: 11.5px; }
.steps .stp.on { color: var(--ink); }
.steps .stp.on .n { background: var(--inverse-bg); color: var(--inverse-fg); }
.steps .sep { width: 26px; height: 1px; background: var(--line); }

/* ------------------------------------------------------------ planner */

.task {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 9px; transition: box-shadow .15s;
}
.task:hover { box-shadow: var(--shadow-sm); }
.task.done { opacity: .5; }
.task.done .t-title { text-decoration: line-through; }
.task .chk { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; flex-shrink: 0; margin-top: 2px; display: grid; place-items: center; color: #fff; font-size: 12px; }
.task.done .chk { background: var(--green); border-color: var(--green); }
.t-title { font-weight: 600; font-size: 14.5px; }
.t-meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; margin-top: 2px; flex-wrap: wrap; }
.prio { font-weight: 700; }
.prio.high { color: var(--red); } .prio.medium { color: var(--amber); } .prio.low { color: var(--muted); }

.agenda-block { border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; color: #fff; position: absolute; left: 74px; right: 12px; overflow: hidden; box-shadow: var(--shadow-sm); }
.agenda-block small { display: block; font-weight: 500; opacity: .8; font-size: 11px; }

.progress-ring { width: 84px; height: 84px; }

/* -------------------------------------------------------------- modal */

.modal-back {
  position: fixed; inset: 0; background: rgba(22, 24, 29, .45); z-index: 100;
  display: none; align-items: flex-start; justify-content: center; padding: 8vh 20px;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.modal-back.open { display: flex; animation: fade .18s ease; }
.modal { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 480px; padding: 28px; animation: pop .22s cubic-bezier(.2, .9, .3, 1.2); max-height: 82vh; overflow-y: auto; }
.modal h3 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 18px; }
.modal .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* -------------------------------------------------------------- toast */

.toast-holder { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  background: var(--inverse-bg); color: var(--inverse-fg); padding: 12px 22px; border-radius: 99px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg); animation: toast-in .25s cubic-bezier(.2, .9, .3, 1.2); display: flex; gap: 9px; align-items: center;
}
.toast.err { background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px); } }

/* --------------------------------------------------------------- misc */

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 28px; } .mt-4 { margin-top: 44px; }
.mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 28px; }
.flex { display: flex; align-items: center; gap: 10px; } .flex-wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 700; }
.hidden { display: none !important; }
code.pill { background: var(--chip-bg); padding: 2px 9px; border-radius: 7px; font-size: 12.5px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }

.auth-card { max-width: 420px; margin: 60px auto; }
.demo-creds { font-size: 12.5px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 12px 14px; color: var(--ink-2); }
.demo-creds b { font-weight: 700; }

/* --------------------------------------------------------- theme toggle */

.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); display: grid; place-items: center;
  flex-shrink: 0; transition: border-color .15s, color .15s, transform .15s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: rotate(12deg); }

@media (max-width: 860px) {
  .nav-links a:not(.nav-keep) { display: none; }
  .hero { padding: 60px 0 46px; }
  .band { padding: 44px 28px; }
}
@media (max-width: 560px) {
  .site-header .bar { gap: 10px; }
  .user-chip .badge { display: none; }
  .user-chip { padding: 4px 10px 4px 5px; }
  .wrap, .wrap-narrow { padding: 0 18px; }
  .page-title h1 { font-size: 27px; }
}
