/* styles.css */
:root{
  --ink: #0e0f12;
  --muted: #5b6370;
  --paper: #fbfbf7;
  --paper-2: #f7f7f1;
  --border: rgba(15, 17, 20, 0.75);
  --line: rgba(10, 12, 15, 0.08);
  --dot: rgba(10, 12, 15, 0.12);
  --accent: #1f6feb;
  --accent-2: #10b981;

  --radius: 18px;
  --shadow: 0 18px 45px rgba(0,0,0,0.14);
  --shadow-soft: 0 10px 30px rgba(0,0,0,0.10);

  --font-ui: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  --font-hand: Kalam, ui-rounded, "Comic Sans MS", cursive;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  color: var(--ink);
  font-family: var(--font-ui);
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.35) 0 1px, transparent 2px) 0 0 / 28px 28px,
    linear-gradient(180deg, #f3f6ff 0%, #f7f7f1 70%, #f2f1ec 100%);
}

/* paper frame */
.page{
  min-height: 100%;
  padding: 22px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
}

.page::before{
  content:"";
  position: fixed;
  inset: 10px;
  border: 2px solid rgba(0,0,0,0.20);
  pointer-events: none;
  border-radius: 18px;
}

/* main notebook sheet */
.page > *{
  background:
    radial-gradient(circle, var(--dot) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.topbar{
  padding: 18px 18px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.brand{ min-width: 260px; }
.logo{
  margin: 0;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(34px, 4vw, 54px);
  letter-spacing: 0.2px;
}
.logo__scribble{
  position: relative;
  display: inline-block;
}
.logo__scribble::after{
  content:"";
  position: absolute;
  left: 2px; right: 2px;
  bottom: 6px;
  height: 10px;
  background: rgba(16,185,129,0.22);
  filter: blur(0.2px);
  border-radius: 9px;
  transform: rotate(-2deg);
  z-index: -1;
}
.logo__dot{ color: var(--accent); }
.logo__suffix{ font-weight: 400; opacity: 0.9; }

.tagline{
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.top-actions{
  display: flex;
  align-items: center;
  gap: 10px;
}

.search{
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  min-width: min(440px, 60vw);
  padding: 10px 12px;
  border: 2px solid rgba(0,0,0,0.55);
  border-radius: 999px;
  background: rgba(255,255,255,0.55);
  box-shadow: var(--shadow-soft);
}

.search input{
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--ink);
}

.btn{
  border: 2px solid rgba(0,0,0,0.65);
  background: rgba(255,255,255,0.60);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }
.btn--ghost{
  border: none;
  background: transparent;
  box-shadow: none;
  font-size: 20px;
  padding: 0 6px;
  line-height: 1;
  cursor: pointer;
  color: rgba(0,0,0,0.65);
}

.layout{
  padding: 18px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
}

.sidebar{
  padding: 14px;
  border-radius: 16px;
  border: 2px solid rgba(0,0,0,0.55);
  box-shadow: var(--shadow-soft);
  background:
    radial-gradient(circle, var(--dot) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(180deg, rgba(255,255,255,0.70) 0%, rgba(255,255,255,0.45) 100%);
}

.hand-title{
  font-family: var(--font-hand);
  font-size: 22px;
  margin: 0 0 10px;
  letter-spacing: 0.2px;
}

.hand-underline{
  position: relative;
  display: inline-block;
  padding-bottom: 6px;
}
.hand-underline::after{
  content:"";
  position: absolute;
  left: 0; right: 0;
  bottom: 2px;
  height: 3px;
  background: rgba(31,111,235,0.55);
  border-radius: 4px;
  transform: rotate(-1deg);
}

.topic-list{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.topic{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  user-select: none;
  font-family: var(--font-hand);
  font-size: 18px;
  line-height: 1.1;
}

.topic::before{
  content: "→";
  opacity: 0.85;
}

.topic:hover{
  background: rgba(255,255,255,0.55);
  border-color: rgba(0,0,0,0.22);
}

.topic.is-active{
  background: rgba(16,185,129,0.18);
  border-color: rgba(0,0,0,0.55);
}

.topic small{
  margin-left: auto;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.20);
  background: rgba(255,255,255,0.55);
}

.sidebar__footer{
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0,0,0,0.35);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.boards{
  padding: 14px;
  border-radius: 16px;
  border: 2px solid rgba(0,0,0,0.55);
  box-shadow: var(--shadow-soft);
  background:
    radial-gradient(circle, var(--dot) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(180deg, rgba(255,255,255,0.62) 0%, rgba(255,255,255,0.38) 100%);
}

.boards__tabs{
  display: flex;
  gap: 10px;
  padding: 6px 4px 12px;
  border-bottom: 1px dashed rgba(0,0,0,0.35);
}

.tab{
  font-family: var(--font-hand);
  font-size: 22px;
  background: transparent;
  border: 2px solid transparent;
  padding: 8px 12px;
  border-radius: 14px;
  cursor: pointer;
  position: relative;
}
.tab:hover{ background: rgba(255,255,255,0.45); }
.tab.is-active{
  border-color: rgba(0,0,0,0.55);
  background: rgba(255,255,255,0.55);
}
.tab.is-active::after{
  content:"";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 3px;
  background: rgba(31,111,235,0.55);
  border-radius: 4px;
  transform: rotate(-1deg);
}

.panel{ display: none; padding-top: 12px; }
.panel.is-active{ display: block; }

.panel__meta{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px 10px;
}

.cards{
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 14px;
}

.card{
  border: 2px solid rgba(0,0,0,0.60);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.82) 0%, rgba(255,255,255,0.62) 100%);
  box-shadow: var(--shadow-soft);
  padding: 12px 12px 10px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
  position: relative;
  overflow: hidden;
}

.card:hover{
  transform: translateY(-2px) rotate(var(--tilt));
  box-shadow: 0 18px 38px rgba(0,0,0,0.14);
}

.card__title{
  margin: 0 0 6px;
  font-family: var(--font-hand);
  font-size: 22px;
}

.card__desc{
  margin: 0 0 10px;
  color: rgba(0,0,0,0.78);
  font-size: 13px;
  line-height: 1.4;
}

.badges{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge{
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.22);
  background: rgba(255,255,255,0.55);
}

.card__footer{
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.pinned{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,0.55);
  background: rgba(31,111,235,0.45);
}

/* footer */
.footer{
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.link{
  color: rgba(0,0,0,0.78);
  text-decoration: none;
  border-bottom: 1px dashed rgba(0,0,0,0.45);
}
.link:hover{ color: var(--accent); border-bottom-color: var(--accent); }
.sep{ opacity: 0.55; }

.muted{ color: var(--muted); margin: 0; }

.sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* modal */
.modal{
  width: min(860px, 92vw);
  border: none;
  padding: 0;
  background: transparent;
}
.modal::backdrop{
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
}
.modal__paper{
  position: relative;
  border-radius: 18px;
  border: 2px solid rgba(0,0,0,0.75);
  background:
    radial-gradient(circle, var(--dot) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  box-shadow: var(--shadow);
  padding: 18px 16px 14px;
}
.modal__close{
  position: absolute;
  top: 10px;
  right: 12px;
  border: 2px solid rgba(0,0,0,0.55);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255,255,255,0.65);
  cursor: pointer;
  font-size: 22px;
}
.modal__content h3{
  font-family: var(--font-hand);
  margin: 0 0 6px;
  font-size: 28px;
}
.modal__content p{ margin: 8px 0; color: rgba(0,0,0,0.80); }
.modal__actions{
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toast{
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.90);
  border: 2px solid rgba(0,0,0,0.60);
  box-shadow: var(--shadow-soft);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}
.toast.is-show{ opacity: 1; }

/* responsive */
@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
  .search{ min-width: 0; width: 100%; }
  .topbar{ flex-direction: column; align-items: stretch; }
  .top-actions{ justify-content: space-between; }
  .cards{ grid-template-columns: 1fr; }
}
