:root {
  --bg: #050505;
  --bg-2: #0b0b0b;
  --ink: #f7f7f7;
  --muted: #9a9a9a;
  --line: rgba(255, 255, 255, 0.14);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0.035;
  background-image: linear-gradient(rgba(255,255,255,0.12) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.12) 1px, transparent 1px);
  background-size: 3px 3px;
}

.wrap {
  position: relative;
  z-index: 2;
  width: min(100% - 40px, 900px);
  margin-inline: auto;
  padding: 28px 0 90px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 800;
  letter-spacing: -0.06em;
  font-size: 1.1rem;
}

.tag,
.eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.back {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
}

.back:hover { color: #fff; border-color: #fff; }

.panel { padding-top: 72px; }

h1 {
  margin: 18px 0 24px;
  font-size: clamp(3.1rem, 10vw, 7rem);
  line-height: 0.88;
  letter-spacing: -0.075em;
}

.lede {
  max-width: 620px;
  margin: 0 0 48px;
  color: #d6d6d6;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.6;
}

form { max-width: 620px; }

label {
  display: block;
  margin: 26px 0 10px;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: clamp(1rem, 2vw, 1.3rem);
  resize: vertical;
}

input:focus,
textarea:focus { border-bottom-color: #fff; }
input::placeholder,
textarea::placeholder { color: #4a4a4a; }

button {
  margin-top: 30px;
  padding: 13px 22px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: #050505;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.25s, background 0.25s, color 0.25s;
}

button:hover { transform: translateY(-2px); }
button:disabled { opacity: 0.5; cursor: wait; transform: none; }

button.quiet {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

button.quiet:hover { color: #fff; border-color: #fff; }

.status {
  min-height: 1.2em;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.status.error { color: #ff8d8d; }

.fineprint {
  max-width: 620px;
  margin-top: 48px;
  color: #5c5c5c;
  font-size: 0.76rem;
  line-height: 1.6;
}

.vault-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-top: 64px;
}

.vault-head h1 { margin-bottom: 0; }
.vault-head button { margin-top: 0; }

.editor {
  margin-top: 64px;
  padding: 30px 0 0;
  border-top: 1px solid var(--line);
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.editor-actions button.quiet { margin-top: 30px; }

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 80px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.list-head h2 {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.list-head input {
  max-width: 260px;
  font-size: 0.85rem;
  padding: 8px 0;
}

.list { display: grid; gap: 14px; margin-top: 24px; }

.card {
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}

.card-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.card-text {
  margin: 0;
  color: #d6d6d6;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.card-meta {
  margin: 16px 0 0;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5c5c5c;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.card-actions button {
  margin: 0;
  padding: 8px 12px;
  font-size: 0.62rem;
  border-radius: 0;
}

.empty {
  padding: 40px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 90px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: #5c5c5c;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.site-foot a {
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}

.site-foot a:hover { color: #fff; border-color: #fff; }

@media (max-width: 560px) {
  .wrap { width: min(100% - 28px, 900px); padding-top: max(20px, env(safe-area-inset-top)); }
  .top { flex-wrap: wrap; }
  .back { margin-left: auto; }
  .panel { padding-top: 48px; }
  .vault-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .list-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .list-head input { max-width: none; }
  .card { padding: 18px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .panel { padding-top: 30px; }
  h1 { font-size: clamp(2.4rem, 8vw, 4rem); margin-bottom: 14px; }
  .lede { margin-bottom: 24px; }
}
