@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
}

:root {
  --canvas: #ffffff;
  --surface-subtle: #f7f8f9;
  --ink: #202124;
  --muted: #5e636a;
  --faint: #858a91;
  --line: #d7dbe0;
  --line-strong: #b7bcc3;
  --blue: #245c95;
  --blue-dark: #1b4c7e;
  --green: #39714a;
  --green-dot: #3e8655;
  --red: #a04438;
  --red-dark: #86342d;
  --error: #a04438;
  --amber: #9a5f16;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

html {
  min-height: 100%;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  min-height: 100vh;
  margin: 0;
  flex-direction: column;
  overflow-x: clip;
}

button,
input,
textarea {
  font: inherit;
}

button,
a,
summary {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

::selection {
  background: var(--blue);
  color: #fff;
}

.app-header {
  display: flex;
  min-height: 58px;
  align-items: center;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: #161719;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.header-links {
  display: flex;
  gap: 20px;
  margin-left: auto;
  color: #565b62;
  font-size: 13px;
}

.header-links a {
  text-underline-offset: 3px;
}

.header-links a:hover {
  color: var(--ink);
}

.app-shell {
  display: flex;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 72px 32px;
  flex: 1;
  flex-direction: column;
}

.create-view,
.reveal-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 72px;
  align-items: start;
}

.task-panel {
  position: relative;
  min-width: 0;
}

.task-heading {
  margin-bottom: 32px;
}

.route-label {
  margin: 0 0 8px;
  color: #646a72;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.route-label.status-ok {
  color: var(--green);
}

.route-label.status-warning {
  color: var(--amber);
}

.task-heading h2 {
  margin: 0;
  color: #181a1d;
  font-size: 32px;
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.task-heading > p:last-child {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.secret-form {
  display: grid;
}

.field-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.field-heading label,
.result-field label {
  color: #272a2e;
  font-size: 13px;
  font-weight: 700;
}

#char-count {
  color: var(--faint);
  font: 11px/1.4 var(--mono);
  font-variant-numeric: tabular-nums;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  outline: none;
  background: #fff;
  color: var(--ink);
}

textarea:focus,
input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(49, 95, 153, 0.14);
}

textarea {
  min-height: 250px;
  padding: 14px;
  resize: vertical;
  font: 14px/1.55 var(--mono);
}

textarea::placeholder,
input::placeholder {
  color: #999ea5;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
}

.form-actions > span,
.action-note,
.expiry,
.warning {
  color: #777c83;
  font-size: 12px;
  line-height: 1.5;
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(49, 95, 153, 0.28);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button.primary {
  width: fit-content;
  background: var(--blue);
  color: #fff;
}

.button.primary:hover:not(:disabled) {
  background: var(--blue-dark);
}

.button.secondary {
  width: fit-content;
  border-color: var(--line-strong);
  background: #fff;
  color: #30343a;
}

.button.secondary:hover:not(:disabled) {
  background: #f1f3f5;
}

.button.destructive {
  margin-top: 22px;
  background: var(--red);
}

.button.destructive:hover:not(:disabled) {
  background: var(--red-dark);
}

.context-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-subtle);
}

.context-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 22px;
  color: #376144;
  font-size: 12px;
  font-weight: 700;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green-dot);
}

.context-panel h2 {
  margin: 0 0 16px;
  color: #30343a;
  font-size: 14px;
}

.context-panel > p {
  margin: -7px 0 18px;
  color: #6e737a;
  font-size: 11px;
  line-height: 1.5;
}

.privacy-steps {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
}

.privacy-steps li {
  position: relative;
  padding-left: 28px;
  counter-increment: steps;
}

.privacy-steps li::before {
  position: absolute;
  top: 0;
  left: 0;
  color: #777d85;
  content: counter(steps, decimal-leading-zero);
  font: 10px/1.5 var(--mono);
}

.privacy-steps strong,
.privacy-steps span {
  display: block;
}

.privacy-steps strong {
  margin-bottom: 3px;
  color: #30343a;
  font-size: 12px;
}

.privacy-steps span,
.context-panel details p {
  color: #6e737a;
  font-size: 11px;
  line-height: 1.5;
}

.context-panel details {
  margin-top: 22px;
  padding-top: 15px;
  border-top: 1px solid #d9dde1;
}

.context-panel summary {
  color: #4f555d;
  font-size: 11px;
  cursor: pointer;
}

.context-panel details p {
  margin: 10px 0 0;
}

.context-panel code {
  font: 0.95em var(--mono);
}

.result-field {
  display: grid;
  gap: 8px;
}

.copy-row {
  display: flex;
}

.copy-row input {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 4px 0 0 4px;
  font: 12px/1.4 var(--mono);
}

.copy-button {
  flex: 0 0 auto;
  border-color: #aeb4bc;
  border-left: 0;
  border-radius: 0 4px 4px 0;
  background: #f1f3f5;
  color: #2d3136;
}

.copy-button:hover:not(:disabled) {
  background: #e4e7ea;
}

.link-details,
.reveal-details {
  display: grid;
  margin: 24px 0 0;
  border-top: 1px solid #d9dde1;
  border-bottom: 1px solid #d9dde1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.link-details > div,
.reveal-details > div {
  min-width: 0;
  padding: 12px;
  border-right: 1px solid #d9dde1;
}

.link-details > div:first-child,
.reveal-details > div:first-child {
  padding-left: 0;
}

.link-details > div:last-child,
.reveal-details > div:last-child {
  border-right: 0;
}

.link-details dt,
.reveal-details dt {
  margin-bottom: 5px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.link-details dd,
.reveal-details dd {
  margin: 0;
  overflow: hidden;
  color: #34383d;
  font: 11px/1.4 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expiry {
  margin: 14px 0 0;
}

.warning {
  margin: 8px 0 0;
}

.result-card .button.secondary {
  margin-top: 22px;
}

.action-note {
  margin: 10px 0 0;
}

.secret-output-group {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.output-label {
  margin: 0 0 8px;
  color: #272a2e;
  font-size: 13px;
  font-weight: 700;
}

.secret-output {
  max-height: 26rem;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font: 14px/1.55 var(--mono);
  white-space: pre-wrap;
  word-break: break-word;
}

#copy-secret {
  margin-top: 10px;
}

.opened-stamp {
  position: absolute;
  top: 0;
  right: 0;
  padding: 4px 7px;
  border: 1px solid #b8d0be;
  border-radius: 3px;
  background: #e7f0e9;
  color: var(--green);
  font: 10px/1.2 var(--mono);
  text-transform: uppercase;
}

.status {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 10;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 140ms ease, transform 140ms ease, padding 140ms ease;
  pointer-events: none;
}

.status:not(:empty) {
  padding: 10px 13px;
  opacity: 1;
  transform: translate(-50%, 0);
}

.status[data-kind="info"],
.status[data-kind="ok"] {
  border-color: #31577e;
  background: #234f7c;
}

.status[data-kind="error"] {
  border-color: #7f332b;
  background: var(--red);
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 32px;
  border-top: 1px solid #dfe2e6;
  color: #7d8289;
  font-size: 11px;
}

.version-tag {
  font-family: var(--mono);
}

@media (max-width: 760px) {
  .app-header {
    min-height: 54px;
    padding: 0 16px;
  }

  .header-links {
    gap: 14px;
    font-size: 11px;
  }

  .app-shell {
    padding: 36px 16px 56px;
  }

  .create-view,
  .reveal-view {
    display: flex;
    flex-direction: column;
    gap: 44px;
  }

  .task-heading {
    margin-bottom: 24px;
  }

  .task-heading h2 {
    font-size: 27px;
  }

  .task-heading > p:last-child {
    font-size: 14px;
  }

  textarea {
    min-height: 210px;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .button.primary {
    width: 100%;
    min-height: 44px;
  }

  .context-panel {
    width: 100%;
  }

  .copy-row {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .copy-row input {
    border-radius: 4px;
  }

  .copy-button {
    min-height: 42px;
    border: 1px solid #aeb4bc;
    border-radius: 4px;
  }

  .link-details,
  .reveal-details {
    grid-template-columns: 1fr;
  }

  .link-details > div,
  .reveal-details > div,
  .link-details > div:first-child,
  .reveal-details > div:first-child {
    padding: 10px 0;
    border-right: 0;
    border-bottom: 1px solid #d9dde1;
  }

  .link-details > div:last-child,
  .reveal-details > div:last-child {
    border-bottom: 0;
  }

  .opened-stamp {
    position: static;
    display: inline-block;
    margin-top: 20px;
  }

  .app-footer {
    padding: 12px 16px;
  }
}

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