@font-face {
  font-family: "Geist Regular";
  src: url("fonts/Geist-Regular.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Geist Grid";
  src: url("fonts/GeistPixel-Grid.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: "Geist Regular", sans-serif;
  --bg: #000;
  --border: #343434;
  --text: #fff;
  color: var(--text);
  background: var(--bg);
}

html {
  height: 100%;
}

* {
  box-sizing: border-box;
}

body * {
  user-select: none;
  -webkit-user-select: none;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem;
  background: var(--bg);
  overflow-x: hidden;
}

.container {
  width: 100%;
  margin: 0 auto;
  min-height: calc(100vh - 4rem);
  min-height: calc(100dvh - 4rem);
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.title {
  margin: 0;
  font-family: "Geist Grid", sans-serif;
  color: var(--text);
  line-height: 0.9;
  white-space: nowrap;
  visibility: hidden;
  transform-origin: left center;
}

.content {
  flex: 1;
  width: 100%;
  padding: 1rem;
}

.controls {
  width: 100%;
}

.input-wrap {
  position: relative;
  width: 100%;
  --field-height: clamp(4rem, 9vw, 4.75rem);
  --inset: 0.5rem;
  --button-size: calc(var(--field-height) - var(--inset) * 2);
}

.url-input,
.download-button {
  border: 1px solid var(--border);
  font: inherit;
}

.url-input {
  width: 100%;
  height: var(--field-height);
  padding: 0 calc(var(--button-size) + var(--inset) * 3) 0 1.5rem;
  border-radius: 999px;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1;
  color: var(--text);
  background: var(--bg);
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

.url-input::placeholder {
  color: #808080;
}

.url-input:focus {
  border-color: #555;
}

.generate-button {
  position: absolute;
  top: var(--inset);
  right: var(--inset);
  width: var(--button-size);
  height: var(--button-size);
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #000;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color 0.15s ease;
}

.generate-button svg {
  display: block;
  width: 54%;
  height: 54%;
}

.generate-button:hover {
  background: #d0d0d0;
}

.output {
  --qr-size: min(360px, 100%);
  --qr-caption-gap: 0.5rem;
  --caption-action-gap: 0.9rem;
  margin-top: 1.5rem;
  padding-bottom: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.output[hidden] {
  display: none;
}

.qr-canvas {
  width: var(--qr-size);
  height: auto;
  background: #fff;
  border: 1px solid var(--border);
  image-rendering: pixelated;
}

.encoded-text {
  margin: var(--qr-caption-gap) 0 0;
  width: var(--qr-size);
  color: #8a8a8a;
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.download-button {
  min-width: 0;
  padding: 1rem 1.5rem;
  border-radius: 999px;
  color: var(--text);
  background: var(--bg);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.download-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.download-buttons {
  width: var(--qr-size);
  margin-top: var(--caption-action-gap);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

@media (min-width: 1024px) {
  .container {
    width: 66.6667%;
  }
}
