/* ============================================================
   MAIN — Reset, base, layout, typography
   ============================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* ── Scrollbar ── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ── Focus visible ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── Links ── */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}
a:hover { opacity: 0.8; }

/* ── Images ── */
img, svg {
  display: block;
  max-width: 100%;
}

/* ── Utility ── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   LAYOUT
   ============================================================ */

.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color var(--transition-slow), border-color var(--transition-slow);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  text-decoration: none;
}

.header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  object-fit: cover;
  flex-shrink: 0;
}

.header-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.header-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ── Main content ── */
.site-main {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 2;
}

.footer-v4v {
  max-width: 480px;
  margin: 0 auto 1.25rem;
  padding: 0.75rem 1.25rem;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
}

.footer-v4v-text {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--accent);
  font-weight: 500;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-footer a:hover { color: var(--accent); }

/* ── About section ── */
.about-section {
  margin-bottom: 1.5rem;
}

.about-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.about-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.about-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.about-toggle-icon {
  transition: transform var(--transition);
}

.about-toggle[aria-expanded="true"] .about-toggle-icon {
  transform: rotate(180deg);
}

.about-content {
  margin-top: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: aboutIn 0.3s ease both;
}

@keyframes aboutIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.about-text {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.about-text p {
  margin-bottom: 0.6rem;
}

.about-text strong {
  color: var(--accent);
  font-weight: 600;
}

.about-v4v {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  background: var(--accent-glow);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ── Section title ── */
.section-header {
  margin-bottom: 1.5rem;
}

.project-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ============================================================
   BUTTONS & CONTROLS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--text-faint);
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 600;
}

.btn-accent:hover {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
  color: #000;
}

.btn-icon {
  padding: 0.45rem;
  width: 36px;
  height: 36px;
  justify-content: center;
}

/* Theme toggle */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
}
.theme-toggle:hover {
  background: var(--surface-hover);
  color: var(--accent);
  border-color: var(--accent);
}

/* Language selector */
.lang-select {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a9e7a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.4rem center;
  padding-right: 1.6rem;
}
.lang-select:hover, .lang-select:focus {
  border-color: var(--accent);
  color: var(--text);
}
.lang-select option {
  background: var(--surface);
  color: var(--text);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 600px) {
  .header-inner { padding: 0 1rem; }
  .site-main    { padding: 1rem; }
  .header-subtitle { display: none; }
}
