:root {
  --bg: #101114;
  --surface: #17191d;
  --surface-2: #1f2227;
  --text: #f4f1ea;
  --muted: #b7b0a4;
  --quiet: #827b70;
  --line: #34302b;
  --accent: #d6a15d;
  --accent-strong: #f0c987;
  --max-width: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Sora", sans-serif;
  background: var(--bg);
}

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

p,
h1,
h2,
h3,
dl,
dd,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 17, 20, 0.92);
  backdrop-filter: blur(12px);
}

.brand {
  font-weight: 700;
  letter-spacing: 0.01em;
}

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

.site-nav a {
  color: var(--muted);
  font-size: 0.92rem;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.link-list a:hover,
.link-list a:focus-visible,
.compact-list a:hover,
.compact-list a:focus-visible {
  color: var(--accent-strong);
}

main {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
}

.intro {
  padding: 76px 0 54px;
  border-bottom: 1px solid var(--line);
}

.role,
.experience-meta span,
.link-list span {
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent);
  font-size: 0.84rem;
}

h1 {
  max-width: 900px;
  margin-top: 16px;
  font-size: clamp(2.4rem, 6vw, 4.7rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.stack-line {
  max-width: 760px;
  margin-top: 14px;
  color: var(--accent-strong);
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  font-weight: 600;
  line-height: 1.4;
}

.summary {
  max-width: 760px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.94rem;
}

.button:hover,
.button:focus-visible {
  border-color: var(--accent);
}

.button-primary {
  color: #18140f;
  border-color: var(--accent);
  background: var(--accent-strong);
}

.button-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: currentColor;
}

.panel,
.link-list a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.panel h2,
.section-heading h2 {
  font-size: 1.06rem;
  line-height: 1.25;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 42px;
  padding: 44px 0 80px;
}

.main-column,
.side-column,
.section-block {
  display: grid;
  gap: 28px;
}

.side-column {
  align-content: start;
}

.section-heading {
  display: grid;
  gap: 10px;
}

.section-heading p {
  max-width: 650px;
  color: var(--muted);
  line-height: 1.65;
}

.experience-item {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 26px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.experience-meta {
  display: grid;
  align-content: start;
  gap: 8px;
}

.experience-meta strong {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.experience-body {
  display: grid;
  gap: 14px;
}

.experience-body h3 {
  font-size: 1.18rem;
  line-height: 1.35;
}

.experience-body h4 {
  margin: 4px 0 -2px;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.35;
}

.experience-body ul,
.compact-list {
  display: grid;
  gap: 10px;
}

.experience-body li,
.compact-list li,
.skill-list dd {
  color: var(--muted);
  line-height: 1.65;
}

.compact-list a {
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}

.compact-list a:hover,
.compact-list a:focus-visible {
  text-decoration-color: currentColor;
}

.link-mark {
  position: relative;
  top: 0.42em;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border: 1px solid var(--accent);
  border-radius: 2px;
}

.link-mark::after {
  content: "";
  position: absolute;
  top: -4px;
  right: -4px;
  width: 5px;
  height: 5px;
  border-top: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
}

.experience-body li {
  position: relative;
  padding-left: 18px;
}

.experience-body li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.panel {
  display: grid;
  gap: 20px;
  padding: 20px;
}

.skill-list {
  display: grid;
  gap: 18px;
}

.skill-list div {
  display: grid;
  gap: 8px;
}

.skill-list dt {
  color: var(--text);
  font-weight: 700;
}

/* Badge skill con icone dei brand. */
.skill-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.skill-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 7px;
  background: var(--c, var(--surface-2));
  color: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.skill-badge:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.skill-badge img,
.skill-badge .skill-ico {
  width: 15px;
  height: 15px;
  display: block;
  flex: 0 0 auto;
}

.skill-badge .skill-ico {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

/* Sfondi chiari → testo scuro. */
.skill-badge--dark {
  color: #1a1407;
  border-color: rgba(0, 0, 0, 0.18);
}

/* Voci senza brand → chip neutro con icona accento. */
.skill-badge--ghost {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--line);
}

.skill-badge--ghost .skill-ico {
  fill: var(--accent);
}

.beyond-list {
  display: grid;
  gap: 0;
}

.beyond-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.beyond-emoji {
  font-size: 1.6rem;
  line-height: 1.1;
}

.beyond-body h3 {
  font-size: 1.12rem;
  line-height: 1.35;
}

.beyond-body p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.65;
}

.beyond-body a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}

.beyond-body a:hover,
.beyond-body a:focus-visible {
  text-decoration-color: currentColor;
}

.links-block {
  padding-top: 10px;
}

.link-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.link-list a {
  display: grid;
  gap: 10px;
  min-height: 118px;
  padding: 18px;
}

.link-list strong {
  line-height: 1.35;
}

@media (max-width: 940px) {
  .content-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .site-nav {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }

  .intro {
    padding: 48px 0 36px;
  }

  .experience-item,
  .link-list {
    grid-template-columns: 1fr;
  }

  .experience-item {
    gap: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ---------------------------------------------------------------- *
 * Footer + privacy note
 * ---------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 64px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 24px 16px;
}

.footer-copy {
  color: var(--quiet);
  font-size: 0.86rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.footer-links a,
.footer-linkbtn {
  color: var(--muted);
  font-size: 0.86rem;
  font-family: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.footer-links a:hover,
.footer-linkbtn:hover,
.footer-linkbtn:focus-visible {
  color: var(--accent-strong);
}

.privacy-note {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8px 24px 40px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.privacy-note h2 {
  color: var(--text);
  font-size: 1.04rem;
  margin-bottom: 10px;
}

.privacy-note p {
  margin-bottom: 10px;
  max-width: 760px;
}

.privacy-note a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.privacy-note code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82em;
  color: var(--accent);
}

/* ---------------------------------------------------------------- *
 * Cookie banner
 * ---------------------------------------------------------------- */
.cookie-banner[hidden] {
  display: none;
}

.cookie-banner {
  position: fixed;
  z-index: 1100;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}

.cookie-text {
  flex: 1 1 280px;
}

.cookie-text strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 0.96rem;
}

.cookie-text p {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.cookie-text a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.cookie-actions .button {
  min-height: 38px;
  padding: 0 18px;
}

@media (max-width: 480px) {
  .cookie-actions {
    width: 100%;
  }
  .cookie-actions .button {
    flex: 1;
  }
}
