:root {
  --color-page: #080a0d;
  --color-surface: #11151b;
  --color-surface-soft: #171d25;

  --color-text: #f5f7fa;
  --color-muted: #a7b0bd;

  --color-red: #ee343a;

  --color-border: rgba(255, 255, 255, 0.1);

  --font-main: Arial, Helvetica, sans-serif;

  --max-width: 1120px;
  --radius: 18px;
}

/* Reset e base della pagina tutorials */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  align-items: center;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  color: var(--color-text);
  font-family: var(--font-main);
  background: var(--color-page);
}

main {
  flex: 1;
}

a {
  color: #6374d6;
}

.page-content {
  width: min(calc(100% - 32px), var(--max-width));
  min-height: 62vh;
  margin: 0 auto;
  padding: 64px 0;
}

.page-title h1 {
  margin: 0 0 2%;
  font-size: clamp(2.4rem, 6.5vw, 3.6rem);
  line-height: 0.95;
}

.this_project-layout {
    display: flex;
    flex-direction: column;
    width: 50vw;
}

.this_project-layout h2 {
    margin-bottom: 0;
      font-size: clamp(1.8rem, 3.1vw, 2.2rem);
}

.this_project-layout h3 {
    margin-bottom: 0;
    font-size: clamp(0.4rem, 1.9vw, 1rem);
}

.this_project-layout p {
    font-size: clamp(1rem, 1vw, 1.2rem);
    line-height: 1.6;
    color: #e5e7eb;
}

.this_project-layout ul {
    font-size: clamp(1rem, 1vw, 1.2rem);
    line-height: 1.6;
    color: #e5e7eb;
}

.this_project-image {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 2vh;
}
.this_project-image img {
    width: 80%;
    border-radius: 1vw;
    border: 2px solid var(--color-muted);
}

.tinkercad {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2vh;
}

.works p strong{
  font-style: italic;
}

/* ---- Area codice ----------------------*/
.code-area {
  display: flex; 
  margin: 0 auto 0;
  flex-direction: column;
  width: 90%;
  align-items: center; 
  justify-content: center; 
}

.code-card {
  width: 100%;
  margin-top: 2vh;
  border: 3px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  background: #1f2b2e;
}

.code-header {
  min-height: 38px;
  padding: 0 14px;
  background: #050505;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.code-header button img{
  width: 1vw;
}

.code-title {
  font-size: 1rem;
  color: #cfd8dc;
  font-family: Consolas, Monaco, "Courier New", monospace;
}

.code-card pre[class*="language-"] {
  margin: 0;
  border-radius: 2vh;
  background: #1f2b2e;
  padding-top: 22px;
  padding-bottom: 22px;
  font-size: clamp(0.8rem, 1vw, 0.95rem);
  line-height: 1.55 !important;

  max-height: 60vh;
  overflow: auto;

  white-space: pre !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

.code-card code[class*="language-"] {
  font-family: Consolas, Monaco, "Courier New", monospace;
  line-height: 1.55 !important;

  /* anche qui forziamo il no-wrap */
  white-space: pre !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

/* Numeri di riga */
.code-card .line-numbers .line-numbers-rows {
  border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.code-card .line-numbers-rows > span {
  display: block;
  line-height: 1.55 !important;
}

.code-card .line-numbers-rows > span:before {
  color: #7f8c91;
}

/* Colori del codice */
.token.comment {
  color: #7f9ca3;
}

.token.keyword {
  color: #00d4ff;
  font-weight: 700;
}

.token.function {
  color: #32c7ff;
}

.token.number {
  color: #f5c06a;
}

.token.string {
  color: #b8e986;
}

.token.operator,
.token.punctuation {
  color: #d7dee2;
}

.token.class-name {
  color: #c77dff;
}

/* Scrool bar */
.code-card pre[class*="language-"]::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.code-card pre[class*="language-"]::-webkit-scrollbar-track {
  background: #172125;
}

.code-card pre[class*="language-"]::-webkit-scrollbar-thumb {
  background: #5f7378;
  border-radius: 10px;
  border: 2px solid #172125;
}

.code-card pre[class*="language-"]::-webkit-scrollbar-thumb:hover {
  background: #7f969c;
}

/*COPY BUTTONNNNN*/
.copy-btn {
  border: 0;
  background: transparent;
  color: #cfd8dc;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 4px;
}

.copy-btn:hover {
  background: #1b2528;
}

.copy-btn.copied {
  color: #77e0a3;
}
/*------------------------------------*/

@media (max-width: 1420px) {
    .page-content {
        width: 60vw;
    }
}

@media (max-width: 720px) { 
    .page-content {
        width: 92vw;
    }

    .this_project-layout {
        width: 100%;
    }

    .this_project-layout h3 {
        margin-bottom: 0;
        font-size: clamp(0.8rem, 1.9vw, 1.3rem);
    }

    .this_project-image img {
        width: 98%;
        border-radius: 4vw;
    }

    .this_project-image iframe {
        width: 90%;
        border: 2px solid var(--color-muted);
    }
    .code-area {
      width: 100%;
    }
}