/* =========================================================================
   ANDREA SASSI PORTFOLIO — styles.css
   Theme: Bauhaus Meets Industrial Brutalism
   ========================================================================= */

:root {
  --ink: #0B0B0B;
  --paper: #F4F3EF;
  --paper-dark: #EAE9E4;
  --accent: #FF5E00; /* Mechanical/Industrial Orange */
  --accent-muted: #E65500;
  --grid-line: #E2E1DC;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  
  --radius-none: 0px; /* Rigorous Bauhaus straight corners */
}

/* ============== RESET & BASE ============== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.45;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Smooth scroll fallback when Lenis is off */
html {
  scroll-behavior: smooth;
}

body::before {
  /* Lightweight engineering millimetric grid lines */
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: -1;
  opacity: 0.45;
}

/* ============== GLOBAL LAYOUT (12-COL GRID) ============== */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1-col);
  column-gap: 24px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 40px;
}

@supports (grid-template-columns: repeat(12, minmax(0, 1fr))) {
  .grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0 20px;
    column-gap: 16px;
  }
}

.font-mono {
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s ease;
}

a:hover {
  color: var(--accent);
}

.text-accent {
  color: var(--accent);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
}

/* ============== LOADER ============== */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--paper);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.8s cubic-bezier(0.85, 0, 0.15, 1), visibility 0.8s;
}

.loader-grid {
  width: calc(100% - 80px);
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.loader-mark {
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: var(--accent);
}

.loader-bar {
  width: 100%;
  height: 4px;
  background-color: var(--paper-dark);
  position: relative;
  overflow: hidden;
}

.loader-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background-color: var(--ink);
  transition: width 0.05s linear;
}

.loader-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #666666;
  display: flex;
  justify-content: space-between;
}

.loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ============== NAVIGATION ============== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  border-bottom: 1px solid var(--grid-line);
  background-color: rgba(244, 243, 239, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
}

@media (max-width: 768px) {
  .nav {
    padding: 0 20px;
    height: 70px;
  }
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.logo-text {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
}

@media (max-width: 768px) {
  .nav-links {
    gap: 16px;
    font-size: 0.75rem;
  }
  .nav-links a:not(.nav-cta) {
    display: none; /* Hide standard links on mobile to save space */
  }
}

.nav-cta {
  background-color: var(--ink);
  color: var(--paper);
  padding: 8px 16px;
  border: 1px solid var(--ink);
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.nav-cta:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

/* ============== HERO ============== */
.hero {
  padding-top: 160px;
  padding-bottom: 80px;
  border-bottom: 1px solid var(--grid-line);
  position: relative;
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@media (max-width: 768px) {
  .hero {
    padding-top: 120px;
    padding-bottom: 40px;
  }
}

.hero-header {
  grid-column: span 12;
}

.technical-meta {
  grid-column: span 12;
  font-size: 0.8rem;
  color: #666666;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--grid-line);
  padding-bottom: 12px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .technical-meta {
    flex-direction: column;
    gap: 4px;
  }
}

.hero-title {
  font-size: clamp(3rem, 10vw, 7.5rem);
  text-transform: uppercase;
  line-height: 0.85;
  margin-bottom: 40px;
}

.hero-details {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  margin-top: 40px;
  align-items: flex-end;
  max-width: 1360px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 40px;
  width: 100%;
}

@media (max-width: 768px) {
  .hero-details {
    display: flex;
    flex-direction: column;
    gap: 32px; /* Increased vertical space between text and status box */
    margin-top: 24px;
    padding: 0 20px; /* Restored side margins on mobile */
  }
}

.hero-description {
  grid-column: span 6;
  font-size: 1.15rem;
  font-weight: 300;
  text-align: justify;
  margin: 0;
}

@media (max-width: 768px) {
  .hero-description {
    font-size: 1rem;
  }
}

.status-box {
  grid-column: 8 / span 5;
  border: 1px solid var(--ink);
  background-color: var(--paper-dark);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 768px) {
  .status-box {
    padding: 16px;
  }
}

.status-dot-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #00E676;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

.status-num-label {
  font-size: 9pt;
  font-weight: 500;
}

.status-meta-text {
  font-size: 10pt;
  color: #333333;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.hero-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 80px;
  font-size: 9px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: #666666;
  margin-top: 20px;
}

.hero-scroll svg {
  margin-top: 10px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ============== ABOUT ============== */
.about {
  padding: 80px 0;
  border-top: 1px solid #DDDDDD;
  background-color: #ECEAE2;
}

.about .grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gap);
}

.about-num {
  grid-column: span 3;
  border-right: 1px solid #DDDDDD;
  padding-right: 20px;
}

.about-num-row {
  font-size: 56pt;
  font-weight: 900;
  line-height: 1;
  color: #3A3A3A;
}

.about-num-label {
  font-family: 'Space Mono', monospace;
  font-size: 8.5pt;
  color: #666666;
  margin-top: 5px;
}

.about-content {
  grid-column: span 9;
  padding-left: 20px;
}

.about-tagline {
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 24px;
}

.about-tagline em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

.about-text {
  font-size: 1.1rem;
  font-weight: 300;
  text-align: justify;
  line-height: 1.5;
  color: #333333;
  margin-bottom: 40px;
}

@media (max-width: 768px) {
  .about {
    padding: 40px 0;
  }
  .about .grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }
  .about-content {
    padding-left: 0 !important;
  }
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 24px;
  list-style-type: none;
  padding: 0;
  margin: 30px 0 0 0;
  border-top: 1px solid var(--grid-line);
  padding-top: 30px;
}

@media (max-width: 768px) {
  .about-stats {
    grid-template-columns: 1fr;
    row-gap: 16px;
    column-gap: 0;
  }
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-val {
  font-size: 32pt;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
}

.stat-lbl {
  font-size: 8pt;
  color: #666666;
}

/* ============== WORK ============== */
.work {
  padding: 80px 0;
  border-top: 1px solid #DDDDDD;
}

@media (max-width: 768px) {
  .work {
    padding: 40px 0;
  }
}

.section-num {
  grid-column: span 3;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 700;
  padding-top: 8px;
}

@media (max-width: 768px) {
  .section-num {
    grid-column: span 4;
    padding-bottom: 8px;
  }
}

.work-header {
  grid-column: span 9;
}

@media (max-width: 768px) {
  .work-header {
    grid-column: span 4;
  }
}

.section-title {
  font-size: clamp(24px, 4vw, 36px);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: #666666;
  margin-top: 0;
  margin-bottom: 40px;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 32px;
  max-width: 1360px;
  margin: 40px auto 0 auto;
  padding: 0 40px;
}

@media (max-width: 768px) {
  .work-grid {
    grid-template-columns: 1fr;
    padding: 0 20px;
    gap: 24px;
  }
}

.work-card {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--grid-line);
  padding-bottom: 24px;
}

@media (max-width: 768px) {
  .work-card {
    grid-column: span 1;
  }
}

.work-card-img-wrapper {
  width: 100%;
  aspect-ratio: 16 / 10;
  position: relative;
  overflow: hidden;
}

.work-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.work-card:hover img {
  transform: scale(1.05);
}

.work-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--ink);
  opacity: 0.05;
  transition: opacity 0.3s;
}

.work-card:hover .work-card-overlay {
  opacity: 0;
}

.work-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #666666;
  border-bottom: 1px solid var(--grid-line);
  padding-bottom: 8px;
}

.project-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
}

.project-desc {
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.5;
  color: #444444;
  margin: 0;
  text-align: justify;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.project-tags span {
  font-size: 0.7rem;
  background-color: var(--paper-dark);
  color: var(--ink);
  padding: 4px 8px;
}

/* ============== SPECS ============== */
.specs {
  padding: 80px 0;
  border-top: 1px solid #DDDDDD;
  background-color: var(--paper-dark);
}

@media (max-width: 768px) {
  .specs {
    padding: 40px 0;
  }
}

.specs-content {
  grid-column: span 9;
}

@media (max-width: 768px) {
  .specs-content {
    grid-column: span 4;
  }
}

.specs-table-container {
  width: 100%;
  overflow-x: auto;
  margin-top: 40px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10pt;
}

th {
  text-align: left;
  border-bottom: 1.5px solid var(--ink);
  padding: 12px 16px;
  font-weight: 700;
}

td {
  padding: 16px;
  border-bottom: 1px solid var(--grid-line);
}

tr:hover td {
  background-color: rgba(255, 94, 0, 0.05);
}

/* ============== CONTACT ============== */
.contact {
  padding: 80px 0;
  border-top: 1px solid #DDDDDD;
}

@media (max-width: 768px) {
  .contact {
    padding: 40px 0;
  }
}

.contact-content {
  grid-column: span 9;
}

@media (max-width: 768px) {
  .contact-content {
    grid-column: span 4;
  }
}

.contact-title {
  font-size: clamp(24px, 4vw, 36px);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.contact-subtitle {
  font-size: 1.05rem;
  color: #666666;
  margin-top: 0;
  margin-bottom: 40px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-top: 1.5px solid var(--ink);
  padding-top: 24px;
}

.contact-row {
  display: flex;
  font-size: 1rem;
}

@media (max-width: 768px) {
  .contact-row {
    flex-direction: column;
    gap: 4px;
  }
}

.contact-row .label {
  width: 150px;
  color: var(--accent);
  font-weight: 700;
}

.contact-row .value {
  font-weight: 500;
}

/* ============== FOOTER ============== */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--grid-line);
  background-color: var(--paper);
}

.footer-logo {
  grid-column: span 4;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.footer-copy {
  grid-column: span 8;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #666666;
}

@media (max-width: 768px) {
  .footer-logo {
    grid-column: span 4;
    margin-bottom: 16px;
  }
  .footer-copy {
    grid-column: span 4;
    flex-direction: column;
    gap: 8px;
  }
  
  /* Ensure all grid elements take full width on mobile instead of defaulting to 1 column */
  .section-num {
    grid-column: span 4 !important;
    margin-bottom: 12px;
  }
  .about-content {
    grid-column: span 4 !important;
  }
  .work-header {
    grid-column: span 4 !important;
  }
  .specs-content {
    grid-column: span 4 !important;
  }
  .contact-content {
    grid-column: span 4 !important;
  }
  
  /* Ensure hero is not restricted in height when stacked */
  .hero {
    min-height: auto !important;
    height: auto !important;
    padding-top: 110px;
    padding-bottom: 50px;
  }
}
