/* =========================
   Global variables
   ========================= */
:root {
  --bg-main: #0c101a;
  --bg-panel: #26345a;
  --border-panel: #3a4a7a;
  --text-main: #e6e9f2;
  --text-muted: #b8c0e0;
  --accent: #7aa2ff;
}

h3 {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

/* Prevent layout shift */
html {
  overflow-y: scroll;
}

/* =========================
   Base layout
   ========================= */
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  background:
    linear-gradient(rgba(31,42,68,0.75), rgba(31,42,68,0.9)),
    url('/images/pagebgr.jpg');

  background-size: cover;
  background-position: center;
  background-attachment: fixed;

  color: var(--text-main);
  line-height: 1.6;

  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

/* =========================
   Sidebar social links
   ========================= */
.social-links {
  margin-top: 0.75rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.2rem;
  margin-right: 1rem;
}

.social-links a:hover {
  color: var(--accent);
}

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.social-links a:hover .icon {
  opacity: 1;
  transform: scale(1.1);
}

/* =========================
   Navigation
   ========================= */
nav {
  padding: 1.5rem 2rem;
}

nav a {
  position: relative;
  color: var(--text-muted);
  text-decoration: none;
  margin-right: 1.5rem;
  font-weight: 500;

  transition: color 0.2s ease;
}

/* Underline (hidden by default) */
nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;

  background-color: var(--accent);
  transform: scaleX(0);
  transform-origin: left;

  transition: transform 0.2s ease;
}

nav a:hover {
  color: var(--text-main);
}

nav a:hover::after {
  transform: scaleX(1);
}

/* Active page */
nav a.active {
  color: var(--text-main);
}

nav a.active::after {
  transform: scaleX(1);
}

/* =========================
   Layout (home page)
   ========================= */
.layout {
  max-width: 1000px;
  margin: 3rem auto;
  padding: 0 1.5rem;
  display: flex;
  flex: 1;
  gap: 2.5rem;
  align-items: flex-start;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  margin-top: 3rem;
}

.profile-image {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border-panel);
  margin-bottom: 1rem;
}

.sidebar h1 {
  font-size: 1.8rem;
  line-height: 1.1;
  margin: 0 0 0.25rem 0;
}

.sidebar .muted {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.sidebar a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.sidebar a:hover {
  color: var(--accent);
}

/* =========================
   Main content container
   ========================= */
.container {
  flex: 1;
  max-width: 720px;
  margin: 3rem auto 3rem auto; 
  padding: 2.5rem;

  background-color: rgba(38, 52, 90, 0.85);
  border: 1px solid var(--border-panel);
  border-radius: 12px;
  backdrop-filter: blur(6px);
}

/* =========================
   Typography
   ========================= */
h1 {
  margin-top: 0;
  font-size: 2.2rem;
}

.muted {
  color: var(--text-muted);
}

/* =========================
   Footer
   ========================= */
.site-footer {
  width: 100%;
  padding: 2.25rem 1rem;
  text-align: center;

  background-color: #182036;
  color: var(--text-muted);
  font-size: 0.85rem;

  border-top: 1px solid var(--border-panel);
}

.site-footer p {
  margin: 0;
}

/* =========================
   Buttons
   ========================= */
.download-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.6rem 1rem;

  background-color: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;

  text-decoration: none;
  font-weight: 500;
}

.download-btn:hover {
  background-color: var(--accent);
  color: #1f2a44;
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 700px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 180px;
    flex-shrink: 0;
    margin-top: 3rem;
  }
}

/* =========================
   Projects page
   ========================= */

.projects-intro {
  margin-bottom: 2rem;
}

.projects-shell {
  width: min(1400px, calc(100% - 3rem));
  margin: 3rem auto;
}

.project-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.projects-header {
  display: flex;
  align-items: center;   /* aligns logo + text nicely */
  gap: 1rem;
  margin-bottom: 1rem;
}

.project-title-block h2 {
  margin: 0;
}

.project-title-block .muted {
  margin: 0.2rem 0 0 0;
  font-size: 0.85rem;
}

.projects-header h1 {
  margin-bottom: 0.75rem;
}

/* =========================
   Logo-first project header
   ========================= */

.project-header--logo-only {
  margin-bottom: 1.5rem;
}

/* Bigger logo for primary project */
.project-logo--large {
  width: 240px;     /* 🔥 main fix */
  height: auto;
  display: block;
}

/* Optional: subtle glow integration */
.project-logo--large {
  filter: drop-shadow(0 0 12px rgba(122, 162, 255, 0.25));
}

/* Grid for project cards */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  align-items: start;
}

.projects-page .screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 1.75rem 0;
}

.project-card {
  padding: 1.6rem;

  background-color: rgba(38, 52, 90, 0.85);
  border: 1px solid var(--border-panel);
  border-radius: 12px;
  backdrop-filter: blur(6px);
}

.projects-page .project-card:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.projects-page .project-card:first-child {
  border-color: var(--accent);
}

.projects-page .project-card:first-child .project-header {
  justify-content: center;
}

/* Screenshot grid inside each project */
.projects-page .screenshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.projects-page .screenshot-grid img {
  cursor: pointer;
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-panel);
}

.projects-page .screenshot-grid img:hover {
  opacity: 0.9;
}

.projects-page .lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.projects-page .lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  border: 1px solid var(--border-panel);
}

.projects-page .lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2rem;
  color: var(--text-main);
  cursor: pointer;
  z-index: 1001;
}

.projects-page .hidden {
  display: none;
}

/* Responsive fallback */
@media (max-width: 1000px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .projects-page .screenshot-grid {
    grid-template-columns: 1fr;
  }
}

/* External link indicator */
.external-link::after {
  content: "⤴";
  font-size: 0.8rem;
  margin-left: 0.4rem;
  opacity: 0.8;
}

/* =========================
   Videos page
   ========================= */

.videos-header {
  margin-bottom: 2rem;
}

.videos-header h1 {
  margin-bottom: 0.75rem;
}

.videos-header .muted {
  max-width: 900px;
  margin: 0;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  align-items: stretch;
}

/* =========================
   Video thumbnails (no iframe)
   ========================= */

.video-card {
  display: flex;
  flex-direction: column;
}

/* Thumbnail container */
.video-thumb {
  position: relative;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-panel);
}

/* Thumbnail image */
.video-thumb img {
  width: 100%;
  display: block;
  transition: transform 0.25s ease;
}

/* Hover zoom */
.video-thumb:hover img {
  transform: scale(1.03);
}

/* Play button overlay */
.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.2rem;
  color: white;
  background: rgba(0,0,0,0.55);
  border-radius: 50%;
  padding: 0.4rem 0.6rem;
  pointer-events: none;
}

/* Actions row */
.video-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.video-actions a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.video-actions a:hover {
  color: #ffffff;
}

/* Share button */
.share-btn {
  background: none;
  min-width: 70px;
  border: 1px solid var(--border-panel);
  color: var(--text-muted);
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
}

.share-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--border-panel);
  background-color: #0c101a;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.video-card .muted {
  margin-top: 0.85rem;
  margin-bottom: 0;
}

.videos-channel-link {
  margin-top: 2rem;
}

.video-status {
  margin-top: 0.5rem;
  margin-bottom: 2rem;
  max-width: 500px;
  padding: 0.7rem 1rem;

  border: 1px solid rgba(122, 162, 255, 0.35);
  background-color: rgba(122, 162, 255, 0.08);

  border-radius: 8px;
}

/* Main description (neutral) */
.video-status-main {
  font-size: 0.95rem;
  color: var(--text-main);
}

/* Highlighted status line */
.video-status-note {
  margin-top: 0.3rem;

  font-size: 0.95rem;
  color: var(--text-main);
  font-weight: 500;

  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

/* Mobile */
@media (max-width: 1000px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================
   About page layout
   ========================= */
.about-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.about-photo {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border-panel);
  flex-shrink: 0;
}

.about-content {
  flex: 1;
}

/* Mobile fallback */
@media (max-width: 700px) {
  .about-layout {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .about-photo {
    margin-bottom: 1rem;
  }
}

/* =========================
   Contact page (form styles)
   ========================= */

form {
  max-width: 520px;
}

form input,
form textarea {
  width: 100%;
  background-color: #1f2a44;
  color: var(--text-main);

  box-sizing: border-box;
  padding: 0.5rem 0.6rem;
  margin-top: 0.3rem;

  font-family: inherit;
  border: 1px solid var(--border-panel);
  border-radius: 4px;
  font-size: 0.95rem;
}

/* Focus state (important fix) */
form input:focus,
form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* Textarea behavior */
form textarea {
  resize: vertical;
  min-height: 140px;
}