:root {
  --deep: #0f0f10;
  --bg: #141415;
  --card: #19191b;
  --raised: #232325;
  --line: rgba(237, 237, 237, 0.08);
  --text: #ededed;
  --text-2: #a1a1a6;
  --text-3: #85858b;
  --ember: #ff6a3d;
  --sans: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/22px var(--sans);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }

svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Bar */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  max-width: 688px;
  margin: 0 auto;
  padding: 0 24px;
}

.wordmark {
  font: 500 16px/1 var(--sans);
  color: var(--text);
  text-decoration: none;
}

.timer {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font: 400 12px/16px var(--mono);
  color: var(--text-3);
}
.timer-value {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.timer.low .timer-value { color: var(--ember); }

main {
  max-width: 688px;
  margin: 0 auto;
  padding: 0 24px 96px;
}

/* Address */

.address { padding: 64px 0 48px; }

.addr {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  font: 500 32px/40px var(--mono);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.local { color: var(--text); }
.domain { color: var(--text-3); }

.local-input {
  width: 10ch;
  min-width: 3ch;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--text-3);
  border-radius: 0;
  outline: none;
  caret-color: var(--ember);
}
.local-input:focus { border-bottom-color: var(--text); }

.actions {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  color: var(--text);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease);
}
.btn:hover { background: #2b2b2e; }
.btn:active { transform: scale(0.98); }
.btn:focus-visible, .row:focus-visible, .code:focus-visible, .wordmark:focus-visible {
  outline: 2px solid var(--text-2);
  outline-offset: 2px;
}
.btn.primary {
  color: var(--deep);
  background: var(--text);
  border-color: transparent;
  box-shadow: none;
}
.btn.primary:hover { background: #ffffff; }
.btn.icon { width: 40px; padding: 0; justify-content: center; }
.btn.ghost {
  height: 32px;
  padding: 0 8px;
  color: var(--text-2);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.btn.ghost.icon { width: 32px; padding: 0; }
.btn.ghost:hover { color: var(--text); background: var(--raised); }
.btn .label { display: inline; }

/* Panel */

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 12px 8px;
}
h2 {
  margin: 0;
  font: 500 14px/20px var(--sans);
  color: var(--text-2);
}
.count {
  font: 400 12px/16px var(--mono);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 16px;
  width: 100%;
  padding: 12px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 150ms var(--ease);
}
.row:hover { background: var(--raised); }
.row.fresh { animation: rise 400ms var(--ease); }

.row-from {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-time {
  font: 400 12px/22px var(--mono);
  color: var(--text-3);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.row-subject {
  color: var(--text-2);
  font-size: 14px;
  line-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-code {
  font: 500 14px/20px var(--mono);
  color: var(--ember);
  text-align: right;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

/* Viewer */

.viewer-bar {
  display: flex;
  justify-content: space-between;
  padding: 4px;
}

.viewer-head { padding: 12px 12px 16px; }
h3 {
  margin: 0;
  font: 500 20px/28px var(--sans);
  overflow-wrap: anywhere;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 14px;
  line-height: 20px;
  overflow-wrap: anywhere;
}
.meta-time {
  font: 400 12px/20px var(--mono);
  color: var(--text-3);
}

.code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 24px);
  margin: 0 12px 16px;
  padding: 20px 24px;
  background: var(--deep);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 150ms var(--ease);
}
.code:hover { border-color: rgba(255, 106, 61, 0.4); }
.code-digits {
  font: 500 40px/1 var(--mono);
  letter-spacing: 0.16em;
  color: var(--ember);
  font-variant-numeric: tabular-nums;
}
.code-hint {
  font: 400 12px/16px var(--mono);
  color: var(--text-3);
}

.body {
  display: block;
  width: 100%;
  height: 60vh;
  min-height: 360px;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
}

.files {
  list-style: none;
  margin: 0;
  padding: 12px 12px 4px;
  font: 400 12px/20px var(--mono);
  color: var(--text-3);
}
.files:empty { display: none; }

/* Toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--deep);
  background: var(--text);
  border-radius: 10px;
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
}

@media (max-width: 560px) {
  .bar, main { padding-left: 16px; padding-right: 16px; }
  .address { padding: 40px 0 32px; }
  .addr { font-size: 22px; line-height: 30px; }
  .actions .btn:not(.icon) { flex: 1; justify-content: center; }
  .code-digits { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
