/* Phlegm — shared styles.
   Grounds: bone (default), paper, dark. Set data-theme on <html>. */

:root,
[data-theme="bone"] {
  --card: #eeefeb;
  --ink: #1c1e1b;
  --ink2: #666a63;
  --faint: #94988f;
  --rule: #d8dbd4;
  --track: #e0e3dc;
  --line: #e4e7e0;
  --field: #f8f9f6;
  --pill: #1a1c17;
  --quote: #464a44;
  --rim: transparent;
  --tile: repeating-linear-gradient(45deg, #e8eae5, #e8eae5 6px, #dfe2dc 6px, #dfe2dc 12px);
}

[data-theme="paper"] {
  --card: #f4f1e8;
  --ink: #221f1a;
  --ink2: #6a6458;
  --faint: #98917f;
  --rule: #ddd7c8;
  --track: #e4dfd0;
  --line: #e7e1d2;
  --field: #fdfcf7;
  --pill: #1a1c17;
  --quote: #4a463c;
  --rim: transparent;
  --tile: repeating-linear-gradient(45deg, #ece8db, #ece8db 6px, #e2ddcc 6px, #e2ddcc 12px);
}

[data-theme="dark"] {
  --card: #15160f;
  --ink: #f1f2e8;
  --ink2: #9a9d90;
  --faint: #767a6c;
  --rule: #2c2e23;
  --track: #26281d;
  --line: #23251b;
  --field: #1d2016;
  --pill: #22261a;
  --quote: #c4c8b8;
  --rim: transparent;
  --tile: repeating-linear-gradient(45deg, #1e2016, #1e2016 6px, #262820 6px, #262820 12px);
}

:root {
  --brand: #aedd35;
  --brand-deep: #8fbb28;
  --brand-dark: #12200a;
  --link: #6d8f1e;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --body: "Familjen Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--card); }

body {
  margin: 0;
  background: var(--card);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--brand-deep); }

img { max-width: 100%; display: block; }

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

/* Header ------------------------------------------------------------- */

.masthead {
  background: var(--brand);
  padding: 17px 0 15px;
}

.masthead .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  font-family: Gluten, system-ui, sans-serif;
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--brand-dark);
}

.masthead nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 12px;
  color: #2f4218;
}

.masthead nav a { color: #2f4218; }
.masthead nav a:hover { color: var(--brand-dark); }

.themes {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 12px;
  background: rgba(18, 32, 10, 0.1);
}

.themes button {
  padding: 3px 9px 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--brand-dark);
  font: 400 10px/1 var(--mono);
  cursor: pointer;
}

.themes button[aria-pressed="true"] { background: rgba(18, 32, 10, 0.16); }

/* Section heads ------------------------------------------------------- */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 9px;
  border-bottom: 1.5px solid var(--ink);
}

.section-head h2 {
  margin: 0;
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.22em;
  color: var(--ink);
}

.meta-note {
  font: 400 9.5px/1 var(--mono);
  letter-spacing: 0.06em;
  color: var(--faint);
}

/* Home ---------------------------------------------------------------- */

main { padding: 30px 0 56px; }

.recent {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 16px 0 34px;
}

.recent a { color: inherit; display: flex; flex-direction: column; gap: 10px; }

.splat { position: relative; width: 100%; height: 96px; }
.splat svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

.splat-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.splat-score {
  font-family: "Baloo 2", system-ui, sans-serif;
  font-weight: 800;
  font-size: 29px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--brand-dark);
}

.splat-tag {
  font-style: italic;
  font-size: 11px;
  color: rgba(18, 32, 10, 0.72);
}

.spec-no {
  font: 400 9px/1 var(--mono);
  letter-spacing: 0.1em;
  color: var(--faint);
}

.film-title {
  font-family: Chonburi, Georgia, serif;
  font-size: 17px;
  line-height: 1.15;
  color: var(--ink);
}

.film-meta { font-size: 11px; color: var(--ink2); }

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

.filters input {
  width: 196px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--field);
  padding: 4px 11px 5px;
  font: 400 9.5px var(--mono);
  letter-spacing: 0.04em;
  color: var(--ink);
  outline: none;
}

.chips { display: flex; gap: 3px; }

.chips button {
  flex: none;
  white-space: nowrap;
  padding: 4px 10px 5px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: transparent;
  color: var(--ink2);
  font: 400 9.5px/1 var(--mono);
  letter-spacing: 0.06em;
  cursor: pointer;
}

.chips button[aria-pressed="true"] { background: var(--brand); color: var(--brand-dark); }

.ledger { margin-top: 12px; }

.ledger-row {
  display: grid;
  grid-template-columns: 66px 1fr 150px 132px 48px 92px;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  color: inherit;
}

.ledger-row:hover { background: var(--track); }

.bar-track {
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--track);
}

.bar-fill { height: 100%; width: 0; transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1); }

.ledger-score {
  font-family: "Baloo 2", system-ui, sans-serif;
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
  text-align: right;
  color: var(--ink);
}

.ledger-tag {
  font-style: italic;
  font-size: 12px;
  color: var(--ink2);
  text-align: right;
}

.empty {
  padding: 34px 0 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.empty strong {
  font-family: Chonburi, Georgia, serif;
  font-weight: 400;
  font-size: 19px;
  color: var(--ink);
}

.empty span { font-size: 11px; color: var(--ink2); }

.ledger-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
}

/* Review page --------------------------------------------------------- */

.post-head {
  display: flex;
  flex-direction: column;
  gap: 7px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 13px;
}

.post-head h1 {
  margin: 0;
  font-family: Shrikhand, Georgia, serif;
  font-weight: 400;
  font-size: 38px;
  line-height: 1.15;
  letter-spacing: 0.005em;
  color: var(--ink);
}

.post-head .byline { font-size: 14px; color: var(--ink2); }

.post-data {
  display: flex;
  gap: 9px;
  font: 400 10px/1 var(--mono);
  color: var(--ink2);
  padding-top: 2px;
}

.post-grid {
  display: grid;
  grid-template-columns: 212px 1fr 196px;
  gap: 34px;
  padding-top: 22px;
}

.rail { display: flex; flex-direction: column; gap: 22px; }

.cats { display: flex; flex-direction: column; gap: 14px; }

.cat { display: flex; flex-direction: column; gap: 4px; }

.cat-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--ink2);
}

.cat-head b {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
}

.cat-score {
  font-family: "Baloo 2", system-ui, sans-serif;
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.cat .bar-track { height: 6px; border-radius: 3px; }

/* Viscometer */

.meter { position: relative; padding-top: 42px; }

.meter-pill {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 6px 11px 7px;
  border-radius: 5px;
  background: var(--pill);
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(20, 22, 16, 0.2);
  transition: left 0.9s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease;
}

.meter-pill span:first-child {
  font-style: italic;
  font-size: 11px;
  color: #b9c4a4;
}

.meter-pill span:last-child {
  font-family: "Baloo 2", system-ui, sans-serif;
  font-weight: 800;
  font-size: 21px;
  line-height: 1;
  letter-spacing: -0.01em;
}

.meter-point {
  position: absolute;
  top: 31px;
  z-index: 3;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 14px solid var(--pill);
  transition: left 0.9s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease;
}

.tube {
  position: relative;
  z-index: 1;
  height: 32px;
  border: 1.5px solid rgba(143, 187, 40, 0.45);
  border-radius: 16px;
  background: linear-gradient(90deg, #a8781a, #c9a51e 12%, #dcd52c 30%, #aedd35);
  overflow: hidden;
}

.tube-label {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: rgba(26, 26, 26, 0.3);
}

.pole {
  position: absolute;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.06em;
}

.pole.swill { left: 13px; font-weight: 700; color: rgba(38, 26, 6, 0.72); }
.pole.goop { right: 13px; font-weight: 800; color: rgba(18, 32, 10, 0.82); }

.lab-mark {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 0;
  border-right: 1.5px dashed rgba(26, 26, 26, 0.55);
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.lab-caption { position: relative; height: 14px; }

.lab-caption span {
  position: absolute;
  transform: translateX(-50%);
  font: 400 9px/1 var(--mono);
  color: var(--ink2);
  white-space: nowrap;
  padding-top: 4px;
  transition: left 0.9s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease;
}

/* Badge */

.badge { position: relative; width: 100%; height: 104px; margin-top: 16px; }
.badge svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

.badge-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 32px;
  text-align: center;
}

.badge-name {
  font-family: "Baloo 2", system-ui, sans-serif;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--brand-dark);
}

.badge-blurb {
  font-size: 10px;
  line-height: 1.35;
  color: rgba(18, 32, 10, 0.74);
  text-wrap: pretty;
}

/* MVP + date */

.rail-foot {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: auto;
  padding-top: 26px;
  border-top: 1px solid var(--rule);
}

.label {
  font: 400 9px var(--mono);
  letter-spacing: 0.08em;
  color: var(--ink2);
}

.mvp { display: flex; align-items: center; gap: 12px; }

.mvp-photo {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--tile);
  background-size: cover;
  background-position: center;
}

.mvp-name {
  font-family: Chonburi, Georgia, serif;
  font-size: 15px;
  line-height: 1.15;
  color: var(--ink);
}

.hr { height: 1px; background: var(--rule); }

.seen {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font: 400 12px var(--mono);
  letter-spacing: 0.06em;
  color: var(--ink);
}

.seen em { font-style: normal; font-size: 9px; color: var(--ink2); }

/* Review body */

.review { display: flex; flex-direction: column; gap: 12px; }

.review h2 {
  margin: 0;
  font-family: Chonburi, Georgia, serif;
  font-weight: 400;
  font-size: 21px;
  line-height: 1.25;
  color: var(--ink);
}

.review p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  text-wrap: pretty;
}

.review blockquote {
  margin: 4px 0;
  border-left: 3px solid var(--brand);
  padding: 3px 0 3px 15px;
  font-family: Chonburi, Georgia, serif;
  font-size: 17px;
  line-height: 1.35;
  color: var(--quote);
}

.review-clip {
  max-height: 320px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 62%, transparent);
  mask-image: linear-gradient(#000 62%, transparent);
}

.review-clip.open {
  max-height: none;
  -webkit-mask-image: none;
  mask-image: none;
}

.btn-row { display: flex; align-items: center; gap: 12px; padding-top: 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px 9px;
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.16s ease;
}

.btn:hover { background: var(--brand); color: var(--brand-dark); }

.btn-solid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding: 11px 14px;
  border: 1.5px solid #1a1a1a;
  border-radius: 4px;
  background: var(--brand);
  color: var(--brand-dark);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
}

.btn-solid:hover { background: #c8ec76; color: var(--brand-dark); }

/* Shots + palette */

.shots { display: flex; flex-direction: column; gap: 11px; }

.shot {
  aspect-ratio: 2.39 / 1;
  border: 1px solid var(--rule);
  background: var(--tile);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 400 9px var(--mono);
  color: var(--faint);
  letter-spacing: 0.06em;
  cursor: zoom-in;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.shot:hover {
  transform: translateY(-3px) scale(1.025);
  box-shadow: 0 10px 22px rgba(20, 22, 16, 0.2);
  border-color: var(--brand-deep);
}

.palette { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.palette svg { width: 100%; display: block; overflow: visible; }

/* Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 44px;
  background: rgba(12, 14, 9, 0.86);
  cursor: zoom-out;
}

.lightbox.open { display: flex; }

.lightbox figure {
  margin: 0;
  width: min(1100px, 100%);
  aspect-ratio: 2.39 / 1;
  background: var(--tile);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--rule);
  box-shadow: 0 26px 64px rgba(20, 22, 16, 0.34);
}

/* Footer */

.foot {
  margin-top: 40px;
  padding: 20px 0 30px;
  border-top: 1px solid var(--rule);
  font: 400 9.5px var(--mono);
  letter-spacing: 0.06em;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

/* Editor -------------------------------------------------------------- */

.edit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 44px;
  background: var(--brand-dark);
}

.edit-bar .wordmark { font-size: 22px; color: var(--brand); }

.edit-bar .right { display: flex; align-items: center; gap: 14px; }

.edit-status { font: 400 10px var(--mono); color: var(--link); }

.edit-bar button {
  padding: 7px 14px 8px;
  border-radius: 4px;
  border: 1px solid var(--link);
  background: transparent;
  color: var(--brand);
  font-family: var(--body);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
}

.edit-bar button.publish {
  border-color: transparent;
  background: var(--brand);
  color: var(--brand-dark);
}

.edit-bar button.publish:disabled {
  background: var(--track);
  color: var(--faint);
  cursor: not-allowed;
}

.field,
.edit input[type="text"],
.edit input[type="date"],
.edit textarea {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--field);
  padding: 7px 9px;
  font-family: var(--body);
  font-size: 13px;
  color: var(--ink);
  outline: none;
}

.edit textarea { min-height: 270px; resize: vertical; line-height: 1.65; padding: 12px; }

.edit .title-input {
  border: 0;
  border-bottom: 1.5px solid var(--rule);
  border-radius: 0;
  background: transparent;
  padding: 2px 0 6px;
  font-family: Shrikhand, Georgia, serif;
  font-size: 34px;
  line-height: 1.15;
}

.edit .headline-input {
  border: 0;
  border-bottom: 1.5px solid var(--rule);
  border-radius: 0;
  background: transparent;
  padding: 2px 0 7px;
  font-family: Chonburi, Georgia, serif;
  font-size: 21px;
  line-height: 1.25;
}

.edit .mono-input { font-family: var(--mono); font-size: 10px; }

.row { display: flex; gap: 10px; }

.slider { width: 100%; accent-color: var(--brand-deep); height: 14px; cursor: pointer; }

.drop {
  position: relative;
  overflow: hidden;
  border: 1px dashed var(--rule);
  border-radius: 2px;
  background: var(--field);
  background-size: cover;
  background-position: center;
}

.drop.shot-slot { aspect-ratio: 2.39 / 1; }
.drop.avatar { width: 56px; height: 56px; flex: none; border-radius: 50%; }

.drop input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font: 400 9px var(--mono);
  color: var(--faint);
  letter-spacing: 0.06em;
  pointer-events: none;
}

.drop.filled span { display: none; }

.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }

.swatch { display: flex; flex-direction: column; gap: 3px; }

.swatch input[type="color"] {
  width: 100%;
  height: 16px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
}

.gate {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 0 28px;
  text-align: center;
}

.gate .splat { width: 150px; height: 110px; }

.gate form { display: flex; flex-direction: column; gap: 10px; width: min(330px, 100%); }

.gate input {
  height: 48px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--field);
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--ink);
  outline: none;
}

.gate button {
  height: 48px;
  border: 0;
  border-radius: 4px;
  background: var(--brand);
  color: var(--brand-dark);
  font-family: var(--body);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.gate .fine { font-size: 10.5px; line-height: 1.5; color: var(--faint); }

.hidden { display: none !important; }

/* Phone --------------------------------------------------------------- */

@media (max-width: 720px) {
  .wrap { padding: 0 20px; }

  .masthead { padding: 14px 0; }
  .wordmark { font-size: 24px; }
  .masthead nav { gap: 12px; font-size: 11px; }

  .recent { grid-template-columns: 1fr 1fr; gap: 20px 16px; }
  .splat { height: 104px; }
  .splat-score { font-size: 31px; }

  .filters { flex-wrap: wrap; }
  .filters input { width: 100%; height: 44px; border-radius: 22px; padding: 0 16px; font-size: 11px; }
  .chips { width: 100%; overflow-x: auto; gap: 6px; padding-bottom: 2px; }
  .chips button { padding: 9px 14px; border-radius: 18px; font-size: 10px; }

  .ledger-row {
    grid-template-columns: 1fr auto;
    gap: 6px 14px;
    padding: 13px 0;
  }

  .ledger-row .spec-no,
  .ledger-row .bar-track,
  .ledger-row .ledger-tag { display: none; }

  .ledger-row .film-meta { grid-column: 1; }
  .ledger-score { font-size: 19px; grid-row: 1 / span 2; align-self: center; }

  .post-grid { grid-template-columns: 1fr; gap: 24px; }
  .post-head h1 { font-size: 30px; }
  .review p { font-size: 15px; }
  .btn { padding: 0 18px; height: 44px; border-radius: 22px; font-size: 13px; }
  .btn-solid { height: 48px; padding: 0 16px; font-size: 13px; }
  .badge { height: 112px; }
  .badge-text { padding: 0 54px; }
  .badge-name { font-size: 14px; }
  .badge-blurb { font-size: 11px; }
  .palette { gap: 8px; }
  .lightbox { padding: 20px; }

  .edit-bar { padding: 12px 20px; flex-wrap: wrap; }
  .edit-grid { grid-template-columns: 1fr !important; }
}
