/* =====================================================
   RENTERIA|LAB — Media Artist Portfolio
   Signal / Noise  ·  Post-Digital Aesthetic
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400;500&display=swap');

/* ---- Variables ---- */
:root {
  --bg:      #070707;
  --surface: #0f0f0f;
  --surface2: #151515;
  --border:  #1e1e1e;
  --muted:   #444;
  --body:    #888;
  --primary: #e8e4df;
  --accent:  #00d9a5;
  --red:     #e63946;
  --mono:    'Space Mono', 'Courier New', monospace;
  --sans:    'Inter', 'Helvetica Neue', sans-serif;
  --nav-h:   56px;
  --max-w:   1200px;
  --ease:    cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5 {
  font-family: var(--mono);
  color: var(--primary);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.2rem, 6vw, 5.5rem); }
h2 { font-size: clamp(1.3rem, 3vw, 2.2rem); }
h3 { font-size: 1.05rem; font-weight: 700; }
h4 { font-size: 0.875rem; font-weight: 700; }

p { margin-bottom: 1.2rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.65; }

hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }
img { max-width: 100%; display: block; }

strong { color: var(--primary); font-weight: 500; }
em { font-style: italic; }

ul, ol { padding-left: 1.5rem; margin-bottom: 1.2rem; }
li { margin-bottom: 0.25rem; }

blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-style: italic;
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface2);
  padding: 0.15em 0.4em;
  border-radius: 2px;
  color: var(--accent);
}

pre {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}
pre code { background: none; padding: 0; }

/* =====================================================
   NAVIGATION
   ===================================================== */

#site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(7, 7, 7, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.3s;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 0.2s;
}
.nav-logo:hover { color: var(--accent); opacity: 1; }
.nav-logo .pipe { color: var(--accent); margin: 0 1px; }

#nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  list-style: none;
}

#nav-links a {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: color 0.2s;
}
#nav-links a:hover { color: var(--accent); opacity: 1; }

#nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1;
}

/* =====================================================
   LANDING HERO
   ===================================================== */

#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(var(--nav-h) + 2rem) 2rem 4rem;
  position: relative;
  overflow: hidden;
}

/* 3D Spectrogram canvas */
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  /* Ambient vignette on top of canvas */
  -webkit-mask-image:
    radial-gradient(ellipse 100% 90% at 50% 100%, black 30%, transparent 100%);
  mask-image:
    radial-gradient(ellipse 100% 90% at 50% 100%, black 30%, transparent 100%);
}

/* Audio toggle button */
#audio-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s;
  margin-top: 2rem;
}
#audio-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}
#audio-toggle.active {
  color: var(--accent);
  border-color: var(--accent);
}

.toggle-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  transition: background 0.25s, box-shadow 0.25s;
}
#audio-toggle.active .toggle-dot {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  animation: dot-pulse 1.4s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* Noise grain overlay */
#hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Horizontal rule across hero */
#hero::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}

#hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

#hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
#hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--accent);
}

#hero h1 {
  color: var(--primary);
  margin-bottom: 1.25rem;
  max-width: 800px;
}

#hero-sub {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 380px;
  margin-bottom: 0;
  line-height: 1.8;
  letter-spacing: 0.02em;
}

#hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s;
}
#hero-cta:hover { color: var(--accent); opacity: 1; }
#hero-cta::after {
  content: '';
  display: block;
  width: 1px;
  height: 48px;
  background: currentColor;
  animation: scroll-indicator 2s ease-in-out infinite;
}

@keyframes scroll-indicator {
  0%   { transform: scaleY(1) translateY(0); opacity: 1; }
  50%  { transform: scaleY(0.6) translateY(4px); opacity: 0.4; }
  100% { transform: scaleY(1) translateY(0); opacity: 1; }
}

/* =====================================================
   NAV CARDS  (landing page section navigation)
   ===================================================== */

.nav-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.nav-card {
  display: block;
  background: var(--surface);
  padding: 0;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: background 0.3s var(--ease);
  position: relative;
}
.nav-card:hover { background: var(--surface2); opacity: 1; }

/* Accent top stripe */
.nav-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}
.nav-card:hover::before { transform: scaleX(1); }

.nav-card-img {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  display: block;
  filter: grayscale(100%) contrast(115%) brightness(0.8);
  transition: filter 0.5s var(--ease);
}
.nav-card:hover .nav-card-img {
  filter: grayscale(30%) contrast(110%) brightness(0.9);
}

.nav-card-body {
  padding: 2rem 2rem 2.5rem;
}

.nav-card-index {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.nav-card-index::before {
  content: '';
  width: 16px;
  height: 1px;
  background: var(--muted);
}

.nav-card h2 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 0.6rem;
  transition: color 0.3s;
}
.nav-card:hover h2 { color: var(--accent); }

.nav-card p {
  font-size: 0.8rem;
  color: var(--body);
  line-height: 1.6;
  margin: 0;
}

/* =====================================================
   SECTION WRAPPER
   ===================================================== */

.landing-section {
  padding: 5rem 2rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 3rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.section-eyebrow {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-title {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--primary);
  letter-spacing: 0.05em;
}

/* =====================================================
   WORKS GRID
   ===================================================== */

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.work-card {
  display: block;
  background: var(--surface);
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
  position: relative;
  overflow: hidden;
}
.work-card:hover { background: var(--surface2); opacity: 1; }

.work-card::after {
  content: '→';
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s, transform 0.2s;
}
.work-card:hover::after { opacity: 1; transform: translateX(0); }

.work-card-year {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
}

.work-card h3 {
  font-size: 0.95rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}
.work-card:hover h3 { color: var(--accent); }

.work-card p {
  font-size: 0.78rem;
  color: var(--body);
  line-height: 1.55;
  margin: 0;
}

.work-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1.25rem;
}

.tag {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  color: var(--muted);
}

/* =====================================================
   CTA SECTION
   ===================================================== */

.cta-wrap {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.cta-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5rem 2rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.cta-inner h2 { margin-bottom: 0.5rem; }
.cta-inner p { max-width: 420px; margin-bottom: 0; }

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.875rem 2rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
  transition: background 0.2s, color 0.2s;
}
.btn:hover { background: var(--accent); color: var(--bg); opacity: 1; }

/* =====================================================
   FOOTER
   ===================================================== */

#site-footer {
  padding: 1.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer-copy {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}
.footer-copy a { color: var(--muted); }
.footer-copy a:hover { color: var(--accent); opacity: 1; }

.footer-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}
.footer-links a {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); opacity: 1; }

/* Social icons from font-awesome */
.footer-icons {
  display: flex;
  gap: 1.25rem;
  list-style: none;
}
.footer-icons a {
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.2s;
}
.footer-icons a:hover { color: var(--accent); opacity: 1; }

/* =====================================================
   DEFAULT LAYOUT (pages & posts)
   ===================================================== */

.page-wrap {
  padding-top: var(--nav-h);
  min-height: 100vh;
}

/* Page header band */
.page-band {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 4rem 2rem 3rem;
  position: relative;
  overflow: hidden;
}

/* subtle diagonal lines */
.page-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 40px,
      rgba(255,255,255,0.008) 40px,
      rgba(255,255,255,0.008) 41px
    );
  pointer-events: none;
}

.page-band-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.page-band-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.page-band-label::before {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--accent);
}

.page-band h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}

.page-band .page-excerpt {
  font-size: 0.9rem;
  color: var(--body);
  margin-top: 0.75rem;
  max-width: 600px;
}

/* Page body content */
.page-body {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3.5rem 2rem;
}

/* Works / Research table (legacy) */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: 2rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

table td {
  padding: 0.875rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table tr:hover td { background: var(--surface); }

table a { color: var(--primary); }
table a:hover { color: var(--accent); opacity: 1; }

table.alt { background: var(--surface); }
table.alt td { border-bottom: none; }

.works_inprogress {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
  padding: 1rem 0.75rem;
}

/* Tech / Research tag lists */
.techlist, ul.techlist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.techlist li { margin: 0; }

.tech {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--border);
  color: var(--muted);
}

/* =====================================================
   POST LAYOUT
   ===================================================== */

.post-wrap {
  padding-top: var(--nav-h);
}

/* Post date bar */
#post-date {
  display: block;
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

/* Post content area */
.post-content {
  max-width: 840px;
  margin: 0 auto;
  padding: 3.5rem 2rem 4rem;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  margin-top: 2.5rem;
  margin-bottom: 0.875rem;
}
.post-content h1 { font-size: 1.5rem; }
.post-content h2 { font-size: 1.2rem; }
.post-content h3 { font-size: 1rem; }

.post-content p { color: var(--body); }
.post-content a { color: var(--accent); }

.post-content img,
.image.fit img,
span.image.fit img {
  width: 100%;
  margin: 2rem 0;
  display: block;
  filter: contrast(108%) brightness(0.95);
}

/* Image wrappers used in posts */
.image.fit, span.image.fit {
  display: block;
  margin: 2rem 0;
}

/* Skills / topics header in post */
h4 + .techlist { margin-bottom: 1.5rem; }
h4 { margin-top: 0; color: var(--muted); font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 0.6rem; }

/* Post navigation (back/next) */
.backnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin: 3rem 0;
  font-family: var(--mono);
}

.backnext.btntop { margin-top: 0; margin-bottom: 2.5rem; }
.backnext.btnbottom { margin-top: 2.5rem; margin-bottom: 0; }

.backnext .back,
.backnext .next {
  background: var(--surface);
  padding: 1.25rem 1.5rem;
  transition: background 0.2s;
}
.backnext .back:has(a):hover,
.backnext .next:has(a):hover { background: var(--surface2); }

.backnext .bpointer,
.backnext .npointer { margin-bottom: 0.4rem; }

.backnext .button.small {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.backnext .button.small:hover { border-color: var(--accent); color: var(--accent); opacity: 1; }

.backnext .btitle a,
.backnext .ntitle a {
  font-size: 0.75rem;
  color: var(--body);
  text-decoration: none;
}
.backnext .btitle a:hover,
.backnext .ntitle a:hover { color: var(--accent); opacity: 1; }

.backnext a, .backnext span {
  color: var(--muted);
  text-decoration: none;
}

/* Author block */
.author {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  margin-top: 2rem;
  background: var(--surface);
}

.author > div:first-child {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  filter: grayscale(100%);
}

.auth-desc {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  color: var(--body);
}

/* Post wrapper section (from post.html) */
section.wrapper.style5 {
  background: transparent;
}

section.wrapper.style5 .inner {
  max-width: 840px;
  margin: 0 auto;
  padding: 3.5rem 2rem 4rem;
}

/* Remove old spectral section styling */
section.wrapper { background: transparent; }

/* =====================================================
   BREADCRUMB / CREDITS PAGE
   ===================================================== */

.breadcrumb { display: none; } /* hide old breadcrumb */

#breadcrumb, nav.breadcrumb { display: none; }

/* Credits page */
.credits-table td:first-child {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

/* =====================================================
   DISQUS CONTAINER
   ===================================================== */

#disqus_thread {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* =====================================================
   SYNTAX HIGHLIGHTING (minimal)
   ===================================================== */

.highlight { background: var(--surface2); border: 1px solid var(--border); padding: 1.25rem; margin-bottom: 1.5rem; overflow-x: auto; }
.highlight code { font-size: 0.82rem; }

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 900px) {
  .cta-inner { flex-direction: column; }
  .cta-inner .btn { align-self: flex-start; }
}

@media (max-width: 768px) {
  #nav-links {
    display: none;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(7, 7, 7, 0.97);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2rem;
    gap: 1.25rem;
    z-index: 199;
  }
  #nav-links.open { display: flex; }
  #nav-toggle { display: block; }

  #hero { padding-bottom: 3rem; }

  .nav-cards { grid-template-columns: 1fr; }
  .works-grid { grid-template-columns: 1fr; }

  .backnext { grid-template-columns: 1fr; }

  #site-footer { flex-direction: column; gap: 1rem; text-align: center; }
  .footer-icons { justify-content: center; }

  .author { flex-direction: column; }

  section.wrapper.style5 .inner { padding: 2.5rem 1.25rem 3rem; }
}

@media (max-width: 480px) {
  .page-band { padding: 3rem 1.25rem 2.5rem; }
  .page-body { padding: 2rem 1.25rem; }
  .landing-section { padding: 3rem 1.25rem; }
}
