/* ---------------------------------------------------------------------------
   Masthead, cards, capture box, toast.
   Interactions snap: hover lifts onto a bigger shadow, :active presses the
   block flat onto the page (translate to the shadow offset, shadow gone).
--------------------------------------------------------------------------- */

/* ---- Masthead -------------------------------------------------------- */

.masthead {
  padding: clamp(18px, 3vw, 30px) clamp(20px, 3.5vw, 36px);
}

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

.masthead-title {
  font-size: clamp(34px, 6vw, 58px);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.masthead-icon {
  display: inline-block;
  color: var(--red);
  -webkit-text-stroke: 1px var(--ink);
}

.masthead-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.masthead-date {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.theme-toggle {
  background: var(--bg);
  border: var(--border-w) solid var(--ink);
  box-shadow: 3px 3px 0 var(--shadow-ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  padding: 5px 10px;
  cursor: pointer;
}

.theme-toggle:hover {
  translate: -1px -1px;
  box-shadow: 4px 4px 0 var(--shadow-ink);
}

.theme-toggle:active {
  translate: 3px 3px;
  box-shadow: none;
}

.summary {
  margin-top: 12px;
  font-size: clamp(16px, 2.2vw, 21px);
  font-weight: 600;
  border-top: var(--border-w) solid var(--ink);
  padding-top: 12px;
}

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

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: clamp(18px, 2.5vw, 28px);
}

.card {
  position: relative;
  border: var(--border-w) solid var(--ink);
  box-shadow: var(--shadow);
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 190px;
}

.card-yellow {
  background: var(--yellow);
  color: var(--ink-on-yellow);
}

.card-red {
  background: var(--red);
  color: var(--ink-on-red);
}

.card-blue {
  background: var(--blue);
  color: var(--ink-on-blue);
}

.card-green {
  background: var(--green);
  color: var(--ink-on-green);
}

/* A fifth card can't have a fifth hue without breaking the Bauhaus palette, so
   IDEAS inverts the skeleton instead: black on white by day, white on black by
   night. Same two colours as the page, swapped. */
.card-ink {
  background: var(--ink);
  color: var(--bg);
}

/* Cards with a .card-link lift/press as one physical block. */
.card:has(.card-link):hover {
  translate: -2px -2px;
  box-shadow: var(--shadow-lift);
}

.card:has(.card-link):active {
  translate: 6px 6px;
  box-shadow: none;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-label {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.card-value {
  font-size: clamp(40px, 5vw, 52px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.card-sub {
  font-size: 14px;
  font-weight: 600;
  min-height: 1.4em;
}

/* Whole-card click target via a stretched link; buttons sit above it. */
.card-link {
  margin-top: auto;
  align-self: flex-start;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-decoration: none;
  border-bottom: 3px solid currentColor;
}

.card-link::after {
  content: '';
  position: absolute;
  inset: 0;
}

.icon-btn {
  position: relative;
  z-index: 1;
  background: transparent;
  border: var(--border-w) solid currentColor;
  width: 34px;
  height: 34px;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
  line-height: 1;
}

.icon-btn:hover {
  background: color-mix(in srgb, currentColor 15%, transparent);
}

.icon-btn:active {
  translate: 2px 2px;
}

.icon-btn[disabled] {
  cursor: wait;
}

@keyframes spin-snap {
  to {
    transform: rotate(360deg);
  }
}

.icon-btn.busy {
  animation: spin-snap 700ms steps(8) infinite;
}

/* ---- Mail card -------------------------------------------------------- */

.mail-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin: 6px 0 auto;
}

.mail-links a {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-decoration: none;
  border-bottom: 3px solid currentColor;
}

.mail-links a:hover {
  translate: -1px -1px;
}

.mail-links a:active {
  translate: 2px 2px;
}

.mail-connect {
  display: inline-block;
  margin-top: 14px;
  border: var(--border-w) solid currentColor;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--shadow-ink);
}

.mail-connect:hover {
  translate: -1px -1px;
  box-shadow: 4px 4px 0 var(--shadow-ink);
}

.mail-connect:active {
  translate: 3px 3px;
  box-shadow: none;
}

.mail-unread {
  border: 2px solid currentColor;
  padding: 1px 9px;
  font-size: 13px;
  font-weight: 900;
}

.mail-list {
  list-style: none;
  margin: 2px 0 10px;
}

.mail-list li {
  border-bottom: 2px solid color-mix(in srgb, currentColor 30%, transparent);
}

.mail-list li:last-child {
  border-bottom: none;
}

.mail-list a {
  display: block;
  padding: 6px 0;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.3;
}

.mail-list a:hover {
  translate: -1px 0;
}

.mail-list .mail-from {
  font-weight: 900;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mail-list .mail-subject {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}

.mail-list li.unread .mail-subject {
  opacity: 1;
}

.mail-list li.unread a::before {
  content: '● ';
  font-size: 10px;
  vertical-align: 2px;
}

.mail-list .mail-when {
  float: right;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.75;
  margin-left: 8px;
}

.mail-open-inbox {
  font-weight: 900;
  letter-spacing: 0.1em;
  font-size: 12px;
  text-decoration: none;
  border-bottom: 2px solid currentColor;
}

/* ---- Ideas card --------------------------------------------------------- */

/* The resurfaced idea sits above the card's stretched link so it can be its
   own target — clicking it opens that idea rather than the board. */
.idea-resurface {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  margin-top: 2px;
  max-width: 100%;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  border-bottom: 2px solid color-mix(in srgb, currentColor 45%, transparent);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.idea-resurface:hover {
  border-bottom-color: currentColor;
  translate: -1px -1px;
}

.idea-resurface:active {
  translate: 2px 2px;
}

/* ---- Podscript bar ------------------------------------------------------ */

.podbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
}

.podbar-info {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  min-width: 0;
}

.podbar-label {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.podbar-sub {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.podbar-action {
  flex-shrink: 0;
  background: var(--blue);
  color: var(--ink-on-blue);
  border: var(--border-w) solid var(--ink);
  box-shadow: 4px 4px 0 var(--shadow-ink);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.12em;
  padding: 10px 22px;
  text-decoration: none;
  cursor: pointer;
}

.podbar-action:hover {
  translate: -1px -1px;
  box-shadow: 5px 5px 0 var(--shadow-ink);
}

.podbar-action:active {
  translate: 4px 4px;
  box-shadow: none;
}

.podbar-action[disabled] {
  cursor: wait;
  opacity: 0.7;
}

.podbar-actions {
  display: flex;
  gap: 14px;
  flex-shrink: 0;
}

.podbar-ghost {
  background: var(--paper);
  color: var(--ink);
}

/* ---- Quick capture ----------------------------------------------------- */

.capture {
  padding: 16px 20px 20px;
}

.capture-label {
  display: block;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.18em;
  margin-bottom: 10px;
}

.capture-row {
  display: flex;
  gap: 12px;
}

.capture-input {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: var(--border-w) solid var(--ink);
  padding: 10px 14px;
  font-size: 16px;
  font-weight: 600;
}

.capture-input:focus {
  outline: none;
  box-shadow: 4px 4px 0 var(--shadow-ink);
}

.capture-input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.capture-btn {
  background: var(--yellow);
  color: var(--ink-on-yellow);
  border: var(--border-w) solid var(--ink);
  box-shadow: 4px 4px 0 var(--shadow-ink);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.12em;
  padding: 10px 22px;
  cursor: pointer;
}

.capture-btn:hover {
  translate: -1px -1px;
  box-shadow: 5px 5px 0 var(--shadow-ink);
}

.capture-btn:active {
  translate: 4px 4px;
  box-shadow: none;
}

.capture-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

/* → TASK is the secondary door: same shape, no colour, so the eye lands on
   → IDEA first. */
.capture-ghost {
  background: var(--paper);
  color: var(--ink);
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  translate: -50% 0;
  background: var(--paper);
  color: var(--ink);
  border: var(--border-w) solid var(--ink);
  box-shadow: var(--shadow);
  font-size: 15px;
  font-weight: 700;
  padding: 12px 20px;
  max-width: min(90vw, 520px);
}

.toast.error {
  background: var(--red);
  color: var(--ink-on-red);
}

/* ---- Small screens ------------------------------------------------------ */

@media (max-width: 560px) {
  .capture-row {
    flex-direction: column;
  }

  .capture-actions {
    align-self: flex-end;
  }
}
