:root {
  --fondo: #f2f2f3;
  --card: #ffffff;
  --binario: #efeff1;
  --bordo: rgba(10, 10, 20, 0.07);
  --testo: #0b0b0f;
  --testo-2: #6b6b76;
  --testo-3: #a1a1aa;
  --accento: #2563eb;
  --fatto: #0b0b0f;
  --da-fare: #d4d4da;
  --compito: #fbfbfc;
}

* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(10px, 4vmin, 40px);
}

.card {
  width: min(440px, 100%);
  background: var(--card);
  border: 1px solid var(--bordo);
  border-radius: 20px;
  padding: clamp(12px, 3.2vh, 20px) clamp(12px, 3.6vw, 20px);
  box-shadow: 0 1px 2px rgba(10, 10, 20, 0.04), 0 22px 44px -22px rgba(10, 10, 20, 0.18);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2.4vh, 16px);
}

.card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; font-size: 14px; letter-spacing: -0.01em; }
.brand__mark { width: 18px; height: 18px; fill: none; stroke: var(--accento); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.card__meta { font-size: 12px; color: var(--testo-3); white-space: nowrap; }
.card__meta span { color: var(--testo-2); font-weight: 560; }

/* the segmented control */
.seg {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--binario);
  border-radius: 13px;
  padding: 3px;
  box-shadow: inset 0 1px 1.5px rgba(10, 10, 20, 0.06);
}

.seg__opt,
.lens__opt {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: clamp(30px, 7vh, 34px);
  border: 0;
  background: transparent;
  color: var(--testo-2);
  font: inherit;
  font-size: 13px;
  font-variation-settings: "wght" var(--w, 520);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border-radius: 10px;
}
.seg__opt:focus-visible { outline: 2px solid var(--accento); outline-offset: 1px; }
.seg__opt svg,
.lens__opt svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* the drop of glass over the chosen view */
.seg__drop {
  position: absolute;
  z-index: 2;
  top: 3px;
  left: 0;
  height: clamp(30px, 7vh, 34px);
  width: 40px;
  border-radius: 10px;
  overflow: hidden;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 1px 1px rgba(10, 10, 20, 0.06),
    0 4px 10px -3px rgba(10, 10, 20, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(10, 10, 20, 0.05),
    inset 0 0 0 0.5px rgba(10, 10, 20, 0.08);
  transform-origin: 50% 50%;
  will-change: transform, width;
}
/* a copy of the labels, magnified like through a lens */
.seg__lens {
  position: absolute;
  top: -3px;
  left: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  color: var(--testo);
  will-change: transform;
}
.lens__opt { pointer-events: none; color: var(--testo); text-shadow: 0.5px 0 rgba(255, 40, 90, 0.18), -0.5px 0 rgba(0, 120, 255, 0.18); }
.lens__opt svg { stroke: var(--accento); }
/* the bright rim along the top of the glass */
.seg__shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(120% 70% at 50% -20%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0) 55%, rgba(37, 99, 235, 0.05));
  mix-blend-mode: screen;
}

/* the tasks */
.view {
  position: relative;
  height: clamp(168px, 44vh, 232px);
}
.heads, .grid { position: absolute; inset: 0; }
.head {
  position: absolute;
  top: 0;
  font-size: 11px;
  color: var(--testo-3);
  font-variation-settings: "wght" 560;
  white-space: nowrap;
  display: flex;
  gap: 5px;
  align-items: baseline;
}
.head b { color: var(--testo-2); font-weight: 600; }
.head i { font-style: normal; color: var(--testo-3); }
.lane {
  position: absolute;
  border-radius: 10px;
  background: #f7f7f9;
}

.task {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 10px;
  border-radius: 9px;
  background: var(--compito);
  border: 1px solid rgba(10, 10, 20, 0.07);
  box-shadow: 0 1px 1px rgba(10, 10, 20, 0.03);
  overflow: hidden;
  will-change: transform, width, height;
}
.task::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2.5px;
  border-radius: 0 2px 2px 0;
  background: var(--stato);
}
.task[data-s="0"] { --stato: var(--da-fare); }
.task[data-s="1"] { --stato: var(--accento); }
.task[data-s="2"] { --stato: var(--fatto); }
.task__t {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-variation-settings: "wght" 540;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.005em;
}
.task[data-s="2"] .task__t { color: var(--testo-2); }
.task__check { width: 12px; height: 12px; flex: none; fill: none; stroke: var(--testo-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.task__who {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 8.5px;
  font-variation-settings: "wght" 640;
  color: #fff;
  background: var(--chi);
}
.task.is-small .task__who { display: none; }
.task.is-small { padding: 0 5px 0 8px; }
.task.is-small .task__t { font-size: 11px; }
.task.is-small .task__check { display: none; }
/* in the columns and the days of the week the title wraps on short lines */
.task.is-wrap { align-items: flex-start; padding: 7px 7px 6px 10px; flex-direction: column; justify-content: space-between; }
.task.is-wrap .task__t {
  flex: none;
  width: 100%;
  line-height: 1.2;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: clip;
}
.task.is-wrap .task__who { align-self: flex-end; width: 18px; height: 18px; }
.task.is-wrap .task__check { position: absolute; left: 10px; bottom: 9px; }
.task.is-small.is-wrap .task__check { display: block; }
.task.is-cal { padding: 5px 4px 4px 7px; }
.task.is-cal .task__t { font-size: 10.5px; -webkit-line-clamp: 3; line-height: 1.16; }
.task.is-small.is-cal .task__check { display: none; }

.ghost {
  position: absolute;
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  fill: #0b0b0f;
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

@media (hover: hover) {
  .seg__opt:hover { color: var(--testo); }
}
