/* Reset and Base Styles */
html, main, .container, body {
  margin: 0;
  padding: 0;
}

table {
  line-height: 1em;
  margin-left: auto;
  margin-right: auto;
  border-collapse: collapse;
  text-align: center;
  margin-bottom: 1.5em;
}

/*
tr:first-of-type {
  background: #eae9f4;
}
*/

tr:first-of-type > th {
  text-align: center;
}
tr, th, td {
  padding: 10px;
}
tr:nth-child(odd) {
  background-color: #222233;
}
table tbody tr td {
  border: 1px solid #222233;
}

ul p {
  margin: 0;
}

body {
  margin: 0;
  padding: 0;
  background-color: black; /*#05050a; /* Very dark base */
  color: #e0e0e5; /* Lighter text */
  font-family: "Tahoma", "Verdana", sans-serif;
  font-size: 13px;
  line-height: 1.7;
  /* Layer 1: Grid (on top) */
  /* Layer 2: Smoky Gradient */
  /* Layer 3: Base Color */
  background-image:
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50"><line x1="0" y1="25" x2="50" y2="25" stroke="%2325252d" stroke-width="0.5"/><line x1="25" y1="0" x2="25" y2="50" stroke="%2325252d" stroke-width="0.5"/></svg>'),
    /*radial-gradient(ellipse at center top, rgba(15, 30, 60, 0.6) 0%, rgba(5, 5, 10, 0) 70%);*/
    background-repeat: repeat, no-repeat;
  background-attachment: fixed, fixed; /* Keep both fixed */
  overflow-x: hidden; /* Prevent horizontal scroll */
}

@font-face {
  font-family: 'Berkeley Mono';
  font-style: normal;
  font-weight: 400; /* Adjust weight if needed */
  src: url('/assets/BerkeleyMonoVariable-Regular.woff') format('woff');
  font-display: swap; /* Optional: Controls how text is displayed while the font loads */
}

@font-face {
  font-family: 'Two Weekends Sans';
  src: url('/assets/twoweekendssans-regular.otf');
}

a {
  color: #77bbff; /* Brighter blue links */
  text-decoration: none;
}

a:hover {
  color: #ffffff;
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6,
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
  color: #ffffff;
  font-weight: bold; /* Bolder like GroverBurger */
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  font-size: 16px;
}

/* Layout Container */
.container {
  max-width: 900px; /* Slightly narrower */
  margin: 30px auto;
  background-color: rgba(10, 10, 15, 0.88); /* Slightly more opaque */
  background-color: rgba(10, 10, 15, 1); /* Slightly more opaque */
  border: 1px solid #222233;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
}

.franklin-content {
  padding-left: 24px;
  padding-right: 24px;
}

/* Header */
header {
  background-color: #030305;
  background: linear-gradient(
    to top, /* Direction: from top-right corner towards bottom-left corner */
    black 0%,      /* Start color: black at the beginning (top-right) */
    black 50%,      /* Middle color stop: also black, positioned at 50% along the gradient line */
    #051020 100%   /* End color: dark blue at the end (bottom-left) */
    );
  border-bottom: 1px solid #333344;
  margin: 0;
  padding: 0;
  padding: 15px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* Allow wrapping even on slightly larger screens if needed */
  gap: 15px; /* Add gap for potential wrapping */
  padding-top: 3.4rem;
}

code {
  font-family: 'Berkeley Mono';
}

/* Logo matches GroverBurger text */
.logo a {
  font-size: 24px;
  color: #ffffff;
  margin: 0;
  letter-spacing: 1px;
  font-weight: bold;
  text-shadow: 0 0 8px rgba(100, 150, 255, 0.75);
  /*font-family: "Arial Black", Gadget, sans-serif;*/
  /*font-family: 'Berkeley Mono';*/
  font-family: 'Two Weekends Sans';
  text-transform: uppercase;
  color: white;
}

.logo .tagline {
  font-size: 10px;
  color: #777788;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

nav {
  padding: 0;
  margin: 0;
}

/* Main Navigation */
nav ul {
  padding: 0;
  margin: 0;
  font-size: 24px;
  list-style: none;
  display: flex;
  flex-wrap: wrap; /* Allow wrapping on slightly smaller screens */
  justify-content: flex-end; /* Align to the right initially */
  /*font-family: 'Two Weekends Sans';*/
}

nav ul li {
  margin-left: 6px;
  margin-bottom: 5px; /* Add margin bottom for wrapped items */
}

nav ul li a {
  display: block;
  padding: 7px 12px;
  border: 1px solid #2a2a3a;
  background-color: #1a1a20;
  color: #9090a8;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
  transition: all 0.2s ease-in-out;
  font-weight: bold;
  white-space: nowrap; /* Prevent text breaking in nav buttons */
}
nav ul li a .nav-icon {
  margin-right: 4px;
  color: #66aaff;
  font-family: monospace;
}

nav ul li a:hover,
nav ul li a.active {
  background-color: #2f2f3a;
  border-color: #555577;
  color: #ffffff;
}

/* Main Content Area */
main {
  padding: 25px;
  position: relative;
}

/* Static Sections (Home/About + Portfolio Grid) */
.static-section {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #252530; /* Separator */
}
.static-section:last-of-type {
  margin-bottom: 0;
  border-bottom: none;
}


/* Page Sections (Blog, Contact, Portfolio Details) - Hidden by default */
.page-section {
  margin-top: 20px;
  margin-bottom: 20px;
  /*animation: fadeIn 0.25s ease-in-out; /* Simple fade-in */
}

@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}

/* Section Headers */
.section-header {
  padding-bottom: 10px;
  margin-bottom: 20px; /* More space after header */
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* Allow header content to wrap */
  gap: 10px; /* Space between title and meta/link */
  border-bottom: 1px dashed #444455;
}
.section-header h2 {
  margin: 0;
  font-size: 13px;
  color: #aaddff;
  text-transform: none;
  font-weight: bold;
}
.section-header .meta { /* For Blog/Contact */
  font-size: 10px;
  color: #666677;
  text-transform: uppercase;
}
.section-header .back-link { /* For Portfolio Detail */
  font-size: 11px;
  color: #77bbff;
  font-weight: bold;
}
.section-header .back-link:hover {
  color: #ffffff;
}

/* --- Portfolio Grid Styles --- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Default: 3 columns */
  gap: 20px;
}

.portfolio-grid a {
  display: block;
  text-decoration: none;
  background-color: #15151a;
  border: 1px solid #333344;
  transition: transform 0.1s ease-out, box-shadow 0.1s ease-out, border-color 0.1s ease-out; /* Added border-color */
  overflow: hidden; /* Keep overflow hidden on the link */
  /* Define default custom properties here (can be overridden inline) */
  --img-scale: 1.0;
  --img-pos-x: 50%;
  --img-pos-y: 50%;
}
.portfolio-grid a:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
  border-color: #555577;
}

.portfolio-item {
  padding: 10px; /* Adjusted padding slightly */
  text-align: left;
}

/* NEW: Image wrapper style */
.portfolio-item .img-wrapper {
  display: block; /* Ensure it behaves like a block */
  overflow: hidden; /* Crucial: Clip the transformed image */
  aspect-ratio: 16 / 10; /* Define the shape/size of the image area */
  margin-bottom: 10px; /* Space between image and text */
  background-color: #28282d; /* Darker background while image loads */
}

/* UPDATED: Image style */
.portfolio-item .img-wrapper img {
  display: block; /* Still good practice */
  width: 100%;     /* Force image to fill wrapper width */
  height: 100%;    /* Force image to fill wrapper height */
  object-fit: cover; /* Cover the wrapper area */
  object-position: center center; /* Default position if needed, but transform-origin is primary */

  /* Use CSS variables for transform */
  transform-origin: var(--img-pos-x) var(--img-pos-y); /* Set origin based on variables */
  transform: scale(var(--img-scale)); /* Apply scale based on variable */
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Smooth transition for hover/changes */
}

/* Optional: Add a subtle zoom effect on hover */
.portfolio-grid a:hover .img-wrapper img {
  /* Increase the scale slightly relative to its base scale */
  /*transform: scale(calc(var(--img-scale) * 1.08));*/
}

.portfolio-item h3 {
  font-size: 14px;
  margin-bottom: 5px;
  color: #ffffff;
  text-transform: none;
  margin: 0;
  padding: 0;
}
.portfolio-item p {
  font-size: 11px;
  color: #9999aa;
  line-height: 1.5;
  margin: 0;
  padding: 0;
}
/* --- End Portfolio Grid Styles --- */

/* --- Portfolio Detail Page Styles --- */
.portfolio-detail .detail-content {
  display: flex;
  gap: 25px;
  flex-wrap: wrap; /* Allow wrapping on smaller views */
}
.portfolio-detail .detail-image {
  flex: 1 1 50%; /* Allow shrinking but prefer 50% */
  min-width: 280px; /* Adjust min-width for smaller screens */
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.portfolio-detail .detail-image img {
  max-width: 100%;
  height: auto;
  border: 1px solid #444;
  display: block; /* Prevent extra space below image */
}
.portfolio-detail .detail-text {
  flex: 1 1 45%; /* Allow shrinking, prefer slightly less than 50% */
  min-width: 250px;
}
.portfolio-detail h3 { /* Project title in detail view */
  font-size: 18px;
  color: #aaddff;
  margin-bottom: 15px;
}
.portfolio-detail p {
  font-size: 13px;
  color: #c0c0d0;
  margin-bottom: 15px;
  line-height: 1.8;
}
.portfolio-detail .tech-stack h4,
.portfolio-detail .links h4 {
  font-size: 13px;
  color: #88ccff;
  margin-bottom: 8px;
  border-bottom: 1px dotted #555;
  padding-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.portfolio-detail .tech-stack ul,
.portfolio-detail .links ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 20px;
}
.portfolio-detail .tech-stack li,
.portfolio-detail .links li {
  margin-bottom: 5px;
  font-size: 11px;
  color: #aaaabb;
}
.portfolio-detail .tech-stack li::before {
  content: "▹ ";
  color: #66aaff;
  margin-right: 6px;
}
.portfolio-detail .links a {
  font-weight: bold;
}
/* --- End Portfolio Detail Page Styles --- */


/* Blog Specific Styles - Keep similar */
.blog-post {
  border-bottom: 1px dashed #333344;
  padding-bottom: 15px;
  margin-bottom: 15px;
}
.blog-post:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
.blog-post h3 {
  font-size: 16px;
  margin-bottom: 5px;
  color: #aaddff;
  text-transform: none;
  font: 'Two Weekends Sans';
}
.blog-post .post-meta {
  font-size: 9px;
  color: #666677;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.blog-post p {
  font-size: 13px;
  color: #c0c0d0;
}
.blog-post a.read-more {
  font-size: 10px;
  display: inline-block;
  margin-top: 8px;
  color: #77bbff;
  text-transform: uppercase;
  font-weight: bold;
}
.blog-post a.read-more:hover { color: #fff; }


/* Contact Specific Styles - Keep similar */
.contact-form label {
  display: block;
  margin-bottom: 3px;
  font-size: 10px;
  color: #888899;
  text-transform: uppercase;
  font-weight: bold;
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 12px;
  background-color: #0a0a0f;
  border: 1px solid #333344;
  color: #d0d0e0;
  font-family: "Tahoma", sans-serif;
  font-size: 13px;
}
.contact-form textarea { height: 140px; resize: vertical; }
.contact-form button {
  padding: 9px 22px;
  background-color: #3a6abc;
  border: 1px solid #5a8ade;
  color: #ffffff;
  font-size: 11px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-weight: bold;
}
.contact-form button:hover { background-color: #4a7bcd; }
.contact-info { margin-top: 10px; }
.contact-info h4 { color: #aaddff; font-size: 14px; margin-bottom: 10px; }
.contact-info p { margin-bottom: 8px; font-size: 12px; }
.contact-info strong { color: #88ccff; margin-right: 8px; font-weight: bold; }
.contact-section-wrapper { /* Added wrapper for contact layout */
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}
.contact-form-container { /* Added container for form */
  flex: 1;
  min-width: 280px; /* Adjusted min-width */
}
.contact-info-container { /* Added container for info */
  flex: 1;
  min-width: 250px;
}

/* Footer */
footer {
  border-top: 1px solid #333344;
  padding: 15px 25px;
  text-align: center;
  font-size: 10px;
  color: #666677;
  background-color: #030305;
  text-transform: uppercase;
}
footer span { margin: 0 10px; color: #444455; }
footer a {
  color: #666677;
  text-decoration: underline;
}
footer a:hover {
  color: #aab;
}

/* Utility classes */
.text-accent { color: #88ccff; font-weight: bold; }
.uppercase { text-transform: uppercase; }
.small-text { font-size: 11px; color: #777788; }
.hidden { display: none !important; } /* Force hide with JS */

/* Decorative elements */
.separator {
  height: 1px;
  background: linear-gradient(to right, rgba(51,51,68,0) 0%, #333344 50%, rgba(51,51,68,0) 100%);
  margin: 25px 0;
  border: 0;
}

/* ================================== */
/* === Responsive Styles (Mobile) === */
/* ================================== */

/* Tablet and Larger Phones (e.g., <= 768px) */
@media (max-width: 768px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns */
    gap: 15px; /* Slightly reduce gap */
  }

  .container {
    margin: 20px auto; /* Reduce top/bottom margin */
  }

  main {
    padding: 20px; /* Reduce padding */
  }

  header {
    padding-left: 20px;
    padding-right: 20px;
  }

  footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  /* Adjust portfolio detail layout slightly if needed */
  .portfolio-detail .detail-content {
    gap: 20px;
  }
}

/* Smaller Phones (e.g., <= 600px) */
@media (max-width: 600px) {
  body {
    font-size: 13px; /* Slightly larger base font for readability */
    line-height: 1.6;
  }

  h1 { font-size: 24px; }
  h2 { font-size: 17px; }
  h3 { font-size: 15px; } /* Adjust heading sizes */

  .container {
    margin: 15px 10px; /* Further reduce margin, add side margin */
    max-width: none; /* Allow container to fill width minus margins */
    width: auto;
    border-left: none; /* Optional: remove side borders */
    border-right: none; /* Optional: remove side borders */
    box-shadow: none; /* Optional: remove shadow */
  }

  header {
    flex-direction: column; /* Stack logo and nav */
    align-items: center; /* Center items vertically */
    padding: 20px 15px 15px 15px; /* Adjust padding */
    padding-top: 2rem; /* Reduce top padding */
  }

  .logo {
    text-align: center; /* Center logo text */
    margin-bottom: 15px; /* Add space below logo */
  }
  .logo h1 {
    font-size: 26px; /* Slightly adjust logo size */
  }
  .logo .tagline {
    font-size: 9px; /* Adjust tagline */
  }

  nav {
    width: 100%; /* Allow nav to take full width */
  }

  nav ul {
    justify-content: center; /* Center nav items */
    padding: 0; /* Remove default padding */
    gap: 5px; /* Adjust gap between wrapped items */
  }

  nav ul li {
    margin-left: 0; /* Remove left margin */
    margin-bottom: 5px;
  }
  nav ul li a {
    padding: 6px 10px; /* Slightly smaller padding */
    font-size: 9px; /* Smaller font size for nav links */
  }

  main {
    padding: 15px; /* Reduce main padding */
  }

  /* --- Portfolio Grid Changes for Smallest Screens --- */
  .portfolio-grid {
    grid-template-columns: 1fr; /* Still 1 column for the grid overall */
    gap: 15px; /* Adjust gap between items */
  }

  /* Remove hover transform effect on link */
  .portfolio-grid a:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); /* Optional: Subtle shadow */
  }

  .portfolio-item {
    display: grid; /* Change display to grid */
    grid-template-columns: 1fr auto; /* Text flexible, Image fixed/auto width */
    grid-template-rows: auto auto; /* Define rows for text stacking */
    grid-template-areas: /* Define layout areas */
      "title image"
      "desc  image";
    gap: 0 12px; /* No row gap, column gap */
    align-items: start; /* Align items to the top of their grid area */
    padding: 10px; /* Adjust padding if needed */
    text-align: left; /* Ensure text is left-aligned */
  }

  .portfolio-item .img-wrapper {
    grid-area: image; /* Assign to the 'image' grid area */
    width: 200px; /* Define a fixed width for the image */
    height: 120px; /* Define a fixed height */
    aspect-ratio: unset; /* Remove aspect ratio if setting fixed height/width */
    margin-bottom: 0; /* Remove default margin */
    align-self: center; /* Vertically center image within its area */
  }
  /* Ensure image inside wrapper covers the new small dimensions */
  .portfolio-item .img-wrapper img {
    object-position: center center; /* Keep centering */
    /* Scale might need adjustment depending on the image content and new size */
  }


  .portfolio-item h3 {
    grid-area: title; /* Assign to the 'title' grid area */
    margin-bottom: 3px; /* Reduce space below title */
    font-size: 13px; /* Adjust font size if needed */
    align-self: end; /* Align title towards the bottom of its area (closer to desc) */
  }

  .portfolio-item p {
    grid-area: desc; /* Assign to the 'desc' grid area */
    font-size: 11px; /* Adjust font size if needed */
    line-height: 1.4;
    align-self: start; /* Align description towards the top of its area */
  }
  /* --- End Portfolio Grid Changes --- */


  .section-header {
    justify-content: center; /* Center header content if it wraps */
    text-align: center; /* Center text within header */
  }
  .section-header h2 {
    width: 100%; /* Ensure h2 takes full width if needed */
  }
  .section-header .meta,
  .section-header .back-link {
    width: 100%;
    text-align: center; /* Center meta/link text */
    margin-top: 5px;
  }

  /* Adjust padding for page sections */
  .page-section {
    padding: 15px;
  }

  /* Contact Form Adjustments */
  .contact-form-container,
  .contact-info-container {
    min-width: 100%; /* Allow stacking */
    flex-basis: 100%;
  }

  /* Footer */
  footer {
    padding: 10px 15px;
  }
  footer span { display: none; } /* Hide separators on small screens */

}

/* Even Smaller Phones (e.g., <= 400px) */
@media (max-width: 400px) {
  body {
    font-size: 12px; /* May need to revert font size if too large */
  }
  header {
    padding-top: 1.5rem;
  }
  .logo h1 {
    font-size: 22px;
  }
  nav ul li a {
    padding: 5px 8px;
  }
  /* Fine-tune portfolio item image size/text size if needed */
  .portfolio-item .img-wrapper {
    width: 140px;
    height: 90px;
  }
  .portfolio-item h3 {
    font-size: 12px;
  }
  .portfolio-item p {
    font-size: 10px;
  }
}


