:root {
  --ink: #16324F;
  --tile-blue: #2F6690;
  --tile-blue-deep: #1B3A5C;
  --clay: #C97B3D;
  --paper: #FBFAF7;
  --paper-dim: #F1EEE6;
  --muted: #6E8394;
  --line: rgba(22, 50, 79, 0.14);

  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }

/* ---------- Tile motif: ambient background field ---------- */
.tile-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--paper);
  background-image:
    linear-gradient(45deg, var(--tile-blue) 24%, transparent 24.5%, transparent 75%, var(--tile-blue) 75.5%, var(--tile-blue)),
    linear-gradient(45deg, var(--tile-blue) 24%, transparent 24.5%, transparent 75%, var(--tile-blue) 75.5%, var(--tile-blue)),
    linear-gradient(45deg, var(--clay) 24%, transparent 24.5%, transparent 75%, var(--clay) 75.5%, var(--clay)),
    linear-gradient(45deg, var(--clay) 24%, transparent 24.5%, transparent 75%, var(--clay) 75.5%, var(--clay));
  background-size: 56px 56px;
  background-position: 0 0, 28px 28px, 28px 0, 0 28px;
  opacity: 0.07;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 0%, transparent 75%);
}

/* ---------- Tile frieze: classic azulejo border strip ---------- */
.tile-frieze {
  width: 100%;
  height: 16px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--tile-blue) 0 16px,
    var(--clay) 16px 32px,
    var(--tile-blue-deep) 32px 48px,
    var(--paper-dim) 48px 64px
  );
}

.tile-mark {
  display: inline-grid;
  grid-template-columns: repeat(2, 7px);
  grid-template-rows: repeat(2, 7px);
  gap: 3px;
  width: 17px;
  height: 17px;
}
.tile-mark::before,
.tile-mark::after {
  content: '';
  background: var(--tile-blue);
}
.section-head .tile-mark span { display: none; }
.tile-mark { position: relative; }
.tile-mark::before { grid-area: 1 / 1; box-shadow: 10px 0 0 var(--clay), 0 10px 0 var(--clay), 10px 10px 0 var(--tile-blue); }

/* ---------- Nav ---------- */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 48px;
  position: relative;
  z-index: 10;
}
.nav-mark {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.08em;
  border: 1px solid var(--line);
  padding: 6px 10px;
  color: var(--tile-blue-deep);
}
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--tile-blue-deep); }

/* ---------- Hero ---------- */
.hero {
  padding-bottom: 96px;
  position: relative;
}

.hero-content {
  max-width: 780px;
  margin: 0 auto;
  padding: 64px 48px 0;
  text-align: left;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 20px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--tile-blue-deep);
  margin-bottom: 28px;
}

.hero-lede {
  font-size: 1.15rem;
  color: var(--ink);
  max-width: 560px;
  margin-bottom: 40px;
}

.hero-actions { display: flex; gap: 16px; }

.btn {
  display: inline-block;
  padding: 13px 26px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 2px;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn-primary { background: var(--tile-blue-deep); color: var(--paper); }
.btn-primary:hover { background: var(--clay); transform: translateY(-1px); }
.btn-ghost { border: 1px solid var(--line); color: var(--tile-blue-deep); }
.btn-ghost:hover { border-color: var(--tile-blue-deep); }

/* ---------- Sections ---------- */
.section {
  max-width: 780px;
  margin: 0 auto;
  padding: 88px 48px;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}

.section h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.9rem;
  color: var(--tile-blue-deep);
}

/* Sobre */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 56px;
}
.about-lead { font-size: 1.05rem; }
.about-details { display: flex; flex-direction: column; gap: 24px; }
.detail { display: flex; flex-direction: column; gap: 4px; }
.detail-label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--clay);
}
.detail-value { font-size: 0.95rem; color: var(--muted); }

/* Habilidades */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.skill-card {
  background: var(--paper-dim);
  padding: 24px;
  border-left: 3px solid var(--tile-blue);
}
.skill-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tile-blue-deep);
  margin-bottom: 14px;
}
.skill-card ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.skill-card li { font-size: 0.92rem; color: var(--ink); }

/* Projetos */
.projects-list { display: flex; flex-direction: column; gap: 20px; }
.project-card {
  padding: 32px;
  border: 1px solid var(--line);
  transition: border-color 0.2s ease;
}
.project-card.featured { border-color: var(--tile-blue); background: var(--paper-dim); }
.project-card.placeholder { border-style: dashed; }
.project-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--clay);
  letter-spacing: 0.04em;
}
.project-card h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 10px 0 12px;
  color: var(--tile-blue-deep);
}
.project-card p { color: var(--muted); max-width: 560px; margin-bottom: 16px; }
.project-link { font-weight: 600; font-size: 0.9rem; color: var(--tile-blue-deep); }
.project-link:hover { color: var(--clay); }

/* Contato */
.contact-lede { font-size: 1.1rem; margin-bottom: 28px; max-width: 480px; }
.contact-links { display: flex; gap: 28px; }
.contact-links a {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--tile-blue-deep);
  border-bottom: 1px solid var(--tile-blue);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.contact-links a:hover { color: var(--clay); border-color: var(--clay); }

/* Footer */
.footer {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px 48px 64px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav { padding: 24px 24px; flex-direction: column; gap: 16px; }
  .nav-links { gap: 20px; }
  .hero-content { padding: 40px 24px 0; }
  .section { padding: 64px 24px; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .skills-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-wrap: wrap; }
  .footer { flex-direction: column; gap: 8px; padding: 24px 24px 48px; }
}
