:root{
  --bg: #f7f7f7;
  --bg-shade: #f7f7f7a8;
  --text: #333;
  --muted: #666;
  --accent: #555; /* header nav color */
  --link: rgb(0, 116, 199);
  --border: #e5e5e5;
  --overlay: rgba(255,255,255,.35);

  --heading-font: 'Oswald', sans-serif;
  --body-font: 'Montserrat', sans-serif;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  font-family: var(--body-font);
  font-weight: 400;
  font-size: 16px;
  margin:0;
  color:var(--text);
  background:var(--bg);
  line-height:1.6em;
}
a{color:var(--link); text-decoration:none}
a:hover{text-decoration:none}

.container{max-width:1100px;margin:0 auto;padding:20px}

header{
  position:sticky; top:0; z-index:10;
  background:rgba(247,247,247,.9);
  backdrop-filter: saturate(160%) blur(4px);
  border-bottom:1px solid var(--border);
}
.header-inner{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 20px;
}
.brand{
  font-family: "oswald", sans-serif;
  font-weight: 200;
  font-style: normal;
  font-size:36px;
  line-height: 80px;
  text-transform: uppercase;
  letter-spacing:.08em;
  color:#333;
}
nav a
{
  color:var(--accent); margin-left:24px; font-weight:500; line-height: 1em; padding: .2em .6em .3em .6em;
}
nav a.active
{
  border: #dedede 1px solid;
  border-radius: 4px;
}
nav a:hover
{
  background-color: #eeeeee;
  border-radius: 4px;
}

/* Grid */
.grid{
  display:grid; gap:0;
  grid-template-columns: repeat(5, minmax(0,1fr));
  padding:0;
  margin:0;
}
li.grid-item { list-style:none; }

@media (max-width: 1200px){
  .grid{grid-template-columns: repeat(3, minmax(0,1fr));}
}
@media (max-width: 640px){
  .grid{grid-template-columns: repeat(2, minmax(0,1fr));}
}
.card{
  position:relative;
  aspect-ratio:1/1;
  overflow:hidden;
  background:#ddd;
  cursor:pointer;
  box-shadow:0 1px 0 rgba(0,0,0,.05);
  line-height: 0;
}
.card img{
  width:100%; height:100%;
  object-fit:cover;
  display:block;
  filter: saturate(105%);
  opacity:0; transform: translateY(8px) scale(.98);
  transition: opacity .5s ease, transform .5s ease;
}
.card img.loaded{ opacity:1; transform: none; }

.card .title{
  position:absolute; left:8px; bottom:8px; right:8px;
  color:white; font-weight:600; text-shadow:0 1px 3px rgba(0,0,0,.5);
  font-size:14px; letter-spacing:.02em;
  line-height: normal;
}

/* Badges on cards + in panel */
.badges, .panel-tags { display:flex; gap:6px; flex-wrap:wrap; }
.badges { position:absolute; top:8px; left:8px; }
.badge{
  font-size:11px; line-height:1;
  padding:4px 8px; border-radius:999px;
  background:rgba(0,0,0,.66); color:#fff;
}
.panel-tags { margin-top:6px; }

footer{
  border-top:1px solid var(--border);
  color:var(--muted);
  padding:20px 0;
  background:#fafafa;
}
.footer-inner{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:0 20px;
  flex-wrap:wrap;
}
.footer-links a{ margin-right:16px; color:#444 }
.footer-phone{ white-space:nowrap }

/* Lightbox overlay */
.overlay{
  position:fixed; inset:0; z-index:30;
  backdrop-filter: blur(100px);
  display:flex; align-items:center; justify-content:center;
  padding:0;
}
.hidden{ display:none }
.panel{
  position:relative;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  overflow:hidden;
  display:flex; flex-direction:column;
}
.panel-header{
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 60px;
  flex-shrink: 0;
  padding: 0 25px;
  z-index: 10;
}
.project-nav {
    grid-column: 2;
    width: 900px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.panel-title{
    font-family: "oswald", sans-serif;
    font-size:24px;
    font-weight:300;
    color:white;
}
.panel-body{
  flex:1;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  width: 100%;
}

#projectContent {
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

#projectContent.visible {
  opacity: 1;
}


/* Slider */
.slider{width:100%;height:100%;}
.slides {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 20px;
  padding: 0 10px;
}
.slides figure {
  position: relative;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  height: auto;
  flex-shrink: 0;
}

.slides figure::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(15, 62, 78, 0.7);
  backdrop-filter: blur(50px);
  border-radius: 6px;
  opacity: 1;
  transition: opacity .3s ease;
  pointer-events: none;
}

.slides figure.active::after {
  opacity: 0;
}
.slides img, .slides .media {
  border-radius: 6px;
  max-height: 90vh;
  max-width: 90vw;
}
.slides iframe {
  width: 100%;
  height: 100%;
  border-radius: 6px;
}

.panel-footer{
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px;
}

.info-btn{
  width: 35px;
  height: 35px;
  background: transparent url('/images/project-info-icon.png') no-repeat center center;
  background-size: contain;
  border: 0;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity .2s ease;
}
.info-btn:hover {
    opacity: 1;
}

.info-panel {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 800px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(50px);
  color: #000;
  border-radius: 12px;
  padding: 20px;
  z-index: 20;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
}
.overlay.info-visible .info-panel {
  opacity: 1;
  pointer-events: auto;
}
.info-inner {
  flex-grow: 1;
}
.info-inner .close-btn {
  /* The close button image is dark, so it won't show up well.
     I will hide it for now. A better solution would be to have a light version of the icon. */
  display: none;
}
.info-text {
  margin-top: 0;
  margin-bottom: 30px;
  line-height: 1.7;
  font-size: 14px;
  border-bottom: 1px solid #ccc;
  padding-bottom: 20px;
}
.info-meta {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  gap: 30px;
}
.client, .skills {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.client-logo {
  max-width: 150px;
  margin-bottom: 10px;
  max-height: 30px;
}
.client h3,
.skills h3 {
  margin: 0 0 15px 0;
  font-family: 'Oswald', sans-serif;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 18px;
}
.skills ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.skills li {
  background: #eee;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 12px;
}

/* Set max-width for text elements inside .panel-body */
.panel-body p,
.panel-body h1,
.panel-body h2,
.panel-body h3,
.panel-body h4,
.panel-body h5,
.panel-body h6,
.panel-body ul,
.panel-body ol,
.panel-body blockquote,
.panel-body pre,
.panel-body table {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.panel-body figure {
  margin-bottom: 40px;
}

/* Optionally, you can add .panel-body > * selector for direct children */
.panel-body > * {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.close-btn{
  grid-column: 3;
  justify-self: end;
  width: 32px;
  height: 32px;
  background: transparent url('/images/Projects-Close-X.png') no-repeat center center;
  background-size: contain;
  border: 0;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity .2s ease;
  z-index: 40;
}
.close-btn:hover {
    opacity: 1;
}
.close-btn:focus {
  outline: none;
}
.nav-btn{
  background-color: transparent;
  border: none;
  width:40px; height:40px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  cursor:pointer;
  opacity: 0.6;
  transition: opacity .2s ease;
}
.nav-btn:hover {
  opacity: 1;
}
.nav-prev{
  background-image: url('/images/projects_arrow_previous.png');
}
.nav-next{
  background-image: url('/images/projects_arrow_next.png');
}
.nav-btn span{ display:none; }

/* Dimmed (filtered-out) cards are unclickable */
.card.dim{
  opacity:.28;
  filter: grayscale(30%);
  pointer-events: none;
}

/* Hide pills when lightbox is open to reduce distraction */
body.lightbox-open main, body.lightbox-open header, body.lightbox-open footer{
  filter: blur(1px) saturate(90%);
}
body.lightbox-open .filter-bar{
  opacity:0; pointer-events:none; transform: translate(-50%, 10px);
  transition: opacity .15s ease, transform .15s ease;
}

.filter-bar button {
  background: #eee;
  padding: 4px 8px;
  border-radius: 15px;
  font-size: 12px;
  border: none;
}

.filter-bar button.active {
  background-color: var(--link);
  color: white;
  border: none;
  padding: 4px 8px;
  font-size: 12px;
}

/* Responsive media embeds with various aspect ratios */
.media{ width:100% }
.media iframe, .media video{
  width:100%; height:100%; border:0; display:block; border-radius:6px; background-color: #111;
}
.ar-16x9{
  aspect-ratio:16/9;
  width: 80vw;
  max-height: 90vh;
}
.ar-1x1 {
  aspect-ratio: 1 / 1;
  height: 85vh;
  max-width: 90vw;
}
.ar-9x16{ aspect-ratio:9/16 }

/* About/Contact page content styling */
.main-content{ padding:20px; max-width: 940px; margin: 60px auto; }
.main-content h1{ font-size:36px; font-family: Oswald; font-weight: 400; line-height: 1.4em; margin:10px 0 12px; }
.main-content h2{ font-size:20px; font-family: var(--body-font); font-weight: 300; font-size: 22px; margin:26px 0 12px; color:#333 }
.main-content p{ margin:0 0 14px; color:var(--text) }
form label{ display:block; font-weight:600; margin:10px 0 6px }
input[type="text"], input[type="password"], input[type="email"], textarea{
  width:100%; padding:12px; border:1px solid var(--border);
  border-radius:6px; background:white; color:#222; font-size:16px;
}
textarea{ min-height:120px; resize:vertical }
button.primary{
  margin-top:14px; padding:10px 16px; border:1px solid #222; background:#222;
  color:#fff; border-radius:999px; font-weight:600; cursor:pointer;
}
button.primary:hover{ filter: brightness(1.08) }

/* ===== Floating filter pills ===== */
.filter-bar{
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 20;
  display: flex; gap: 6px; align-items: center;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(8px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
.filter-pill{
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
.filter-pill:hover{ transform: translateY(-1px) }
.filter-pill.active, .filter-pill[aria-pressed="true"]{
  background:#111; color:#fff; border-color:#111;
}

/* Honeypot for spam prevention */
.honeypot{
  display: none;
}

/* Login Page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--bg);
}

.login-panel {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px/ 30px rgba(0,0,0,.15);
    width: 100%;
    max-width: 400px;
}

.login-panel h1 {
    text-align: center;
    margin-top: 0;
    font-family: var(--heading-font);
    font-weight: 400;
}

.login-panel form {
    display: flex;
    flex-direction: column;
}

.login-panel .error {
    color: red;
    text-align: center;
    margin-top: 15px;
}

/* ===== Hamburger Menu ===== */
.hamburger-menu {
  display: none; /* Hidden by default, shown in media query */
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001; /* Ensure it's above other header content */
}

.hamburger-menu-line {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--text);
  margin: 5px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

header.nav-open .hamburger-menu-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

header.nav-open .hamburger-menu-line:nth-child(2) {
  opacity: 0;
}

header.nav-open .hamburger-menu-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (min-width: 769px) {
  .nav-wrapper {
    display: block;
  }
}

/* ===== Mobile & Portrait Orientation Tweaks ===== */
@media (max-width: 768px) {
  .nav-wrapper {
    display: none; /* Hide by default on mobile */
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 1000;

    /* Animation */
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
  }

  header.nav-open .nav-wrapper {
    padding: 20px 0;
    display: flex; /* Show when open */
    flex-direction: column;
    align-items: center;
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-wrapper nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding-bottom: 20px;
  }

  .nav-wrapper nav a {
    margin-left: 0;
    padding: 10px;
    font-size: 18px;
  }

  .hamburger-menu {
    display: block;
  }

  .slides {
    gap: 10px; /* Reduce gap on smaller screens */
    padding: 0 5px;
  }
  .slides img, .slides iframe {
    max-width: 85vw; /* Allow more space for adjacent slides */
  }
  .ar-1x1 {
    height: auto; /* Let aspect ratio dictate height */
    width: 80vw;
  }

  .project-nav {
    width: 85vw;
  }
}
