/* Layout and palette follow Samuel Kraft's portfolio template (MIT):
   a 640px column, 14px base, Radix "sand" greys. The accent is UnlistD's blue. */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #fdfdfc;
  --hover: rgb(0 0 0 / 6%);
  --field: #f1f0ef;
  --border: #dad9d6;
  --text: #21201c;
  --text-2: #63635e;
  --brand: #346bf1;
  --header-bg: rgb(253 253 252 / 80%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111110;
    --hover: rgb(255 255 255 / 7%);
    --field: #222221;
    --border: #3b3a37;
    --text: #eeeeec;
    --text-2: #b5b3ad;
    --header-bg: rgb(17 17 16 / 80%);
  }
}

* { box-sizing: border-box; }

html {
  font-size: 14px;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 1rem/1.6 "Inter", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, p, ul { margin: 0; }
h1, h2 { font-size: 1rem; font-weight: 500; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
strong { font-weight: 500; }
a { color: inherit; }
.secondary { color: var(--text-2); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand img { border-radius: 8px; }

.site-header nav { display: flex; gap: 4px; }

.site-header nav a {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text-2);
  text-decoration: none;
  transition: color 150ms, background-color 150ms;
}

.site-header nav a:hover { color: var(--text); background: var(--hover); }

/* Page column */

main {
  display: flex;
  flex-direction: column;
  gap: 64px;
  max-width: 640px;
  margin: 0 auto;
  padding: 56px 16px 96px;
}

.intro { display: flex; flex-direction: column; gap: 12px; }
.intro h1 { font-size: 1.7rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.note { color: var(--text-2); font-size: 0.93rem; }

/* Buttons */

.downloads { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms, transform 100ms;
}

.button:hover { background: var(--hover); }
.button:active { transform: scale(0.97); }
.button.square { width: 40px; padding: 0; }
.button.primary { border-color: transparent; background: var(--brand); color: #fff; }
.button.primary:hover { background: #2a5cdb; }
.button[disabled] { opacity: 0.6; cursor: default; }

.icon {
  flex: none;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat;
  mask: var(--i) center / contain no-repeat;
}

/* The "fork it." pop-up on the macOS and Linux buttons */

.fork { position: relative; display: inline-flex; }

.pop {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px) scale(0.96);
  transition: opacity 150ms, transform 150ms;
}

.pop.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* Gallery cards */

.cards { display: flex; flex-direction: column; gap: 16px; }

.card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: calc(100% + 32px);
  margin: 0 -16px;
  padding: 16px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
  transition: background-color 150ms;
}

.card:hover { background: var(--hover); }
.card img { width: 100%; border-radius: 12px; background: #000; }
.card-text { display: flex; flex-direction: column; gap: 4px; }

/* Feature list */

.list li {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  transition: opacity 150ms;
}

@media (hover: hover) {
  .list:hover li { opacity: 0.5; }
  .list:hover li:hover { opacity: 1; }
}

/* Contact form */

.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; color: var(--text-2); }

.form input,
.form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--field);
  color: var(--text);
  font: inherit;
  resize: vertical;
}

.form input:focus-visible,
.form textarea:focus-visible { outline-offset: 0; }

.form-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }

/* Footer */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 64px;
  border-top: 1px solid var(--border);
}

.site-footer a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer a.plain { display: inline; text-decoration: underline; text-underline-offset: 3px; }

/* Lightbox */

dialog {
  max-width: min(1200px, 94vw);
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #000;
  cursor: zoom-out;
}

dialog::backdrop { background: rgb(0 0 0 / 80%); }

/* Staggered entrance, as in the template */

@media (prefers-reduced-motion: no-preference) {
  .in { animation: in 500ms both; animation-delay: calc(var(--index) * 90ms); }

  @keyframes in {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@media (max-width: 520px) {
  .site-header nav a[href^="#"] { display: none; }
  .list li { grid-template-columns: 1fr; gap: 2px; }
}
