:root {
  --paper: #f3f0e9;
  --ink: #181815;
  --muted: #74736d;
  --line: rgba(24, 24, 21, 0.14);
  --card: #fbfaf7;
  --lime: #dfff57;
  --violet: #6654ff;
  --shadow: 0 12px 28px rgba(35, 31, 21, 0.08), 0 2px 6px rgba(35, 31, 21, 0.04);
  color-scheme: light;
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 5%, rgba(255, 255, 255, 0.88), transparent 28rem),
    var(--paper);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(102, 84, 255, 0.3);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(243, 240, 233, 0.84);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 27px;
  height: 27px;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  padding: 3px;
  border-radius: 7px;
  background: var(--ink);
}

.brand-mark i {
  display: block;
  border-radius: 2px;
  background: var(--lime);
}

.brand-mark i:nth-child(2),
.brand-mark i:nth-child(3) {
  background: #fff;
}

.topbar-actions {
  display: flex;
  width: min(620px, 66vw);
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.search-wrap {
  display: flex;
  width: min(390px, 100%);
  height: 46px;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.search-wrap:focus-within {
  border-color: rgba(24, 24, 21, 0.34);
  background: #fff;
  box-shadow: 0 4px 18px rgba(35, 31, 21, 0.06);
}

.search-wrap svg,
.upload-button svg {
  width: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.search-wrap input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.search-wrap input::placeholder {
  color: #86847d;
}

.search-wrap kbd {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.65);
  font: 12px "DM Mono", monospace;
}

.upload-button,
.empty-upload,
.auth-submit {
  display: inline-flex;
  height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  color: #fff;
  background: var(--ink);
  font-size: 14px;
  font-weight: 650;
  transition: transform 140ms ease, background 140ms ease;
}

.upload-button:hover,
.empty-upload:hover,
.auth-submit:hover {
  transform: translateY(-1px);
  background: #302f2a;
}

main {
  padding: 0 clamp(20px, 4vw, 64px) 80px;
}

.intro {
  display: flex;
  max-width: 1500px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin: 0 auto;
  padding: clamp(54px, 8vw, 108px) 0 clamp(42px, 6vw, 72px);
}

.eyebrow {
  margin: 0 0 15px;
  color: var(--violet);
  font: 500 12px "DM Mono", monospace;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(50px, 8.4vw, 118px);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 0.88;
}

.intro-copy {
  margin: 25px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 1.8vw, 20px);
  letter-spacing: -0.02em;
}

.privacy-note {
  display: flex;
  max-width: 270px;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
  font-size: 13px;
  line-height: 1.5;
}

.privacy-note strong {
  color: var(--ink);
  font-weight: 650;
}

.account-menu {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.account-email {
  max-width: 170px;
  overflow: hidden;
  color: var(--muted);
  font: 11px "DM Mono", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signout-button {
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.48);
  font-size: 12px;
  font-weight: 650;
}

.signout-button:hover {
  background: #fff;
}

.auth-gate {
  display: grid;
  max-width: 1500px;
  min-height: 440px;
  place-items: center;
  margin: 0 auto;
  padding: 50px 0;
  border-top: 1px solid var(--line);
}

.auth-panel {
  width: min(430px, 100%);
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow);
}

.auth-panel h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1;
}

.auth-copy {
  margin: 14px 0 28px;
  color: var(--muted);
  font-size: 14px;
}

.install-hint {
  display: flex;
  max-width: 1500px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: -34px auto 34px;
  padding: 18px 20px;
  border: 1px solid rgba(102, 84, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
}

.install-hint .eyebrow {
  margin-bottom: 5px;
}

.install-hint strong,
.install-hint span {
  display: block;
}

.install-hint strong {
  font-size: 14px;
}

.install-hint span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.install-hint button,
.secondary-button {
  flex: 0 0 auto;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 650;
}

.access-loader {
  display: block;
  width: 30px;
  height: 30px;
  border: 2px solid var(--line);
  border-top-color: var(--violet);
  border-radius: 50%;
  animation: access-spin 700ms linear infinite;
}

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

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-form label {
  display: grid;
  gap: 7px;
}

.auth-form label span {
  color: var(--muted);
  font: 10px "DM Mono", monospace;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.auth-form input {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: #fff;
  font-size: 14px;
}

.auth-form input:focus {
  border-color: rgba(102, 84, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(102, 84, 255, 0.12);
}

.auth-error {
  min-height: 18px;
  margin: -3px 0;
  color: #aa3028;
  font-size: 12px;
  line-height: 1.45;
}

.auth-submit {
  width: 100%;
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.6;
}

.auth-switch {
  display: block;
  margin: 17px auto 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.auth-switch:hover {
  border-color: currentColor;
  color: var(--ink);
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 5px;
  border-radius: 50%;
  background: #78b832;
  box-shadow: 0 0 0 4px rgba(120, 184, 50, 0.13);
}

.board-tools {
  display: flex;
  max-width: 1500px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
}

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

.filter {
  display: inline-flex;
  height: 35px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
}

.filter span {
  color: #9b9991;
  font: 11px "DM Mono", monospace;
}

.filter:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
}

.filter.is-active {
  border-color: var(--line);
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 5px rgba(35, 31, 21, 0.04);
}

.board-status {
  margin: 0;
  color: var(--muted);
  font: 12px "DM Mono", monospace;
}

.dropzone {
  position: relative;
  max-width: 1500px;
  min-height: 420px;
  margin: 0 auto;
  padding-top: 28px;
}

.media-grid {
  column-count: 4;
  column-gap: 18px;
}

.media-card {
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 0 0 18px;
  overflow: hidden;
  break-inside: avoid;
  border: 1px solid rgba(24, 24, 21, 0.1);
  border-radius: 15px;
  background: var(--card);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  animation: card-in 320ms ease forwards;
}

@keyframes card-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.media-preview {
  position: relative;
  overflow: hidden;
  background: #dedbd3;
}

.media-preview img,
.media-preview video {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

.media-preview video {
  aspect-ratio: 16 / 10;
  background: #151514;
}

.audio-preview {
  position: relative;
  display: flex;
  min-height: 196px;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  overflow: hidden;
  color: #fff;
  background: var(--violet);
}

.audio-preview::before,
.audio-preview::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  content: "";
}

.audio-preview::before {
  width: 230px;
  height: 230px;
  right: -115px;
  top: -80px;
}

.audio-preview::after {
  width: 150px;
  height: 150px;
  right: -75px;
  top: -40px;
}

.audio-icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
}

.audio-icon svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.audio-preview audio {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 38px;
  opacity: 0.94;
}

.media-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 13px 14px 15px;
}

.media-copy {
  min-width: 0;
  flex: 1;
}

.media-name {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.media-details {
  margin: 4px 0 0;
  color: var(--muted);
  font: 10px "DM Mono", monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.remove-button {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  color: #87847c;
  background: transparent;
  opacity: 0;
  transition: opacity 140ms ease, color 140ms ease, background 140ms ease;
}

.media-card:hover .remove-button,
.remove-button:focus-visible {
  opacity: 1;
}

.remove-button:hover {
  color: #a52b22;
  background: #f7e8e5;
}

.remove-button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.empty-state,
.no-results {
  display: flex;
  min-height: 410px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-graphic {
  position: relative;
  width: 142px;
  height: 112px;
  margin-bottom: 24px;
}

.empty-card {
  position: absolute;
  display: block;
  width: 70px;
  height: 88px;
  border: 1px solid rgba(24, 24, 21, 0.13);
  border-radius: 10px;
  box-shadow: 0 8px 15px rgba(35, 31, 21, 0.06);
}

.card-one {
  left: 2px;
  top: 18px;
  transform: rotate(-9deg);
  background: #ffc2c2;
}

.card-two {
  right: 2px;
  top: 18px;
  transform: rotate(9deg);
  background: var(--lime);
}

.card-three {
  z-index: 2;
  left: 36px;
  top: 3px;
  display: grid;
  place-items: center;
  background: #fff;
}

.card-three svg {
  width: 25px;
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.empty-state h2,
.no-results h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.empty-state p,
.no-results p {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 14px;
}

.no-results button {
  border: 0;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}

.drop-overlay {
  position: fixed;
  z-index: 100;
  inset: 12px;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(102, 84, 255, 0.58);
  border-radius: 22px;
  pointer-events: none;
  background: rgba(243, 240, 233, 0.91);
  backdrop-filter: blur(12px);
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 140ms ease, transform 140ms ease;
}

.drop-overlay.is-visible {
  opacity: 1;
  transform: scale(1);
}

.drop-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--ink);
}

.drop-overlay-inner svg {
  width: 46px;
  margin-bottom: 18px;
  padding: 11px;
  border-radius: 50%;
  color: #fff;
  background: var(--violet);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.drop-overlay-inner strong {
  font-size: clamp(23px, 3vw, 36px);
  letter-spacing: -0.045em;
}

.drop-overlay-inner span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.toast {
  position: fixed;
  z-index: 110;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  padding: 13px 16px;
  border-radius: 10px;
  pointer-events: none;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 12px 30px rgba(22, 21, 17, 0.2);
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.upload-progress {
  position: fixed;
  z-index: 105;
  right: 22px;
  bottom: 22px;
  width: min(340px, calc(100vw - 44px));
  padding: 15px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 12px 30px rgba(22, 21, 17, 0.2);
}

.upload-progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
  font-size: 12px;
}

.upload-progress-copy span:last-child {
  font: 11px "DM Mono", monospace;
}

.upload-progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
}

.upload-progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--lime);
  transition: width 140ms ease;
}

dialog {
  width: min(520px, calc(100vw - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 24px 80px rgba(22, 21, 17, 0.24);
}

dialog::backdrop {
  background: rgba(24, 24, 21, 0.42);
  backdrop-filter: blur(8px);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 24px 19px;
  border-bottom: 1px solid var(--line);
}

.dialog-heading .eyebrow {
  margin-bottom: 8px;
}

.dialog-heading h2 {
  margin: 0;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.045em;
}

.dialog-close {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
}

.media-actions-grid {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.media-action {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 14px;
  padding: 13px;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  text-align: left;
  background: #fff;
  transition: border-color 150ms ease, transform 150ms ease;
}

.media-action:hover {
  border-color: var(--line);
  transform: translateY(-1px);
}

.media-action-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--violet);
  font: 23px "DM Mono", monospace;
}

.record-icon {
  color: #db3f35;
  background: #f9e4e2;
}

.media-action strong,
.media-action small {
  display: block;
}

.media-action strong {
  font-size: 14px;
}

.media-action small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.recorder-body {
  display: flex;
  min-height: 350px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 24px 28px;
  text-align: center;
}

.recording-orb {
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  border-radius: 50%;
  background: #f7e3e1;
}

.recording-orb i {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #d43d33;
  transition: border-radius 180ms ease, transform 180ms ease;
}

.recording-orb.is-recording {
  animation: recording-pulse 1.4s ease-in-out infinite;
}

.recording-orb.is-recording i {
  border-radius: 6px;
  transform: scale(0.8);
}

@keyframes recording-pulse {
  50% { box-shadow: 0 0 0 14px rgba(212, 61, 51, 0.08); }
}

.recording-time {
  margin: 20px 0 3px;
  font: 500 28px "DM Mono", monospace;
  letter-spacing: -0.05em;
}

.recording-status {
  min-height: 20px;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12px;
}

.recorder-body audio {
  width: min(330px, 100%);
  margin: 0 0 20px;
}

.record-toggle,
.primary-button {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  color: #fff;
  background: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.record-toggle.is-recording {
  background: #d43d33;
}

.recording-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.recording-actions .secondary-button {
  min-height: 46px;
}

@media (max-width: 1100px) {
  .media-grid {
    column-count: 3;
  }
}

@media (max-width: 780px) {
  .topbar {
    min-height: 68px;
    gap: 12px;
  }

  .brand > span:last-child,
  .search-wrap kbd {
    display: none;
  }

  .upload-button {
    width: 46px;
    flex: 0 0 auto;
    padding: 0;
    font-size: 0;
  }

  .topbar-actions {
    width: calc(100% - 40px);
  }

  .search-wrap {
    width: 100%;
  }

  .intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 28px;
    padding-top: 54px;
  }

  .privacy-note {
    max-width: none;
  }

  .board-tools {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .media-grid {
    column-count: 2;
  }

  .remove-button {
    opacity: 1;
  }
}

@media (max-width: 520px) {
  main,
  .topbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  h1 {
    font-size: 54px;
  }

  .intro-copy {
    max-width: 320px;
  }

  .filters {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .filter {
    flex: 0 0 auto;
  }

  .media-grid {
    column-count: 1;
  }

  .media-preview img,
  .media-preview video {
    max-height: none;
  }

  .install-hint {
    align-items: flex-start;
    margin-top: -26px;
  }

  dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    margin-bottom: max(8px, env(safe-area-inset-bottom));
    border-radius: 18px;
  }

  .dialog-heading {
    padding: 21px 20px 16px;
  }

  .media-actions-grid {
    padding: 12px;
  }

  .toast,
  .upload-progress {
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    width: calc(100vw - 28px);
    max-width: none;
  }
}

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