@font-face {
  font-family: "JetBrainsMono Nerd Font";
  src: url("../assets/fonts/JetBrainsMonoNerdFont-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "JetBrainsMono Nerd Font";
  src: url("../assets/fonts/JetBrainsMonoNerdFont-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --border: #e5e2da;
  --text: #1a1917;
  --muted: #7a776f;
  --accent: #2f6f4f;
  --accent-light: #e8f3ec;
  --radius: 14px;
  --font-mono: "JetBrainsMono Nerd Font", "SF Mono", Consolas, monospace;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
}

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

.header-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 4px;
}

.header-link:hover {
  color: var(--accent);
}

.privacy-btn {
  background: var(--accent-light);
  color: var(--accent);
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.hero {
  text-align: center;
  padding: 40px 20px 24px;
  max-width: 600px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 28px;
  margin-bottom: 12px;
}

.hero p {
  color: var(--muted);
  font-size: 16px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  padding: 0 20px 40px;
  max-width: 800px;
  margin: 0 auto;
}

.tool-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  cursor: pointer;
  font-family: inherit;
  min-height: 120px;
  justify-content: center;
}

.tool-card:active {
  background: var(--accent-light);
  border-color: var(--accent);
}

.tool-icon {
  font-size: 28px;
}

.tool-name {
  font-weight: 700;
  font-size: 15px;
}

.tool-desc {
  font-size: 12px;
  color: var(--muted);
}

.workspace {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px;
}

.back-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  padding: 8px 0;
  margin-bottom: 12px;
  cursor: pointer;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.file-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
}

.file-remove {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
}

.primary-btn {
  width: 100%;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  margin-top: 20px;
  cursor: pointer;
}

.primary-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.result-box {
  margin-top: 20px;
  padding: 20px;
  background: var(--accent-light);
  border-radius: var(--radius);
  text-align: center;
}

.result-box a {
  display: inline-block;
  margin-top: 10px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.page-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.page-thumb canvas {
  max-width: 100%;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.page-thumb-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.page-thumb.selectable {
  cursor: pointer;
  opacity: 0.35;
}

.page-thumb.selectable.selected {
  opacity: 1;
  border-color: var(--accent);
}

.page-thumb-download {
  background: var(--accent-light);
  color: var(--accent);
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.file-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}

.file-card.dragging {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border-color: var(--accent);
}

.file-card-thumb {
  width: 40px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  overflow: hidden;
  color: var(--muted);
  font-size: 18px;
}

.file-card-thumb canvas {
  max-width: 100%;
  max-height: 100%;
}

.file-card-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-card-handle {
  cursor: grab;
  color: var(--muted);
  font-size: 20px;
  padding: 8px;
  touch-action: none;
  user-select: none;
}

.file-card-handle:active {
  cursor: grabbing;
}

.file-card-remove {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 6px;
}

.file-card-placeholder {
  border: 2px dashed var(--accent);
  border-radius: 12px;
  background: var(--accent-light);
}

.site-footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--muted);
  font-size: 13px;
}

.footer-links {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}

.font-credit {
  margin-top: 14px;
  font-size: 11px;
  opacity: 0.7;
}

.font-credit a {
  color: var(--muted);
  text-decoration: underline;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 28px 20px;
  max-width: 500px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}

@media (min-width: 900px) {
  /* On wider screens, behave like a devtools side panel: docked to the
     right edge, full height, sliding in over the page rather than a
     centered popup. This deliberately echoes what opening a real
     browser devtools panel looks like. */
  .modal {
    background: transparent;
    align-items: stretch;
    justify-content: flex-end;
    pointer-events: none;
  }

  .modal-content {
    pointer-events: auto;
    border-radius: 0;
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.08);
    max-width: 380px;
    width: 380px;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    animation: slideIn 0.2s ease-out;
  }

  @keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
}

.modal-content h2 {
  font-size: 20px;
  margin-bottom: 16px;
  padding-right: 30px;
}

.proof-box {
  background: var(--accent-light);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin-bottom: 16px;
}

.proof-counter #bytesSent {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 800;
  color: var(--accent);
  display: block;
}

.proof-label {
  font-size: 13px;
  color: var(--muted);
}

.proof-explain {
  font-size: 14px;
  margin-bottom: 14px;
  color: var(--text);
}

.proof-tech {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}

.proof-tech summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
}

.proof-tech ol {
  margin: 10px 0 10px 20px;
}
