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

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Bold.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 700;
}

:root {
  color-scheme: dark;
  --background: #14120b;
  --text: #edecec;
  --muted: #969592;
  --surface: #201e18;
  --border: #2a2822;
  --accent: #eb5600;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Geist", system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.625;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--background);
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  border-radius: 2px;
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.site-shell {
  width: 100%;
  max-width: 582px;
  margin: 0 auto;
  padding: 80px 16px 48px;
}

h1,
h2,
h3,
p,
ul,
ol,
blockquote,
pre {
  margin-top: 0;
}

.introduction h1 {
  margin-bottom: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.625;
}

.introduction p {
  margin-bottom: 0;
  padding-top: 16px;
}

section {
  margin-top: 48px;
}

.introduction a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(235, 86, 0, 0.4);
  text-underline-offset: 3px;
}

.introduction a:hover {
  text-decoration-color: currentColor;
}

.section-heading {
  margin-bottom: 0;
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.625;
}

.empty-block {
  min-height: 72px;
}

.entry-list {
  margin-bottom: 0;
  padding: 0;
  list-style: none;
}

.entry-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 11px 0 12px;
}

.entry-list a:hover span {
  color: var(--accent);
}

.entry-list time {
  flex: none;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.back-link {
  color: var(--muted);
  font-size: 13px;
}

.back-link:hover {
  color: var(--text);
}

.entry-header {
  margin: 48px 0 32px;
}

.entry-header h1 {
  margin-bottom: 8px;
  font-size: 33.75px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.entry-header time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.prose h2 {
  margin: 48px 0 16px;
  font-size: 20.625px;
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.3;
}

.prose h3 {
  margin: 32px 0 12px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre {
  margin-bottom: 20px;
}

.prose ul,
.prose ol {
  padding-left: 24px;
}

.prose a {
  text-decoration: underline;
  text-decoration-color: var(--muted);
  text-underline-offset: 3px;
}

.prose a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.prose blockquote {
  margin-left: 0;
  padding-left: 16px;
  border-left: 1px solid var(--border);
  color: var(--muted);
}

.prose code {
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.prose pre {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.prose pre code {
  padding: 0;
  border: 0;
  background: transparent;
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 32px 0;
  border-radius: 6px;
}

@media (max-width: 640px) {
  .site-shell {
    padding-top: 48px;
  }

  .entry-header h1 {
    font-size: 28px;
  }
}

/* Table of contents: the left margin on wide screens, quiet until hovered. */
.toc {
  display: none;
}

@media (min-width: 1100px) {
  .toc {
    position: fixed;
    top: 168px;
    left: calc(50% - 291px - 200px);
    display: grid;
    gap: 6px;
    width: 160px;
    font-size: 13px;
  }

  .toc {
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  .toc.is-hidden {
    opacity: 0;
    transform: translateX(-6px);
    pointer-events: none;
  }

  .toc a {
    color: var(--muted);
    opacity: 0.6;
    transition: opacity 0.2s ease, color 0.2s ease;
  }

  .toc:hover a,
  .toc a[aria-current] {
    opacity: 1;
  }

  .toc a[aria-current],
  .toc a:hover {
    color: var(--text);
  }
}

.prose kbd {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
  font-family: inherit;
  font-size: 12px;
}

/* Post header: the title, and on project pages a quiet button that copies the AI instructions. */
.entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.entry-header h1 {
  margin-bottom: 0;
}

.ai-copy {
  flex: none;
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ai-copy:hover {
  border-color: var(--muted);
  color: var(--text);
}

.ai-copy:active {
  transform: scale(0.97);
}

.ai-copy.done {
  border-color: var(--accent);
  color: var(--accent);
}

/* Theme: light */
html[data-theme="light"] {
  color-scheme: light;
  --background: #f7f6f2;
  --text: #1d1b16;
  --muted: #74726c;
  --surface: #eeece6;
  --border: #e2e0d9;
}

/* Language: show only the active one */
html[lang="it"] [lang="en"],
html[lang="en"] [lang="it"] {
  display: none;
}

.portrait {
  display: block;
  width: 120px;
  height: auto;
  margin-bottom: 24px;
  border-radius: 4px;
}

.site-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  max-width: 582px;
  margin: 0 auto;
  padding: 14px 16px 18px;
  background: var(--background);
  color: var(--muted);
  font-size: 13px;
}

.site-shell {
  padding-bottom: 96px;
}

.site-footer .switch span {
  padding: 0 4px;
  opacity: 0.5;
}

.site-footer button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.site-footer button:hover {
  color: var(--text);
}

html[lang="it"] [data-set-lang="it"],
html[lang="en"] [data-set-lang="en"],
html[data-theme="light"] [data-set-theme="light"],
html[data-theme="dark"] [data-set-theme="dark"] {
  color: var(--text);
}

/* Layout a due colonne: foto e contatti a sinistra */
.site-shell.layout {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  column-gap: 48px;
  max-width: 880px;
}

.side .portrait {
  width: 160px;
  margin-bottom: 18px;
}

.contact {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.75;
}

.contact a:hover {
  color: var(--accent);
}

.layout .site-footer {
  max-width: 880px;
}

@media (max-width: 680px) {
  .site-shell.layout {
    display: block;
  }

  .side {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 24px;
  }

  .side .portrait {
    width: 96px;
    margin-bottom: 0;
  }
}

.contact .mail {
  white-space: nowrap;
}

/* niente riquadro di focus al click col mouse, solo da tastiera */
.site-footer button:focus {
  outline: none;
}

.site-footer button:focus-visible {
  border-radius: 2px;
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* P.IVA: quasi invisibile, come i dettagli secondari di benji.org */
.site-footer .vat {
  font-size: 11px;
  letter-spacing: 0.01em;
  opacity: 0.45;
  font-variant-numeric: tabular-nums;
}
