* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --background: #000000;
  --accent: #332839;
  --color: #FFFFFF;
  --light-gray: #ab9eb4;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: 'Lexend', monospace;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #050505; /* Fallback color */
  /* Gradient overlay top, image bottom */
  background-image: 
    linear-gradient(to bottom, rgba(5, 5, 5, 1) 60%, rgba(5, 5, 5, 0.1) 95%),
    url('./bg_glow.webp'); 
  background-size: auto, cover; /* Size for gradient, size for image */
  background-position: top; /* Center the image */
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
}

header {
  width: 100%;
  padding: 15px 0; /* Padding top/bottom */
  /* border-bottom: 1px solid var(--accent); */
  /* margin-bottom: 2rem; */
}

.header-content {
  width: 100%;
  max-width: 1280px; /* Match main content width */
  margin: 0 auto; /* Center header content */
  display: flex;
  align-items: center;
  padding-top: 1rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  position: relative;
}

.header-nav {
  margin-left: 3rem;
  display: flex;
  gap: 2rem; /* Space between nav links */
  transition: all 0.2s;
}

.header-logo {
  height: 2.5rem; /* Adjust size as needed */
  width: auto;
  display: block; /* Prevents extra space below image */
}

header nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}

header nav a {
  color: var(--light-gray);
  text-decoration: none;
  font-size: 1.2rem;
}

header nav a:hover {
  color: var(--color);
}

main {
  width: 100%;
  max-width: 1280px; /* Or adjust as needed */
  margin: 0 auto; /* Center the main content */
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-grow: 1; /* Allow main to grow and push footer down */
}

.layer{
  display: grid;
  align-items: center;
  margin-top: auto; /* Removed to allow flow */
  margin-bottom: 2rem; /* Add space below hero */
  grid-template-columns: 1fr;
  color: #FFFFFF;
  width: 100%;
  max-width: 800px;
}

.layer span,
.glitch-logo {
  font-weight: bold;
  grid-row-start: 1;
  grid-column-start: 1;
  font-size: 2rem;
  --stack-height: calc(100% / var(--stacks) - 1px);
  --inverse-index: calc(calc(var(--stacks) - 1) - var(--index));
  --clip-top: calc(var(--stack-height) * var(--index));
  --clip-bottom: calc(var(--stack-height) * var(--inverse-index));
  clip-path: inset(var(--clip-top) 0 var(--clip-bottom) 0);
  animation: layer 250ms cubic-bezier(.46,.29,0,1.24) 1 backwards calc(var(--index) * 120ms), glitch 1.5s ease infinite 2s alternate-reverse;
}

.layer span:nth-child(odd),
.glitch-logo:nth-child(odd) { --glitch-translate: 8px; }

.layer span:nth-child(even),
.glitch-logo:nth-child(even) { --glitch-translate: -8px; }

@keyframes layer{
  0% {
    opacity: 0;
    transform: translateY(-50%);
    text-shadow: -2px 3px 0 red, 2px -3px 0 blue;
  };
  60% {
    opacity: 0.5;
    transform: translateX(50%);
  }
  80% {
    transform: none;
    opacity: 1;
    text-shadow: 2px -3px 0 red, -2px 3px 0 blue;
  }
  100% {
    text-shadow: none;
  }
}

@keyframes glitch {
  0% {
    text-shadow: -2px 3px 0 purple, 2px -3px 0 green;
    transform: translate(var(--glitch-translate));
  }
  2% {
    text-shadow: 2px -3px 0 red, -2px 3px 0 blue;
  }
  4%, 100% {  text-shadow: none; transform: none; }
}

@media (max-width: 768px) {
  body {
    padding: 15px 5px;
  }
  
  .layer span,
  .glitch-logo {
    font-size: 1.5rem;
  }
  .logo-container {
    margin-bottom: 15px;
  }
  .glitch-logo {
    width: 90%;
  }
  .tagline {
    font-size: 1rem;
  }
  .header-content {
    padding-top: 0.5rem;
    position: relative;
  }
  .header-logo {
    height: 3rem;
  }
  .header-nav {
    font-size: 1.5rem;
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(20, 18, 28, 1);
    border-radius: 1rem;
    box-shadow: 0 2rem 3rem 0 rgba(0,0,0,1);
    display: none;
    flex-direction: column;
    align-items: flex-end;
    padding: 1.2rem 1.5rem;
    gap: 1.2rem;
    z-index: 100;
    min-width: 320px;
    margin-top: 0.5rem;
    transition: all 0.2s;
  }
  .header-nav.open {
    display: flex;
  }
  .header-nav a {
    font-size: 1.5rem;
    color: var(--color);
    text-align: right;
  }
  .header-nav a:active {
    color: var(--color);
  }
  .hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 1.5rem;
    height: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 101;
    margin-left: auto;
    margin-right: 1rem;
  }
  .hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--color);
    border-radius: 2px;
    transition: all 0.3s;
  }
  .header-nav {
    transition: display 0.2s;
  }
  .hamburger {
    display: flex;
  }
}

@media (min-width: 769px) {
  .hamburger {
    display: none !important;
  }
  .header-nav {
    display: flex !important;
    position: static;
    flex-direction: row;
    align-items: center;
    background: none;
    box-shadow: none;
    padding: 0;
    gap: 2rem;
    min-width: unset;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px 5px;
  }
  
  .layer span,
  .glitch-logo {
    font-size: 1.2rem;
  }
}

/* Styles moved from index.html */
.logo-container {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    width: 100%;
    margin-bottom: 20px;
}
.glitch-logo {
    grid-row-start: 1;
    grid-column-start: 1;
    width: 80%;
    max-width: 300px;
    height: auto;
}
.tagline {
    text-align: center;
    margin: 0 0 4rem 0; /* Space below tagline, before products */
    font-size: 1.2rem;
    padding: 0 15px;
}
.footer {
    margin-top: auto; /* Push footer to bottom */
    left: 0;
    bottom: 0;
    width: 100%;
    text-align: center;
    padding: 10px;
    color: #FFFFFF;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Style links within the footer */
.footer a {
    color: inherit; /* Inherit color from footer */
    text-decoration: none; /* Remove underline by default */
}

.footer a:hover {
    text-decoration: underline; /* Add underline on hover */
}

.products {
    text-align: center;
    padding: 2rem 1rem;
    width: 100%;
    margin-top: 7rem;
    margin-bottom: 7rem;
}

.products h2 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: #e9e0ee; /* Assuming white text is desired */
}

.product-item {
    display: inline-flex;
    flex-direction: column;
    /* Align items to the start (left/top), text will be right-aligned separately */
    align-items: flex-start; 
    /* Pushes content to top and bottom */
    justify-content: space-between; 
    background-color: #000000aa;
    border-radius: 1rem;
    padding: 1.5rem; /* Adjusted padding */
    margin: 1rem;
    color: #FFFFFF;
    max-width: 480px;
    min-height: 220px; /* Adjusted height slightly */
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    background-image: url('./abstract_bg_2.webp');
    background-repeat: no-repeat;
    background-blend-mode: multiply;
    background-color: rgba(0, 0, 0, 0.5);
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.product-item a {
    text-decoration: none;
    display: block;
    color: var(--color);
    /* margin-bottom removed, spacing controlled by justify-content */
}

.product-item .product-logo-link {
    margin-bottom: 0; /* Remove specific margin, rely on space-between */
    align-self: flex-start;
}

/* New container for text */
.product-text-content {
    width: 100%;
    /* Add other styles if needed, like margin-top if space-between isn't enough */
}

/* Update selectors to target elements within the new div */
.product-text-content p,
.product-text-content a {
    text-align: left; /* Align text to the left */
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Subtitle styling */
.product-text-content p:nth-of-type(1) {
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

/* Description styling */
.product-text-content p:nth-of-type(2) {
    font-size: 0.9rem;
    font-weight: 300;
    opacity: 0.8;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

/* CTA link styling */
.product-text-content a {
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--color);
    text-decoration: none;
}

.product-text-content a:hover {
    text-decoration: underline;
}

.product-logo {
    max-height: 1.5rem;
    height: auto;
}

/* Privacy Page Specific Styles */
.privacy-content {
    color: var(--color); /* Ensure text color consistency */
    max-width: 800px; /* Limit width for readability */
    width: 100%; /* Ensure it takes up available width up to max-width */
    padding: 40px; /* Add padding around content */
    margin: 20px auto; /* Center block and add vertical margin */
    box-sizing: border-box; /* Include padding in width calculation */
}

.privacy-content h1 {
    margin-bottom: 20px;
}

.privacy-content h2 {
    margin-top: 0;
    margin-bottom: 15px;
}

.privacy-content p,
.privacy-content li {
    line-height: 1.6;
    margin-bottom: 15px;
}

.privacy-content ol {
    list-style-position: outside;
    padding-left: 40px;
}

.privacy-content ol li {
    padding-left: 15px;
    margin-bottom: 25px;
}

.privacy-content ol li::marker {
  font-size: 1.4em;
  font-weight: bold;
  color: var(--color);
}

.privacy-content ul {
    list-style: disc inside; /* Style unordered list */
    margin-left: 20px; /* Indent list items */
}

.privacy-content a {
    color: var(--color); /* Style links */
    text-decoration: underline;
}

.privacy-content .last-updated {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 30px;
}

.privacy-content .back-link {
    margin-bottom: 30px; /* Add space below the link */
    font-size: 0.9rem;
}

.privacy-content .back-link a {
    text-decoration: none; /* Remove underline */
}

.privacy-content .back-link a:hover {
    text-decoration: underline; /* Add underline on hover */
}

.hero {
  width: 100%;
  min-height:400px;
  background: url('./abstract_bg_1.webp') center/cover no-repeat;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  position: relative;
  margin-top: 2rem;
  margin-bottom: 2rem;
  border-radius: 2rem;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 20, 0.35); /* Slightly dim, adjust alpha as needed */
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 2.5rem 2rem 2rem 2rem;
}

.hero-text {
  background: rgba(18, 18, 25, 0.25);
  color: var(--color);
  padding: 1.5rem 2rem;
  border-radius: 1rem;
  max-width: 480px;
  text-align: right;
  box-shadow: 0 4px 25px 0 rgba(0,0,0,0.20);
  font-size: 2rem;
}

.hero-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--color);
  font-weight: bold;
  text-decoration: underline;
  font-size: 1.1rem;
  transition: color 0.2s;
}

.hero-link:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Company Page Specific Hero */
.company-hero {
  background: url('./abstract_bg_glow_1.webp') center/cover no-repeat;
  background-repeat: no-repeat;
  background-size: contain;
  /* Override general hero alignment to center content */
  align-items: center;
  justify-content: center;
  width: 80%;
  max-height: 200px;
  min-height: 0px;
}

.company-hero .hero-content {
  /* Override general hero alignment */
  justify-content: flex-start;
  align-items: center;
  padding: 2rem; /* Adjust padding if needed */
}

.company-hero .hero-text {
  /* Override general hero text styles */
  background: none; /* Remove background for cleaner centering */
  box-shadow: none; /* Remove shadow */
  text-align: center; /* Center text */
  max-width: 80%;   /* Allow text block to be wider */
  font-size: 2.5rem; /* Make text larger */
}

.company-hero .hero-link {
  font-size: 1.3rem; /* Adjust link size if needed */
}

.company-hero::before {
  background: rgba(10, 10, 20, 0.25); /* Dimmer overlay for glow */
}

/* Company Page Specific Content Styles */
.company-content {
    color: var(--color);
    max-width: 800px; /* Consistent width */
    width: 100%;
    padding: 0 40px;
    box-sizing: border-box;
}

.company-content h2 {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}


/* Letter From Founder Styles */
#letter-from-founder {
    padding: 2rem; /* Padding inside the letter area */
    background-color: rgba(20, 18, 28, 0.5); /* Optional subtle background */
    border-radius: 8px;
    border: 1px solid var(--accent);
    margin-bottom: 4rem;
}

#letter-from-founder span {
    display: block; /* Make span behave like a block */
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 1.5rem; /* Space after salutation */
}

#letter-from-founder p {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.2rem; /* Space between paragraphs */
}

/* Indent closing remarks (adjust based on exact structure) */
#letter-from-founder p:nth-last-child(1),
#letter-from-founder p:nth-last-child(2),
#letter-from-founder p:nth-last-child(3),
#letter-from-founder p:nth-last-child(4) {
    margin-bottom: 0.2rem; /* Reduce space in signature block */
}

#letter-from-founder p:nth-last-child(1) { /* Founder Title */
    font-style: italic;
    opacity: 0.8;
}
