/* ============================================================
   Hive — team task board
   Warm paper, honey accent, honeycomb geometry.
   ============================================================ */

@font-face {
  font-family: "Space Grotesk";
  src: url("assets/space-grotesk.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("assets/work-sans.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #fbf6ec;
  --paper-2: #f4ecdd;
  --surface: #ffffff;
  --ink: #241f1a;
  --ink-soft: #4b4239;
  --muted: #6f6455;
  --line: #e7dcc9;
  --line-strong: #d8c9af;
  --honey: #e9a227;
  --honey-deep: #b9790d;
  --honey-wash: #fdf1d6;

  --todo: #64748b;
  --progress: #cf8a0a;
  --blocked: #c9483a;
  --done: #2f8365;

  --todo-bg: #efece6;
  --progress-bg: #fbf1da;
  --blocked-bg: #fbeae6;
  --done-bg: #e8f3ed;

  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(48, 38, 24, 0.06);
  --shadow-md: 0 10px 24px -12px rgba(48, 38, 24, 0.32);
  --shadow-lg: 0 28px 60px -24px rgba(48, 38, 24, 0.5);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Work Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(
      1200px 520px at 88% -8%,
      rgba(233, 162, 39, 0.16),
      transparent 60%
    ),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll {
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

/* ---------- App bar ---------- */

.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 4vw, 44px);
  background: rgba(251, 246, 236, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.logo {
  display: grid;
  place-items: center;
  filter: drop-shadow(0 5px 10px rgba(185, 121, 13, 0.28));
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  min-width: 0;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.tagline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.appbar-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.week-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.total-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: var(--honey-wash);
  border: 1px solid #f0d79a;
  border-radius: 999px;
  padding: 6px 13px;
  white-space: nowrap;
}

/* ---------- Shell / toolbar ---------- */

.shell {
  padding: clamp(18px, 3.2vw, 38px) clamp(18px, 4vw, 44px) 64px;
  max-width: 1560px;
  margin: 0 auto;
}

.toolbar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.search-field {
  flex: 1 1 320px;
  max-width: 460px;
}

.input-wrap,
.select-wrap {
  position: relative;
  display: block;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

input[type="search"],
select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

input[type="search"] {
  padding-left: 42px;
}

input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}

.filter-field {
  flex: 0 0 auto;
  min-width: 210px;
}

select {
  appearance: none;
  padding-right: 40px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f6455' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 17px;
}

input[type="search"]:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(233, 162, 39, 0.55);
  outline-offset: 2px;
  border-color: var(--honey);
}

.result-count {
  margin: 0 0 13px auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- Board ---------- */

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.column {
  background: var(--col-bg, var(--paper-2));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  min-width: 0;
}

.column-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 6px 13px;
}

.column-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  transform: rotate(45deg);
  background: var(--col-accent, var(--muted));
  flex: none;
}

.column-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}

.column-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--col-accent, var(--muted));
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 2px 9px;
}

.column-body {
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-height: 60px;
}

.column-empty {
  margin: 4px 6px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  opacity: 0.8;
}

/* ---------- Card ---------- */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 15px 14px;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--col-accent, var(--muted));
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.project-chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--paper-2);
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.priority {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pri-color, var(--muted));
  white-space: nowrap;
}

.priority::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.priority.high {
  --pri-color: #c9483a;
}
.priority.medium {
  --pri-color: #cf8a0a;
}
.priority.low {
  --pri-color: #64748b;
}

.card-title-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
  cursor: pointer;
  border-radius: 6px;
}

.card-title-btn:hover {
  color: var(--honey-deep);
}

.card-summary {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 11px;
}

.avatar {
  flex: none;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: #fff;
  background: var(--ink-soft);
  letter-spacing: 0.02em;
}

.assignee {
  font-size: 12.5px;
  color: var(--ink-soft);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-date {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.card-done .card-title-btn {
  text-decoration: line-through;
  text-decoration-color: var(--line-strong);
  color: var(--ink-soft);
}

/* ---------- Empty state ---------- */

.empty-state {
  text-align: center;
  max-width: 440px;
  margin: 8vh auto 0;
  padding: 40px 26px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
}

.empty-mark svg {
  fill: none;
  stroke: var(--honey);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.empty-state h2 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 12px 0 6px;
}

.empty-state p {
  margin: 0 0 20px;
  color: var(--muted);
}

.btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  border-radius: 11px;
  padding: 11px 18px;
  cursor: pointer;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.btn:hover {
  background: var(--paper-2);
}

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

/* ---------- Detail drawer ---------- */

.drawer-root {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(36, 31, 26, 0.46);
  backdrop-filter: blur(2px);
  animation: fade-in 0.2s ease;
}

.drawer {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(560px, 94vw);
  background: var(--paper);
  border-left: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: slide-in 0.24s cubic-bezier(0.22, 0.7, 0.3, 1);
  overflow: hidden;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes slide-in {
  from {
    transform: translateX(24px);
    opacity: 0.4;
  }
}

.drawer-header {
  position: relative;
  padding: 24px 26px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.drawer-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-right: 44px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--pill-ink, var(--ink));
  background: var(--pill-bg, var(--paper-2));
  border-radius: 999px;
  padding: 5px 12px;
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pill-dot, var(--muted));
}

.status-pill[data-status="todo"] {
  --pill-ink: #46536b;
  --pill-bg: var(--todo-bg);
  --pill-dot: var(--todo);
}
.status-pill[data-status="in-progress"] {
  --pill-ink: #8a5c05;
  --pill-bg: var(--progress-bg);
  --pill-dot: var(--progress);
}
.status-pill[data-status="blocked"] {
  --pill-ink: #9c3226;
  --pill-bg: var(--blocked-bg);
  --pill-dot: var(--blocked);
}
.status-pill[data-status="done"] {
  --pill-ink: #236349;
  --pill-bg: var(--done-bg);
  --pill-dot: var(--done);
}

.detail-project {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.close-detail {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}
.close-detail:hover {
  background: var(--paper-2);
  transform: rotate(90deg);
}
.close-detail svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

#detail-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.6vw, 29px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.02em;
  margin: 0;
  outline: none;
}

.drawer-scroll {
  overflow-y: auto;
  padding: 22px 26px 30px;
  flex: 1;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.meta-cell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
}

.meta-cell dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.meta-cell dd {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.body-copy {
  font-size: 15.5px;
  line-height: 1.68;
  color: var(--ink-soft);
}

.body-copy p {
  margin: 0 0 15px;
}

.body-copy p:last-child {
  margin-bottom: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 20px 0 4px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 4px 11px;
}

.drawer-status {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 16px 26px 20px;
}

.drawer-status label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

.hint {
  margin: 9px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  border-radius: 12px;
  padding: 13px 18px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  max-width: calc(100vw - 32px);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast .toast-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--honey);
  flex: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .appbar {
    padding: 13px 16px;
  }
  .week-label {
    display: none;
  }
  .total-badge {
    font-size: 11px;
    padding: 5px 10px;
  }
  .wordmark {
    font-size: 22px;
  }
  .shell {
    padding: 16px 14px 56px;
  }
  .toolbar {
    align-items: stretch;
    gap: 12px;
    margin-bottom: 18px;
  }
  .search-field {
    max-width: none;
    flex-basis: 100%;
  }
  .filter-field {
    flex: 1 1 100%;
    min-width: 0;
  }
  .result-count {
    margin: 0;
    width: 100%;
  }

  /* Board becomes a horizontal snap rail. */
  .board {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 86%;
    grid-template-columns: none;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 4px 18px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .column {
    scroll-snap-align: start;
  }

  .drawer {
    width: 100%;
    border-left: 0;
  }
  .drawer-header {
    padding: 20px 18px 16px;
  }
  .drawer-scroll {
    padding: 18px 18px 24px;
  }
  .drawer-status {
    padding: 14px 18px calc(16px + env(safe-area-inset-bottom));
  }
  .meta-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
