/* -------- Reset -------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

::selection {
  background: rgba(252, 196, 172, 0.30); /* #fcc4ac */
  color: #000000;
}

.dark ::selection {
  background: rgba(252, 196, 172, 0.65);
  color: #000000;
}

/* -------- Theme tokens -------- */
:root {
  --bg: #ffffff;
  --fg: #0b0b0b;
  --muted: rgba(11, 11, 11, 0.58);
  --soft: rgba(11, 11, 11, 0.12);
  --border: rgba(11, 11, 11, 0.14);
  --accent: #fcc4ac;

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  --radius: 18px;
}

.dark {
  --bg: #000000;
  --fg: #f6f6f6;
  --muted: rgba(246, 246, 246, 0.60);
  --soft: rgba(246, 246, 246, 0.12);
  --border: rgba(246, 246, 246, 0.14);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

/* -------- Contact button -------- */
.contact-button {
  position: fixed;
  top: 22px;
  right: 22px;

  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--fg);

  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  font-weight: 400;

  color: var(--fg);
  background: transparent;
  text-decoration: none;

  transition: 
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
}

/* Hover: invertito, ma soft */
.contact-button:hover {
  background: var(--fg);
  color: var(--bg);
  transform: translateY(-1px);
}

/* Active: ritorna giù */
.contact-button:active {
  transform: translateY(0);
}

/* Focus accessibile */
.contact-button:focus-visible {
  outline: 3px solid rgba(252, 196, 172, 0.35);
  outline-offset: 3px;
}

/* -------- Page -------- */
body {
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.accent {
  color: var(--accent); /* #fcc4ac */

}.hero-logo {
  width: 100px;              
  height: auto;

  margin-bottom: 20px;

  display: block;
  margin-left: auto;
  margin-right: auto;

  opacity: 0.9;
}

/* -------- Editor card -------- */
.editor-intro {
  margin-bottom: 40px;
  text-align: center; 
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 24px;
  color: var(--fg);
  letter-spacing: -0.015em;
}

.editor {
  width: min(780px, 92vw);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.editor__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand__name {
  font-weight: 400;
  letter-spacing: -0.02em;
}

.brand__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(252, 196, 172, 0.16);
  animation: dotPulse 1.6s ease-in-out infinite;
}

.meta__mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  color: var(--muted);
}

.editor__body {
  padding: 22px 20px 18px 20px;
}

/* -------- Code area -------- */
.code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
  color: var(--fg);
}

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

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

.code__id {
  color: var(--fg);
}

.code__string {
  color: var(--fg);
  position: relative;
}

.code__string::selection,
.code__comment::selection,
.code__id::selection,
.code__dim::selection {
  background: rgba(252, 196, 172, 0.35);
}

/* Active line (subtle) */
.code__line.active {
  display: inline-block;
  padding: 6px 10px 6px 10px;
  margin-left: -10px;
  border-radius: 12px;
  background: rgba(252, 196, 172, 0.10);
  border: 1px solid rgba(252, 196, 172, 0.18);
}

/* Prompt + typing */
.prompt {
  color: var(--accent);
  font-weight: 500;
  margin-right: 10px;
}

.typing {
  color: var(--fg);
}

/* Cursor (terminal-ish) */
.cursor {
  display: inline-block;
  width: 10px;
  height: 1.2em;
  margin-left: 6px;
  transform: translateY(3px);
  background: var(--accent);
  border-radius: 3px;
  animation: blink 0.95s steps(1) infinite;
}

@keyframes blink {
  0%, 55% { opacity: 1; }
  56%, 100% { opacity: 0; }
}

.font-credit {
  margin-top: 14px;
  font-weight: 200;
  font-size: 13px;
  color: var(--muted);
}

.font-credit__link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(252, 196, 172, 0.35);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.font-credit__link:hover {
  color: var(--fg);
  border-bottom-color: rgba(252, 196, 172, 0.75);
}

.font-credit__link:focus-visible {
  outline: 3px solid rgba(252, 196, 172, 0.35);
  outline-offset: 3px;
  border-bottom-color: transparent;
}

/* -------- Theme toggle -------- */
.theme-toggle {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.18s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  background: rgba(252, 196, 172, 0.10);
  border-color: rgba(252, 196, 172, 0.35);
}

.theme-toggle:active {
  transform: translateY(0px);
}

/* Better focus */
.theme-toggle:focus-visible {
  outline: 3px solid rgba(252, 196, 172, 0.35);
  outline-offset: 3px;
}

/* Responsive tweaks */
@media (max-width: 420px) {
  .code { font-size: 14px; }
  .editor__body { padding: 18px 16px 14px 16px; }
}

@keyframes dotPulse {
  0%, 100% {
    opacity: 0.35;
    transform: scale(0.92);
    box-shadow: 0 0 0 3px rgba(252, 196, 172, 0.10);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
    box-shadow: 0 0 0 6px rgba(252, 196, 172, 0.18);
  }
}