:root {
    --background-color: #1E1E1E;
    --primary-color: #ffffff;
    --subheader-color: #e0e0e0;
    --accent-color: #fff;
    --divider-color: rgba(255, 255, 255, 0.10); /* Added for dividers, based on surface-border */

    --max-width: 1200px;
    --gap: 24px;

    /* Subtle surface styling for sections */
    --surface: rgba(255, 255, 255, 0.03);
    --surface-border: rgba(255, 255, 255, 0.10);
}

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

html, body {
    height: 100%;
}

body {
    margin: 0;
    /*background-color: var(--background-color);*/
    /*color: var(--accent-color);*/
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    /*background-color: #0b0f1a;*/
    /*background-image:*/
    /*        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.3), transparent),*/
    /*        radial-gradient(2px 2px at 80px 120px, rgba(255,255,255,0.2), transparent),*/
    /*        radial-gradient(2px 2px at 200px 50px, rgba(255,255,255,0.3), transparent);*/
    /*background-size: 400px 400px;*/

    background-color: #0b0f1a;
    background-image:
        /* Noise for galaxy effect */
        url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"%3E%3Cg fill="%23FFFFFF" fill-opacity="0.02"%3E%3Cpath d="M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c3.87 0 7-3.13 7-7s-3.13-7-7-7-7 3.13-7 7 3.13 7 7 7zm-2-69c3.87 0 7-3.13 7-7s-3.13-7-7-7-7 3.13-7 7 3.13 7 7 7zm60 21c3.87 0 7-3.13 7-7s-3.13-7-7-7-7 3.13-7 7 3.13 7 7 7zM53 88c3.87 0 7-3.13 7-7s-3.13-7-7-7-7 3.13-7 7 3.13 7 7 7zM5 39c3.87 0 7-3.13 7-7s-3.13-7-7-7-7 3.13-7 7 3.13 7 7 7z"%3E%3C/g%3E%3C/svg%3E'),
        /* Stars */
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 80px 120px, rgba(255,255,255,0.2), transparent),
        radial-gradient(2px 2px at 200px 50px, rgba(255,255,255,0.3), transparent),
        radial-gradient(1.5px 1.5px at 150px 200px, rgba(255,255,255,0.25), transparent),
        radial-gradient(0.8px 0.8px at 300px 100px, rgba(255,255,255,0.35), transparent),
        radial-gradient(1.2px 1.2px at 50px 300px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2.5px 2.5px at 250px 250px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 400px 150px, rgba(255,255,255,0.2), transparent),
        radial-gradient(0.7px 0.7px at 120px 340px, rgba(255,255,255,0.28), transparent),
        radial-gradient(1.8px 1.8px at 360px 60px, rgba(255,255,255,0.3), transparent),
        radial-gradient(3px 3px at 420px 280px, rgba(255,255,255,0.35), transparent),
        radial-gradient(1.1px 1.1px at 180px 360px, rgba(255,255,255,0.26), transparent),
        radial-gradient(2.2px 2.2px at 340px 220px, rgba(255,255,255,0.32), transparent),
        radial-gradient(0.9px 0.9px at 60px 420px, rgba(255,255,255,0.24), transparent);
    background-size: 100px 100px, 700px 700px; /* Noise small, stars larger */
    background-attachment: fixed;
}



.portfolio-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 24px 20px 64px;
}

/* Header */
.header {
    margin-bottom: 24px;
    padding-bottom: 16px; /* space above the divider */
    position: relative;
}

.header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(
            to right,
            transparent 0,
            var(--divider-color) 32px,
            var(--divider-color) calc(100% - 32px),
            transparent 100%
    );
    pointer-events: none;
}

.header h1 {
    margin: 0 0 4px 0;
    color: var(--primary-color);
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.subheader {
    margin: 0;
    color: var(--subheader-color);
    font-size: clamp(16px, 2vw, 18px);
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* Content sections */
.content {
    display: grid;
    gap: 32px;
}

/* Thin separators between sibling blocks inside .content */
.content > * + * {
    position: relative;
}

/* Gradient hairline with gentle side fade and balanced spacing */
.content > * + *::before {
    content: "";
    display: block;
    height: 1px;
    background: linear-gradient(
            to right,
            transparent 0,
            var(--divider-color) 32px,
            var(--divider-color) calc(100% - 32px),
            transparent 100%
    );
    margin: 8px 0 16px; /* small space above and below the line */
}

/* Utility: add to any container to draw lines between its children */
.divide-y > * + * {
    border-top: 1px solid var(--divider-color);
    padding-top: 12px;
}

/* Hero / About */
.blurb {
    display: grid;
    grid-template-columns: clamp(120px, 18vw, 180px) minmax(0, 1fr);
    gap: clamp(16px, 3vw, var(--gap));
    align-items: center;
    color: var(--accent-color);
    background: var(--surface);
    padding: 0 24px;

    background: rgba(63, 63, 63, 0.14);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.blurb-text {
    font-size: clamp(18px, 2vw, 21px);
    line-height: 1.7;
    max-width: 72ch; /* comfortable measure */
}

.logo {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    display: block;
}

/* Projects */
.projects h2 {
    margin: 0 0 12px 0;
    color: var(--accent-color);
    font-size: clamp(22px, 3vw, 28px);
}

/* Project list as grid for responsive tiling */
.project-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;

}

/* Individual project tile */
.project-tile {
    box-sizing: border-box;
    min-width: 0;
    color: var(--accent-color);
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 12px;

    border: 1px solid rgba(0, 0, 0, 0.3);
    background: rgba(63, 63, 63, 0.14);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: transform 180ms ease, box-shadow 180ms ease, background-image 180ms ease, background-color 180ms ease;
    /* Make tiles indicate clickability */
    cursor: pointer;
}

/* Hover / focus lift to indicate clickability (subtle white gradient glow) */
.project-tile:hover,
.project-tile:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 8px 36px rgba(0,0,0,0.25), 0 2px 18px rgba(255,255,255,0.03);
    /* add a very subtle white gradient overlay to imply elevation/glow */
    background-image: linear-gradient(to bottom, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
}

/* Stronger focus outline for keyboard users while keeping visual design */
.project-tile:focus-visible {
    outline: 2px solid rgba(255,255,255,0.06);
    outline-offset: 4px;
}

.project-tile h2,
.project-tile p {
    margin: 10px;

}

/* Utilities */
.visually-hidden {
    position: absolute !important;
    height: 1px; width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap; /* prevent line breaks */
}

.project-sub-information {
    float: left;
    margin: 0 10px 0 10px;
    box-sizing: border-box;
    font-size: 11px;
    line-height: 0;
    text-align: center;
}

.project-short-description {
    font-size: 16px;
    line-height: 24px;
    color: #fff;
}

.video-container {
    aspect-ratio: 16 / 9;
    width: 100%;
    display: block;
    max-width: 100%;
    overflow: hidden;
    background: #000;
    border-radius: 12px 12px 0 0;
}

/* Make the video fill the container and respect the aspect-ratio */
.video-container video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.video-information {
    line-height: 30px;
    background-color: #000;
}

.sub-info-row:after {
    content: "";
    display: table;
    clear: both;
}

/* Responsive adjustments - removed blurb stacking to keep logo on left */
@media (max-width: 820px) {
    /* Keep blurb grid intact, allow text to wrap in narrower space */
    /* No changes to .blurb or .logo here to prevent centering and stacking */
}
/* Inline title row with arrow opener */
.project-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 10px;
}

.project-title-row h2 {
  margin: 0;
}

/* Arrow trigger next to title */
.project-open {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(63,63,63,0.22);
  color: var(--accent-color);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  padding: 0;
  flex: 0 0 auto;
}
.project-open:hover { background: rgba(255,255,255,0.08); }

/* ------------------------------
   Modal (Project Details)
   ------------------------------ */

/* Backdrop layer (unchanged) */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 220ms ease;
}

.modal.is-open { display: flex; opacity: 1; }

/* Dialog panel: solid background matching site */
.modal__dialog {
  width: min(100%, 940px);
  max-height: 90vh;
  overflow: auto;
  color: var(--accent-color);

  /* Solid app background, no glass transparency */
  background: #0b0f1a;                  /* matches page background */
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.07);

  transform: translateY(12px) scale(0.985);
  transition: transform 220ms ease;
}
.modal.is-open .modal__dialog { transform: translateY(0) scale(1); }

/* Keep internal sections slightly raised for structure */
.modal__section {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 12px 14px;
}

/* Header and buttons remain the same */
.modal__header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 16px 16px 0 16px;
}
.modal__title { margin: 0; font-size: clamp(22px, 2.6vw, 28px); }
.modal__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent-color);
  font: inherit;
  cursor: pointer;
  opacity: 0.8;
  padding: 6px;
  border-radius: 8px;
}
.modal__close:hover { opacity: 1; background: rgba(255,255,255,0.06); }

.modal__body { display: grid; gap: 16px; padding: 12px 16px 16px 16px; }

.modal__hero-media {
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  background: #000;
  border-radius: 12px;
}
.modal__hero-media video,
.modal__hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.modal__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; }

.tech-list { display: grid; gap: 10px; padding-left: 18px; margin: 0; }
.tech-list li { margin: 0; }

.tech-clip { margin-top: 8px; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; overflow: hidden; }
.tech-clip video { width: 100%; height: 100%; object-fit: cover; display: block; }

.modal__actions { display: flex; justify-content: flex-end; gap: 12px; padding-top: 4px; }

.btn {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(63, 63, 63, 0.22);
  color: var(--accent-color);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}
.btn:hover { background: rgba(255,255,255,0.08); }

.btn-primary {
  border-color: rgba(42, 118, 255, 0.7);
  background: linear-gradient(0deg, rgba(42,118,255,0.22), rgba(42,118,255,0.22));
}
.btn-primary:hover { background: rgba(42,118,255,0.28); }

.tags { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.tag { background: #0048ad; color: #fff; border-radius: 6px; padding: 4px 8px; font-size: 12px; font-weight: 700; -webkit-border-radius: 6px; -moz-border-radius: 6px; -ms-border-radius: 6px; -o-border-radius: 6px; }

@media (max-width: 820px) {
  .modal__grid { grid-template-columns: 1fr; }
}

/* Prevent page scroll when modal open */
body.modal-open { overflow: hidden; }
/* No breaking visual changes; only small helper styles for dynamic render */

/* Hide HTML templates */
template { display: none; }

/* Optional subtle divider between title row and summary */
.project-title-row + p {
  margin-top: 6px;
}
