html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

@media (max-width: 1024px) {
  body.nav-open {
    height: 100vh;
    overflow: hidden;
    position: relative;
  }
}

.table-wrapper {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .table {
    min-width: 720px;
  }
  .table th,
  .table td {
    white-space: nowrap;
  }
}

:root {
  --background: #0f172a;
  --background-alt: #111c34;
  --card-background: rgba(15, 23, 42, 0.7);
  --card-border: rgba(148, 163, 184, 0.25);
  --primary: #38bdf8;
  --primary-dark: #0ea5e9;
  --accent: #a855f7;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --heading: #f8fafc;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.45);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 10px;
  --max-width: 1100px;
  --transition: 200ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Poppins", "Segoe UI", system-ui, -apple-system,
    sans-serif;
  background: radial-gradient(circle at top left, #172554, #020617 60%);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

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

a:hover,
a:focus {
  color: var(--primary);
}

img {
  max-width: 100%;
  display: block;
}

main {
  flex: 1;
}

.container {
  width: min(100% - 3rem, var(--max-width));
  margin-inline: auto;
}

.site-header {
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.2rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--heading);
}

.brand img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

nav {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background-color var(--transition);
}

.nav-links a:hover,
.nav-links a:focus,
.nav-links a.active {
  color: var(--heading);
  background: rgba(56, 189, 248, 0.12);
}

.nav-toggle {
  display: none;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--heading);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
}

.nav-toggle:hover {
  background: rgba(56, 189, 248, 0.3);
}

.social-badges {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.social-badges a {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.15);
  color: var(--heading);
  font-size: 1.1rem;
  transition: transform var(--transition), background var(--transition);
}

.social-badges a:hover {
  transform: translateY(-2px);
  background: rgba(56, 189, 248, 0.3);
}

.hero {
  padding: clamp(4rem, 8vw, 6rem) 0;
}

.hero .content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero .intro {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.hero h1 {
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  color: var(--heading);
  margin: 0;
}

.hero h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  color: var(--primary);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.hero .avatar {
  justify-self: center;
  width: min(280px, 70vw);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(168, 85, 247, 0.5);
  box-shadow: var(--shadow);
}

.section {
  padding: clamp(3.5rem, 7vw, 5.5rem) 0;
}

.section-header {
  margin-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 650px;
}

.section-title {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  color: var(--heading);
}

.section-subtitle {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--card-background);
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  padding: 1.8rem;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.flex-fill {
  flex: 1 1 0;
}

.card h3 {
  margin: 0;
  color: var(--heading);
  font-size: 1.15rem;
}

.card p,
.card ul,
.card ol {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.card ul,
.card ol {
  padding-left: 1.1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: rgba(56, 189, 248, 0.16);
  border-radius: 999px;
  color: var(--primary);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.highlight {
  color: var(--accent);
}

.skills-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.skills-list li {
  background: var(--card-background);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.skills-list li::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.7);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.image-grid img {
  border-radius: var(--radius-sm);
  border: 2px solid rgba(56, 189, 248, 0.22);
  height: 100%;
  object-fit: cover;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: var(--card-background);
  box-shadow: var(--shadow);
}

.table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-muted);
}

.table thead {
  background: rgba(56, 189, 248, 0.1);
  color: var(--heading);
}

.table th,
.table td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  text-align: left;
  font-size: 0.95rem;
}

.table tbody tr:hover {
  background: rgba(56, 189, 248, 0.08);
}

.table a {
  color: var(--primary);
  font-weight: 600;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #0f172a;
  box-shadow: 0 16px 32px rgba(56, 189, 248, 0.25);
  transition: transform var(--transition), box-shadow var(--transition);
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(56, 189, 248, 0.35);
}

.cta-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
}

.contact-card {
  background: var(--card-background);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  padding: clamp(2rem, 5vw, 3rem);
  box-shadow: var(--shadow);
  display: grid;
  gap: 1.6rem;
}

.contact-intro {
  margin: 0;
  font-size: 1.1rem;
  color: var(--heading);
  line-height: 1.7;
}

.contact-tip {
  margin: 0;
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.contact-email {
  background: rgba(15, 23, 42, 0.65);
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  padding: clamp(1.4rem, 4vw, 1.8rem);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.4);
  display: grid;
  gap: 1rem;
  align-items: start;
}

.email-link {
  font-size: clamp(1.1rem, 2.8vw, 1.35rem);
  font-weight: 700;
  color: var(--heading);
  word-break: break-word;
}

.email-link:hover,
.email-link:focus {
  color: var(--primary);
}

.copy-button {
  align-self: flex-start;
  font-size: 0.95rem;
  padding-inline: 1.6rem;
}

.copy-feedback {
  display: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
}

.copy-feedback.visible {
  display: block;
}

.footer {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: rgba(2, 6, 23, 0.88);
}

.spec-grid {
  display: grid;
  gap: 1.4rem;
}

.spec-group {
  display: grid;
  gap: 1.2rem;
}

.spec-group h3 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--heading);
}

.spec-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.spec-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.8rem;
  background: var(--card-background);
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}

.spec-card figure {
  margin: 0;
  display: flex;
  justify-content: center;
}

.spec-card img {
  width: min(160px, 60%);
  border-radius: var(--radius-sm);
}

.spec-card strong {
  color: var(--heading);
  font-size: 1.1rem;
}

.spec-card a {
  color: var(--primary);
  font-weight: 600;
}

.callout {
  background: rgba(56, 189, 248, 0.15);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  color: var(--primary);
  font-weight: 600;
}

.social-card-grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.social-card {
  background: var(--card-background);
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  padding: 1.6rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 1rem;
}

.social-card span {
  font-size: 2.2rem;
}

.social-card h3 {
  margin: 0;
}

.social-card p {
  margin: 0;
  color: var(--text-muted);
}

.social-card .button {
  justify-self: start;
}

.reveal {
  font-family: "Inter", "Poppins", sans-serif;
}

.reveal .big-title {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.reveal .subtitle {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: #b4c6ef;
  margin-top: 0.4rem;
}

.reveal .card {
  background: rgba(15, 23, 42, 0.75);
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.5);
  padding: 1.6rem;
}

.reveal .slide-stack {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-width: 1000px;
}

.reveal .slide-row {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

.reveal .slide-row.align-start {
  align-items: flex-start;
}

.reveal .slide-row.tight {
  margin-top: 0.75rem;
}

.reveal .slide-grid-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  align-items: start;
}

.reveal .slide-cards {
  display: flex;
  gap: 1.2rem;
}

.reveal .slide-cards > * {
  flex: 1;
}

.reveal .code {
  background: rgba(2, 6, 23, 0.7);
  border-radius: 16px;
  padding: 1rem;
}

.reveal .small {
  font-size: 0.75rem;
  opacity: 0.75;
}

.reveal .icon-box {
  width: 120px;
  text-align: center;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
}

.reveal pre[class*="language-"] {
  margin: 0;
}

.reveal .fragment.card {
  margin-top: 0.75rem;
}

@media (max-width: 1024px) {
  nav {
    position: fixed;
    inset: 0 0 auto auto;
    height: 100vh;
    width: min(280px, 70vw);
    background: rgba(2, 6, 23, 0.96);
    flex-direction: column;
    padding: 6rem 1.5rem 2rem;
    transform: translateX(100%);
    transition: transform var(--transition);
  }

  nav.open {
    transform: translateX(0);
  }

  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-header .inner {
    padding: 1rem 0;
  }

  .hero .content {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }

  .hero .intro {
    align-items: center;
  }

  .hero .avatar {
    order: -1;
  }

  .social-badges {
    display: none;
  }
}

@media (max-width: 720px) {
  .container {
    width: min(100% - 2rem, 100%);
  }

  .card {
    padding: 1.4rem;
  }

  .contact-card {
    padding: 1.8rem;
  }

  .contact-email {
    text-align: center;
    align-items: center;
  }

  .contact-email .copy-button {
    width: 100%;
    justify-content: center;
  }

  .spec-card {
    padding: 1.2rem;
  }
}

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

input[type="file"] {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

input[type="file"]::file-selector-button {
  padding: 0.45rem 1rem;
  margin-right: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
    border-color var(--transition), box-shadow var(--transition),
    transform var(--transition);
}

input[type="file"]::file-selector-button:hover {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #0f172a;
  border-color: transparent;
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

input[type="file"]::-webkit-file-upload-button {
  padding: 0.45rem 1rem;
  margin-right: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
    border-color var(--transition), box-shadow var(--transition),
    transform var(--transition);
}

input[type="file"]::-webkit-file-upload-button:hover {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #0f172a;
  border-color: transparent;
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

select,
.rem-target-select,
#bulkTargetSelect {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--primary) 50%),
    linear-gradient(135deg, var(--primary) 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 3px),
    calc(100% - 11px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}

.rem-target-select:focus,
#bulkTargetSelect:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.5);
}

.remaining-row {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.remaining-row:last-child {
  border-bottom: none;
}

.small-muted {
  color: var(--text-muted);
}

.spacer-sm {
  height: 12px;
}

.turns-settings-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.field-label-sm {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.turns-input {
  padding: 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text);
}

.turns-input--small {
  width: 92px;
}

.turns-input--medium {
  width: 140px;
}

.shuffle-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 18px;
}

.text-muted {
  color: var(--text-muted);
}

.per-turn-details {
  flex-basis: 100%;
  margin-top: 0.6rem;
}

.per-turn-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.per-turn-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.3rem;
}

.mt-1 {
  margin-top: 1rem;
}

.mt-06 {
  margin-top: 0.6rem;
}

.mt-08 {
  margin-top: 0.8rem;
}

.table-wrapper--preview {
  max-height: 220px;
  overflow: auto;
}

.table-wrapper--result {
  max-height: 360px;
  overflow: auto;
}

.actions-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.result-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.summary-text {
  margin-top: 0.8rem;
  color: var(--text-muted);
}

.remaining-controls {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.remaining-list-scroll {
  max-height: 220px;
  overflow: auto;
}

.note-muted {
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.select-all-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.button-secondary {
  background: linear-gradient(135deg, #94a3b8, #0f172a);
}

body .iubenda-embed.iubenda-black {
  position: fixed !important;
  bottom: 1rem !important;
  left: 1rem !important;
  right: auto !important;
  top: auto !important;
  z-index: 9999 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;

  padding: 0.4rem 0.9rem !important;
  border-radius: 999px !important;

  background: rgba(15, 23, 42, 0.92) !important;
  background-image: none !important;
  background-repeat: no-repeat !important;

  color: var(--text) !important;
  font-size: 0.8rem !important;
  line-height: 1 !important;
  text-decoration: none !important;
  text-indent: 0 !important;

  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.65) !important;

  border: none !important;
  overflow: hidden !important;

  -webkit-mask: none !important;
  mask: none !important;
}

body .iubenda-embed.iubenda-black::before,
body .iubenda-embed.iubenda-black::after {
  content: none !important;
  background: none !important;
  box-shadow: none !important;
}

body .iubenda-embed.iubenda-black:hover {
  background: linear-gradient(135deg, var(--primary), var(--accent)) !important;
  color: #0f172a !important;
  background-image: none !important;
}

@media (max-width: 640px) {
  body .iubenda-embed.iubenda-black {
    bottom: 0.75rem !important;
    left: 0.75rem !important;
    padding: 0.35rem 0.8rem !important;
    font-size: 0.75rem !important;
  }
}
