/* =========================================================
   kalinamendes.com
   Modo escuro. Mobile-first. Tokens no :root.
   ========================================================= */

@font-face {
  font-family: "Instrument Sans";
  src: url("assets/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #0E0F13;
  --bg-alt: #121419;
  --surface: #171A20;
  --line: #262A33;
  --line-strong: #363B47;
  --text: #ECEEF3;
  --muted: #989EAD;
  --accent: #B69CFF;
  --accent-hover: #C9B6FF;
  --accent-soft: rgba(182, 156, 255, 0.12);

  --sans: "Instrument Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, "Liberation Mono", monospace;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: clamp(1.3rem, 1.1rem + 0.9vw, 1.625rem);
  --step-3: clamp(2rem, 1.4rem + 2.8vw, 3.25rem);
  --step-4: clamp(2.75rem, 1.6rem + 5.6vw, 5.75rem);

  --gutter: clamp(1.25rem, 4.5vw, 3rem);
  --section-space: clamp(4.5rem, 3rem + 6vw, 8rem);
  --header-h: 4rem;
  --radius: 8px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  background: var(--bg);
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
@media (min-width: 1024px) { body { font-size: 1.0625rem; } }

h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }

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

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

.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--accent); color: var(--bg);
  font-weight: 600; text-decoration: none; border-radius: var(--radius);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0.75rem 1.35rem;
  font: inherit; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--radius);
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.btn-small { min-height: 2.5rem; padding: 0.45rem 1rem; font-size: var(--step--1); }
.btn-accent { background: var(--accent); color: var(--bg); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  transition: background-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.site-header.is-solid,
.site-header.menu-open {
  background: rgba(14, 15, 19, 0.88);
  box-shadow: 0 1px 0 var(--line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.brand {
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand-prompt { color: var(--accent); }

.nav-toggle {
  display: none; position: relative;
  width: 2.75rem; height: 2.75rem; margin-right: -0.5rem;
  background: none; border: 0; color: var(--text); cursor: pointer;
}
.js .nav-toggle { display: block; }
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  position: absolute; left: 50%;
  width: 1.375rem; height: 2px; margin-left: -0.6875rem;
  background: currentColor; border-radius: 2px;
  transition: transform 0.3s var(--ease), background-color 0.2s;
}
.nav-toggle-bars { top: 50%; margin-top: -1px; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; }
.nav-toggle-bars::before { transform: translateY(-7px); }
.nav-toggle-bars::after { transform: translateY(7px); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: rotate(-45deg); }

.site-nav a:not(.btn) { text-decoration: none; }

.js .site-nav {
  position: fixed; inset: var(--header-h) 0 auto 0;
  padding: 0.5rem var(--gutter) 2rem;
  background: var(--bg);
  box-shadow: 0 1px 0 var(--line), 0 30px 40px -20px rgba(0, 0, 0, 0.6);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0s linear 0.3s;
}
.js .site-nav.is-open {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.nav-list a {
  display: block; padding: 0.9rem 0;
  font-size: var(--step-2); font-weight: 550;
  border-bottom: 1px solid var(--line);
}
.site-nav .btn { width: 100%; margin-top: 1.5rem; min-height: 3rem; font-size: var(--step-0); }

.no-js .site-header { position: absolute; height: auto; padding-block: 1rem; }
.no-js .header-inner { flex-wrap: wrap; }
.no-js .nav-list { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.no-js .nav-list a { font-size: var(--step-0); border: 0; padding: 0.25rem 0; }
.no-js .site-nav .btn { display: none; }

@media (min-width: 900px) {
  .js .nav-toggle { display: none; }
  .js .site-nav, .no-js .site-nav {
    position: static; display: flex; align-items: center; gap: 2rem;
    padding: 0; background: none; box-shadow: none;
    opacity: 1; visibility: visible; transform: none;
  }
  .nav-list, .no-js .nav-list { display: flex; gap: 1.75rem; }
  .nav-list a, .no-js .nav-list a {
    position: relative; padding: 0.35rem 0;
    font-size: var(--step--1); font-weight: 500;
    color: var(--muted); border: 0;
    transition: color 0.2s var(--ease);
  }
  .nav-list a:hover, .nav-list a.is-active { color: var(--text); }
  .nav-list a.is-active::before {
    content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
    height: 1px; background: var(--accent);
  }
  .site-nav .btn, .no-js .site-nav .btn {
    display: inline-flex; width: auto; margin-top: 0;
    min-height: 2.5rem; font-size: var(--step--1);
  }
}

/* ---------- Topo ---------- */
.hero {
  position: relative;
  padding-block: calc(var(--header-h) + clamp(2.5rem, 7vw, 6rem)) clamp(4rem, 9vw, 7rem);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
/* grade técnica muito discreta, só no topo */
.hero::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000, transparent 75%);
}

.hero-grid { display: grid; gap: 3rem; align-items: center; }

.prompt {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--muted);
  margin-bottom: 1rem;
}
.prompt-sign { color: var(--accent); }
.caret {
  display: inline-block; width: 0.55em; height: 1.1em;
  margin-left: 0.15em; vertical-align: -0.2em;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-name {
  font-size: var(--step-4);
  font-weight: 650;
  font-stretch: 80%;
  line-height: 0.95;
  letter-spacing: -0.025em;
}

.hero-title {
  margin-top: 1.1rem;
  font-family: var(--mono);
  font-size: clamp(0.875rem, 0.8rem + 0.4vw, 1.0625rem);
  color: var(--accent);
}
.hero-sep { color: var(--line-strong); margin-inline: 0.35em; }
.hero-part { white-space: nowrap; }
@media (max-width: 559px) {
  .hero-part { display: block; }
  .hero-sep { display: none; }
}

.hero-lead {
  max-width: 34rem;
  margin-top: 1.5rem;
  font-size: var(--step-1);
  color: var(--muted);
  line-height: 1.55;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.25rem; }
.hero-actions .btn-accent { flex: 1 1 100%; }
.hero-actions .btn-ghost { flex: 1 1 0; }
@media (min-width: 560px) { .hero-actions .btn { flex: 0 0 auto; } }

/* Cartão de identidade */
.id-card { justify-self: start; width: min(15rem, 62vw); }
.id-photo { position: relative; padding: 0.9rem; }
.id-photo img {
  width: 100%; height: auto; aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  filter: saturate(0.92);
}
.id-frame {
  position: absolute; inset: 0; width: 100%; height: 100%;
  fill: none; stroke: var(--accent); stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
  overflow: visible;
}
.id-caption {
  display: flex; align-items: center; gap: 0.55rem;
  margin-top: 0.6rem; padding-left: 0.9rem;
  font-family: var(--mono); font-size: 0.8125rem; color: var(--muted);
}
.id-dot {
  width: 0.5rem; height: 0.5rem; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-soft);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(182, 156, 255, 0.45); }
  70%, 100% { box-shadow: 0 0 0 0.5rem rgba(182, 156, 255, 0); }
}

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1fr auto; gap: 4rem; }
  .id-card { justify-self: end; width: clamp(17rem, 24vw, 22rem); }
}

/* Entrada: o único momento orquestrado da página */
.js .step { opacity: 0; transform: translateY(12px); animation: step-in 0.8s var(--ease) forwards; }
.js .hero-name.step { animation-delay: 0.35s; }
.js .hero-title.step { animation-delay: 0.45s; }
.js .hero-lead.step { animation-delay: 0.55s; }
.js .hero-actions.step { animation-delay: 0.65s; }
.js .id-card.step { animation-delay: 0.5s; transform: none; }
.js .id-frame path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw 1.1s var(--ease) 0.7s forwards; }
@keyframes step-in { to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Seções ---------- */
.section { padding-block: var(--section-space); }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }

.section-head { margin-bottom: clamp(2.5rem, 5vw, 3.75rem); }
.section-path {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.section-title {
  font-size: var(--step-3);
  font-weight: 620;
  font-stretch: 82%;
  letter-spacing: -0.02em;
}

.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Etiquetas */
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags li {
  padding: 0.3rem 0.75rem;
  font-size: var(--step--1);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.tags-mono li { font-family: var(--mono); font-size: 0.8125rem; }

/* ---------- Sobre ---------- */
.about-text { max-width: 44rem; }
.about-text p + p, .music-text p + p { margin-top: 1.25rem; }
.about-text p, .music-text p { color: var(--muted); }
.about-lead { color: var(--text) !important; font-size: var(--step-2); line-height: 1.45; font-weight: 500; }



/* ---------- Registro ---------- */
.log-grid { display: grid; gap: 4rem; }

.log-title {
  font-size: var(--step-2);
  font-stretch: 85%;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.log-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.log-date {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.log-body h4 { font-size: var(--step-1); font-weight: 600; }
.log-org { margin-top: 0.15rem; font-size: var(--step--1); color: var(--text); opacity: 0.75; }
.log-body p:not(.log-org) { margin-top: 0.5rem; color: var(--muted); max-width: 36rem; }

@media (min-width: 640px) {
  .log-item { grid-template-columns: 7.5rem 1fr; gap: 1.5rem; }
  .log-date { padding-top: 0.2rem; }
}
@media (min-width: 1100px) {
  .log-grid { grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
  .log-item { grid-template-columns: 6.75rem 1fr; }
}

/* ---------- Base técnica ---------- */
.stack-grid { display: grid; gap: 1rem; }
.stack {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.3s var(--ease);
}
.stack:hover { border-color: var(--line-strong); }
.stack .tags li { background: var(--bg); }
.stack-title {
  font-family: var(--mono); font-size: var(--step--1); font-weight: 500;
  color: var(--accent); margin-bottom: 1.1rem;
}

.skill-list { display: grid; gap: 0; }
.skill-list li {
  position: relative;
  padding: 0.65rem 0 0.65rem 1.25rem;
  border-top: 1px solid var(--line);
}
.skill-list li:first-child { border-top: 0; padding-top: 0; }
.skill-list li::before {
  content: ">";
  position: absolute; left: 0;
  font-family: var(--mono); font-size: 0.875rem;
  color: var(--accent);
}
.skill-list li:first-child::before { top: 0.05rem; }

@media (min-width: 768px) {
  .stack-grid { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
  .stack-wide { grid-column: 1 / -1; }
  .skill-list { grid-template-columns: repeat(2, 1fr); column-gap: 2.5rem; }
  .skill-list li:nth-child(2) { border-top: 0; padding-top: 0; }
  .skill-list li:nth-child(2)::before { top: 0.05rem; }
}
@media (min-width: 1024px) {
  .skill-list { grid-template-columns: repeat(3, 1fr); }
  .skill-list li:nth-child(3) { border-top: 0; padding-top: 0; }
  .skill-list li:nth-child(3)::before { top: 0.05rem; }
}

/* ---------- Música ---------- */
.music { display: grid; gap: 3rem; }
.music-text { max-width: 40rem; }

.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 72%;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.shot {
  scroll-snap-align: start;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}
.shot img {
  width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover;
  transition: transform 0.9s var(--ease);
}
.shot:hover img { transform: scale(1.03); }

@media (min-width: 768px) {
  .gallery { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; gap: 1.25rem; }
  .shot:nth-child(2) { transform: translateY(2.5rem); }
  .music { gap: 3.5rem; }
  #musica { padding-bottom: calc(var(--section-space) + 2.5rem); }
}

/* ---------- Contato ---------- */
.contact { max-width: 44rem; }
.contact-text { margin-top: 1rem; font-size: var(--step-1); color: var(--muted); }
.contact-mail {
  margin-top: 2rem;
  font-family: var(--mono);
  font-size: clamp(1rem, 0.7rem + 1.6vw, 1.75rem);
  overflow-wrap: anywhere;
}
.contact-mail a {
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size 0.4s var(--ease), color 0.2s;
}
.contact-mail a:hover { color: var(--accent); background-size: 100% 1px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.contact-actions .btn { flex: 1 1 11rem; }
@media (min-width: 560px) { .contact-actions .btn { flex: 0 0 auto; } }
.copy-feedback { min-height: 1.5em; margin-top: 0.9rem; font-family: var(--mono); font-size: 0.8125rem; color: var(--accent); }

/* ---------- Rodapé ---------- */
.site-footer { padding-block: 2rem; border-top: 1px solid var(--line); font-size: var(--step--1); color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.footer-links a { text-decoration: none; transition: color 0.2s var(--ease); }
.footer-links a:hover { color: var(--accent); }

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal, .js .step { opacity: 1; transform: none; }
  .js .id-frame path { stroke-dashoffset: 0; }
  .caret { opacity: 1; }
}
