*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #121110;
  --bg-elevated: #1a1816;
  --bg-editor: #0e0d0c;
  --sidebar: #161412;
  --text: #ece8e1;
  --text-dim: rgba(236, 232, 225, 0.48);
  --hairline: rgba(255, 255, 255, 0.07);
  --hairline-strong: rgba(255, 255, 255, 0.12);
  --accent: #e8a035;
  --accent-soft: rgba(232, 160, 53, 0.16);
  --accent-hover: #f2b24d;
  --accent-text: #1a1200;
  --select-bg: rgba(232, 200, 140, 0.18);
  --select-text: #f5ead8;
  --error: #ff8f8f;
  --error-bg: rgba(255, 95, 95, 0.1);
  --radius-outer: 1.25rem;
  --radius-inner: calc(1.25rem - 0.3rem);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --font-ui: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.55;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}

.orb-amber {
  width: 38vw;
  height: 38vw;
  top: -10%;
  right: 8%;
  background: radial-gradient(circle, rgba(232, 160, 53, 0.14) 0%, transparent 68%);
}

.orb-void {
  width: 42vw;
  height: 42vw;
  bottom: -14%;
  left: -8%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.04) 0%, transparent 70%);
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.nav-island {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(720px, calc(100% - 2rem));
  margin: 1rem auto 0;
  padding: 0.55rem 0.55rem 0.55rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 40px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--hairline);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: -0.03em;
  transition: opacity 700ms var(--ease);
}

.logo:hover {
  opacity: 0.82;
}

.logo-glow {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(232, 160, 53, 0.55);
}

.site-domain {
  padding-right: 0.35rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
}

.container {
  position: relative;
  z-index: 2;
  width: min(1120px, 94vw);
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

/* --- Bezel system --- */

.bezel-outer {
  padding: 0.3rem;
  border-radius: var(--radius-outer);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--hairline);
}

.bezel-inner {
  border-radius: var(--radius-inner);
  background: var(--bg-editor);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* --- Create page --- */

.page-create {
  position: relative;
  z-index: 2;
  min-height: calc(100dvh - 4rem);
  display: flex;
  flex-direction: column;
  padding: 0 0.75rem 2rem;
}

@media (min-width: 768px) {
  .page-create {
    padding: 0 1rem 2.5rem;
  }
}

.alert {
  margin: 0.75rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-inner);
  color: var(--error);
  background: var(--error-bg);
  border: 1px solid rgba(255, 95, 95, 0.18);
  font-size: 0.8125rem;
}

.editor-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  flex: 1;
  margin-top: 1rem;
  min-height: 0;
}

@media (min-width: 768px) {
  .editor-workspace {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 0.85rem;
    min-height: calc(100dvh - 8rem);
  }
}

.editor-main {
  min-height: 52dvh;
  display: flex;
}

@media (min-width: 768px) {
  .editor-main {
    min-height: 0;
    height: calc(100dvh - 8rem);
  }
}

.editor-canvas {
  flex: 1;
  display: flex;
  min-height: 0;
}

.editor-main textarea {
  width: 100%;
  height: 100%;
  min-height: 50dvh;
  border: 0;
  resize: none;
  padding: 1.25rem 1.5rem;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  outline: none;
}

@media (min-width: 768px) {
  .editor-main textarea {
    min-height: 0;
  }
}

.editor-main textarea::placeholder {
  color: var(--text-dim);
}

.editor-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.3rem;
  border-radius: var(--radius-outer);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

@media (min-width: 768px) {
  .editor-sidebar {
    height: calc(100dvh - 8rem);
  }
}

.btn-paste {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: calc(100% - 0.6rem);
  margin: 0.3rem auto 0.65rem;
  padding: 0.8rem 0.85rem 0.8rem 1.15rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #f0b24d, var(--accent));
  color: var(--accent-text);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(232, 160, 53, 0.22);
  transition:
    transform 700ms var(--ease),
    box-shadow 700ms var(--ease),
    filter 700ms var(--ease);
}

.btn-paste:hover {
  filter: brightness(1.04);
  box-shadow: 0 14px 36px rgba(232, 160, 53, 0.28);
}

.btn-paste:active {
  transform: scale(0.98);
}

.btn-paste-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.12);
  transition: transform 700ms var(--ease);
}

.group:hover .btn-paste-icon {
  transform: translate(2px, -1px) scale(1.05);
}

.sidebar-section {
  padding: 0 0.45rem 0.75rem;
}

.sidebar-label {
  margin: 0 0 0.45rem;
  padding: 0 0.35rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.lang-shell {
  border-radius: 1rem;
}

.lang-shell.bezel-outer {
  padding: 0.2rem;
}

.lang-list {
  max-height: 210px;
  overflow-y: auto;
  padding: 0.15rem;
}

.lang-item {
  display: block;
  cursor: pointer;
}

.lang-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.lang-item span {
  display: block;
  padding: 0.5rem 0.65rem;
  border-radius: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  transition:
    background 500ms var(--ease),
    color 500ms var(--ease),
    transform 500ms var(--ease);
}

.lang-item:hover span {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.lang-item input:checked + span {
  color: var(--select-text);
  background: var(--select-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.sidebar-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sidebar-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-field span {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.field-shell {
  padding: 0.15rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--hairline);
  transition: border-color 700ms var(--ease), box-shadow 700ms var(--ease);
}

.field-shell:focus-within {
  border-color: rgba(232, 160, 53, 0.35);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.sidebar-field select,
.sidebar-field input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  outline: none;
  color-scheme: dark;
}

.sidebar-field option {
  background: var(--bg-elevated);
  color: var(--text);
}

.sidebar-hint {
  margin: auto 0 0;
  padding: 0.75rem 0.55rem 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.man-help {
  display: grid;
  gap: 1.5rem;
  margin-top: 2.5rem;
  padding: 2rem 0.25rem 1rem;
  max-width: 40rem;
}

.help-block p,
.help-block .man-block {
  margin: 0.5rem 0 0;
}

.help-block p,
.man-block {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
}

.man-block {
  color: rgba(236, 232, 225, 0.72);
  white-space: pre-wrap;
}

.eyebrow {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(232, 160, 53, 0.18);
}

/* --- Secondary pages --- */

.page-head {
  margin-bottom: 1.5rem;
}

.page-head-center {
  text-align: center;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.lede {
  margin: 0;
  color: var(--text-dim);
}

.paste-id {
  font-family: var(--font-mono);
  color: var(--accent);
}

.bezel-shell {
  padding: 0.3rem;
  border-radius: var(--radius-outer);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--hairline);
}

.bezel-shell.narrow {
  max-width: 24rem;
  margin: 0 auto;
}

.bezel-inner {
  padding: 1.25rem;
}

.paste-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.input-shell {
  padding: 0.15rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--hairline);
}

.input-shell:focus-within {
  border-color: rgba(232, 160, 53, 0.35);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea,
input[type="password"],
select {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  padding: 0.65rem 0.75rem;
  outline: none;
  color-scheme: dark;
}

select option {
  background: var(--bg-elevated);
  color: var(--text);
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #f0b24d, var(--accent));
  color: var(--accent-text);
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 700ms var(--ease), filter 700ms var(--ease);
}

.btn-primary:hover {
  filter: brightness(1.04);
}

.btn-primary:active,
.btn-secondary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: var(--hairline);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.07);
}

.view-page {
  max-width: 32rem;
  padding-top: 1rem;
}

.view-note {
  margin: 0 0 1.25rem;
  color: var(--text-dim);
  font-size: 0.875rem;
  line-height: 1.6;
}

.raw-url {
  margin: 1.5rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--hairline);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

.view-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .view-layout {
    grid-template-columns: 280px 1fr;
  }
}

.meta-bento {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: grid;
  gap: 0.5rem;
}

.meta-chip {
  padding: 0.75rem 0.85rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--hairline);
  font-size: 0.8125rem;
}

.meta-chip span {
  display: block;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.meta-chip strong {
  font-family: var(--font-mono);
  font-weight: 500;
}

.meta-chip-accent {
  border-color: rgba(232, 160, 53, 0.2);
  background: var(--accent-soft);
}

.meta-chip-accent strong {
  color: var(--accent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.code-shell.bezel-outer {
  min-width: 0;
}

.code-inner pre {
  margin: 0;
  overflow: auto;
  max-height: min(75dvh, 720px);
}

.code-inner pre code {
  display: block;
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  background: transparent !important;
}

.hljs {
  background: transparent !important;
  color: rgba(236, 232, 225, 0.88) !important;
}

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
}

.reveal {
  opacity: 0;
  transform: translateY(2rem);
  filter: blur(6px);
  transition:
    opacity 900ms var(--ease),
    transform 900ms var(--ease),
    filter 900ms var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }

  .btn-paste,
  .btn-paste-icon,
  .btn-primary,
  .btn-secondary,
  .lang-item span,
  .logo {
    transition: none;
  }
}
