/* ═══════════════════════════════════════════════════════════
   Alexander Balagurak — Portfolio Styles
   Light off-white/tan palette, accent #3a3330, Josefin Sans
   ═══════════════════════════════════════════════════════════ */

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

:root {
  --bg:          #f5f0eb;
  --surface:     #ffffff;
  --border:      #ddd5cc;
  --text:        #2c2420;
  --text-muted:  #6b5e54;
  --accent:      #3a3330;
  --accent-hover:#1e1a18;
  --accent-bg:   rgba(58, 51, 48, 0.06);
  --chip-bg:     #ede7e0;
  --chip-text:   #5a4f46;

  /* Typography */
  --font: "Josefin Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
          Roboto, sans-serif;

  /* Layout */
  --max-w: 960px;
  --gutter: 24px;
  --header-h: 60px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img { max-width: 100%; display: block; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
a:hover { color: var(--accent-hover); }

/* ── Container ─────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-decoration: none;
  white-space: nowrap;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

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

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline:hover {
  background: var(--accent-bg);
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-icon {
  padding: 6px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-icon:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Header ────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(245, 240, 235, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: box-shadow 0.3s var(--ease);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 24px;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}
.logo:hover { color: var(--accent); }

.nav { margin-left: auto; }

.nav-list {
  display: flex;
  list-style: none;
  gap: 4px;
}

.nav-link {
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
}
.nav-link:hover { color: var(--text); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  height: 2px;
  background: var(--text);
  transition: all 0.25s var(--ease);
  border-radius: 1px;
}
.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Hero ──────────────────────────────────────────────── */
.hero {
  padding: 140px 0 80px;
  min-height: 60vh;
  display: flex;
  align-items: center;
}

.hero-greeting {
  font-size: 16px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.hero-name {
  font-size: clamp(32px, 6vw, 52px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.hero-tagline {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.hero-summary {
  max-width: 560px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 32px;
}

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

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

.section-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 40px;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background: var(--accent);
  margin-top: 12px;
}

/* ── Project Cards ─────────────────────────────────────── */
.project-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 32px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(58, 51, 48, 0.1);
}

.project-screenshot {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.project-screenshot img {
  width: 100%;
  height: auto;
  display: block;
}

.project-content {
  padding: 28px 32px 32px;
}

.screenshot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
  padding: 48px 24px;
  text-align: center;
}

.project-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 2px;
}

.project-subtitle {
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 12px;
}

.project-desc {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 16px;
  line-height: 1.6;
}

.project-bullets {
  list-style: none;
  margin-bottom: 20px;
}
.project-bullets li {
  position: relative;
  padding-left: 16px;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.5;
}
.project-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  background: var(--accent);
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.chip {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  background: var(--chip-bg);
  color: var(--chip-text);
  letter-spacing: 0.2px;
}

.project-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Subsection title (Other Projects) */
.subsection-title {
  font-size: 20px;
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 24px;
  color: var(--text-muted);
}

/* Other projects grid */
.other-projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.mini-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.mini-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(58, 51, 48, 0.1);
}

.mini-card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.mini-card-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.mini-card-bullets {
  list-style: none;
  margin-bottom: 16px;
}
.mini-card-bullets li {
  position: relative;
  padding-left: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
  line-height: 1.5;
}
.mini-card-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  background: var(--accent);
}

/* ── Contact ───────────────────────────────────────────── */
.contact-container {
  text-align: center;
}

.contact-text {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
}

.contact-resume {
  margin-top: 8px;
}

/* ── Footer ────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 13px;
}
.footer-links a:hover { color: var(--accent); }

/* ═══════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  :root {
    --gutter: 16px;
    --header-h: 56px;
  }

  /* Mobile nav */
  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(245, 240, 235, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 16px var(--gutter);
    transform: translateY(-110%);
    opacity: 0;
    transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
    z-index: 999;
  }
  .nav.open {
    transform: translateY(0);
    opacity: 1;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
  }

  .nav-link {
    padding: 12px 0;
    font-size: 16px;
    border-bottom: 1px solid var(--border);
  }

  .hamburger { display: flex; }

  /* Header resume btn hidden on mobile */
  .header-actions > .btn-outline { display: none; }

  /* Hero */
  .hero {
    padding: 110px 0 60px;
    min-height: auto;
  }

  /* Project cards */
  .project-content {
    padding: 20px;
  }

  /* Other projects */
  .other-projects-grid {
    grid-template-columns: 1fr;
  }

  /* Section spacing */
  .section { padding: 56px 0; }
  .section-title { font-size: 24px; margin-bottom: 28px; }

  /* Footer */
  .footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  /* Contact buttons stack */
  .contact-links {
    flex-direction: column;
    align-items: center;
  }
  .contact-links .btn {
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero-name { font-size: 28px; }
  .hero-tagline { font-size: 16px; }

  .hero-actions {
    flex-direction: column;
  }
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── Focus styles (accessibility) ──────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  z-index: 10000;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 8px;
}

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