/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── Design tokens ──────────────────────────────────────────────────────── */
:root {
  --bg:             #ffffff;
  --text-primary:   #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary:  #86868b;
  --border:         #d2d2d7;
  --border-hover:   #a1a1a6;
  --accent:         #0071e3;
  --accent-hover:   #0077ed;
  --surface:        #f5f5f7;
  --max-width:      980px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
}

/* ─── Base ───────────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47059;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 22px;
}

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  padding: 110px 0 72px;
  border-bottom: 1px solid var(--border);
}

.hero__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 56px;
}

.hero__content { flex: 1; min-width: 0; }

.hero__name {
  font-size: 56px;
  font-weight: 300;
  letter-spacing: -0.5px;
  line-height: 1.07143;
  color: var(--text-primary);
}

.hero__role {
  font-size: 21px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 10px;
}

.hero__social {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 28px;
}

.social-link {
  display: flex;
  align-items: center;
  color: var(--text-primary);
  opacity: 0.55;
  transition: opacity 0.18s ease;
}

.social-link:hover { opacity: 1; }

.hero__bio {
  margin-top: 20px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
}

/* ─── Hero photo ─────────────────────────────────────────────────────────── */
.hero__photo-wrap { flex-shrink: 0; }

.hero__photo {
  display: block;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 1px solid var(--border);
}

.hero__photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 36px;
  font-weight: 300;
  color: var(--text-tertiary);
  letter-spacing: -0.5px;
  user-select: none;
}

/* ─── Sections ───────────────────────────────────────────────────────────── */
.section {
  padding: 64px 0;
}

.section__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

.section__text {
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-primary);
  max-width: 580px;
}

/* ─── Projects grid ──────────────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.projects-empty {
  padding: 40px 0 0;
  font-size: 15px;
  color: var(--text-tertiary);
}

/* ─── Project card ───────────────────────────────────────────────────────── */
.project-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.project-card__image {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.project-card__body { padding: 24px; }

.project-card__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.project-card__desc {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-top: 8px;
}

.project-card__tech {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 12px;
}

.project-card__link {
  display: inline-block;
  font-size: 13px;
  color: var(--accent);
  margin-top: 16px;
  transition: color 0.15s ease;
}

.project-card__link:hover { color: var(--accent-hover); }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  padding: 32px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  font-size: 15px;
  font-family: var(--font);
  font-weight: 400;
  border-radius: 980px;
  border: none;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
  white-space: nowrap;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--border-hover);
  background: var(--surface);
}

.btn-danger {
  background: transparent;
  color: #c00;
  border: 1px solid transparent;
}
.btn-danger:hover:not(:disabled) { background: #fff0f0; }

/* ─── Form elements ──────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s ease;
  appearance: none;
}

.form-input:focus,
.form-textarea:focus { border-color: var(--accent); }

.form-textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.5;
}

.form-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.form-error {
  font-size: 13px;
  color: #c00;
  margin-top: 4px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

/* ─── Admin — login ──────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 340px;
  padding: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.login-card__title {
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 24px;
}

/* ─── Admin — layout ─────────────────────────────────────────────────────── */
.admin-header {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.admin-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-header__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.admin-body { padding: 48px 0; }

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.admin-section-title {
  font-size: 21px;
  font-weight: 600;
}

.admin-status {
  font-size: 13px;
  color: #1a8a3a;
}

/* ─── Admin — form panel ─────────────────────────────────────────────────── */
.form-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  margin-bottom: 28px;
}

.form-panel__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
}

/* ─── Admin — project list ───────────────────────────────────────────────── */
.project-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.project-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background 0.12s ease;
}

.project-list-item:last-child { border-bottom: none; }
.project-list-item:hover { background: var(--surface); }

.project-list-item__info {
  flex: 1;
  min-width: 0;
}

.project-list-item__name {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-list-item__tech {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-list-item__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-sm {
  font-size: 13px;
  padding: 5px 13px;
  border-radius: 6px;
}

.list-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* ─── Image preview ──────────────────────────────────────────────────────── */
.imagem-preview__img {
  max-width: 200px;
  max-height: 120px;
  border-radius: 6px;
  border: 1px solid var(--border);
  object-fit: cover;
}

/* ─── Ver mais ───────────────────────────────────────────────────────────── */
.project-card__desc-wrapper { position: relative; }

.project-card__desc-truncated {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card__ver-mais {
  display: inline;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  padding: 0;
  margin-top: 4px;
  transition: color 0.15s ease;
}

.project-card__ver-mais:hover { color: var(--accent-hover); }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 734px) {
  .hero { padding: 64px 0 48px; }
  .hero__inner { flex-direction: column-reverse; align-items: flex-start; gap: 28px; }
  .hero__name { font-size: 38px; }
  .hero__role { font-size: 18px; }
  .hero__photo, .hero__photo-placeholder { width: 120px; height: 120px; font-size: 24px; }
  .section { padding: 48px 0; }
  .projects-grid { grid-template-columns: 1fr; }
  .project-list-item { flex-wrap: wrap; gap: 10px; }
}
