/* ── Base styles ─────────────────────────────────────────────────────────── */
:root {
  --clr-bg: #000;        /* main background (black)          */
  --clr-bg-panel: #111;  /* slightly lighter panels          */
  --clr-primary: #e50914;/* Netflix-red accent               */
  --clr-text: #f2f2f2;   /* light text for dark background   */
  --radius: 12px;        /* default corner radius            */
  --shadow: 0 4px 12px rgba(229, 9, 20, 0.35);
  --shadow-hover: 0 6px 16px rgba(229, 9, 20, 0.55);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.5;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--clr-bg-panel);
  border-bottom: 2px solid var(--clr-primary);
}

.logo {
  margin: 0;
  color: var(--clr-primary);
  font-size: 1.8rem;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

nav a {
  position: relative;
  color: var(--clr-text);
  text-decoration: none;
  font-weight: 500;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--clr-primary);
  transition: width 0.3s ease;
}

nav a:hover::after,
nav a:focus-visible::after {
  width: 100%;
}

/* ── Projects grid ──────────────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.card {
  background: var(--clr-bg-panel);
  border: 2px solid var(--clr-primary);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover,
.card:focus-within {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.card h2 {
  margin: 1rem 1rem 0;
  color: var(--clr-primary);
  font-size: 1.25rem;
}

.card p {
  margin: 0.5rem 1rem 1rem;
  flex: 1 1 auto; /* ensures button sits at the bottom */
}

.btn {
  align-self: flex-start;
  margin: 0 1rem 1rem;
  padding: 0.5rem 1.1rem;
  border: none;
  border-radius: 6px;
  background: var(--clr-primary);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s ease;
}

.btn:hover,
.btn:focus-visible {
  background: #ff1a25;
}

/* ── About section ──────────────────────────────────────────────────────── */
.about {
  max-width: 800px;
  margin: 2rem auto;
  padding: 1.5rem 2rem;
  background: var(--clr-bg-panel);
  border-left: 4px solid var(--clr-primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.about h2 {
  margin-top: 0;
  color: var(--clr-primary);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1rem;
  background: var(--clr-bg-panel);
  border-top: 2px solid var(--clr-primary);
  font-size: 0.9rem;
}

/* ── Responsive tweaks ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  nav ul { gap: 1rem; }

  .projects-grid { padding: 1rem; }
}
