/* sobasically.co — "defaced dictionary" aesthetic
   Warm paper + academic serif, vandalized by a highlighter marker. */

:root {
  --paper: #faf5ec;
  --paper-deep: #f2ead9;
  --ink: #1a1714;
  --ink-soft: #5c554b;
  --rule: #d9cfba;
  --marker: #ffe81a;
  --marker-soft: #fff3a3;

  --c-ai: #6d4fe0;
  --c-medicine: #d94f3d;
  --c-science: #17836f;
  --c-finance: #1f6f3f;
  --c-culture: #e0740f;

  --serif: "Fraunces", Georgia, serif;
  --sans: "Instrument Sans", -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  /* subtle paper grain */
  background-image:
    radial-gradient(circle at 15% 20%, rgba(0,0,0,.018) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 60%, rgba(0,0,0,.015) 0 1px, transparent 1px);
  background-size: 7px 7px, 11px 11px;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }

::selection { background: var(--marker); color: var(--ink); }

/* ————— masthead ————— */

.masthead {
  border-bottom: 3px solid var(--ink);
  padding: 28px 0 18px;
}
.masthead-inner {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.logo {
  font-family: var(--serif);
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 900;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
  line-height: 1;
}
.logo-so { font-style: italic; font-weight: 400; }
.logo-basically {
  background: linear-gradient(104deg, transparent 2%, var(--marker) 4%, var(--marker) 96%, transparent 98%);
  padding: 0 .12em;
}
.logo-period { color: var(--c-medicine); }
.tagline {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1rem;
}

/* ————— toolbar ————— */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
  padding: 12px 0;
}
.toolbar-inner { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

.searchbox { position: relative; flex: 1 1 220px; min-width: 200px; }
.searchbox input {
  width: 100%;
  font-family: var(--serif);
  font-size: 1.05rem;
  padding: 10px 38px 10px 14px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transition: box-shadow .15s ease, transform .15s ease;
}
.searchbox input:focus {
  outline: none;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}
.slash-hint {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--sans);
  font-size: .75rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1px 7px;
  color: var(--ink-soft);
  background: var(--paper);
  pointer-events: none;
}

.cats { display: flex; gap: 6px; flex-wrap: wrap; }
.cat {
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .01em;
  padding: 6px 12px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  cursor: pointer;
  transition: background .12s ease, transform .12s ease;
}
.cat:hover { transform: translateY(-1px); background: var(--marker-soft); }
.cat.is-active { background: var(--ink); color: var(--paper); }

/* ————— hero: today's entry ————— */

.hero { padding: 44px 0 8px; }

.hero-label {
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.hero-label::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

.hero .entry { border: none; box-shadow: none; padding: 0; background: transparent; }
.hero .entry:hover { transform: none; }
.hero .term {
  font-size: clamp(2.6rem, 9vw, 5rem);
  line-height: .95;
  letter-spacing: -0.03em;
}
.hero .formal { max-width: 60ch; }
.hero .basically-text { font-size: clamp(1.5rem, 4.5vw, 2.4rem); }

/* ————— feed ————— */

.feed-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 48px 0 18px;
  border-top: 3px solid var(--ink);
  padding-top: 14px;
  flex-wrap: wrap;
}
.feed-title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: -.01em;
}
.feed-tools { display: flex; gap: 8px; }

.btn-marker, .btn-ghost, .btn-more {
  font-family: var(--sans);
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  border: 1.5px solid var(--ink);
  padding: 7px 14px;
  border-radius: 999px;
  transition: transform .12s ease, background .12s ease;
}
.btn-marker { background: var(--marker); color: var(--ink); }
.btn-marker:hover { transform: rotate(-1.5deg) scale(1.03); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--paper-deep); }
.btn-ghost.is-active { background: var(--ink); color: var(--paper); }

.feed { display: grid; gap: 22px; }

/* ————— entry card ————— */

.entry {
  background: #fffdf6;
  border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 rgba(26,23,20,.9);
  padding: 26px 28px 22px;
  position: relative;
  transition: transform .15s ease, box-shadow .15s ease;
  animation: rise .35s ease both;
}
.entry:hover { transform: translate(-2px,-2px); box-shadow: 7px 7px 0 rgba(26,23,20,.9); }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.entry-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.term {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  letter-spacing: -.02em;
  line-height: 1.05;
}
.term a { color: inherit; text-decoration: none; }
.term a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--marker); }

.badge {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
  white-space: nowrap;
}
.badge.ai        { background: var(--c-ai); }
.badge.medicine  { background: var(--c-medicine); }
.badge.science   { background: var(--c-science); }
.badge.finance   { background: var(--c-finance); }
.badge.culture   { background: var(--c-culture); }

.formal {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 340;
  color: var(--ink-soft);
  font-size: .98rem;
  margin: 12px 0 4px;
  padding-left: 14px;
  border-left: 3px solid var(--rule);
}
.formal::before {
  content: "the complicated version: ";
  font-family: var(--sans);
  font-style: normal;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 3px;
}

.basically { margin-top: 16px; }
.basically-label {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink);
  margin-right: .35em;
}
.basically-text {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  line-height: 1.25;
  letter-spacing: -.01em;
  background: linear-gradient(104deg, transparent 1%, var(--marker) 3%, var(--marker) 97%, transparent 99%);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: .02em .18em;
}

.hot {
  margin-top: 14px;
  font-size: .82rem;
  color: var(--ink-soft);
  display: flex;
  gap: 7px;
  align-items: baseline;
}
.hot::before { content: "🔥"; font-size: .8rem; }

.entry-actions {
  margin-top: 14px;
  display: flex;
  gap: 12px;
}
.entry-actions button {
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  border-bottom: 1px dotted var(--ink-soft);
}
.entry-actions button:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ————— load more / footer / toast ————— */

.load-wrap { text-align: center; padding: 34px 0 10px; }
.btn-more {
  background: transparent;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  padding: 10px 26px;
}
.btn-more:hover { background: var(--marker); transform: rotate(1deg); }
.btn-more[hidden] { display: none; }

.empty {
  text-align: center;
  padding: 60px 20px;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.15rem;
}
.empty strong { font-style: normal; }

.footer {
  margin-top: 70px;
  border-top: 3px solid var(--ink);
  padding: 26px 0 44px;
  font-size: .9rem;
  color: var(--ink-soft);
}
.footer-fine { margin-top: 6px; font-size: .78rem; }

.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translate(-50%, 80px);
  background: var(--ink);
  color: var(--paper);
  font-size: .85rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 999px;
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
  pointer-events: none;
  z-index: 50;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 560px) {
  .entry { padding: 20px 18px 18px; }
  .masthead { padding: 20px 0 14px; }
  .slash-hint { display: none; }
}
